summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* chip: add support for npcx trngDavid Cross2023-05-152-0/+252
| | | | | | | | | BUG=b:280889889 TEST=add CONFIG_RNG to NPCX based board.h file (e.g. npcx9_evb) Change-Id: I93b3a7742c3b7d614cc1218104cd642b3339f8b3 Signed-off-by: David Cross <davidmcross@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507895 Reviewed-by: Bobby Casey <bobbycasey@google.com>
* tasks: Only report stack overflow if task is enabledRob Barnes2023-05-155-9/+16
| | | | | | | | | | | | | | | | | Don't report stack overflow on a task that has been disabled. Without this change, system safe mode will fail to recover from a stackoverflow because the stackoverflow will be detected again, even though the task has already been disabled. BUG=b:278792557 TEST=System safe mode starts on boten after a stackoverflow Change-Id: I59ab579c296d108dcd8c5aba9cb32bba6c7bbf54 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455298 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* ec: Add #line in include/system.hJeremy Bettis2023-05-151-0/+6
| | | | | | | | | | | | | | Work around coreboot GCC preprocessor bug. BUG=b:272518464 TEST=gcc -E Change-Id: I609d019680bedddc8deea0f377c8bee4df6f5df1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4533365 Commit-Queue: Aaron Massey <aaronmassey@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* ppc: ktu1125: Fix register used for VCONN controlScott Collyer2023-05-151-3/+7
| | | | | | | | | | | | | | | | | | | | The register that was being used to enable/disable VCONN (KTU1125_SET_SW_CFG) was incorrect. It should be KTU1125_CTRL_SW_CFG. In addition, VCONN was being applied to wrong CC line. KTU1125_CC1S_VCONN --> applies VCONN to CC1 when the polarity is CC2 KTU1125_CC2S_VCONN --> applies VCONN to CC2 when the polarity is CC1 BUG=b:267589112 TEST=Verfied using totalphase that VCONN is being enabled and the CC voltage of the CC data line is correct. Change-Id: I45c85800849dbabeac36d976525de7d058ad23f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519354 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* charger: Rename enum charge_state_v2 to charge_stateSimon Glass2023-05-154-23/+23
| | | | | | | | | | | | | | | | Now that we don't have an old charge_state, this is the only one. Rename it accordingly. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: I95923eedd2715b8c7793df8f6e3171c82f9347ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516193 Reviewed-by: Tristan Honscheid <honscheid@google.com> Tested-by: Simon Glass <sjg@chromium.org> Commit-Queue: Eric Peers <epeers@google.com>
* charger: Delete charge_state_v2.hSimon Glass2023-05-151-9/+0
| | | | | | | | | | | | | | | | This is not used any more. Delete it. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: I982d9ac1e593232518850ad061480cd9746cfcbe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516192 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Eric Peers <epeers@google.com>
* doc: zephyr_troubleshooting: add a note about macro expansionFabio Baltieri2023-05-151-2/+12
| | | | | | | | | | | | | | | Add a note about the new config option CONFIG_COMPILER_TRACK_MACRO_EXPANSION, and also add an example on how to disable LTO without changing the project file itself. BUG=none TEST=check the page on gitiles Change-Id: I3af8b5ba4f8a0e59a419e426baa4d5460040e86c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516858 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* ec: Enable unaligned access for cortex-mFiras Sammoura2023-05-157-2/+172
| | | | | | | | | | | | | | | | | | Enable unaligned access for cortext-m and. Add a unit test to validate that unaligned access runs properly on both bloonchipper and dartmonkey. Add benchmarks to measure the speed gain between aligned and unaligned access. BRANCH=none BUG=b:239254184 TEST=test/run_device_tests.py -b dartmonkey -t unaligned_access TEST=test/run_device_tests.py -b bloonchipper -t unaligned_access Change-Id: I7d75433e6b7b33d7c82ad740dc85a8646d891c6a Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4327795 Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* omnigul: Modify LED behaviorLogan_Liao2023-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | Modify LED behavior to meet SPEC. S3(discharge): Amber on 1 sec, off 3 sec. S5(discharge): LED off. Battery Error: Amber on 1 sec, off 1 sec. BUG=b:281786726, b:281785649, b:281782326 TEST=test LED behavior meet SPEC. Change-Id: I8e99dfe1d3d415fd5182e494d57e1a02b5c1c59e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4521358 Code-Coverage: Kyle Lin <kylelinck@google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
* [marasov] Enable CONFIG_USB_PD_VBUS_DETECT_PPCmichael5_chen12023-05-152-0/+9
| | | | | | | | | | | | | | | | | | | | | Denpend on HW design, the VBUS control by PPC. Enable CONFIG_USB_PD_VBUS_DETECT_PPC. Disable CONFIG_USB_PD_VBUS_DETECT_TCPCl. BUG=b:277171675 TEST=manual C1: Plug AC through HUB pass (10/10) C1: Plug AC pass (10/10) C0: Plug AC through HUB Pass (10/10) C0: PLug AC pass (10/10) Change-Id: Id91f0aef5e5e24e969c9a50934d821a491d9146b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520030 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Code-Coverage: Kyle Lin <kylelinck@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Tested-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com>
* starmie: Improve RT1739 dead battery voltage issuewangganxiang2023-05-153-1/+11
| | | | | | | | | | | | | | | | Add RT1739 initialization during EC boot. This modification is optimized for dead battery voltage issues. BUG=b:281606949 TEST=zmake build starmie The board can power on normally under AC only mode. Change-Id: I1843b9bce231bc730ad1c4ccb69d74fe3d7beb65 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516061 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Commit-Queue: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Tested-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* Craask: define LED behavior at STATE_DISCHARGE_S0_BAT_LOWben chen2023-05-151-1/+1
| | | | | | | | | | | | | | STATE_DISCHARGE_S0_BAT_LOW: Blue on BUG=b:282116750 TEST=check LED behavior while SOC < 10% in battery mode. Change-Id: I57487200de2360dfa34cecda8a99ab1c008d2758 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4525880 Reviewed-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Tested-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* USB Mux: Use polarity in safe modeJameson Thies2023-05-1223-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a handful of drivers look for the mux_state to be equal to USB_PD_MUX_SAFE_MODE when handling safe mode. This check requires that the polarity information be cleared before sending the mux_state to any drivers to correctly handle the safe state. But the same mux_state is sent to the kernel, which relies on polarity information from the EC when setting USB-C switches. This CL updates the retimer, tcpm and usb_mux drivers which check for mux_state to equal USB_PD_MUX_SAFE_MODE to instead only look for the safe mode bit to be set. This allows those drivers to function the same way in safe mode regardless of polarity information. It also updates usb_mux.c to preserve the polarity bit when sending mux_state to drivers in safe_state. LOW_COVERAGE_REASON=20 of the changed drivers have no emulators BUG=b:279733113 TEST=make -j buildall, confirmed that no remaining drivers check for mux state to equal USB_PD_MUX_SAFE_MODE. Checked on redrix that we are able to drive a monitor with inverted and normal polarity after losing Try.SRC. Change-Id: Ifc89d0ba1da0975436f93be102fadf725a5b8566 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4527219 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jameson Thies <jthies@google.com> Commit-Queue: Jameson Thies <jthies@google.com>
* zmake: Resolve coreboot_sdk_root pathAaron Massey2023-05-121-1/+2
| | | | | | | | | | | | | | | | | The COREBOOT_SDK_ROOT environment variable is not resolved. Resolve the COREBOOT_SDK_ROOT environment variable to an absolute path. BUG=b:268050548 TEST=CQ TEST=fwsdk: bazel build //platform/rules_cros_firmware/cros_firmware:herobrine_ec Change-Id: Ib5e053531dfce1a13e2840d8968ae559d425cf89 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4529215 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* common: move chip agnostic trng code from stm32 to commonDavid Cross2023-05-125-71/+97
| | | | | | | | | | | | | | | | | | | | | Making this change causes common trng functions to move memory locations. This change only affects fingerprint (FPMCU) boards BUG=b:280889889 TEST=make BOARD=bloonchipper, CONFIG_CMD_RAND enabled in board.h ALLOW_CONFIG=1 ./util/compare_build.sh -b all => All boards match, except the following Fingerprint boards: bloonchipper dartmonkey hatch_fp nami_fp nocturne_fp nucleo-dartmonkey Change-Id: I4dbb5e255be0f61eb7b446af4565bea487c08e52 Signed-off-by: David Cross <davidmcross@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507892 Reviewed-by: Bobby Casey <bobbycasey@google.com>
* kingler: add usbc testEric Yilun Lin2023-05-1212-78/+358
| | | | | | | | | | | | | | This CL adds the initial USB-C tests on kingler BUG=b:272664811 TEST=twister -ci zephyr/test Change-Id: I14395ce84442f40e6fd05f7c14a2814fb24ebb9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4483240 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* rt1718s: integrate board src enable functionsEric Yilun Lin2023-05-125-42/+41
| | | | | | | | | | | | | | | | | Integrate the source enable functions into the driver. Also, reorder the TCPCI call and the board hook call to ensure the board hook is called later in case that the GPIO config auto-reload clobbers the GPIO values. BUG=b:276661970 TEST=test voltorb C1 source/sink Change-Id: Ifff3ae116c088f13ee5e7eec3418810a35ead884 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4522688 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Uldren: modify rotate matrixmick_hsiao2023-05-121-4/+4
| | | | | | | | | | | | | | | modift rotate matrix to let motionsensor works corretly BUG=b:281487225 TEST=watch -n 1 ectool motionsense, all data are correctly as expected Change-Id: I13032d7c9eb46695eb281be9cc3f0125dcde85a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4515843 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Mick Hsiao <mick_hsiao@compal.corp-partner.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* joxer: Allow alternate rotation parameters for JoxerScott Chao2023-05-124-0/+67
| | | | | | | | | | | | | | This will allow joxer to load different rotation matrix according to cbi. BUG=b:282054731 TEST=make sure joxer rotate correctly Change-Id: I03aa376f05f8f68cbabacf897915cb54d6b80ab7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4486659 Commit-Queue: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
* starmie: implement base detectionwangganxiang2023-05-124-5/+168
| | | | | | | | | | | | | | Change the judgment mode to interrupt. BUG=b:281643319 TEST=`ectool mkbpget switches` Change-Id: I974cd46ed187fefc3989a0072bc93fe556fd425b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516960 Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Tested-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Commit-Queue: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* winterhold: Enable CHARGER_MAINTAIN_VBAT Configjohnwc_yeh2023-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | Prevents charger from requesting minimum voltage when AC is off and battery is not present. LOW_COVERAGE_REASON=no unit tests for skyrim yet, b/247151116 BUG=b:269679145 TEST=test on winterhold, AC only after cold reboot the last time of the charger 0x15(Max System Voltage) not fill in 0x15=0800(2.048V) Change-Id: I716f43adab716823c68f3a1f8a7accfa1ead05db Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4506107 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: JohnWC Yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: JohnWC Yeh <johnwc_yeh@compal.corp-partner.google.com>
* chgstv2: Change battery near full depends on display SOCwen zhang2023-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The battery_near_full is used to set PWR_STATE_DISCHARGE_FULL and PWR_STATE_CHARGE_NEAR_FULL and these two states are used to set LED behaviors. We should change battery_near_full to depend on display SOC because LED bahaviors are already depends on display SOC. There is an exception, isl9241.c also checks charge_get_state() == PWR_STATE_CHARGE_NEAR_FULL in function isl9241_restart_charge_voltage_when_full. With this change, this feature will depend on the battery display SOC rather than RSOC. The display SOC is bigger than RSOC ~3% when the battery is BATTERY_LEVEL_NEAR_FULL(default 97%) so this feature may be 3% ahead of schedule. The 3% difference should have no harm for this feature. BUG=b:278512388 TEST=1.verify LED behavior on voltorb 2.no "E: Node with matching prop not found" on voltorb Change-Id: I87f555571e22cbcdd0e8e0a201f76e3de8204ebe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4478776 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
* battery: Deprecate CONFIG_BATTERY_LEVEL_NEAR_FULLwen zhang2023-05-1127-52/+49
| | | | | | | | | | | | | | | | | | Atlas, coral, corori, eve, morphius, primus, and rammus are setting CONFIG_BATTERY_LEVEL_NEAR_FULL to custom values. This causes their LEDs show 'full' while the display battery percentages are still < 100%. We'll make these boards define CONFIG_BATT_HOST_FULL_FACTOR, instead. And fix LED dts for some zephyr projects. BUG=b:280818345 TEST=build pass Change-Id: I98f97798ea99cc812671d5b31d64e92d55a1e05a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4523043 Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Hades: Fast forward DSW_PWROK to PCH_PWROKDaisuke Nojiri2023-05-112-1/+2
| | | | | | | | | | | | | | | | On urgent shutdown, it's required for PCH_PWROK to drop while PCH's voltages are still above 95%. This CL adds a dedicated interrupt handler for DSW_PWROK to reduce the latency. BUG=b:279918234 TEST=On Agah. The latency improved from 1.5 ms to 127 us. Change-Id: I5d0b1ab880f8d7ec6af89e3d9b230541c75d57ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520131 Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tarun Tuli <taruntuli@google.com> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* Agah: Fast forward DSW_PWROK to PCH_PWROKDaisuke Nojiri2023-05-112-1/+2
| | | | | | | | | | | | | | | | On urgent shutdown, it's required for PCH_PWROK to drop while PCH's voltages are still above 95%. This CL adds a dedicated interrupt handler for DSW_PWROK to reduce the latency. BUG=b:279918234 TEST=On Agah. The latency improved from 1.5 ms to 127 us. Change-Id: I004d11789bc94eb91f1f0df440bc5532bcb67a4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518229 Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tarun Tuli <taruntuli@google.com>
* panic_output: Do not use ccprintf to induce stack overflowRob Barnes2023-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The console command to induce a stack overflow crash uses ccprintf, which acquires a mutex lock internally. The exception handler aborts the thread (shell_uart) when the stack overflow is detected, but the mutex is not released. This causes system safe mode to deadlock. Switch to panic_printf to avoid this deadlock. A more robust long term fix may be to change Zephyr internals to release mutexes on aborted threads. LOW_COVERAGE_REASON=Swapping single function call BUG=b:278792557 TEST=Able to start system safe mode after a stack overflow on skyrim Change-Id: Ib7b50487d27e77fdd5b6cec5176060074868dca3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4504115 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Auto-Submit: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com> Tested-by: Rob Barnes <robbarnes@google.com>
* flash_ec: Fix shellcheck warning SC2009Bobby Casey2023-05-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The error was: Hook script "cros lint ${PRESUBMIT_FILES}" failed with code 1: In util/flash_ec line 854: if ps -o cmd= "${pid}" | grep -qE "(servod|/sbin/init)"; then ^ SC2009 (info): Consider using pgrep instead of grepping ps output. Unfortunately, per this thread crrev.com/c/3864978/4/util/flash_ec#857 it seems like the ps / grep solution is our best bet so shellcheck exclusion was added. BRANCH=none BUG=b:242127759 TEST=util/flash_ec --board=dartmonkey --image build/dartmonkey/ec.bin Change-Id: I271384dae6d0edd9a84546883b799a5a8fe64207 Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864978 Reviewed-by: Josie Nordrum <josienordrum@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Uldren: update fw configmick_hsiao2023-05-113-63/+25
| | | | | | | | | | | | | | | Update cbi config to let DB works, Also remove fan code, because uldren doesn't have fan design BUG=b:273159459 TEST=DB can charge and read usb Change-Id: I9da2c3fd7eedc44cfcaad89d32c393cc528feff2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4522690 Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Mick Hsiao <mick_hsiao@compal.corp-partner.google.com> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* octopus: Enable system safe mode panic recoveryRob Barnes2023-05-111-0/+3
| | | | | | | | | | | | | | System safe mode allows the EC to recover from some types of panics which allows the OS to collect more data about the panic. BUG=b:268342532 TEST=Pass safe mode tast test on bloog Change-Id: Iecbe84b9229fdae8c069de12c56361580cd9cb04 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4479495 Tested-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* zephyr/test: Increase timeoutJeremy Bettis2023-05-111-0/+1
| | | | | | | | | | | | | | | | | This test is timing out on gitlab, increase timeout to 6m. https://gitlab.com/zephyr-ec/ec/-/jobs/4264180403 BUG=None TEST=None Change-Id: I5a18e20091825f649d29b29950644f1121b90ed6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4523022 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Al Semjonovs <asemjonovs@google.com>
* myst: add bringup configsBoris Mittelberg2023-05-111-0/+5
| | | | | | | | | | | | | | | Add configs for BRINGUP and SYSTEM_UNLOCKED BUG=b:281691329 TEST=zmake build myst Change-Id: Ib84c1bb98b614cda05848291feb362e6f62fffb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4521338 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Robert Zieba <robertzieba@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* charger: Move charger_state_v2.h into charge_state.hSimon Glass2023-05-11128-356/+337
| | | | | | | | | | | | | | | | | | | | We don't have a v1 anymore, so the name makes no sense. Move it into the existing file. Include charge_state.h instead of v2, doing this in the same change to avoid build errors. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: Ic3e3adc45e4d002c2cd5ba8aa65e24686e01d628 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516191 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: Avoid using charger_state as a variableSimon Glass2023-05-113-21/+21
| | | | | | | | | | | | | | | | We have enum charge_state_v2 and used to have enum charge_state. Try to avoid using charger_state in the source except as an enum. This makes no functional change. BUG=b:218332694 TEST=CQ Change-Id: I3e53843799b7a6258cf636c11df47389b8d98123 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516190 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* host_command_pd: Avoid using charger_state as a variableSimon Glass2023-05-111-3/+3
| | | | | | | | | | | | | | | We have enum charge_state_v2 and used to have enum charge_state. Try to avoid using charger_state in the source except as an enum. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: I68e4eb3112a32be00819f74c51ea744d148a88d5 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516189 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* charger: Rename charge_get_state() to led_pwr_get_state()Simon Glass2023-05-1175-101/+101
| | | | | | | | | | | | | | | | | | We have a new 'charge state' in struct charge_state_data as part of the charge_state_v2.h file. This is confusing. Rename this function to match the enum it is referencing. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: I7f08dd4fb11e2939e0ef779018c1e3206ebc8d20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516188 Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* charger: Rename enum charge_state to led_pwr_stateSimon Glass2023-05-1114-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | This name is confusing, since its members start with PWR_ and the comment for enum charge_state_v2 says that these values are only used to control the LEDs, with one not-quite-correct exception, whatever that might be. We could rename it to power_state, but that is already fairly widely used as a variable in the code base. Also it seems better to match the enum PWR_ prefix. Future work may rename the members too. Rename the charge_state enum. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: If8a7cc73dcfb4c1e89984e57fc55e432416e8aec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516187 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* boxy: remove barreljack related codearthur.lin2023-05-113-65/+4
| | | | | | | | | | | | | | | Remove barreljack related code. Default use type-c port0 as power source for bring up. BUG=none TEST=make -j BOARD=boxy TEST=flash boxy ec on dibbi, and it can power on by type-c AC only Change-Id: I92ca1a1fdd8dd2c5eeeba02f217771ddbbe792e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4505786 Commit-Queue: Arthur Lin <arthur.lin@lcfc.corp-partner.google.com> Tested-by: Arthur Lin <arthur.lin@lcfc.corp-partner.google.com> Reviewed-by: Derek Huang <derekhuang@google.com>
* boxy: Enable VBUS ADCjimmy.wu2023-05-113-14/+14
| | | | | | | | | | | | | | Enable VBUS ADC following dibbi. BUG=b:271941405 TEST=make -j BOARD=boxy Change-Id: I60c3d09ab3af37ce6c8f6a623ddea04311530628 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508971 Tested-by: Jimmy Wu <jimmy.wu@lcfc.corp-partner.google.com> Reviewed-by: Derek Huang <derekhuang@google.com> Tested-by: Arthur Lin <arthur.lin@lcfc.corp-partner.google.com> Commit-Queue: Jimmy Wu <jimmy.wu@lcfc.corp-partner.google.com>
* corsola: do not reset TCPC if no battery connectedEric Yilun Lin2023-05-111-3/+12
| | | | | | | | | | | | | | | | The RT1718S controls the EN_SNK pin to the PPC. When the TCPC is reset without battery connected, this might cause the brown-out of the system due to the PPC stops sinking. BUG=b:276661970 TEST=reset EC without battery, and it first boots due to the soft-reset, and brown-out and then second boots with power-on flag. Change-Id: I79453e3625c8510818a78552c674b8887505dcb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4506109 Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* rt1718s: do not software reset TCPC with batteryEric Yilun Lin2023-05-111-0/+6
| | | | | | | | | | | | | | | | | | The RT1718S controls the EN_SNK pin to the PPC. When the TCPC is reset without battery connected, this might cause the brown-out of the system due to the PPC stops sinking. BUG=b:276661970 TEST=reset EC without battery, and it first boots due to the soft-reset, and brown-out and then second boots with power-on flag. BRANCH=none Change-Id: Icc9696a5085ab502a451a9740271e16e06bd53b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4506108 Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org>
* voltorb: enable MFG FUNCTION to read battery cell voltageSiyu Qin2023-05-111-0/+1
| | | | | | | | | | | | | | | Enable macro CONFIG_PLATFORM_EC_SMART_BATTERY_OPTIONAL_MFG_FUNC, so that ectool can read battery cell voltage. BUG=b:281805616 TEST=use "ectool i2cxfer 1 0xb 2 0x3d" can read cell voltage Change-Id: Id446d44ef4b4ad98a7a55837e9c7428c763adf9b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520742 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Tested-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
* yavilla: Limit C1 current with low power chargerTommy Chung2023-05-112-0/+22
| | | | | | | | | | | | | | | | This follows CL:4379827 to solve C1 OCPC voltage drop with low power charger (5V). BUG=none TEST=make sure that yavilla c2c charging will not brownout on C1 port. Change-Id: I603bec0c8bcc3da7e934b8d88d791e2245ef7793 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520738 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Devin Lu <devin.lu@quantatw.com> Commit-Queue: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* zephyr: test: Test keyboard_8042.c console commandsTristan Honscheid2023-05-117-2/+267
| | | | | | | | | | | | | | | | Add tests for the `8042` set of console commands in `keyboard_8042.c`, covers about 100 new lines. BUG=b:281691908 TEST=./twister -s drivers/drivers.keyboard_8042 Change-Id: I1e28e0258305d0e1d17571346fcdca8f19102cb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520583 Commit-Queue: Peter Marheine <pmarheine@chromium.org> Tested-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com> Auto-Submit: Tristan Honscheid <honscheid@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* safe_mode: Remove schedule_system_safe_mode_timeoutRob Barnes2023-05-113-23/+2
| | | | | | | | | | | | | | | Zephyr and CrOS EC can use the same method for scheduling the safe mode timeout, so there's no need to have an overridden task. BUG=None TEST=Safe mode starts and timesout on skyrim Change-Id: I57b296223ec86cf47110a00f3f021e8a8a30ead3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519103 Tested-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Rob Barnes <robbarnes@google.com> Auto-Submit: Rob Barnes <robbarnes@google.com>
* safe_mode: Shorten stringsRob Barnes2023-05-112-10/+11
| | | | | | | | | | | | | | | | Many old boards are out of flash space, which makes porting safe mode to older boards difficult. To make this process smoother shorten strings so less flash space is needed. BUG=None TEST=Safe mode runs Change-Id: I0934f1a477b01e7c8f71241844ac0eefa093c5ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519102 Commit-Queue: Rob Barnes <robbarnes@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Rob Barnes <robbarnes@google.com> Auto-Submit: Rob Barnes <robbarnes@google.com>
* power/x86: Add dedicated interrupt handler for pwrokDaisuke Nojiri2023-05-112-0/+32
| | | | | | | | | | | | | | | | On urgent shutdown, it's required for PCH_PWROK to drop while PCH's voltages are still above 95%. This CL adds a dedicated interrupt handler for DSW_PWROK to reduce the latency. BUG=b:279918234 TEST=Build Agah. Change-Id: I933913fc86c0636b3fed362ddc14712903531e84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519341 Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* charger: Drop charge_state_v1.hSimon Glass2023-05-101-69/+0
| | | | | | | | | | | | | | This does not appear to be used anymore. Drop it to avoid confusion. This makes no functional change. BUG=b:218332694 TEST=CQ Change-Id: I56e76372a86f27397576a64153b0aa0ad993341a Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516186 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* util: preupload: make filename argument optionalFabio Baltieri2023-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | The filename argument is meant to take ${PRESUBMIT_FILES} from the presubmit config, but the file list can be empty if the commit only contains deleted files. Change the argument nargs value from "+" to "*" to allow running the scripts with no arguments, they become a noop in this case instead of failing with: check_cprints.py: error: the following arguments are required: filename BUG=none TEST=repo upload on a patch with only deleted files Change-Id: Id77c745651fd30d4a005f2b0decada9a72c50592 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518770 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* gitlab: Use checkout_at_date for depot_toolsJeremy Bettis2023-05-101-2/+2
| | | | | | | | | | | | | | | | The git clone for depot_tools keeps getting 500 errors. Switch from git clone to checkout_at_date, both to keep depot_tools sync'd with the ec revision, and also because checkout_at_date already handles retries. BUG=None TEST=None Change-Id: I662ecfddca18c23ff32a4e3e571009bc574d4708 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4521521 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* board/hyperdebug: Gpio monitoring verifies that list is sameJes B. Klinke2023-05-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | The HyperDebug board can watch for edges on a set of pins, like a logic analyzer. It will buffer such events, for later retrieval by OpenTitanTool. The current logic depends on the list of signals at the time of retrieval is exactly identical to the list given at start of monitoring. This was almost verified, in that there were checks for pins being left our, or new pins being added to the list, but no check for the order of the given names. This CL adds a check that the order is the same. BUG=b:281857275 TEST=tast run - gscdevboard.Ti50EcReset TEST=Manual invocations of opentitantool to trigger error Change-Id: Ifcd9b96a319aff94b073ca758224045a5b1d67d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518234 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>