summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Reland "Use third_party boringssl for AES"Yi Chou2023-04-2110-21/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 6fa9cc0c7484be908010a6acdd6547d686234e34 Original change's description: > Use third_party boringssl for AES > > The original boringssl copy is not maintainable in the long term. > We should build it from the upstream version. > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Signed-off-by: Yi Chou <yich@google.com> > Change-Id: I3ead1244c3c839590281e20e5c4828242933d1f2 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3925087 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Signed-off-by: Yi Chou <yich@google.com> Cq-Depend: chromium:4439330 Change-Id: Ic22faafacaf331a1376d094a37c6efe271326d0b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439569 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* beadrix: Support POW-TECH batterygavin.lee2023-04-212-0/+30
| | | | | | | | | | | | | | | | | Add second source battery POW-TECH SG20JL1C2S5900-P1P BUG=b:273842037 TEST=emerge-dedede chromeos-ec , read battery info via EC console BRANCH=none Signed-off-by: Owen Yang <owen.yang@ecs.corp-partner.google.com > Change-Id: I0a7a5fbb0c64713f75d0449954c1a9b97ffdacb0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4349273 Tested-by: Owen Yang <owen.yang@ecs.corp-partner.google.com> Reviewed-by: Ivan Chen <yulunchen@google.com> Commit-Queue: Ivan Chen <yulunchen@google.com> Reviewed-by: Owen Yang <owen.yang@ecs.corp-partner.google.com>
* zephyr: test: Set up OCPC test project and check console commandsTristan Honscheid2023-04-2110-1/+492
| | | | | | | | | | | | | | | | | | | Add a new test binary that has a Nissa-style Kconfig and devicetree, complete with chargers. Use this configuration to run OCPC (common/ocpc.c) and test this module, which has never previously been used in our tests. This CL contains tests for ocpc.c's console commands. BRANCH=None BUG=b:276805061 TEST=./twister -T zephyr/test/ocpc Change-Id: I34dbe1abcae98d8ca9aa9613dddf3b4ba2838792 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4438529 Commit-Queue: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* Taranza: Create initial EC imageYu-An Chen2023-04-2111-1/+958
| | | | | | | | | | | | | | | | | Create the initial EC image for the taranza variant by copying the dibbi board EC files. More changes will be added later. BUG=b:277664211 BRANCH=none TEST=make BOARD=taranza Change-Id: I5b085ed96117e268fe0e5b30d0e5eb4cb7ae522a Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4410551 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* zephyr: led: Change the node depends on display SOCwen zhang2023-04-211-1/+2
| | | | | | | | | | | | | | | | This change makes the zephyr shim led driver use the display SoC for the LED node that depends on battery level, so that the charge LED and the display SoC work synchronously. BUG=b:278512388 BRANCH=none TEST=./twister -T zephyr/test/drivers/ -s drivers.led_driver Change-Id: I82a9e6a18486fb806f49855fbb5773bd7176929a Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4430138 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
* gitlab: Use repo to clone boringsslYi Chou2023-04-211-6/+27
| | | | | | | | | | | | | | Since we are clone the repo with "repo" command, we don't need to clone it again. BRANCH=None BUG=b:248508087, b:273639386 TEST=yaml validator, run repo_clone_at_data locally Change-Id: I08e8413382b8151bebecc90362fb7f31342c01e8 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4453523 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: bc12 shim: Remove compat guardstabilize-15432.B-mainKeith Short2023-04-211-7/+0
| | | | | | | | | | | | | | | The CONFIG_PLATFORM_EC_USB_CHARGER option already guards the bc12.c shim from compiling. A check that a BC1.2 driver is enabled is not required. BUG=none BRANCH=none TEST=zmake compare-builds -a TEST=./twister Change-Id: I1c9598b81a4eb4f96cfc85ef21ecc313db65a8a7 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426808 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* Reland "zephyr/tests: emulator and tests for sm5803"Peter Marheine2023-04-2015-7/+1665
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit fd2415cda6a261b92390aad04829f46f33ffc9e6, with sleeps in test_lpm increased from 4 to 10 seconds. This seems to fix the flakiness that was observed, verified with no failures over 8 CQ builds. Original change's description: > zephyr/tests: emulator and tests for sm5803 > > This implements an emulator and some tests for the SM5803 charger. The > current tests do not exercise the driver as comprehensively as intended, > but those will be added in a later change. > > One discovered bug in the driver is fixed, where some interrupts were > disabled immediately after being enabled. > > BUG=b:242544165 > TEST=twister -ciC -s drivers/drivers.sm5803 > BRANCH=nissa > > Change-Id: I9fc6abd26cd1b2e0cbc05b8e45cf94fc83abd08c > Signed-off-by: Peter Marheine <pmarheine@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290087 > Reviewed-by: Tristan Honscheid <honscheid@google.com> BUG=b:242544165,b:278890420 TEST=`bb add chromeos/cq/firmware-zephyr-cov-cq -commit https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4451846` 8 times, verified success for all builds. Change-Id: Ifd0d486a45be2242023e6efba6457e7907aaedd2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4451846 Reviewed-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com> Tested-by: Peter Marheine <pmarheine@chromium.org>
* charger: Disambiguate charger command outputDaisuke Nojiri2023-04-201-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | The values of the charger console command output are not clearly explained. This CL reformats the output as follows: Name: ISL9241 Option: (0x2830004) Man id: 0x0049 Dev id: 0x000e I_dptf: disabled Limits ( min max step) chg_voltage: 8760 mV ( 64 - 18304, 8) chg_current: 4336 mA ( 8 - 12280, 8) input_current: 4512 mA ( 8 - 12280, 8) BUG=b:278898714 BRANCH=None TEST=See above (on Vell). Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ide4b448d15b5066c43cec9e8aadf1ffdb1afe7f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4447187 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* corsola: merge pd_power_supply_* functionsTing Shen2023-04-207-102/+86
| | | | | | | | | | | | | | | | | | pd_power_supply_* functions are almost identical between krabby and kingler. Since the krabby version is already tested, merge them to reduce test code implementation effort. BUG=b:272664811 TEST=1) ./twister 2) zmake compare-builds krabby kingler BRANCH=none Change-Id: If00c8576589ae657447a7adfb18c46907f47538c Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439254 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* rollback: Add support for entropy from RNG for rollbackaddentPatryk Duda2023-04-201-5/+17
| | | | | | | | | | | | | | | | | | | | | | If 'rollbackaddent' is called without any arguments we can add entropy from RNG. This is useful for testing and debugging purposes. BUG=b:277029648 BRANCH=none TEST=Compile firmware or bloonchipper. Use 'rollbackaddent' command without any arguments to add randomness to rollback. Check if the secret was changed using 'rollbackinfo' command. TEST=./test/run_device_tests.py -b bloonchipper -t rollback.* Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Change-Id: I0da2df8825d915eaf92364ec07f596b7638a64fd Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4381923 Tested-by: Patryk Duda <patrykd@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com>
* Dibbi: Add CONFIG_EMULATED_SYSRQmick_hsiao2023-04-201-0/+1
| | | | | | | | | | | | | | | Add CONFIG_EMULATED_SYSRQ to let the EC pass the button state to the AP BUG=b:273720621 BRANCH=none TEST=get pass for the test item firmware_DevMode with the change of EC Change-Id: I27d7cba0d1fe30b89679f0b33ae5e5d5fef8144f Signed-off-by: mick_hsiao <mick_hsiao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4444453 Reviewed-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Reka Norman <rekanorman@chromium.org>
* hammer: Add jewel boardstabilize-15429.B-mainlschyi2023-04-203-0/+12
| | | | | | | | | | | | | | | Add the Hammer derivative base jewel board. BUG=b:278138283 TEST=make BOARD=jewel BRANCH=none Change-Id: I506d619b95149041a2ee8f8997032252d359c9d4 Signed-off-by: lschyi <lschyi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4444451 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org>
* rex: Update GPIOsCaveh Jalali2023-04-208-99/+122
| | | | | | | | | | | | | | | | | | | | | | Regenerate rex GPIO definitions from spreadsheet+arbitrage. gpio.csv and generated.dtsi are purely auto-generated. rex.dtsi contains overrides to generated.dtsi to correct the cases that the automated process doesn't handle correctly, yet. the workflow is: 1. run arbitrage to generate gpio.csv 2. run util/pinmap/pinmap/pinmap to generate generated.dtsi BRANCH=none BUG=b:276384581 TEST=42/45 passes on suite:faft_ec (no worse than before) Change-Id: Ia43fe20f2c7e422902deb107b39814cf499b2790 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4392209 Reviewed-by: Yuval Peress <peress@google.com>
* retimer: Use common console command for all RetimersVijay Hiremath2023-04-199-165/+169
| | | | | | | | | | | | | | BUG=b:278138274 BRANCH=none TEST=Tested on ADL-RVP, retimer console command works ./twister -T zephyr/test/drivers ./twister -T zephyr/test/drivers -s drivers.default ./firmware_builder.py --metrics /tmp/tmp_pc1rc15 build Change-Id: Idaec9b41f550ad6aafa34400e95ebf00b9c11348 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426790 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* rex: Shuffle GPIOs for easier reviewCaveh Jalali2023-04-192-50/+19
| | | | | | | | | | | | | | | | The next round of auto generated GPIOs includes updates for overrides currently in rex.dtsi, so move them over so changes are easier to review. BRANCH=none BUG=b:276384581 TEST=rex boots Change-Id: Ibdc3bd94e6cf7134169bee75e406b7a105820fbe Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4392208 Reviewed-by: Madhu 🌱 <mparuchuri@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* ec: Add another #line directiveJeremy Bettis2023-04-191-0/+6
| | | | | | | | | | | | | | | | | | | To workaround pre-processor glitch in motion_lid.c add a #line directive. BRANCH=None BUG=b:272518464 TEST=zmake build --coverage -a && \ ./util/find_non_exec_lines.py build/zephyr/all_builds.info Change-Id: I6e35ec1eb2ad4b90e09b082bb3439b4910fecf94 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4447188 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Al Semjonovs <asemjonovs@google.com>
* Revert "zephyr/tests: emulator and tests for sm5803"Aaron Massey2023-04-1915-1665/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fd2415cda6a261b92390aad04829f46f33ffc9e6. Reason for revert: http://b/278890420 - test was flakily blocking CQ Original change's description: > zephyr/tests: emulator and tests for sm5803 > > This implements an emulator and some tests for the SM5803 charger. The > current tests do not exercise the driver as comprehensively as intended, > but those will be added in a later change. > > One discovered bug in the driver is fixed, where some interrupts were > disabled immediately after being enabled. > > BUG=b:242544165 > TEST=twister -ciC -s drivers/drivers.sm5803 > BRANCH=nissa > > Change-Id: I9fc6abd26cd1b2e0cbc05b8e45cf94fc83abd08c > Signed-off-by: Peter Marheine <pmarheine@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290087 > Reviewed-by: Tristan Honscheid <honscheid@google.com> Bug: b:242544165 Change-Id: I315d36d1e08035f13d847ea1a21756ee3790216e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4448966 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: make console buffer logging depend on non-minimal loggingPeter Marheine2023-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | The console buffer log backend depends on CONFIG_LOG_OUTPUT, which only does something if logging is enabled and not in minimal mode. Without this dependency, enabling this backend while in minimal mode causes a link-time error because symbols enabled by CONFIG_LOG_OUTPUT are absent. When in minimal mode log backends are ignored completely anyway, so this change also helps prevent accidental misconfiguration because it doesn't make sense to enable a log backend that will never be used. BUG=b:265781350 TEST=zmake build -a BRANCH=none Change-Id: Ib0722102963b44484f07a779b2bbbde72b29b743 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4445346 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* zephyr/tests: emulator and tests for sm5803Peter Marheine2023-04-1915-7/+1665
| | | | | | | | | | | | | | | | | | This implements an emulator and some tests for the SM5803 charger. The current tests do not exercise the driver as comprehensively as intended, but those will be added in a later change. One discovered bug in the driver is fixed, where some interrupts were disabled immediately after being enabled. BUG=b:242544165 TEST=twister -ciC -s drivers/drivers.sm5803 BRANCH=nissa Change-Id: I9fc6abd26cd1b2e0cbc05b8e45cf94fc83abd08c Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290087 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* nissa: implement tests for project common.cPeter Marheine2023-04-1910-3/+255
| | | | | | | | | | | | | | | | | | | This file contains some utility functions that are fairly straightforward to test, but requires more complex build configuration than the existing sub_board tests because it requires the charger code be built in. The SM5803 input voltage checks are not fully tested because the isl923x driver does not implement get_battery_cells(); testing that will require a SM5803 emulator. BUG=b:267959470 TEST=./twister -T zephyr/test/nissa BRANCH=nissa Change-Id: Ic89f8f84b1889cfb4fe588fdd7c6f06a817e76c1 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4402420 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* gitlab: Fix yamlJeremy Bettis2023-04-181-5/+5
| | | | | | | | | | | | | | | | Colons and \w are not allowed in yaml and must be quoted and escaped. BRANCH=None BUG=b:248508087, b:273639386 TEST=yaml validator on gitlab Change-Id: I46ecd711f17f1635e11086083a5afdae24fc295f Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4443072 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr: LED: Reformated led-pins bindingsJason Yuan2023-04-1827-593/+565
| | | | | | | | | | | | | | | | | | This CL formats the led-pins devicetree to be more intuitive as part of the LED driver overhaul. led-policy and led driver logic is unmodified in this CL and will be added later. BUG=b:228868616 TEST=twister, power LED verified on Villager, Lazor, Skyrim, Xivu BRANCH=none Change-Id: Ia688e872811199447d1e0b11a5533fd8478d2935 Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426805 Commit-Queue: Wai-Hong Tam <waihong@google.com> Auto-Submit: zhi cheng yuan <jasonyuan@chromium.org> Tested-by: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* board/hyperdebug: Implement flash extensionsJes B. Klinke2023-04-183-185/+238
| | | | | | | | | | | | | | Allow dual and quad-lane SPI operations. BUG=b:273601311 TEST=HyperDebug able to flash 16MB in 31 seconds Change-Id: I0243154085d018e123053f22c4a3a9d3b5a853d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4346953 Reviewed-by: Brian Nemec <bnemec@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org>
* rex: Enable USB PD loggingCaveh Jalali2023-04-181-0/+1
| | | | | | | | | | | | | | | The kernel has the capability to probe the EC for PD logs, so enable the EC to support such requests. BRANCH=none BUG=b:271939417 TEST=no more EC console spam about unknown host command 0x0115 Change-Id: I3ecb99cfcca1000b261c376aa8a67890ff07879c Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4424881 Reviewed-by: Madhu 🌱 <mparuchuri@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* chip/stm32: Add extensions for flash programmingJes B. Klinke2023-04-183-36/+369
| | | | | | | | | | | | | | | | | | | | | | | Add support to usb_spi.c for processing a new "Flash Command Start" packet, as an alternative to the existing "Command Start" packet. The new serial flash version carries additional flags, among others, to request a one-byte "Write enable" transaction to take place before the main transaction, and to request repeated polling of the "busy bit" after the main transaction. These allow the number of USB round trips to be reduced when using Servo Micro or C2D2 for flash programming. Also, flags of the new request allow the caller to ask for dual or quad lane communication, which can be supported by board-specific SPI drivers. This is intended for use on the HyperDebug debugger board. BUG=b:273601311 TEST=c2d2 flashing gets slight performance boost Change-Id: Id4d1ec9f37387b4e083a397ca15300455f7a0ada Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4346952 Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* chip/stm32: Remove unwanted protool extensionJes B. Klinke2023-04-181-85/+0
| | | | | | | | | | | | | | | This first attempt turned out to be too closely coupled to the capabilities of the STM32L5xx OctoSPI, allowing odd combiations that is never used by actual SPI flash chips. BUG=b:273601311 TEST=make BOARD=c2d2 Change-Id: I3fd5b1356d1c2c3a7d63dbdf8e1a5fd45ddfe0a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4432090 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org>
* panic: Set watchdog panic reason if old watchdog panicRob Barnes2023-04-182-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The watchdog panic info may be set in watchdog handler or during system pre init after the watchdog reset. It depends on the chip implementation. For cortex-m on Zephyr, the watchdog panic reason is not set in the watchdog handler. The current logic in system pre init only sets the watchdog panic reason when the current reason is not a watchdog. This means only the first watchdog is reported. Successive watchdogs are ignored because the panic flags are never reset. The panic flags will only be reset if a non-watchdog panic occurs or EC memory cleared (FW update or 0 battery). This change checks if the current watchdog panic is old. This is inferred by checking for the PANIC_DATA_FLAG_OLD_HOSTCMD flag, which is set when the host reads the panic info. BUG=b:273516527 BRANCH=Zephyer NPCX boards TEST=Succesive watchdogs are correctly reported in elog TEST=drivers.system unit test Change-Id: I91ec1bf75a85ea7fed978895a262ff74e6ac16c7 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4415329 Commit-Queue: Aaron Massey <aaronmassey@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* Revert "Use third_party boringssl for AES"Yi Chou2023-04-1810-61/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6fa9cc0c7484be908010a6acdd6547d686234e34. Reason for revert: break the build of chromeos-base/chromeos-fpmcu-unittests. Original change's description: > Use third_party boringssl for AES > > The original boringssl copy is not maintainable in the long term. > We should build it from the upstream version. > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Signed-off-by: Yi Chou <yich@google.com> > Change-Id: I3ead1244c3c839590281e20e5c4828242933d1f2 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3925087 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: Ie6acdab0be298625229b69eb9ac3ff5fd196387c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439430 Commit-Queue: Yi Chou <yich@google.com> Owners-Override: Yi Chou <yich@google.com> Reviewed-by: Howard Yang <hcyang@google.com> Tested-by: Yi Chou <yich@google.com>
* Revert "tree: Remove the stale boringssl AES code"Yi Chou2023-04-1816-0/+3747
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1eb725490d0e7ff726b9edcf11579080a412a02f. Reason for revert: break the build of chromeos-base/chromeos-fpmcu-unittests. Original change's description: > tree: Remove the stale boringssl AES code > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 > Signed-off-by: Yi Chou <yich@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: I81f5035e25bed8e98516072a6f2a7a609fd6eede Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439431 Commit-Queue: Yi Chou <yich@google.com> Tested-by: Yi Chou <yich@google.com> Reviewed-by: Howard Yang <hcyang@google.com>
* Revert "fpsensor: Use OPENSSL_cleanse instead of always_memset"Yi Chou2023-04-183-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 848e5a749e7cd6d02a2b31ee275470ba68cbe43d. Reason for revert: break the build of chromeos-base/chromeos-fpmcu-unittests. Original change's description: > fpsensor: Use OPENSSL_cleanse instead of always_memset > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Change-Id: If26578b31d768875bd4b85cdce8a6365e181685a > Signed-off-by: Yi Chou <yich@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4387995 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: I088af334de9537e88e6824262b0ea9ef6344ff72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439432 Owners-Override: Yi Chou <yich@google.com> Tested-by: Yi Chou <yich@google.com> Commit-Queue: Yi Chou <yich@google.com> Reviewed-by: Howard Yang <hcyang@google.com>
* clock: Remove the weak definition clock_enable_moduleYi Chou2023-04-1817-9/+82
| | | | | | | | | | | | | | | | | BUG=b:248508087 TEST=make buildall -j200 TEST=./util/compare_build.sh -b all => Most of the compare result match except for adlrvpm_ite, adlrvpp_ite, adlrvpp_mchp1727, cozmo, icarus, it8xxx2_pdevb, mchpevb1, npcx_evb, npcx_evb_arm pico. And differ the change is the address of clock_enable_module. BRANCH=none Change-Id: I5750c5d5037f303f6cf55a73a1cd5a9501b49aa1 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4369174 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* fpsensor: Use OPENSSL_cleanse instead of always_memsetYi Chou2023-04-183-21/+25
| | | | | | | | | | | | BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: If26578b31d768875bd4b85cdce8a6365e181685a Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4387995 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* tree: Remove the stale boringssl AES codeYi Chou2023-04-1816-3747/+0
| | | | | | | | | | | | BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Use third_party boringssl for AESYi Chou2023-04-1810-21/+61
| | | | | | | | | | | | | | | The original boringssl copy is not maintainable in the long term. We should build it from the upstream version. BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Signed-off-by: Yi Chou <yich@google.com> Change-Id: I3ead1244c3c839590281e20e5c4828242933d1f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3925087 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Disable boringssl ASM for armv7Yi Chou2023-04-181-1/+2
| | | | | | | | | | | | | | | | The asm version of boringssl will cause the FPMCU crash. Disable the asm will resolve this issue. BUG=b:248508087, b:275450331 TEST=make runhosttests -j TEST=make buildall -j TEST=EC_CMD_FP_ESTABLISH_PK_* would not crash dartmonkey BRANCH=none Change-Id: Ib52ea141b57fc38aac375ea64eae32db8e203034 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4368967 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Add third_party boringssl supportYi Chou2023-04-185-1/+98
| | | | | | | | | | | | | | The boringssl support can be enabled via CONFIG_BORINGSSL_CRYPTO. BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: Ibb16bd16a06b08dd86ff7a465c2b4f52994600d8 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388274 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* cmake: Disable exception supportYi Chou2023-04-181-0/+3
| | | | | | | | | | | | | | | https://www.chromium.org/chromium-os/build/c-exception-support/ C++ exceptions are disabled by default for all C and C++ code. BUG=b:248508087 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: I03f9be211f859af239dd65e1839650b88f95fe57 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4336874 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* cmake: Support GNU compilers in the common toolchain fileYi Chou2023-04-182-10/+39
| | | | | | | | | | | | | | | Some platform are using the GNU compilers. We should support them properly. BUG=b:248508087 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: Ia8d85bacf00c49a63f6f0fe665ea1309cc84b1f1 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4336873 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Uldren: set EC fw config and add functionmick_hsiao2023-04-1810-29/+147
| | | | | | | | | | | | | | | | Add KB_BL, DB_USB, and tablet BUG=b:273159459 BRANCH=none TEST=zmake build uldren successfully Change-Id: I9cba0a3dcfaa39184810124f8021bfa9ea014a58 Signed-off-by: mick_hsiao <mick_hsiao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4411574 Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Kyle Lin <kylelinck@google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* power/icelake: Wait for enough power before booting the APReka Norman2023-04-181-0/+5
| | | | | | | | | | | | | | | | | | | | | Currently, when dibbi is powered from Type-C only, the AP fails to boot after an EC reboot. This is because it tries to boot the AP before PD negotiation is complete, so there is not enough power to boot. Modify the icelake power sequencing to wait for enough power before trying to boot the AP. This is similar to how CL:1980104 solved the same issue on puff. BRANCH=None BUG=b:272188485 TEST=reboot EC on dibbi with Type-C power only, AP boots successfully Change-Id: I815c69c58d1f6c9c759ec17b81a7b40fc96279f8 Signed-off-by: Reka Norman <rekanorman@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4421370 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Reka Norman <rekanorman@chromium.org> Commit-Queue: Reka Norman <rekanorman@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: Add myst to gitlab buildsTristan Honscheid2023-04-182-0/+11
| | | | | | | | | | | | | | Start running builds for the myst project in Gitlab and calculating code coverage. BUG=b:274615054 BRANCH=None TEST=None Change-Id: Ie0c7262f0948d5d8cc3811930a16310fc5345196 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4357300 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* presubmit: Validate testcase.yaml filesTristan Honscheid2023-04-183-4/+138
| | | | | | | | | | | | | | | | | | Add a helper script that examines testcase.yaml files and call it during the presubmit hook. Currently the script scans for extra_args fields in the testcase.yaml files that reference the deprecated CONF_FILE, OVERLAY_CONFIG, or DTC_OVERLAY_FILE vars and prints a message to use the corresponding extra_conf_files, extra_overlay_confs, or extra_dtc_overlay_files YAML field. BUG=None BRANCH=None TEST=Tried submitting some invalid testcase.yaml files Change-Id: I0a08c2bec156eb4e43acca255377c7563757c53b Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4428298 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* kindred: fix set TCPC_AUX_SWITCH to 0xC on Port 0Boris Mittelberg2023-04-182-28/+25
| | | | | | | | | | | | | | | Updating the mux via a callback instead of interrupt BUG=b:183123775 BRANCH=main,firmware-hatch-12672.B TEST=make BOARD=kindred Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: Ic90202937bda5b8c8028b9f9affae021095521b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4158695 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
* ANX7406: Add API to control GPIO0Daisuke Nojiri2023-04-182-0/+30
| | | | | | | | | | | | | This CL adds an API which controls GPIO0 of ANX7406. BUG=b:269790564 BRANCH=None TEST=make BOARD=hades Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I1e2ebda63fa49aec88d703f31f7bb70730939b63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426802 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: Fix uninitialized variableJeremy Bettis2023-04-181-1/+1
| | | | | | | | | | | | | | | | | | The test was causing inconsistent code coverage due to calling set_offset with an uninitialized variable. BRANCH=None BUG=b:278607671 TEST=Ran test several times Change-Id: I779096eb0b90deb040b50b1015bbffcf22fc0583 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4437750 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: Eliminate pointer from SYS_INIT functionsKeith Short2023-04-1740-80/+42
| | | | | | | | | | | | | | | | | | | | The upstream change https://github.com/zephyrproject-rtos/zephyr/pull/51217 modified the function signature for the SYS_INIT call, eliminating the unused device pointer. Run the Zephyr provided script ./zephyr/scripts/utils/migrate_sys_init.py to update all callers. BUG=b:278595739 BRANCH=none TEST=zmake build -a Cq-Depend: chromium:4422804 Change-Id: I881bc536cef43a7c3ac4bc5eb3ce1893237bbd1f Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4437049 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* ktu1125: fix polarity and vconn sourcingBoris Mittelberg2023-04-172-10/+22
| | | | | | | | | | | | | Set polarity to be used when enabling vconn BUG=b:207178886 BRANCH=none TEST=manual test on rex sku2 Change-Id: I82efeeb7d01f7b8baa6493753c0a96471116b1a9 Signed-off-by: Boris Mittelberg <bmbm@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4409006 Reviewed-by: Diana Z <dzigterman@chromium.org>
* fpsensor: Use consistent unsigned type for finger indexTom Hughes2023-04-173-7/+5
| | | | | | | | | | | | | | | | | | This is a followup to https://crrev.com/c/3872809, which changed the variable tracking the number of fingers to a consistent type (uint16_t). BRANCH=none BUG=b:244781166 TEST=./test/run_device_tests.py --board dartmonkey => PASS TEST=./test/run_device_tests.py --board bloonchipper => PASS TEST=Flash firmware on gimble, enroll, lock, unlock Change-Id: I1f414fc2bf3ccb229ad074f73eaf4a51fa252bdb Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4382560 Reviewed-by: Yi Chou <yich@google.com>
* Whiterun: Increase lis12dw2 sensor ODRKornel Dulęba2023-04-171-2/+3
| | | | | | | | | | | | | | | It's used for body detection feature. The suggested frequency for that is 50Hz. Adjust the sensor to match that. BUG=b:262680246 BRANCH=none TEST="accelrate 0" prints 50Hz Change-Id: Iec93d4508251bcd63eafbe5c7e4bdee5531c6217 Signed-off-by: Kornel Dulęba <korneld@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4379150 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>