summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* tree: rename strtoul to strtoull since it is 64-bitJett Rink2020-11-1117-76/+78
| | | | | | | | | | | | | | | A long is 32-bit, but a long long is 64-bit. The function name should be strtoull if it is returning 64 bits of data. BRANCH=none BUG=b:172592963 TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr/kconfig: put KB protocol because KB optionJett Rink2020-11-111-0/+4
| | | | | | | | | | | | | | The PLATFORM_EC_KEYBOARD_PROTOCOL_8042 should be guarded by the PLATFORM_EC_KEYBOARD option. BRANCH=none BUG=b:172512307 TEST=build posix-ec with CL stack Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Idd070454a11ed65cab763ff7788dec4b907f610d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530152 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr/gpio: add bound checks to all gpio functionsJett Rink2020-11-111-0/+12
| | | | | | | | | | | | | | | The static check for zephyr will generate warnings if we do not bounds check the incoming gpio_signal enum. We should bounds check anyway. BRANCH=none BUG=b:172512307 TEST=build posix-ec with CL stack Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I1b2014c02e02d7271eeabd3cc041b3c452b1c43f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530151 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr/util: reorder header filesJett Rink2020-11-111-3/+6
| | | | | | | | | | | | | | | When compiling posix-ec, there are issues with strncasecmp. If we include the correct zephyr headers and hide the EC's version of stdlib, we can make everything work BRANCH=none BUG=b:172512307 TEST=build posix-ec with CL stack Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Ia4d412a45e15b91b36b94ca58ecc9cbe41b2b082 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530150 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: forward cros_crc8 to zephyrs crc8 implJett Rink2020-11-116-0/+85
| | | | | | | | | | | | | | | Shim in support for crc8 used in CBI, I2C, and other applications within platform/ec BRANCH=none BUG=b:168032589 TEST=add unit test for platform/ec and zephyr based CRC8 approaches and verify they both pass. Change-Id: Ib609f98596c4edc6e6f0d01b6242e62a1f95ad72 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527811 Reviewed-by: Yuval Peress <peress@chromium.org>
* crc32: rename test crc32->crc to allow for crc8Jett Rink2020-11-1110-10/+10
| | | | | | | | | | | | | | Instead of creating a new test for crc8, just make the existing crc32 test more generic. BRANCH=none BUG=none TEST=none Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I459e9b721a6cc0d94cef8c0d93102ad372095c34 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527493 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* crc8: rename crc8 to cros_crc8 to to avoid zephyr conflictJett Rink2020-11-119-33/+35
| | | | | | | | | | | | | | | | | Zephyr already provides a robust implementation for crc8, but it conflicts with platform/ec's name of crc8. Rename platform/ec to use cros_crc8 instead since it is a special case of zephyr crc8 implementation. BRANCH=none BUG=b:168032589 TEST=builds. Just a rename Change-Id: Idf312098cb921c8e10dcb48c5eb297801af2df8a Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527810 Reviewed-by: Yuval Peress <peress@chromium.org>
* malefor: enable EFS2Caveh Jalali2020-11-112-0/+4
| | | | | | | | | | | | | | This enables EFS2 on malefor. BRANCH=volteer BUG=b:172877805 TEST=buildall succeeds Change-Id: I6ea7f751075b2e540012ec03034568b82ce5ab89 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528702 Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Commit-Queue: Nick Vaccaro <nvaccaro@google.com>
* lindar: Enable EFS2jerry2.huang2020-11-111-0/+2
| | | | | | | | | | | | | | This patch enables EFS2 for volteer. BUG=b:152998236 BRANCH=firmware-volteer-13521.B TEST=Verify system boots and software sync works. Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: Ibb3a107889212df2e2b1eaa4c88aa8a0763c5b07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521553 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* Metaknight: Reconfig LED GPIO, and modify Led behaviorYu-An Chen2020-11-114-76/+67
| | | | | | | | | | | | | | | | Config GPIOC3, GPIOC4 to control LED. Move GPIOC2 to NC pins. Modify Led behavior. BUG=b:172845491 BRANCH=master TEST=make BOARD=metaknight PASS TEST=Led behavior is correct after change. Signed-off-by: yu-an.chen@quanta.corp-partner.google.com Change-Id: Icc86b6e6c7e6541c73d70c0903a609be419782ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528730 Reviewed-by: Diana Z <dzigterman@chromium.org>
* asruada: use hayato image as asuradaEric Yilun Lin2020-11-113-9/+9
| | | | | | | | | | | | | | Deprecate asurada image and use hayato image instead. Define BOARD_ASURADA_REV0 to get the old asurada image back. BUG=none TEST=make buildall -j BRANCH=none Change-Id: I10bc67bf36337158d30918e2b77070328b963f33 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530816 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* raa489000: Ignore BATGONE on aux chargersAseda Aboagye2020-11-112-0/+21
| | | | | | | | | | | | | | | | | | | | | On OCPC systems, the BATGONE pin is left unconnected as it's not needed. However, the default setting of the RAA489000 looks at the BATGONE pin in order utilize LEARN mode. This commit modifies the initialization to ignore the BATGONE pin on auxiliary chargers in an OCPC system. BUG=b:171457154, b:166168305 BRANCH=None TEST=Build and flash magolor, verify that `chgstate discharge on` results in 0 amperes being consumed from the connected AC adapter. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Iefec97e2dfcf0852a02c7acd05257014e93e9f57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523303 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* Coachz: support battery GH02047XLSimon Zhou2020-11-112-0/+60
| | | | | | | | | | | | | | support battery GH02047XL BRANCH=master BUG=b:172613247 TEST=make BOARD=coachz -j flash ec and check battery info Change-Id: I6bdb0b18a88272e56b2aba1f82c99620243a70be Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2529269 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* lingcod: enable EFS2Caveh Jalali2020-11-112-0/+4
| | | | | | | | | | | | | | This enables EFS2 on lingcod. BRANCH=volteer BUG=b:172877836 TEST=buildall succeeds Change-Id: Ic3cc5c508f83d8679f11ec8e268b7f7822150ba4 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528700 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* test: Add 3072-byte key test case for rsa testYicheng Li2020-11-114-5/+184
| | | | | | | | | | | | | | | | | | This is so that the unittest can be built for a board that actually uses 3072-byte RSA in RW signature verification, and run on-device. E.g. `build --BOARD=hatch_fp test-rsa` BRANCH=none BUG=b:169256204 TEST=make -j buildall TEST=make BOARD=bloonchipper test-rsa3, flash to Dragonclaw, rwsig verify OK, test passes. Change-Id: I1e67f05b76b53d96fe508832a94e9af5ad896d4d Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2429392 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* nocturne_fp: Do not build rsa unittestYicheng Li2020-11-111-1/+2
| | | | | | | | | | | | | | | nocturne_fp uses RSA exponent 3 for its own rwsig verification, so the rsa test will fail on a nocturne_fp device. If we modify the test, we won't pass rwsig verification on device. BRANCH=none BUG=b:169256204 TEST=make -j buildall Signed-off-by: Yicheng Li <yichengli@chromium.org> Change-Id: I9ca69da2ee870a672ffb029e962f5e0cc0c17c2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2464231 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* hatch_fp: Do not build rsa unittestYicheng Li2020-11-111-1/+2
| | | | | | | | | | | | | | | hatch_fp uses RSA exponent 3 for its own rwsig verification, so the rsa test will fail on a hatch_fp device. If we modify the test, we won't pass rwsig verification on device. BRANCH=none BUG=b:169256204 TEST=make -j buildall Change-Id: I92a2f419c8cc022dc231ffa00fb643be3d6db20c Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2444455 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* dooly: enable red LEDstabilize-13591.B-masterZick Wei2020-11-104-4/+35
| | | | | | | | | | | | | | | | | This patch enable red LED on dooly. BUG=b:163574191, b:172781906 BRANCH=puff TEST=verify with console command: LED red/pink, confirm LED change to red/pink. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I320e716a8243421a827897b5e86902ad459fc462 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2519242 Reviewed-by: Andrew McRae <amcrae@chromium.org> Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Commit-Queue: Zick Wei <zick.wei@quanta.corp-partner.google.com>
* hammer: support vivaldi keyboardTing Shen2020-11-106-10/+151
| | | | | | | | | | | | | | | | | | | | This CL implements vivald function row config for hammer keyboard. If CONFIG_USB_HID_KEYBOARD_VIVALDI defined, STM32 HID keyboard now returns an extra 32-bit data represents the status of action keys. Additionally, if board_vivaldi_keybd_config returns a non-null pointer, driver will convert function keys to action key according to the given config. BUG=b:171156337 TEST=verify keycode is correct in `evtest` BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ide3289fd2c1bb8859a74e97134e6113441cfb967 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508848 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* Add EC_CMD_BATTERY_GET_STATIC v1 for zorkPeter Marheine2020-11-106-31/+94
| | | | | | | | | | | | | | | | | | | | | | | | Some zork variants have battery model names that differ only beyond the 7th character, which cannot be differentiated with the current limitation of 8 characters per battery string. Introduce a new hostcmd version that allows longer battery strings and enable it on Zork. Because allowing longer strings through the host memory map is more difficult and not required (because getting the full longer string is mostly only useful for servicing), the host memory map is unchanged. ectool is updated to use hostcmd (rather than memory map) if the new command version is available, in order to take advantage of it. BUG=b:171854783 TEST=ectool battery prints longer strings when supported by the EC; a hacked EC on morphius can return 11 characters of text. An EC running older firmware still works with a new ectool. BRANCH=zork Change-Id: I63d20d4f690b6945cb1d423aafaf55dafc039211 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2519243 Reviewed-by: Edward Hill <ecgh@chromium.org>
* adlprvp: Add support for SYS_PWROK_ECSooraj Govindan2020-11-102-5/+14
| | | | | | | | | | | | | | | | | | Per the power sequencing requirements, SYS_PWROK_EC should be driven based on ALL_SYS_PWRGD deassertion/assertion. BRANCH=None BUG=b:169551130 TEST=Build, flash and boot the Alderlake RVP platform to OS make BOARD=adlrvpp_ite -j; sudo util/flash_ec --board=adlrvpp_ite --image=<path> Signed-off-by: Sooraj Govindan <sooraj.govindan@intel.com> Change-Id: Ifd6805dc878cbbaa401f43b325a42d1b1431b1ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521550 Tested-by: Sooraj Govindan <sooraj.govindan@intel.corp-partner.google.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: caveh jalali <caveh@chromium.org>
* isl923x: Disable PSYS monitor on suspendWai-Hong Tam2020-11-101-2/+2
| | | | | | | | | | | | | | | | | The PSYS monitor consumes power, 905uA (enabled) vs 24uA (disabled). When AP is in suspend, which uses less power, the PSYS monitor takes a significant portion. Should disable it to save power. The `psys` command will return -1. BRANCH=None BUG=b:172701160 TEST=Triggered AP in suspend, used `amonbmon` command to check the battery discharge current drop. Change-Id: I6df18a65b040b73e626587d9775296df58d283c6 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528691 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Kakadu: Update Led Behaviorwen zhang2020-11-101-65/+103
| | | | | | | | | | | | | | | According to the requirement of OEM, update the led behavior. BUG=b:172400861 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified LED behavior and result is OK. Change-Id: I9b81e8f4b345eb8e9766a99fee95668affacc853 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2517417 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* genvif: Manufacturer_Info_VID_Port not setDenis Brockus2020-11-101-0/+5
| | | | | | | | | | | | | | BUG=b:172842249 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I7fa19424a37c2a295f94351143ed22821968ea3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527702 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* genvif: Guard Manufacturer_Info_PID_PortDenis Brockus2020-11-101-5/+9
| | | | | | | | | | | | | | | | Adding CONFIG_USB_PD_MANUFACTURING_INFO guard BUG=b:172842062 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ia048ead9060f11dc9bc943ef6dd3b935c7d5cf5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527701 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* genvif: XID_SOPDenis Brockus2020-11-101-14/+17
| | | | | | | | | | | | | BUG=b:172424930,b:172842768 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ib7734fca61b9169f718ce58aa15277251d2bd560 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523383 Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* genvif: Product_Total_Source_Power_mWDenis Brockus2020-11-101-4/+9
| | | | | | | | | | | | | BUG=b:172439432 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I9440fc55caf33adce3e5b846e3ad9dd68ce44d35 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523378 Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* genvif: split up initialization to spec field groupingsDenis Brockus2020-11-101-325/+482
| | | | | | | | | | | | | BUG=b:172665003 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ic356fc0df99e449f90bdb0390e5473c621f717d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523451 Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* genvif: Unconstrained_PowerDenis Brockus2020-11-101-4/+22
| | | | | | | | | | | | | BUG=b:172419824 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I465fadb323649fbcace24f81a944595a0751d714 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2522670 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: add shim for extpowerJack Rosenthal2020-11-102-0/+12
| | | | | | | | | | | | | | | | This brings over the extpower_common.c and extpower_gpio.c files to the Zephyr build. This is needed as a dependency of power sequencing. BUG=b:172720290 BRANCH=none TEST=on volteer, observe "hostevents" command output to see AC_PRESENT event set when charger connected. (requires the zephyr-chrome CL as well) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I28ad442180762d542cc6031ab1f33284b08a4572 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527703 Reviewed-by: Jett Rink <jettrink@chromium.org>
* zephyr: Redefine assert safelySimon Glass2020-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | At present a build error is produced when building keyboard_scan.c due to a redefinition of this symbol. Undef it first. BUG=b:167405015 BRANCH=none TEST=make BOARD=volteer zmake configure .../zephyr-chrome/projects/experimental/volteer \ -B /tmp/z/cos zmake build /tmp/z/cos see there are no errors Change-Id: I9b13d1737d6ce6f7ab35b0d6457c2db49cea8dbc Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523838 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org>
* zephyr: correct shimmed task prioritiesJett Rink2020-11-091-2/+3
| | | | | | | | | | | | | | | | | Add build assert to ensure that deferred task is lower than all of the other shimmed tasks. Also make priority of tasks from 0 to COUNT - 1 instead of 1 to COUNT BRANCH=none BUG=none TEST=volteer still builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Iabe9f1117850975ec9bf3df1dcfc690b4725a7e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523389 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* cleanup: follow header include styleJett Rink2020-11-094-8/+11
| | | | | | | | | | | | | | | | | In order to align with go/zephyr-shim-how-to, update all of the platform/ec header files to use "quotes" and only use <brackets> for zephyr header files. Also include an empty line between the two. BRANCH=none BUG=none TEST=all zephyr tests build and pass; build volteer Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I27c275c24aa4f8eb40e100b07517b60f548f06cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521594 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: move from SYS_INIT to mainJett Rink2020-11-094-14/+19
| | | | | | | | | | | | | | | | | | We are going to need to perform initialization in Zephyr's main before we start the EC tasks or call the INIT hooks. If we rely on SYS_INIT, all of that happens before main is called. BRANCH=none BUG=none TEST=pass tasks unit tests and run on volteer Cq-Depend: chromium:2523462 Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Icd035695b86fc9690cea88887902be61d9b37a18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523380 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: add option to shim power buttonJack Rosenthal2020-11-092-0/+10
| | | | | | | | | | | | Add an option to shim the power button module. BUG=b:172471187 BRANCH=none TEST=volteer: press power button, observe UART output Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7dbc705b19bfc312e2707080f22e411ebd7e2c1b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523382
* zephyr: add stub host events implementationJack Rosenthal2020-11-093-29/+40
| | | | | | | | | | | | | | | | Include host_command.c and host_event_commands.c so that we get some basic definitions to get things compiling. Since we don't have CONFIG_HOSTCMD_ESPI enabled yet, this is really just pulling in stub definitions. BUG=b:172678200 BRANCH=none TEST=compiles for volteer Cq-Depend: chromium:2523466 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ic293f80d30ecf9534ff935b73aa4ca42614a77be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523381
* Zephyr: add more compliant implementation for irq_(un)lockYuval Peress2020-11-087-12/+152
| | | | | | | | | | | | | | | | | | This change replaces the stubbed irq_(un)lock static functions defined in task.h with new functions that behave more like the Zephyr implementation of irq_(un)lock functions. This should make the migration from interrupt_(dis|en)able to Zephyr more seamless. BRANCH=none BUG=b:172060699 TEST=Added unit tests, make runtests -j, and built for various boards: eve, volteer, arcada_ish, atlas, hatch, kohaku, nocturne, samus, and scarlet Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ia7ad2b8d7d411a11699353bf5d3cc36a261fad14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511720
* Add chip-specific shim along with i2c moduleYuval Peress2020-11-0812-13/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change accomplishes 2 things: 1. It refactors the zephyr/shim directory to structure around chip specific compilation. In this example, we're focusing on npcx7m6fb which is used in volteer but others can be added easily. 2. It shims the common/i2c_master.c by providing an alternate implementation of i2c_xfer_unlocked that calls down to the Zephyr API i2c_write_read instead of the chip specific i2c_xfer_no_retry or chip_i2c_xfer_with_notify. The shim layer is made possible by the addition of zephyr/shim/include/i2c/i2c.h which adds a functions that needs to be implemented per chip (npcx7 family in this case) and allows us to map the current port int which is defined in chip/${CHIP}/registers.h (chip/npcx/registers-npcx7.h in our case). This function (i2c_get_device_for_port) maps the platform/ec port int to a const struct device * which is needed in the Zephyr I2C APIs. BRANCH=none BUG=b:171302975 TEST=clean_build.sh projects/experimental/volteer/ and make BOARD=eve Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I210f4758337bf384d0d6f103eef8b89126887d11 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2504285 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* common:i2c: Migrate interrupt_(dis|en)able calls to irq_(un|)lockYuval Peress2020-11-081-5/+7
| | | | | | | | | | | | | | | | | This change migrates interrupt_disable -> irq_lock and interrupt_enable -> irq_unlock. BRANCH=none BUG=b:172060699 TEST=make runtests -j, and built for various boards: eve, volteer, arcada_ish, atlas, hatch, kohaku, nocturne, samus, and scarlet Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ia5d872d8b9fcabc23a859350cf3bf121597d84af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2517629 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* Trogdor: Apply internal PU to the interrupt of PI3USB9201Wai-Hong Tam2020-11-074-6/+10
| | | | | | | | | | | | | | | | | The BC1.2 chip PI3USB9281 some Trogdor old revisions used has push-pull output on the interrupt pin. But the PI3USB9201 some latest revisions used has open-drain output. These lines don't have external PU. So apply EC internal PU. BRANCH=Trogdor BUG=b:172674040 TEST=Plugged a C-to-A adapter to a CDP port, the BC1.2 interrupted and detected the 1.5A source. Change-Id: I15e27221bff1ce35fc35b03ac38340b5dfb1055d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523298 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* zephyr: shim the lid switchJack Rosenthal2020-11-072-0/+9
| | | | | | | | | | | | | | | Enable an option to compile common/lid_switch.c. BUG=b:172652088 BRANCH=none TEST=On volteer, with zephyr-chrome CL, observe lid{open,close,state} console commands, gpio interrupt works Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ica5b8abd1b0e0d9666ded9bd27927562ee36b80c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523456 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* zephyr: gpio: shim gpio_{en,dis}able_interruptJack Rosenthal2020-11-071-0/+56
| | | | | | | | | | | | | | These two platform/ec functions are used pretty widely across common code, and enables/disables the interrupt functionality on a GPIO PIN. BUG=b:172652088 BRANCH=none TEST=compile with lid switch shim, observe lid state change Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Iad662397da24b58e577537d835c4a2d532307bb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523455 Reviewed-by: Jett Rink <jettrink@chromium.org>
* test_util: use ztest only if CONFIG_ZTEST is defined, not CONFIG_ZEPHYRJack Rosenthal2020-11-071-3/+3
| | | | | | | | | | | | | | | This header can be included from shimmed modules for an actual build (not just tests). In that case, CONFIG_ZEPHYR would be defined, but not CONFIG_ZTEST, and headers like ztest.h are not available. BUG=b:172678200 BRANCH=none TEST=compile both host_command.c and hooks test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I24c704f6288eac9a8ca53580ec00e43073a6fef0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2522968 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* zephyr: move shimmed_tasks.h include to config.hJack Rosenthal2020-11-072-5/+9
| | | | | | | | | | | | | | | | | Unfortunately, many things in config.h rely on HAS_TASK_* to be defined before we start processing config.h. Move this include a little sooner so we have it then. BUG=b:172678200 BRANCH=none TEST=compiles with host_command.c added Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I791426b78777997748eff2c91210b8a426d9a8ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2522970 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pi3usb9201: clean up the includesDawid Niedzwiecki2020-11-071-1/+0
| | | | | | | | | | | | | | | | Remove unnecessary the "tcpm.h" include. It will help with porting the pi3usb9201 driver to Zephyr. BRANCH=none BUG=b:172236680 TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I446daf8025e35876c5018e041ba515e4ae017b3d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521598 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Intelrvp:Supports boards without DC jackAyushee2020-11-073-1/+21
| | | | | | | | | | | | | | | This commit checks if the dedicated port count is greater than 0 for the charger specific files while keeping the code common for both DC jack supported and non DC jack supported boards. BUG=b:172642304 BRANCH=None TEST=make buildall -j Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I138d33802c2df586963e244f18b787ccce60b8f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523294 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Don't output a newline in cputs() unless requestedSimon Glass2020-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present this function adds a newline, but it should not. Fix it. BUG=b:167405015 BRANCH=none TEST=zmake configure .../zephyr-chrome/projects/experimental/volteer \ -B /tmp/z/cos zmake build /tmp/z/cos Run on volteer and see that the keyboard output looks right. before: 20-11-06 15:17:39.329 keyboard_scan_task 20-11-06 15:17:39.329 [0x00000000T KB init state: -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 -- 20-11-06 15:17:39.342 ] after: 20-11-06 15:19:11.144 [0x00000000T KB init state: -- -- -- -- -- -- -- -- -- -- -- -- --] Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ic2592d49fa1f6debf8d0a65c9dc1b9bef2eb88ef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523390 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* zephyr: Enable the '8042' commandSimon Glass2020-11-073-20/+36
| | | | | | | | | | | | | | | | | | | | | | | | | This is used to provide information about the keyboard operation. Enable this command and its subcommands. Note that in ECOS these subcommands are also top-level commands, but this is not the case in Zephyr, since it seems unnecessary. Note also that changing these to console sub-commands may end up making FAFT testing more difficult since the invocation on the EC UART would be different. BUG=b:167405015 BRANCH=none TEST=make BOARD=volteer zmake configure .../zephyr-chrome/projects/experimental/volteer \ -B /tmp/z/cos zmake build /tmp/z/cos Run on volteer and try out '8042 kbd', etc. Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ia11092af350247ac98681485a9ddd309c7192272 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523452 Reviewed-by: Jett Rink <jettrink@chromium.org>
* zephyr: cleanup unused _ZEPHYR_WARN_UNIMPLEMENTED macroJack Rosenthal2020-11-071-11/+0
| | | | | | | | | | | | | | Tasks are implemented now, so this can go away. BUG=b:171741620 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I0ce8d680d80eb2ac1bfa3f9ca31143f7f8924af4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523386 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ectool: Stop printing reserved fieldCaveh Jalali2020-11-061-2/+0
| | | | | | | | | | | | | | | | The ec_response_locate_chip.reserved field was overloaded to return the TCSS port mapping. We are no longer doing this, so there is no point for ectool to print out a reserved field. BRANCH=none BUG=b:153941950 TEST=buildall passes Change-Id: Ib0c2c5ba95b2d9afb72455e4864e69deb0abd185 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427633 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>