summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "herobrine: Add a wrapper to create new variant projects"stabilize-14477.B-mainWai-Hong Tam2022-01-243-37/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7da11090fe6b612eba73cdd0fe4e0d6b0818f5a5. Reason for revert: The herobrine build is broken. Original change's description: > herobrine: Add a wrapper to create new variant projects > > Add a wrapper function to help creating new project easily. So far > it just builds the existing herobrine_npcx9 project. > > BRANCH=None > BUG=b:214613810 > TEST=Built the herobrine_npcx9 project and checked it boot correctly > on the hardware. > > Change-Id: I28eef726108aa3f9de9fd266f6b843222ab42f8c > Signed-off-by: Wai-Hong Tam <waihong@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390640 > Reviewed-by: Keith Short <keithshort@chromium.org> Bug: b:214613810 Change-Id: I35143c800cc63f8c821527a2783d462bfc6ad46f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413812 Auto-Submit: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "herobrine: Move alt-component logic to the project subdirectory"Wai-Hong Tam2022-01-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3b704faa6c1db27adb691cb223159c6aa84aa3ee. Reason for revert: The herobrine build is broken. Original change's description: > herobrine: Move alt-component logic to the project subdirectory > > The alternative component logic is very project specific. Create > an extra subdirectory for this code. > > BRANCH=None > BUG=b:214613810 > TEST=Built the herobrine_npcx9 project and checked it boot correctly > on the hardware. > > Change-Id: Iebbe30b6ccb2d6a013143dee7405f75fc5ff8097 > Signed-off-by: Wai-Hong Tam <waihong@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390642 > Reviewed-by: Keith Short <keithshort@chromium.org> Bug: b:214613810 Change-Id: Ieba3768edad7eb36d789406f70e902b443cb6ddc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413811 Auto-Submit: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "herobrine: Move the PWM dt nodes from board to project"Wai-Hong Tam2022-01-243-30/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bba7f4dc9dd24f95d9b029f064b599b44a2ca039. Reason for revert: The herobrine build is broken. Original change's description: > herobrine: Move the PWM dt nodes from board to project > > Make the board independent from the hardware project. The PWM > dt nodes should be related to the project. Move them. > > BRANCH=None > BUG=b:214613810 > TEST=Built the herobrine_npcx9 project and checked generated > source.dts unchanged. > > Change-Id: If4db04e0490d743580afa64f115efd4663feb00f > Signed-off-by: Wai-Hong Tam <waihong@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400543 > Reviewed-by: Keith Short <keithshort@chromium.org> Bug: b:214613810 Change-Id: I3a2243dbb857a86270ea1887abe1fbb7a869bd97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413730 Auto-Submit: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* Revert "herobrine: Move the ADC dt nodes from board to project"Wai-Hong Tam2022-01-243-47/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5340a3299dd6193c5821fbc57d3fb1852137cf01. Reason for revert: The herobrine build is broken. Original change's description: > herobrine: Move the ADC dt nodes from board to project > > Make the board independent from the hardware project. The ADC > dt nodes should be related to the project. Move them. > > BRANCH=None > BUG=b:214613810 > TEST=Built the herobrine_npcx9 project and checked generated > source.dts unchanged. > > Change-Id: I09e921b42b29851a0a3ca955da64cdd1e72d2a2c > Signed-off-by: Wai-Hong Tam <waihong@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400544 > Reviewed-by: Keith Short <keithshort@chromium.org> Bug: b:214613810 Change-Id: I44048a359caa1e8891c304c7083fafbc8e994dd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413729 Auto-Submit: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* Revert "herobrine: Move the common EC nodes from board to project"Wai-Hong Tam2022-01-243-38/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit af1da08a314b7bdf6bfa8044d19aa80f471ec3fb. Reason for revert: The herobrine build is broken. Original change's description: > herobrine: Move the common EC nodes from board to project > > Make the board independent from the hardware project. Move > several common EC nodes to the project directory. > > BRANCH=None > BUG=b:214613810 > TEST=Built the herobrine_npcx9 project and checked generated > source.dts unchanged. > > Change-Id: Icc89a5fbf53cc26dd5f06c4919c4ec416d6a91be > Signed-off-by: Wai-Hong Tam <waihong@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400545 > Reviewed-by: Keith Short <keithshort@chromium.org> Bug: b:214613810 Change-Id: I3cfa43d7f60a49dc039dcb168d61365b41349730 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413728 Auto-Submit: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "herobrine: Deprecate herobrine_npcx9 board and use npcx9 instead"Wai-Hong Tam2022-01-246-12/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c02d3d40f6340f689eff5b67c84e83de8f69f1c5. Reason for revert: The herobrine build is broken. Original change's description: > herobrine: Deprecate herobrine_npcx9 board and use npcx9 instead > > The herobrine_npcx9 board is now the same as the common npcx > board. Change the herobrine project to use the npcx9 instead of > the herobrine_npcx9. Remove the herobrine_npcx9 board directory. > > BRANCH=None > BUG=b:214613810 > TEST=Built the herobrine_npcx9 project and checked generated > source.dts and kconfig.conf unchanged. > > Change-Id: I449122d017cc8a06af68c6cea6a4eb260edcfa15 > Signed-off-by: Wai-Hong Tam <waihong@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400547 > Reviewed-by: Sam Hurst <shurst@google.com> > Reviewed-by: Keith Short <keithshort@chromium.org> Bug: b:214613810 Change-Id: I3e2b1d834d16dcfc0cc53f09de5175ac54f9380b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413726 Auto-Submit: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Relocate GPIO interrupt handling to separate fileAndrew McRae2022-01-244-178/+232
| | | | | | | | | | | | | Move GPIO interrupt handling to separate file from gpio.c BUG=b:214608987 TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ibb1ea36da218ecd8f75a1e48e650f79adc259049 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406472 Reviewed-by: Keith Short <keithshort@chromium.org>
* brask: adjust the stack sizeZhuohao Lee2022-01-241-3/+3
| | | | | | | | | | | | | | Adjust the stack size based on the `make analyzestack` result. BUG=b:204398670 BRANCH=None TEST=make ; make analyzestack and checked the output Change-Id: I3877021e859ea441f35e7d58fe9ae3161e85b532 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406475 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* zephyr: Allow a default value to be set for each FW_CONFIG fieldAndrew McRae2022-01-245-5/+35
| | | | | | | | | | | | | | | | Allow a field value to be set as the default value if the FW_CONFIG data cannot be read or is unavailable. By default, FW_CONFIG fields are set to 0 if unavailable, but this allows a value to be set instead as the default. BUG=b:215776112 TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I86deeca5dae567548dc47d578d1c22492b7222da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406471 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: emul: use non-deprecated includesAaron Massey2022-01-2435-35/+35
| | | | | | | | | | | | | Drop usage of deprecated <emul.h> for <drivers/emul.h> BRANCH=none BUG=none TEST=zmake configute --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I9e221f44fa3b70305916914c0bbeed21b6a6bed8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413067 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* pd: Fix wrong PD accessors handling in default caseŁukasz Hajec2022-01-242-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL fixes implementation added in commit 06d89b033065. Default return value from get_usb_pd_vbus_detect is USB_PD_VBUS_DETECT_NONE, which leads to executing parts of code, that earlier (before mentioned commit) were executed only when CONFIG_USB_PD_VBUS_DETECT_NONE was directly defined. Add additional enum value and return it for a default case when none of configs "CONFIG_USB_PD_VBUS_DETECT_*" is defined. BRANCH=None BUG=b:212683593 TEST=make BOARD=servo_v4p1 flash servo with new firmware plug servo into DUT (without charger) do not observe any problems, e.g hard reset loop Signed-off-by: Łukasz Hajec <lha@semihalf.com> Change-Id: Icf7028b8ba8a3e039a0c1e89de14ee0a4708df74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3378345 Reviewed-by: Parth Malkan <parthmalkan@google.com> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Łukasz Hajec <hajec@google.com> Commit-Queue: Łukasz Hajec <hajec@google.com>
* zephyr: mchp: Add cros_flash drivermartin yan2022-01-247-2/+658
| | | | | | | | | | | | | Add cros_flash driver and related configs BUG=none BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I4b8aadf5820871e0abcff0306eefae634a4ee8df Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3388451 Reviewed-by: Keith Short <keithshort@chromium.org>
* beadrix: Support battery protection for low voltage chargeTang Qijun2022-01-241-0/+1
| | | | | | | | | | | | | | | | | | Battery voltage is lower than voltage_min, precharge voltage & current are supplied and charging will be disabled after CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT seconds BRANCH=None BUG=b:215658820 TEST=Keep the battery voltage below 6V and charge it for more than 30 minutes. The system stops the charging function and the charging current is zero. Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Change-Id: I77375e59f3c6b131a1002718b4914a35270eefa6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3411683 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* herobrine: Deprecate herobrine_npcx9 board and use npcx9 insteadWai-Hong Tam2022-01-246-129/+12
| | | | | | | | | | | | | | | | | The herobrine_npcx9 board is now the same as the common npcx board. Change the herobrine project to use the npcx9 instead of the herobrine_npcx9. Remove the herobrine_npcx9 board directory. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked generated source.dts and kconfig.conf unchanged. Change-Id: I449122d017cc8a06af68c6cea6a4eb260edcfa15 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400547 Reviewed-by: Sam Hurst <shurst@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* npcx9: Enable the power management featuresWai-Hong Tam2022-01-241-0/+7
| | | | | | | | | | | | | | | The power management features have been enabled in some pilot boards, like brya, trogdor, herobrine, etc. Enable them in the common npcx9 board too. BRANCH=none BUG=b:214613810 TEST=Built the images krabby, kingler, and skyrim correctly. Change-Id: Ie84bd9fccc3c9299671b57539bc4bb2c99a8a7b3 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400546 Reviewed-by: Keith Short <keithshort@chromium.org>
* servo_v4: Undefine CONFIG_USB_PD_TCPMV1_DEBUG to save spaceŁukasz Hajec2022-01-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | The servo_v4 is almost out of flash space in RO. Undefine CONFIG_USB_PD_TCPMV1_DEBUG to save space. It disables PD protocol state names in the TPCMv1 console and saves ~900 bytes in RO flash space. Applying to RO only since space is most limited there. This is to keep servo_v4 buildig at ToT. TCPMv1 is deprecated and probably would not be developed in future. BUG=b:212683593 BRANCH=none TEST=Built and flashed the servo v4 firmware. Started servod and verified some functions. Signed-off-by: Łukasz Hajec <lha@semihalf.com> Change-Id: I01d2926ba14f81368c61ab817ddc407e0bef9f43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3405036 Tested-by: Łukasz Hajec <hajec@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Łukasz Hajec <hajec@google.com>
* zephyr test: Offer high-voltage PDOAbe Levkoy2022-01-241-12/+18
| | | | | | | | | | | | | | Provide higher than default power from the emulated charger. Verify that the PD stack sees the new PDO. BUG=b:213908743 TEST=zmake configure --test zephyr/test/drivers BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: If9bc1ca7a63da08fb42d33186d0734b197d36cdb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3405645 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Update documents with CBI FW_CONFIG featureAndrew McRae2022-01-242-0/+124
| | | | | | | | | | | | | | Add the CBI FW_CONFIG feature to the documentation. BUG=b:212758472 TEST=none BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I6e53289a5b5961978a69f64a0e9fd67daac11c35 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3411032 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* zephyr test: Configure charging power in DTSAbe Levkoy2022-01-244-11/+7
| | | | | | | | | | | | | | | | | Use the device tree to configure the battery's desired charging voltage and current. Do not modify the device parameters during the driver unit test. The battery charging voltage and current are not directly related to the VBUS voltage and current, so do not check that the charging voltage matches VBUS. BUG=b:213908743,b:213909940 TEST=zmake configure --test zephyr/test/drivers BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I99ca3da7e49755587cd73347bb56f5e372e99d91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3405644 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* pinmap: Update generation of adc channelAndrew McRae2022-01-242-2/+2
| | | | | | | | | | | | | Update the pinmap generator to use the io-channels adc property. BUG=none TEST=go test ./... BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I1e0252b94028d550d8538cd95bc6aa5f27afea1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3411517 Reviewed-by: Dawid Niedzwiecki <dawidn@google.com>
* zephyr: corsola: assign USB PIDEric Yilun Lin2022-01-243-9/+4
| | | | | | | | | | | | | | | | Assign USB PID for corsola projects. BUG=b:214325274 TEST=zmake testall BRANCH=none Change-Id: I7ac9ed2829ac00e1db656331a063b5edf6d4b2a0 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3411678 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* npcx: gpio: add a new guard to KSI's GPIO_INTJun Lin2022-01-244-6/+12
| | | | | | | | | | | | | | | | | | | | In npcx chips, KSI pins are muxed with GPIO pins. In the current gpio driver, the GPIO interrupt for these pins is enabled only when KEYSCAN task is not defined. However, this assumption is not true when the ADC anti-ghost feature is introduced. This CL adds a new guard for the GPIO_INT of KSIs. The board level driver can define this flag to override the default behavior. BRANCH=none BUG=b:213412432 TEST=pass "make buildall" Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I21b2278f3bcf4b8bc685f5c2d7a4a4a1a0b7705b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3369175 Tested-by: Arthur Lin <arthur.lin@lcfc.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* nissa: Reinstate TCPC low power mode for chargersAndrew McRae2022-01-241-3/+1
| | | | | | | | | | | | | | It is likely the stack issues caused the loop, so re-enable low power mode for the TCPCs. BUG=b:215299763,b:214881978 TEST=flash and run, confirm no loop in low power mode. BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I6909d76cc329a93e2d03783d85bf240d6936bcdf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406465 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* adlrvpn: configure charger vsys min registerDeepti Deshatty2022-01-234-3/+49
| | | | | | | | | | | | | | | | | | | | | | | ADL-N uses the similar charger chip as Brya i.e BQ25720 Referring to the b:196184163 charger system voltage register should be set based on the AC or AC+battery conditions. New API set_charger_system_voltage() is implemented for this. API is called when AC/battery is connected/disconnected. Changes helped to solve the PROCHOT assertion by charger chip when no battery is connected to the RVP. BRANCH=none BUG=none TEST=verified change on adlrvp-n board. PROCHOT not asserted when no battery connected to the RVP. Change-Id: Ic21d8008530e08f2b7d26994665ca8cc37cffdfe Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3338099 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* herobrine: Move the common EC nodes from board to projectWai-Hong Tam2022-01-233-28/+38
| | | | | | | | | | | | | | | Make the board independent from the hardware project. Move several common EC nodes to the project directory. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked generated source.dts unchanged. Change-Id: Icc89a5fbf53cc26dd5f06c4919c4ec416d6a91be Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400545 Reviewed-by: Keith Short <keithshort@chromium.org>
* herobrine: Move the ADC dt nodes from board to projectWai-Hong Tam2022-01-233-38/+47
| | | | | | | | | | | | | | | Make the board independent from the hardware project. The ADC dt nodes should be related to the project. Move them. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked generated source.dts unchanged. Change-Id: I09e921b42b29851a0a3ca955da64cdd1e72d2a2c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400544 Reviewed-by: Keith Short <keithshort@chromium.org>
* herobrine: Move the PWM dt nodes from board to projectWai-Hong Tam2022-01-233-23/+30
| | | | | | | | | | | | | | | Make the board independent from the hardware project. The PWM dt nodes should be related to the project. Move them. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked generated source.dts unchanged. Change-Id: If4db04e0490d743580afa64f115efd4663feb00f Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400543 Reviewed-by: Keith Short <keithshort@chromium.org>
* herobrine: Move alt-component logic to the project subdirectoryWai-Hong Tam2022-01-232-2/+2
| | | | | | | | | | | | | | | The alternative component logic is very project specific. Create an extra subdirectory for this code. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked it boot correctly on the hardware. Change-Id: Iebbe30b6ccb2d6a013143dee7405f75fc5ff8097 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390642 Reviewed-by: Keith Short <keithshort@chromium.org>
* herobrine: Add a wrapper to create new variant projectsWai-Hong Tam2022-01-223-11/+37
| | | | | | | | | | | | | | | Add a wrapper function to help creating new project easily. So far it just builds the existing herobrine_npcx9 project. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked it boot correctly on the hardware. Change-Id: I28eef726108aa3f9de9fd266f6b843222ab42f8c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390640 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr test: Merge SYV682 testsAbe Levkoy2022-01-223-518/+497
| | | | | | | | | | | | | Move tests from ppc.c to ppc_syv682c.c. This is coverage-neutral. BUG=b:190519131 TEST=zmake configure --test zephyr/test/drivers BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I3d2945f327e0655454d1f638a8f63e18cda89ffc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406590 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* herobrine: Remove the project subdirectory herobrine_npcx9Wai-Hong Tam2022-01-2215-0/+0
| | | | | | | | | | | | | | | | Follow the guidelines in go/zephyr-variants. Make the directory structure flat, no subdirectory for variant project, so the common dts and kconfigs can easily be shared. BRANCH=None BUG=b:214613810 TEST=Built the herobrine_npcx9 project and checked it boot correctly on the hardware. Change-Id: I791b4017826fbf06adaf7dc7f5cc15d55023bbac Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390639 Reviewed-by: Keith Short <keithshort@chromium.org>
* tree: Delete chip/lm4 and board/bdsTom Hughes2022-01-2228-6271/+1
| | | | | | | | | | | | | | | | | | While working on https://crrev.com/c/3373621, I noticed that either the comment or code was wrong in chip/lm4/clock.c. chip/lm4 is only used by the "bds" board, which doesn't appear to be used anymore, so just delete it. BRANCH=none BUG=b:200828093 TEST=make buildall -j Cq-Depend: chromium:3378222 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I444a9a6e2c853dc4f9f3d799182daaeb110b1277 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3373622 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: skyrim: update EEPROM info in DTSDawid Niedzwiecki2022-01-221-0/+5
| | | | | | | | | | | | | | | The cbi_eeprom node represents EEPROM, that stores CBI. Assign the type of the EEPROM chip and provide additional properties. BUG=b:211779766 TEST=Build EC image for Skyrim BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I8b21fe7163f4d1ad09378caf5b8e2720a5dc81fc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3405039 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: test: verify usb pd host info host commandAaron Massey2022-01-211-0/+18
| | | | | | | | | | | | | | | Verify the zephyr espi driver can receive host EC_CMD_USB_PD_POWER_INFO host command. BRANCH=none BUG=b:215389861 TEST=zmake configure --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ib947f5c2f335629f781ae63066110466640b661e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3408002 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* charge_manager: test can EC_CMD_USB_PD_POWER_INFOAaron Massey2022-01-2112-10/+41
| | | | | | | | | | | | | | | Enable the implementation of EC_CMD_USB_PD_POWER_INFO in test builds. Add a mock implementation of ADCs. BRANCH=none BUG=b:215389861 TEST=make buildall TEST=zmake configure --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Icdef25cfb8e01e62b680af87683ca1dd34f04542 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3399877 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: drivers: Improve code coverage of watchdog.cAl Semjonovs2022-01-218-1/+175
| | | | | | | | | | | | | Add test cases to improve code coverage of watchdog.c BRANCH=none BUG=b:210148660 TEST=zmake -D configure --coverage --test zephyr/test/drivers/ Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: I90b0c0268fb75769180918e69f822d25007f14aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398304 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: cleanup: it8xxx2/pinmux: use DT_FOREACH_STATUS_OKAYTim Lin2022-01-211-81/+39
| | | | | | | | | | | | | | | | | | | | Using DT_FOREACH_STATUS_OKAY instead of DT_NODE_HAS_STATUS is more streamlined. BUG=none BRANCH=none TEST=zmake configure -b zephyr/projects/it8xxx2_evb/ From the memory dump 0xf01600, check whether GPIOs are set to I2C alternate function. TEST=zmake configure -b zephyr/projects/asurada/hayato/ Boot normally on hayato. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I71a77e2464bb1ccb1c418c39bb596b44091acb99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3392109 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Revert "make: disable kconfig option check"Simon Glass2022-01-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately this was disabled but never restarted. We have a number of CONFIG options that are missing Kconfigs: For volteer the list is: CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT CONFIG_HOSTCMD_DEBUG_MODE CONFIG_LED_PWM_COUNT CONFIG_POWER_S4_RESIDENCY CONFIG_STEINHART_HART_3V3_30K9_47K_4050B CONFIG_USB_PD_FLAGS This cannot be applied until the above are fixed. Possibly this is not a big problem anymore, since we are likely not adding much new functionality to ECOS. This reverts commit b3f5db5be78e15290dc7d80eaeecbb0f1b754a2c BUG=b:195718112 BRANCH=none TEST=make buildall -j32 Change-Id: I4b148caa04509721db83d001eb65dc061b2f21a6 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3388360 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Require updates if ad-hoc configs have been convertedSimon Glass2022-01-211-4/+4
| | | | | | | | | | | | | | | | | At present a 'Congratulations' message is printed but the build still succeeds. Change this so that people must run the update step to get a passing build. BUG=b:195718112 BRANCH=none TEST=add CONFIG_BATTERY to config_allowed.txt $ make BOARD=volteer -j30 See that an error is produced and the build fails Change-Id: I7675bd16b274612fb5e4088302ee5ea53ecd2a7b Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406589 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Skyrim: Configure CBI WP controlDiana Z2022-01-212-1/+4
| | | | | | | | | | | | | | | Add the CBI WP control, as well as CONFIG_SYSTEM_UNLOCKED so we can allow the EC to control this signal. BRANCH=None BUG=b:208515128 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4a9455e001cba3b091943fef260d63b039ff5ea9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390527 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Skyrim: Configure temperature sensors for first boardsDiana Z2022-01-216-22/+58
| | | | | | | | | | | | | | | Skyrim is using the PCT2075 rather than the TMP112, and disable the SB-TSI sensor for the first boards. BRANCH=None BUG=b:208515128 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie96067d7be7f5fd693b20d45fd7092d16c387ee2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390526 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Zephyr: Add PCT2075 devicetree supportDiana Z2022-01-214-0/+85
| | | | | | | | | | | | | | Add support for configuring the PCT2075 in the zephyr devicetree. BRANCH=None BUG=b:208515128 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ibb9f86441131378e870d1cb85da842d1bc4c2859 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3390525 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* driver: icm42607: removed SW reset and added POC initializeJuHyun Kim2022-01-212-20/+133
| | | | | | | | | | | | | | | | | | | Removed SW reset in initialize code due to hardware issue of ICM42607 Added registers initialization code instead of SW reset BUG=chromium:1288737 BRANCH=None TEST=ectool motionsense && CROS-EC IIO drivers Signed-off-by: JuHyun Kim <jkim@invensense.com> Change-Id: If14c071b82b62a7432cb1855cdf5d1c9dc744a91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3403824 Tested-by: JuHyun Kim <jkim@invensense.com> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: Kconfig: Fix behavior of VBUS detection modeTristan Honscheid2022-01-212-7/+10
| | | | | | | | | | | | | | | Make CONFIG_PLATFORM_EC_USB_PD_VBUS_DETECT_NONE the default choice for VBUS detection and make it explicit. Then set the detection mode to _TCPC in the test `prj.conf` file. BRANCH=None BUG=b:215392619 TEST=zmake -D configure --test test-drivers; Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I9d382ba04e93480fd79f9c4407ed5a85fd5079f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3404938 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* anx3443: power down in S3 if the mux is in usb2 only modeTing Shen2022-01-212-7/+72
| | | | | | | | | | | | | | | | | | | | | | To save S3 power consumption when USB2 device (e.g. Gnubby) attached, add a mechanism to detect if the device is USB2 or USB3. If it's USB2 only, cache the mux state when entering S3, and restore when back to S0. Also removed the "Mux is not powered in Z1" related code since it's not true. BUG=b:209533566 TEST=see b:209533566 comment8 BRANCH=cherry Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ib05dfe7868e57d3507c95f0020f94fd352d0034b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3394666 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* dojo: set pd log level to 1Tommy Chung2022-01-211-1/+1
| | | | | | | | | | | | | | | PD log level = 0 cannot pass FAFT, switch it to default 1. (CL:3386136) BUG=none BRANCH=cherry TEST=none Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Iead211063cfe853d4faf16b6bd29cd72ba6ad760 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3403833 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: drivers: Increase ticks per second in testsTomasz Michalec2022-01-213-8/+66
| | | | | | | | | | | | | | | | | | | | | Increase ticks per second to 10000 (10 ticks per ms) from 100. This allows to meassure delays of 1 ms and simulate time related behaviour better. PS8815 test is extended to check if delay of 1 ms is applied when role control register is written. This is workaround for some PS8815 HW revisions (b/171430855). BUG=b:203858808 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ib8b4b38c5994b4040b12225f28b628edf1278049 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398505 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: drivers: Accept exact delay in reboot testTomasz Michalec2022-01-211-1/+1
| | | | | | | | | | | | | | | | Reboot AP on G3 host command allows to select delay for reboot. Test for it should pass when delay is greater or equal to selected delay. BUG=b:203858808 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I74a9878aa96fa9c1b850846ebbe85f3d510a53f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398504 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: drivers: Fix timinig issues of ppc syv682x testTomasz Michalec2022-01-211-4/+6
| | | | | | | | | | | | | | | | | | | | | test_ppc_syv682x_interrupt() should wait for repeated interrupt after setting high-voltage overcurrent state. test_ppc_syv682x_write_busy() should wait for at least 400 busy reads to trigger timeout in syv682x_wait_for_ready(). This function timeouts after 400 ms repeatedly calling i2c read with 1 ms delay after each call. BUG=b:203858808 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I096928bc1bb889036283ab2d715c13b1771dfd85 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398503 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* clock-stm32f4: Improve timestamp calculation after deep sleepPatryk Duda2022-01-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | Before this change, the timestamp (t0) and current time from the RTC (rtc0) were not called close together, so some time could have elapsed between them. This would result in the calculation of rtc_diff be a little smaller than it should be: rtc_diff = get_rtc_diff(&rtc0, &rtc1); This patch fixes the problem by obtaining the time from RTC close to obtaining t0 timestamp and using it to calculate the difference after wake up. BUG=b:200828093 BRANCH=none TEST=make -j buildall Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I4d0ebcf681a70231481cad2401c9f599e8e21da0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3359428 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com>