summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* util/check_clang_format: Format C++ filesfactory-skyrim-15384.B-mainTom Hughes2023-03-161-4/+8
| | | | | | | | | | | | BRANCH=none BUG=none TEST=./util/check_clang_format.py Change-Id: Ie270a1683ff62b7cb7d95e972b2fe51119be9885 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338477 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tree: Run clang-format on C++ filesTom Hughes2023-03-1627-139/+156
| | | | | | | | | | | BRANCH=none BUG=none TEST=CQ passes Change-Id: I4e359ebbfacfa10239e991ee89da82db5161ef20 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338476 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* test/fpsensor_hw: Include config.h instead of board.hTom Hughes2023-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | When running clang-format (which rearranged headers), the build for the fpsensor_hw started failing with "Include config.h instead of board.h": https://chromium.googlesource.com/chromiumos/platform/ec/+/3089e438e3a89aab1ca67c8488c6d7519f4ee630/include/config.h#5862 board.h shouldn't be included directly; instead we can just include config.h, which includes board.h. BRANCH=none BUG=none TEST=CQ passes Change-Id: Id9dc6374ccaa34ae45b184f62eded6c84eb20cba Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4342815 Reviewed-by: Firas Sammoura <fsammoura@google.com>
* usb_charger: support processing events synchronouslyPeter Marheine2023-03-152-5/+27
| | | | | | | | | | | | | | | | | | | Some hardware topologies require that high-priority tasks be able to process BC1.2 interrupts at higher priority than the BC1.2 task runs at, but increasing the priority of the BC1.2 task may not be appropriate. This adds a synchronous version of usb_charger_task_set_event suitable for those devices' needs. BUG=b:269064073 TEST=Nissa devices using the new function on shared USB-C IRQs no longer experience priority inversion that sometimes causes incorrect behavior. BRANCH=nissa Change-Id: I191fb0500c3d793d521168b37e9e8ed3fdd28473 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4339477 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: power_button: convert to the input APIFabio Baltieri2023-03-1510-31/+61
| | | | | | | | | | | | | | | | | Convert the shim button driver to use the input APIs for the debounced state, use gpio_pin_get_dt() for the signal level one. BUG=b:268200726 BRANCH=none TEST=./twister, cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Cq-Depend: chromium:4339704 Change-Id: Ie4c3729709af7690332bc91aea2131a51aed184e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4329528 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* nds32: Support for system safe modeRob Barnes2023-03-151-0/+15
| | | | | | | | | | | | | | Add support for entering system safe mode on nds32 based EC. This is accomplished by returning from exception handler with iret. BUG=b:269606355 BRANCH=dedede TEST=Pass system safe mode tast test (with modified Kernel and AP). Change-Id: Iac87b5ebd55ce0224b277257e137dffb7d764263 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334213 Reviewed-by: Keith Short <keithshort@chromium.org>
* system_safe_mode: Remove ifdef around IDLE taskRob Barnes2023-03-151-2/+0
| | | | | | | | | | | | | | Legacy CrOS EC does not define HAS_TASK_IDLE. Idle task is always present in CrOS EC and Zephyr EC, so just remove the ifdef conditional. BUG=None BRANCH=None TEST=Safe mode runs on a Boten Change-Id: I0e65a1f984c5ee1000e23904fa8311750872e000 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334212 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* system_safe_mode: Fix typo in HAS_TASK_HOOKRob Barnes2023-03-151-1/+1
| | | | | | | | | | | | | HAS_TASK_HOOK should be HAS_TASK_HOOKS. BUG=None BRANCH=None TEST=Test system safe mode on Boten Change-Id: I7f42d522a5a8f04d05fabb0993cb928f79c46213 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334211 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* rex: fix polarity on tcpc reset lineJason Yuan2023-03-152-6/+14
| | | | | | | | | | | | | | | | | | | This CL adds the ACTIVE_LOW flag to the TCPC reset line. BUG=b:254148652 TEST=none BRANCH=none LOW_COVERAGE_REASON=Some untested code have been simplified, which does not actually reduce code coverage even though it is technically uncovered. Change-Id: I05234c6b11aa67b641a7330c0f7798662e4f383a Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4335412 Tested-by: zhi cheng yuan <jasonyuan@chromium.org> Auto-Submit: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: zhi cheng yuan <jasonyuan@chromium.org>
* gpio/i2c: Only use status okay for Zephyr interrupts/named-i2cYuval Peress2023-03-153-8/+11
| | | | | | | | | | | | | | | | | Replace calls for DT_FOREACH_CHILD with DT_FOREACH_CHILD_STATUS_OKAY. This makes it possible for variants to disable some interrupts or i2c buses without having to remove the nodes. BRANCH=none BUG=b:272529568,b:273308069 TEST=zmake build rex rex-sans-sensors TEST=zmake compare-builds -a Change-Id: I3bf9034fd3f5e70665598d9e0b503d5e76bc13e4 Signed-off-by: Yuval Peress <peress@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4339256 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* winterhold: Fine-tune thermal configLeila Lin2023-03-152-39/+39
| | | | | | | | | | | | | | | | | Fine-tune thermal config for winterhold project. LOW_COVERAGE_REASON=no unit tests for skyrim yet, b/247151116 BRANCH=none BUG=b:255732503 TEST=verify the thermal config on winterhold is correct Change-Id: Ieccf5b2ffbd664f73bc14738e846ded58fa9e6c2 Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338762 Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Commit-Queue: Isaac Lee <isaaclee@google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* kconfig: Add correct dependency for motionsenseYuval Peress2023-03-151-0/+4
| | | | | | | | | | | | | | | All the sensor drivers and features should be gated by the motionsense Kconfig. Without this we will be building things we did not intend. BRANCH=none BUG=b:272529568,b:273308069 TEST=zmake build rex rex-sans-sensors Change-Id: I23df21f41f8a9cd4336187d04034e7e9de10110d Signed-off-by: Yuval Peress <peress@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334714 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: brya: correct duplicate GPIOsKeith Short2023-03-152-17/+19
| | | | | | | | | | | | | | Correct duplicate GPIOs on the brya project. Duplicate entries are error prone if future changes are made to the GPIO configuration. BUG=b:271588407 BRANCH=none TEST=zmake build -a Change-Id: Ida8efe2099612af598cfb0334afa230cb81f93bc Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4307836 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: lazor: fix duplicated GPIOKeith Short2023-03-152-10/+18
| | | | | | | | | | | | | | | | | | | Both the gpio_switchcap_pg_int_l and gpio_da9313_gpio0 entries in the named-gpios pointed to the same GPIO pin. This causes the GPIO initialization to configure this pin twice, but only properties from the second entry are active on the pin. Use multiple node-labels on the same GPIO pin so that there is only a single "gpios" entry created. BUG=b:271576198 BRANCH=none TEST=zmake build -a Change-Id: I63a84319b13007d877b13b76a782ea1a6a51f1e9 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4307835 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr test: Verify no discovery notification spamAbe Levkoy2023-03-152-0/+67
| | | | | | | | | | | | | | | Attach to a PD 2.0 partner that will not let the TCPM swap to DFP, preventing the TCPM from performing discovery. Verify that the TCPM only notifies the AP that discovery is complete (and empty) once. BUG=b:271613370 TEST=twister -s zephyr/test/drivers/drivers.usbc_alt_mode BRANCH=none Change-Id: I3f97d05e7578f06d9867442fdfbc73a3e4d9b8a5 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334628 Reviewed-by: Diana Z <dzigterman@chromium.org>
* partner emul: Optionally reject DR_SwapAbe Levkoy2023-03-152-2/+39
| | | | | | | | | | | | | | Support runtime configuration of the partner emulator to Reject a Data Role Swap based on the new role of the partner emulator. BUG=b:271613370 TEST=twister -s drivers/drivers.usbc_alt_mode BRANCH=none Change-Id: I47a6b99d334d083ad0d9e40b211507a4e21248b3 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334627 Reviewed-by: Diana Z <dzigterman@chromium.org>
* mt8186,mt8188: skip forcing shutdown if AP is offEric Yilun Lin2023-03-151-1/+12
| | | | | | | | | | | | | | | | | | If the AP is off, we should stop calling chipset_force_shutdown() from re-doing shutdown. BUG=b:273657181 TEST=In S0, dut-control power_key:8.2, the chipset_force_shutdown is not called BRANCH=none Change-Id: I4413f984465f10d0f4b588cd6d80ead8464778bc Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338759 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com>
* mt8186,mt8188: fix warm reset issued by servo and gscEric Yilun Lin2023-03-152-13/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the EC holding SYS_RST_ODL (AP reset) in S3S5. Only asserting the SYS_RST_ODL with forcing shutdown. This will allow the AP to boot when the servo or gsc releases SYS_RST_ODL. When the AP is in reset, the power_state will be set to S5 first, and the target should be G3 if the power state has been put to G3 by S5 inactive timer. This is to prevent EN_PP4200_S5 and PMIC from being turned off, which would prevent the AP from booting when SYS_RST_ODL released if the AP reset was held by gsc or servo. To make it clearer, only three cases that we need to consider: 1. SYS_RST_ODL is held by GSC or Servo 2. SYS_RST_ODL is asserted by AP itself, a gracefully shutdown 3. SYS_RST_ODL is asserted by EC. For case 1, and 2, we don't need to assert SYS_RST_ODL, since the EC is not the initiator. BUG=b:267268982 b:273657518 TEST=On Steelix, and Geralt: * Cold reset: $ dut-control cold_reset:on sleep:0.2 cold_reset:off Result: G3 -> S0 * Long power press to shutdown: $ dut-control dut-control power_key:8.2 Result: S0 -> S5 -> G3 * Long power press to power-on but then shutdown: $ dut-control dut-control power_key:9.2 Result: G3 -> S0 -> S5 -> G3 * Short power press to power-on: $ dut-control dut-control power_key:tab Result: G3 -> S0 * Console command: apreset Result: S0 -> S0, AP reboots * Console command: apshutdown Result: S0 -> S5 -> G3 * Lid open to power-on: $ dut-control lid_open:no sleep:0.2 lid_open:yes Result: G3 -> S0 * AP console: reboot Reulst: S0 -> S0 * AP console: poweroff Reulst: S0 -> G3 * Short power press to power-on: $ dut-control dut-control power_key:tab Result: G3 -> S0 * Servo issue warm reset: $ dut-control power_state:warm_reset Result: S0 -> S5 -> S0 * Servo hold warm_reset and release: $ dut-control warm_reset:on sleep:2 warm_reset:off Result: S0 -> S5 -> S0 BRANCH=none Change-Id: I81fc25a5088722487fbbf74d641a5edf4ad450e5 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338758 Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com>
* skyrim: Validate usb port number in ppc_configKornel Dulęba2023-03-155-0/+16
| | | | | | | | | | | | | | | On skyrim only port0 is supported in current limiter logic. Add a check to verify that. Update the test accordingly BUG=b:267205976 TEST=./twister -i -T zephyr/test/skyrim BRANCH=none Change-Id: I04d5cd68ff99b72b0fa4884cbb3b09849f61407e Signed-off-by: Kornel Dulęba <korneld@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334556 Reviewed-by: Robert Zieba <robertzieba@google.com>
* markarth: Add F75303 remote and local sensor.Logan_Liao2023-03-151-6/+6
| | | | | | | | | | | | | | | | This patch add F75303 local, remote1, remote2 sensor. BUG=b:269786658 BRANCH=none TEST=markarth console temps that show right value. Change-Id: I9ae5f4c947c2641082c54524c5a019326d0df7a2 Signed-off-by: Logan_Liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290677 Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Chao Gui <chaogui@google.com>
* Zephyr: Correct Temp sensor F75303 read methond.Logan_Liao2023-03-1511-66/+116
| | | | | | | | | | | | | | | | This patch correct F75303 read fail on zephyr. BUG=b:269786658 BRANCH=none TEST=test markarth console that temps show right value. Change-Id: I315d80e2166d0b5f4d69f4e671846abe52fccbba Signed-off-by: Logan_Liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290094 Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Chao Gui <chaogui@google.com> Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com>
* util: Use libec for FP_ENCRYPTION_STATUSFiras Sammoura2023-03-151-9/+14
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=rm -rf build && make BOARD=host utils Change-Id: Iade517026ef7c36846a5ce58629777ee9746db0f Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4336841 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* frostflow: Modify charger frequence for power consumption.Logan_Liao2023-03-155-0/+93
| | | | | | | | | | | | | | | | | | To avoid charger enter CCM mode, modify isl9241 frequence to 600kHz from 1020kHz in S5. BUG=b:271704154 BRANCH=none TEST=power team test power consumption is lower than 1020kHz. Change-Id: I9906f2795582c2c8e4a63a674404c0e5a5dfbc96 Signed-off-by: Logan_Liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333276 Reviewed-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Chao Gui <chaogui@google.com> Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
* fpsensor: Fix error code checkTom Hughes2023-03-151-1/+1
| | | | | | | | | | | | | | | enum ec_error_list can never be less than zero. We should be checking that against the enum val EC_SUCCESS instead. BRANCH=none BUG=none TEST=none Change-Id: I2731354618bc5af1f6793a066cad7333e1c92b4d Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338475 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Firas Sammoura <fsammoura@google.com>
* util: Use libec for RAND_NUMFiras Sammoura2023-03-141-18/+15
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=rm -rf build && make BOARD=host utils Change-Id: I02110dbdd9068e71e564cc37b2e78f9d055673fe Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4336838 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* fpsensor: Compile more fingerprint files with C++Tom Hughes2023-03-1410-21/+97
| | | | | | | | | | | | | | BRANCH=none BUG=b:234181908 TEST=./test/run_device_tests.py -b bloonchipper => PASS (except http://b/268355032) TEST=./test/run_device_tests.py -b dartmonkey => PASS (except http://b/268355032) Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3f8d1a95f0f1e844f0bf1e56e5514dda521979b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852917 Reviewed-by: Andrea Grandi <agrandi@google.com>
* safe_mode: Add EC_CMD_GET_PANIC_INFO to allowed host commandsRob Barnes2023-03-141-4/+4
| | | | | | | | | | | | | | Add EC_CMD_GET_PANIC_INFO to allowed host commands so the kernel driver can query the panic flags. BUG=b:266092457 BRANCH=None TEST=Modified kernel is able to query panic flags after panic. Change-Id: Iaf27600b8e82c8acc41bd2d9a313ff5f8e343635 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4316729 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Zephyr test: Add USB PD Discovery testDiana Z2023-03-145-0/+419
| | | | | | | | | | | | | | | Add a test to cover the various ifs and elses of the usb_pd_discovery.c code. BRANCH=None BUG=b:267964449 TEST=run in twister and observe sweet sweet 93% coverage in usb_pd_discovery.c Change-Id: Ifdec5a8f57213b1e8050dbd0ca69ff068b038714 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4329094 Reviewed-by: Tomasz Michalec <tmichalec@google.com>
* TCPM: Fold expected SVID check into mode consumptionDiana Z2023-03-142-14/+7
| | | | | | | | | | | | | | | The dfp_consume_modes() function is fully capable of determining if a DiscoverModes SVID ACK matches the expected SVID. Let it handle this check. BRANCH=None BUG=b:169242812 TEST=./twister -s drivers/drivers.usb_pd_discovery with following CL Change-Id: I21e4207843dfba8e8c508c12e857601e529856b0 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4329093 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPM: Move pd_get_mode_vdo() to TCPMv1Diana Z2023-03-142-8/+8
| | | | | | | | | | | | | | | This function is only used with the GFU host commands, which are only fully supported in TCPMv1. Move it next to its place of use so it isn't included in the TCPMv2 builds. BRANCH=None BUG=b:267964449 TEST=CQ+1 Change-Id: I981f32c56ce725e39a86862c509ec27e19695352 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4330171 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPM: Remove unused USB2 cable functionDiana Z2023-03-142-19/+0
| | | | | | | | | | | | | | Remove this function which is not called from anywhere. BRANCH=None BUG=b:267964449 TEST=CQ+1 Change-Id: I35bc04fd826fb3d66d4a3f66fabf7e461e71b6e1 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4330170 Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* ec: Add yet more #line directivesJeremy Bettis2023-03-142-0/+12
| | | | | | | | | | | | | | | | | | There are more files that are reporting incorrect coverage due to the gcc preprocessor getting off by a line. BRANCH=None BUG=b:272518464 TEST=Ran coverage build Change-Id: I8b0fa21702c7fd3611c57af68b59ea70f605861f Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334214 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* .gitignore: Add .idea/ for Clion IDETim Van Patten2023-03-141-0/+3
| | | | | | | | | | | | | | Add .idea/ to .gitignore for the Clion IDE. BRANCH=none BUG=none TEST=none Change-Id: Ib15ae022f074d632785b222650a35f4dbb85c971 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4316727 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* board/hyperdebug: Enable all three I2C portsJes B. Klinke2023-03-144-22/+108
| | | | | | | | | | | | | | | | | Allow forwarding to any of the three I2C ports of the HyperDebug board. Also, add an "i2c info" command which lists the I2C ports by symbolic name and index, (the latter to be used when sending binary data via USB.) This also sets the stage for adding "i2c set speed" similarly to what has been done for SPI ports. BUG=b:192262089 TEST=Observed forwarding to I2C2 pins via analyzer Change-Id: I661999cc0bda881cbe6d884eed7905aa5173964c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4327132 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>
* rex: test: usb_pd_policy: Refactor the FFF declarationMadhurima Paruchuri2023-03-141-12/+6
| | | | | | | | | | | | | | | | | Use FAKE_VALUE_FUNC inplace of DECLARE_FAKE_VALUE_FUNC and DEFINE_FAKE_VALUE_FUNC, as both of them are called from same file Use FAKE_VOID_FUNC inplace of DECLARE_FAKE_VOID_FUNC and DEFINE_FAKE_VOID_FUNC, as both of them are called from same file BRANCH=none BUG=none TEST=./twister -T zephyr/test -c Change-Id: I8ca62a45c53d18174248d4f0476af900674c9d8e Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4323340 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* rex: test: fan: Refactor FFF declaration and DTC overlay configMadhurima Paruchuri2023-03-142-7/+6
| | | | | | | | | | | | | | | | | | | | | Use FAKE_VALUE_FUNC inplace of DECLARE_FAKE_VALUE_FUNC and DEFINE_FAKE_VALUE_FUNC, as both of them are called from same file Use FAKE_VOID_FUNC inplace of DECLARE_FAKE_VOID_FUNC and DEFINE_FAKE_VOID_FUNC, as both of them are called from same file Use new YAML DTC overlay config field inplace of extra_args to configure device tree files to be used during testing BRANCH=none BUG=none TEST=./twister -s rex/rex.fan -c Change-Id: I44b3d2998eea33ae1f83c4af1d2d8cf5c2f843e3 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4323339 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* rex: zephyr: test: Add unit tests for board_powerMadhurima Paruchuri2023-03-1416-9/+487
| | | | | | | | | | | | BUG=b:247796816 BRANCH=None TEST=./twister -s rex/rex.board_power -c Change-Id: Ic0c93914ff978ca69215f196cec2f33dbd080524 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214905 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* util: Remove ec_panicinfoHsin-Yi Wang2023-03-147-289/+34
| | | | | | | | | | | | | | | ec_panicinfo is moved to libec. BUG=b:172222556 BRANCH=None TEST=`BOARD=host make utils-host` TEST=test with CL:4322820 and parse a sample eccrash and check result Cq-Depend: chromium:4318210 Change-Id: Ib9770932f4555600bd3487757809bfb046f0bad8 Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4318306 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* geralt: add an empty base state implementationTing Shen2023-03-143-0/+38
| | | | | | | | | | | | | | | | | Set base detached by default. This is a quick fix to turn on virtual keyboard to unblock developers. BUG=b:272439221 TEST=`ectool mkbpget switches` BRANCH=none Change-Id: I0ff0350982d5633d6a680bc170f3dc2948a56488 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4327719 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* anx7447: replace anx7447_get_vbus_voltageEric Yilun Lin2023-03-141-21/+5
| | | | | | | | | | | | | | | | | Replace the function to use the generic TCPCI API instead. BUG=b:272664811 TEST=1. ./twister -T zephyr/test/drivers 2. test steelix C0 anx3447 port, and VBUS reporting is correct BRANCH=none Change-Id: I5916ed6f010d863d003c9fb1d981c7817f495206 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333419 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* tcpci: add tcpci_get_vbus_voltage_no_checkEric Yilun Lin2023-03-142-4/+19
| | | | | | | | | | | | | | | | | | | The function is identical to get_vbus_voltage but without checking the DEV_CAP_1. This is a refactor for some TCPCI (e.g. ANX7447) support VBUS sensing, but doesn't report it in DEV_CAP_1. BUG=b:272664811 TEST=./twister -T zephyr/test/drivers BRANCH=none Change-Id: Ic66fc1dd86eea363f82388453c0181f35bfc5ae6 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333418 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* anx7447: drop unused anx7447 functionsEric Yilun Lin2023-03-142-49/+0
| | | | | | | | | | | | | | | | The functions are replaced by the TCPCI calls. BUG=b:272664811 TEST=zmake testall BRANCH=none Change-Id: I9ebf5216c7cdd0134afe8d3be35b0a518e2e7d8d Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333417 Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org>
* voltorb: add charger thermistor functionSiyu Qin2023-03-141-0/+38
| | | | | | | | | | | | | | | | | | The OEM thermal test needs high temperature protection, so add the temp-sensors to EC. BUG=b:263700449 BRANCH=corsola TEST=1. Use `ectool temps all` can see charger-thermistor temperature value. 2. The ap shutdown when thernistor reaches the temperature protection value. Change-Id: I31127af4451a8d363883045d98d207ac58215876 Signed-off-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4131896 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
* rex: Disable TBT on port C1Caveh Jalali2023-03-141-0/+8
| | | | | | | | | | | | | | | Port C1 does not support thunderbolt. BRANCH=none BUG=b:261547088 TEST=OWC thunderbolt hub now enumerates correctly on C1 LOW_COVERAGE_REASON=b:247796816 will address rex project coverage Change-Id: I1c2d933579b0fffb07c5759a0e7502e7cbc84435 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4331571 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* rex: Disable VBUS reverse current alertsCaveh Jalali2023-03-141-0/+4
| | | | | | | | | | | | | | | | Rex detects a false VBUS reverse current event on the SM5360A PPC (ps8815 daughterboard). BRANCH=none BUG=b:272914961 TEST=cable matter hub now powers up on C1 (still doesn't enumerate, but that's a different issue) Change-Id: I4ec478312c21178f7836ada8af5e8e031776aa1b Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4331572 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Madhu 🌱 <mparuchuri@google.com>
* winterhold: adjusts phase comparator threshold offsetstabilize-15381.B-mainRidden_Liu2023-03-141-2/+2
| | | | | | | | | | | | | | | | | Modify 0x39 Forward Buck Phase Comparator Threshold Offset bit<15:13> from 000=0mV to 110=-2mV. BUG=b:265862821 BRANCH=none TEST=fix charger stuck in CCM problem and S5 power consumption can meet < 0.5W criteria. Change-Id: Icc0ee2b6f2a33eb27d243c5a0421be0efe70fd7f Signed-off-by: Ridden_Liu <ridden_liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333200 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Isaac Lee <isaaclee@google.com>
* PD: Add retimer/redriver cable details in Host command responseRajesh Kumar2023-03-142-0/+6
| | | | | | | | | | | | | | | | This change add support to provide retimer/redriver cable details to AP through host command "EC_CMD_USB_PD_CONTROL" to configure Bit2 and Bit22 of IOM register. BRANCH=None BUG=None TEST=Verified cable type is appropriate through host command response Change-Id: Ia0c40bac7c8140a848719b654f85281c3afc8e8d Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4317924 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* tasks: Remove use of IS_ENABLED in macro conditionsRob Barnes2023-03-132-6/+6
| | | | | | | | | | | | | | | | IS_ENABLED is not meant to be used in macro conditionals according to the documentation: "Note: This macro will only function inside a code block due to the way it checks for unknown values." BUG=None BRANCH=None TEST=Build Change-Id: I407ddfe4f75d51933c9ee4e8f2ea24ec86b47764 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4320980 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* skyrim: Add clamshell & convertible tests.Grzegorz Bernacki2023-03-137-2/+266
| | | | | | | | | | | BRANCH=none BUG=b:269234224 TEST=Ran tests Change-Id: I8d0d889cbc7d508854e35ab45bb13d1b2a4af360 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4296798 Reviewed-by: Robert Zieba <robertzieba@google.com>
* skyrim: Disable tablet mode on clamshell devices.Grzegorz Bernacki2023-03-132-0/+27
| | | | | | | | | | | | | | | | | This commits disables tablet mode if CBI data shows that this is clamshell device. It requires enable of dynamic sensor count, so motion_sensor_count can be set to zero. BRANCH=none BUG=b:269234224 TEST=Verify that skyrim15w does not go into tablet mode Change-Id: I54a4230824badec3afd17d5e969f0cfc960ac2e3 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4274889 Reviewed-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>