summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Charge_state_v2: Always evaluate battery disconnectDiana Z2023-04-251-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Always evaluate the battery disconnect state when we know the battery is physically present. Otherwise, we may miss the battery coming out of disconnect if AC is removed around the same time the battery becomes responsive. This causes us to remain in safe state with an active charge port offering 0mV/0mA. Note this change adjusts the criteria for battery disconnect, counting errors in assessing the battery disconnect state as disconnects. This should account for the fact that the check now runs before we've verified battery communication is okay. BRANCH=skyrim BUG=b:276837557 TEST=on frostflow, ensure units don't show charging when AC is removed after coming out of ship mode Change-Id: Ie52c993005cf389dc2912c6ab9492483b60239a9 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4470067 Tested-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* fpsensor: Switch to the ScopedFastCpuYi Chou2023-04-251-4/+3
| | | | | | | | | | | | | The RAII ScopedFastCpu is more convenient than the C API. BUG=b:248508087 TEST=make V=1 BOARD=bloonchipper -j BRANCH=none Change-Id: I2f71008ac130759126e3b1fcccda99d93d757ee6 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4344623 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* clock: Add mock for clock_enable_moduleYi Chou2023-04-252-0/+25
| | | | | | | | | | | | BUG=b:248508087 TEST=make buildall -j BRANCH=none Force-Relevant-Builds: all Change-Id: If691bd1400b65c5595b833293578e16208c49849 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4376399 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Reland "fpsensor: Use OPENSSL_cleanse instead of always_memset"Yi Chou2023-04-253-21/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 848e5a749e7cd6d02a2b31ee275470ba68cbe43d 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 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Force-Relevant-Builds: all Change-Id: If8ac7ed3a87af1369cf278a84af470ba0540984b Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4464661 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Reland "tree: Remove the stale boringssl AES code"Yi Chou2023-04-253-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f 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 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Force-Relevant-Builds: all Change-Id: Ifac2e67d3f347be07a4ab880398029a694fa357d Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4464660 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Reland "Use third_party boringssl for AES"Yi Chou2023-04-251-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Force-Relevant-Builds: all Change-Id: I2bf9e2157eec030ec3526939846a5706b1954afd Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4464659 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* common/tablet: Fix printing the tablet modeGwendal Grignou2023-04-241-2/+7
| | | | | | | | | | | | | | | | table_mode is not just a boolean, it stores the cause(s) for getting in tablet mode. Fixes: c1f6b2a249250 ("common/tablet: Allow getting out of tablet mode when sensors are broken") BUG=b:279135356 TEST=Compile Change-Id: I4a50118004285da2f7ba4229e537d6cd8d7b07d1 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4468727 Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* panic: Add flags to panicinfo outputRob Barnes2023-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Output the panic flags in the panicinfo console command output. This is helpful for debugging panicinfo bugs. Example output: 23-04-17 08:52:52.168 Saved panic data: 0x49 (NEW) 23-04-17 08:52:52.168 a1 = 0x00000001 23-04-17 08:52:52.171 a2 = 0x100B5506 23-04-17 08:52:52.173 a3 = 0x00000000 23-04-17 08:52:52.176 a4 = 0x00000000 23-04-17 08:52:52.179 ip = 0x100B1594 23-04-17 08:52:52.179 lr = 0x10081B1B 23-04-17 08:52:52.182 pc = 0x10095ABA 23-04-17 08:52:52.185 xpsr = 0x21000000 23-04-17 08:52:52.188 v1 = 0x00000001 23-04-17 08:52:52.188 v2 = 0x00000000 23-04-17 08:52:52.190 v3 = 0x00000000 23-04-17 08:52:52.192 v4 = 0x00000000 23-04-17 08:52:52.195 v5 = 0xFFFFFFFD 23-04-17 08:52:52.198 v6 = 0x200CA0B4 23-04-17 08:52:52.202 v7 = 0x100B1584 23-04-17 08:52:52.202 v8 = 0x00000001 23-04-17 08:52:52.203 psp = 0x200CA038 23-04-17 08:52:52.206 exc_rtn = 0xFFFFFFFD 23-04-17 08:52:52.209 msp = 0x200CAC90 BUG=None BRANCH=None TEST=panicinfo on skyrim Change-Id: I703e6f1a703b801cb61120365dbcc1c49e77ebe3 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4416457 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec: Add another #line directive for usb_common.cJeremy Bettis2023-04-221-0/+6
| | | | | | | | | | | | | | | | | | | To workaround pre-processor glitch in common/usb_common.c add a #line directive. BRANCH=None BUG=b:272518464 TEST=make -j$(nproc) -C zephyr -f Makefile.cq twister_host COVERAGE=y TEST=./util/find_non_exec_lines.py twister-out-host/coverage.info Change-Id: I43216871dc2998cd89c945871b15f012ced97bf8 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4461055 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* Revert "Reland "Use third_party boringssl for AES""Jonathon Murphy2023-04-211-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0164feeebaad4abc7deb510c57ca0707dd2babb1. Reason for revert: Breaks postsubmit b/279174496 Original change's description: > Reland "Use third_party boringssl for AES" > > 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> Bug: b:248508087, b:273639386 Change-Id: I5cfb826bff10df55bbadf76c6cc2062bc761a6d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4456117 Commit-Queue: Jonathon Murphy <jpmurphy@google.com> Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Auto-Submit: Jonathon Murphy <jpmurphy@google.com> Reviewed-by: Jonathon Murphy <jpmurphy@google.com> Tested-by: Jonathon Murphy <jpmurphy@google.com> Owners-Override: Jonathon Murphy <jpmurphy@google.com>
* Revert "Reland "tree: Remove the stale boringssl AES code""Jonathon Murphy2023-04-213-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2e03009c0dccc4ae9683d3b7d761e900b3cf2c46. Reason for revert: Breaks postsubmit b/279174496 Original change's description: > Reland "tree: Remove the stale boringssl AES code" > > This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f > > 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 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Signed-off-by: Yi Chou <yich@google.com> > Change-Id: Ifca00792d0568ed767a1c9aea4953eb7a93c1c92 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439570 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: I4c44cdd75a9cc38e3e0e688d91f2a64b908ae61d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4459598 Tested-by: Jonathon Murphy <jpmurphy@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Auto-Submit: Jonathon Murphy <jpmurphy@google.com> Owners-Override: Jonathon Murphy <jpmurphy@google.com>
* Revert "Reland "fpsensor: Use OPENSSL_cleanse instead of always_memset""Jonathon Murphy2023-04-213-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32316a1137042220e533166e097a23b12d5ce91c. Reason for revert: Breaks postsubmit b/279174496 Original change's description: > Reland "fpsensor: Use OPENSSL_cleanse instead of always_memset" > > This is a reland of commit 848e5a749e7cd6d02a2b31ee275470ba68cbe43d > > 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 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Change-Id: I2a818345996e4a9f545ad7eefbdaf6a7e4497795 > Signed-off-by: Yi Chou <yich@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439434 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: I8d34bb643c6d7c3be2ef1719c7b6ffae387a36b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4459599 Auto-Submit: Jonathon Murphy <jpmurphy@google.com> Tested-by: Jonathon Murphy <jpmurphy@google.com> Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Owners-Override: Jonathon Murphy <jpmurphy@google.com>
* Reland "fpsensor: Use OPENSSL_cleanse instead of always_memset"Yi Chou2023-04-213-21/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 848e5a749e7cd6d02a2b31ee275470ba68cbe43d 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 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: I2a818345996e4a9f545ad7eefbdaf6a7e4497795 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439434 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Reland "tree: Remove the stale boringssl AES code"Yi Chou2023-04-213-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f 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 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Signed-off-by: Yi Chou <yich@google.com> Change-Id: Ifca00792d0568ed767a1c9aea4953eb7a93c1c92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439570 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Reland "Use third_party boringssl for AES"Yi Chou2023-04-211-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* zephyr: test: Set up OCPC test project and check console commandsTristan Honscheid2023-04-211-1/+12
| | | | | | | | | | | | | | | | | | | 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>
* 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>
* 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>
* panic: Set watchdog panic reason if old watchdog panicRob Barnes2023-04-181-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-181-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-183-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-181-9/+0
| | | | | | | | | | | | | | | | | 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-183-6/+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-181-5/+10
| | | | | | | | | | | | | | | 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>
* zephyr: Eliminate pointer from SYS_INIT functionsKeith Short2023-04-175-15/+5
| | | | | | | | | | | | | | | | | | | | 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>
* fpsensor: Use consistent unsigned type for finger indexTom Hughes2023-04-172-6/+4
| | | | | | | | | | | | | | | | | | 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>
* flash: cbi: Block the HCs from flash CBI section modificationMadhurima Paruchuri2023-04-171-1/+84
| | | | | | | | | | | BRANCH=None BUG=b:267629295 TEST=./twister -T zephyr/test -c Change-Id: Ibcf176f10860cc126b267908faba054df256c3d4 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4414226 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* USB-PD: Make sink automatically enter EPR modeDaisuke Nojiri2023-04-173-3/+20
| | | | | | | | | | | | | | | | | | | | Currently, EPR mode is entered only by 'pd' console command. This CL makes sink ports enter EPR mode automatically. PE_FLAGS_EPR_EXPLICIT_EXIT is cleared when soft reset is sent, a source is disconnected, or EPR is entered again. BUG=b:257320026,b:274929940 BRANCH=None TEST=On Agah, plug AC, observe automatic entry to EPR. Then type 'pd 1 epr exit' and observe EPR mode is not re-entered. Then replug AC and observe the port enters EPR automatically. TEST=make run-usb_pd_console Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ie2b94323ba404d44ee70756e1893c065c34911fd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4421425 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* system_safe_mode: Allow coredump host commandsRob Barnes2023-04-171-4/+11
| | | | | | | | | | | | | | | | Allow coredump host commands in system safe mode. These are used to dump ec memory after a panic. Also ran clan-format. BUG=b:273967724 BRANCH=None TEST=Able to dump memory after a panic Change-Id: If662111711bb362b930a9229bf1d0e6fc604149e Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4421423 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec: Add back in some #line directivesJeremy Bettis2023-04-151-0/+6
| | | | | | | | | | | | | | | | | We still have files that get odd coverage problems due to the pre-processor marking the wrong line of code, and claiming that we have no coverage of comments and blank lines. BRANCH=None BUG=b:272518464 TEST=Ran util/find_non_exec_lines.py Change-Id: If0d1d632fa52001531d7782412d9ebee8f14b054 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426797 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* USB-PD: Update pd console command for EPRDaisuke Nojiri2023-04-141-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > pd 1 epr enter EPR enter requested > [130.434040 C1: PE_SNK_Send_EPR_Mode_Entry] [130.434852 C1: DPM Waiting] [130.445641 C1: PE_SNK_EPR_Mode_Entry_Wait_For_Response] [130.501005 C1: Entered EPR] [130.501378 C1: PE_SNK_Wait_for_Capabilities] [130.518489 C1: PE_SNK_Evaluate_Capability] [130.519076 C1: PE_SNK_Select_Capability] C1: Req [8] 28000mV 5000mA > pd 1 state Port C1 CC1, Enable - Role: SNK-UFP TC State: Attached.SNK, Flags: 0x1000 PE State: PE_SNK_Ready, Flags: 0x41000201 EPR > pd 1 epr exit EPR exit requested [222.511037 C1: Request SPR before EPR exit] [222.511515 C1: PE_SNK_Select_Capability] C1: Req [4] 20000mV 5000mA BUG=b:257320026 BRANCH=None TEST=Agah. Run make run-usb_pd_console. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: If7566e1dc4de790180e44b49893622e1e71269da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4296999 Reviewed-by: Keith Short <keithshort@chromium.org>
* host_cmd: Add command to get/set s0ix counterGrzegorz Bernacki2023-04-141-0/+22
| | | | | | | | | | | BUG=b:261869264 TEST=Tested on skyrim and nissa BRANCH=none Change-Id: I4f2cd0121b6eab445b9645037d607ae10daea835 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4239443 Reviewed-by: Robert Zieba <robertzieba@google.com>
* TCPMv2: Disable PE during ErrorRecoveryDiana Z2023-04-131-2/+1
| | | | | | | | | | | | | | | | | | | | If ErrorRecovery was requested from the TC layer, ensure that the TC layer also disables the PE layer. Otherwise, the PE states may continue to progress while we're holding Open on the CC lines. Consolidate calls to disable PD messages into the tc_detached() function, which already handles the general necessities of getting the port cleaned up. BRANCH=None BUG=b:276837557 TEST=on skyrim, run some dead battery boots and observe we don't have any instances of sending a Request while in ErrorRecovery Change-Id: I8bd23ff8824b32e3895fe6e71f314aa6f0bc4127 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4416460 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* USB-PD: Update EC_CMD_TYPEC_STATUS for EPRDaisuke Nojiri2023-04-131-30/+70
| | | | | | | | | | | | | | | | | Currently, EC_CMD_TYPEC_STATUS can carry up to 7 PDOs. With EPR, the max number of PDOs is 11. This patch adds version 1 of the command with the new response struct which has 11 slots for source caps and sink caps. BRANCH=None BUG=b:257320026 TEST=Tested v0 on Vell. v1 will be tested when time comes. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I694b5897de7faee8e492c7cdc196ff94dd9c8fb4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4294392 Reviewed-by: Keith Short <keithshort@chromium.org>
* rollback: Move CONFIG_SHA256 outside of add_entropy()Patryk Duda2023-04-121-4/+4
| | | | | | | | | | | | | | | | | | | This patch introduces no functional changes. BUG=b:277029648 BRANCH=none TEST=make BOARD=bloonchipper TEST=./test/run_device_tests.py -b bloonchipper -t rollback.* Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Change-Id: I4c826439a988dd66890837c2e8398049c0706de2 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4408868 Commit-Queue: Patryk Duda <patrykd@google.com> Tested-by: Patryk Duda <patrykd@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* charge_manager: don't refer to ramp functions if disabledPeter Marheine2023-04-121-9/+4
| | | | | | | | | | | | | | | | | | | Although preprocessor guards for charge ramp support were used to determine whether current should be ramped, this still depended on the compiler to optimize out references to chg_ramp_get_current_limit() in the no-ramp configuration. Such optimizations cannot be depended on when building unit tests, so lift the conditional branches that use ramp-related functions into the preprocessor conditional blocks. BUG=b:276805061,b:267959470 TEST=Zephyr unit tests no longer fail to link with undefined references to chg_ramp_get_current_limit and friends. BRANCH=none Change-Id: Ic17c690cd4bab5f51b31597023824fbbc7dcd4d5 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4402422 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* system_safe_mode: Print process stack dumpRob Barnes2023-04-112-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the CONFIG_SYSTEM_SAFE_MODE_PRINT_STACK option for printing the faulting process stack to the console buffer. This must be done in safe mode because the console buffer ignores log messages while in an ISR. This option is on by default when system safe mode is enabled. get_panic_stack_pointer is a new overidable function that each architecture needs to implement to support this feature. The default implementation returns 0, which will result in no stack being printed. This is a workaround until coredumps are fully supported. BUG=b:266084064 BRANCH=None TEST=System safe mode zephyr test passes Stack print observed on boten, guybrush, and skyrim boards. LOW_COVERAGE_REASON=Cortex-M and NDS32 specific code cannot be tested Change-Id: Ied78ab7e6edca9cfa97c50323d94e39a3fca0eef Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4301695 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* rollback: Move variables declaration under one #ifdef in add_entropy()Patryk Duda2023-04-111-5/+3
| | | | | | | | | | | | | | | | | | | | | Since we don't need to create variables at the beginning of the function we can merge two CONFIG_ROLLBACK_SECRET_LOCAL_ENTROPY_SIZE blocks into one. This patch introduces no functional changes. BUG=b:277029648 BRANCH=none TEST=make BOARD=bloonchipper TEST=./test/run_device_tests.py -b bloonchipper -t rollback.* Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Change-Id: I2eff4fed07e8edb983384ed4cff72b1e0ffbd379 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4408869 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com> Tested-by: Patryk Duda <patrykd@google.com>
* zephyr: shim: Add GESTURE_DETECTION to enable/disable body detectionRuihai Zhou2023-04-111-1/+2
| | | | | | | | | | | | | | | | | Add GESTURE_DETECTION to enable/disable body detection on zephyr. Also define LID_ACCEL and format the string literal to avoid build failed after enable GESTURE_DETECTION. BRANCH=corsola BUG=b:272655176 TEST=zmake build steelix TEST=check cros-ec-activity loaded Change-Id: Id77f0baeee3b7e710746991a653a77497984402b Signed-off-by: Ruihai Zhou <zhouruihai@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4405803 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* zephyr: Support PLATFORM_EC_CMD_GPIO_EXTENDED flagKnox Chiou2023-04-111-2/+5
| | | | | | | | | | | | | | | | | | | Support PLATFORM_EC_CMD_GPIO_EXTENDED flag to enable `gpioset` on zephyr. BUG=b:272185086 BRANCH=none TEST=zmake build geralt TEST=gpioset lid-open 0/1 Change-Id: I40097dcb9fca337177b9cef9458ddab0c4eab2bf Signed-off-by: Knox Chiou <knoxchiou@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383289 Code-Coverage: Knox Chiou <knoxchiou@chromium.org> Commit-Queue: Knox Chiou <knoxchiou@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Knox Chiou <knoxchiou@chromium.org>
* USB-PD: Support Vconn swap during EPR entry for SinkDaisuke Nojiri2023-04-072-1/+22
| | | | | | | | | | | | | | | | Currently, a sink port must not be a Vconn source before entering EPR. This CL makes TCPMv2 allow a sink port to swap Vconn during EPR mode entry. BUG=b:257320026 BRANCH=None TEST=Agah. Set the sink port as Vconn source. Trigger EPR enter. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: If569ec9fe9e0f4ffbb153db649c3f9c04b698eb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4295370 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* zephyr: test: Fix flaky keyboard_scan testTristan Honscheid2023-04-071-0/+11
| | | | | | | | | | | | | | | | Latent key presses were appearing in a subsequent test, throwing off FFF expectations. Resolved by adding a test-only helper function to `keyboard_scan.c` to wipe out the debouncing state between tests. Also broke out the failing test into two independent ones. BRANCH=None BUG=None TEST=./twister -s drivers/drivers.keyboard_scan Change-Id: I79f2a6891f36e10a7df87865573348312c5b57d5 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4404706 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* keyboard_scan: drop CONFIG_KEYBOARD_LANGUAGE_IDFabio Baltieri2023-04-062-75/+0
| | | | | | | | | | | | | | Drop the CONFIG_KEYBOARD_LANGUAGE_ID option and code, does not seem to be used, can't find any historical reference either. BRANCH=none BUG=b:277105687, b:80168723 TEST=zmake compare-builds -a Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: If4eb37818ec4819204bcb343c37188f70457e09d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4403956 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* fpsensor: Rename fpsensor_detect functionsBobby Casey2023-04-062-4/+4
| | | | | | | | | | | | | | | | Rename get_fp_sensor_type and get_fp_sensor_spi_select to fpsensor_detect_get_type and fpsensor_detect_get_spi_select to be more consistent with other APIs BRANCH=none BUG=b:256674283 TEST=./util/compare_build.sh -b all -j 120 => MATCH Change-Id: Ie548ff5b33079cbc607cb9552efdfe9676da4c02 Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4283704 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* fp_sensor_mock: Rename fp_sensor_mockBobby Casey2023-04-063-5/+5
| | | | | | | | | | | | | | | | | Rename fp_sensor_mock files to fpsensor_mock to be consistent with other file names. This helps avoid issues with scripts using pattern matched filenames, such as util/migrated_files.sh. BRANCH=none BUG=none TEST=compare_build.sh -b fp => MATCH TEST=make BOARD=bloonchipper tests TEST=make BOARD=dartmonkey tests Change-Id: I6f7e213cbf72a59cfd5994c66dc7b93ea44c6505 Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334695 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* fpsensor: Fix definition of FP_SENSOR_IMAGE_OFFSETBobby Casey2023-04-061-5/+0
| | | | | | | | | | | | | | | | | | FP_SENSOR_IMAGE_OFFSET defines the offset from the beginning of fp_buffer to the image read from the sensor. If not defined this value defaults to zero but the definition was inadvertently removed in https://crrev.com/c/4273187. BRANCH=none BUG=b:276928792 TEST=make runhosttests -j TEST=./test/run_device_tests.py --board bloonchipper => PASS TEST=./test/run_device_tests.py --board dartmonkey => PASS Change-Id: If91cf6276e9a9c848ebf1885016788d5f066f0ad Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4400531 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* rollback: Replace interrupt_{disable,enable} with irq_{lock,unlock}Patryk Duda2023-04-061-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace interrupt_* functions with their irq_* counterparts since we are going to use rollback regions in Zephyr. Zephyr EC shim doesn't provide interrupt_disable() and interrupt_enable() functions. Instead, irq_lock() and irq_unlock() functions, used in Zephyr, are implemented in EC and compiled when building Cros EC (without Zephyr). These functions are wrappers for old interrupt_disable() and interrupt_enable() functions. BUG=b:277029648 BRANCH=none TEST=make BOARD=bloonchipper TEST=./test/run_device_tests.py -b bloonchipper -t rollback.* Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Change-Id: I4899985cfc50aff65b0daebeb139520ff72c6af4 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4403576 Tested-by: Patryk Duda <patrykd@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com>
* rollback: Remove SECTION_IS_RO around get_rollback_erase_size_bytes()Patryk Duda2023-04-061-19/+16
| | | | | | | | | | | | | | | | This function is used when CONFIG_ROLLBACK_UPDATE is enabled. There is no need to prevent from compiling this function in RW. BUG=b:277029648 BRANCH=none TEST=make BOARD=bloonchipper Change-Id: I75acb976dd53f15c9ce6bbdd5a2cc7c5e22da8e5 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4381921 Commit-Queue: Patryk Duda <patrykd@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Patryk Duda <patrykd@google.com>