summaryrefslogtreecommitdiff
path: root/zephyr/shim
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: test: Test 8042 keyboard command handlersTristan Honscheid2023-05-171-1/+1
| | | | | | | | | | | | | | | | | This CL adds coverage to several keyboard command handlers, specifically I8042_SYSTEM_RESET, I8042_READ_CTL_RAM, I8042_ENABLE_A20, I8042_PULSE_START, invalid commands, ATKBD_CMD_RESEND, and invalid ATKBD commands. BUG=None TEST=./twister -s drivers/drivers.keyboard_8042 Change-Id: Ia1fb3d4988a7e8f8697cea3efafeeba8e36069f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4545418 Auto-Submit: Tristan Honscheid <honscheid@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Peter Marheine <pmarheine@chromium.org> Tested-by: Tristan Honscheid <honscheid@google.com>
* battery: check the battery stable state when battery wake upSiyu Qin2023-05-161-0/+6
| | | | | | | | | | | | | | | | | Check the specific battery status to judge whether the battery is initialized and stable when the battery wakes up from ship mode. Use two MASKs to provide logical AND and logical OR options for different status. BUG=b:275392868 TEST=zmake build -a Change-Id: I7c5b4c9a74024846b6611ed49bf4823cf877469c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4486658 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Tested-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
* charger: Rename charge_get_state() to led_pwr_get_state()Simon Glass2023-05-111-1/+1
| | | | | | | | | | | | | | | | | | 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-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* safe_mode: Remove schedule_system_safe_mode_timeoutRob Barnes2023-05-111-8/+0
| | | | | | | | | | | | | | | 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>
* charger: Add a way to disable debugging at build timeSimon Glass2023-05-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | Add a way to disable some debugging related to the chgstate command. It is a small, but enough to reclaim 70 bytes for damu. Use functions to avoid needing #ifdefs in the main body of the code. Convert the value to a bool while we are here. BUG=b:218332694 TEST=build on brya and see that the feature is still enabled $ grep CONFIG_CHARGE_DEBUG build/brya/.config CONFIG_CHARGE_DEBUG=y Check damu is the same as before: *** 12 bytes in flash and 10908 bytes in RAM still available on damu RO **** Change-Id: I07d2453aa74ab53a29275bba76cd2e8003c5dc14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518028 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: make PPC/TCPC support optionalKeith Short2023-05-092-6/+18
| | | | | | | | | | | | | | | | | | | | | | The "ppc" and "tcpc" properties are tagged as optional by the devicetree. Update the PPC and TCPC shim drivers to support an empty entry in the ppc_chips[] and tcpc_config[] arrays. This is useful for boards that need to setup different USB-C chips at runtime and ensures there is a valid entry to update. BUG=none TEST=zmake build -a TEST=locally, comment out the "ppc" and "tcpc" property on skyrim and validate the corresponding arrays are correct. Change-Id: Ief1c3670d5ef9d8e07a599286e77fbb9e229335e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516398 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com> Tested-by: Keith Short <keithshort@chromium.org> Auto-Submit: Keith Short <keithshort@chromium.org>
* ec: Add #line in zephyr/shim/include/atomic.hJeremy Bettis2023-05-051-0/+6
| | | | | | | | | | | | | | | Work around coreboot GCC preprocessor bug. BUG=b:272518464 TEST=gcc -E Change-Id: Ifc6980358316f1857538e4e50b39083d47ec09b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510241 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: tcpc: Allow use of emulators outside a test buildSimon Glass2023-05-031-4/+0
| | | | | | | | | | | | | These emulators are useful outside of testing. Allow them to be used. BUG=b:218332694 TEST=with other changes, see that it can be built into dev-posix Change-Id: I402e7cab4d3c1d6172ab244a629b42ae962e7a33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501044 Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* ec: Add async FLASH_PROTECTFiras Sammoura2023-05-031-0/+5
| | | | | | | | | | | | | | | | | | | Create an async FLASH_PROTECT command that is enabled when CONFIG_FLASH_PROTECT_DEFERRED is defined. Disable this configuration for boards cerise, damu, stern,cand willow where there is no flash memory available. Disable this configuration for board hyperdebug where the deferred implementation in not possible because CONFIG_COMMON_RUNTIME is undefined. Enable this configuration otherwise in both the ec and zephyr configuration files. BRANCH=nocturne BUG=b:116396469 TEST=make buildall -j Change-Id: I0605cc600841ec2ec3c1dd2d3d3598b28d20ffcb Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4335413 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* driver: shim: Port KTU1125 PPC driver to ZephyrScott Collyer2023-04-263-0/+20
| | | | | | | | | | | | | | | | | This CL adds the shim layer required to support the KTU1125 PPC driver. BUG=b:267589112 BRANCH=None TEST=zmake build rex Verified basic type-c/PD operation on SKU2 system Change-Id: Ie8b83910ce60c0e3f276a7b3086f9b9c708bdaf7 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4358755 Reviewed-by: Boris Mittelberg <bmbm@google.com> Tested-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: caveh jalali <caveh@chromium.org>
* clock: Add mock for clock_enable_moduleYi Chou2023-04-255-5/+10
| | | | | | | | | | | | 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>
* zephyr: Add support for board override of fan duty adjustment logicKornel Dulęba2023-04-211-29/+6
| | | | | | | | | | | | | | | | | | | The generic logic has proven to not work well on whiterun. In order to mitigate that, while not affecting everyone else, a custom fan duty adjustment logic needs to be implemented. The behavior is controlled with CONFIG_CUSTOM_FAN_DUTY_CONTROL, which will be enabled on whiterun in a another patch. Some structs has been moved to the fan header, so that they can be accessed from the custom logic. BUG=b:276577324 BRANCH=none TEST=make try_build_boards Change-Id: Iff31b6526be83b8b0165c4490bafe26f131e6c84 Signed-off-by: Kornel Dulęba <korneld@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4423152 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: led: Change the node depends on display SOCwen zhang2023-04-211-1/+2
| | | | | | | | | | | | | | | | This change makes the zephyr shim led driver use the display SoC for the LED node that depends on battery level, so that the charge LED and the display SoC work synchronously. BUG=b:278512388 BRANCH=none TEST=./twister -T zephyr/test/drivers/ -s drivers.led_driver Change-Id: I82a9e6a18486fb806f49855fbb5773bd7176929a Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4430138 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
* zephyr: bc12 shim: Remove compat guardstabilize-15432.B-mainKeith Short2023-04-211-7/+0
| | | | | | | | | | | | | | | The CONFIG_PLATFORM_EC_USB_CHARGER option already guards the bc12.c shim from compiling. A check that a BC1.2 driver is enabled is not required. BUG=none BRANCH=none TEST=zmake compare-builds -a TEST=./twister Change-Id: I1c9598b81a4eb4f96cfc85ef21ecc313db65a8a7 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426808 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* retimer: Use common console command for all RetimersVijay Hiremath2023-04-191-0/+10
| | | | | | | | | | | | | | BUG=b:278138274 BRANCH=none TEST=Tested on ADL-RVP, retimer console command works ./twister -T zephyr/test/drivers ./twister -T zephyr/test/drivers -s drivers.default ./firmware_builder.py --metrics /tmp/tmp_pc1rc15 build Change-Id: Idaec9b41f550ad6aafa34400e95ebf00b9c11348 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426790 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: LED: Reformated led-pins bindingsJason Yuan2023-04-183-28/+38
| | | | | | | | | | | | | | | | | | This CL formats the led-pins devicetree to be more intuitive as part of the LED driver overhaul. led-policy and led driver logic is unmodified in this CL and will be added later. BUG=b:228868616 TEST=twister, power LED verified on Villager, Lazor, Skyrim, Xivu BRANCH=none Change-Id: Ia688e872811199447d1e0b11a5533fd8478d2935 Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426805 Commit-Queue: Wai-Hong Tam <waihong@google.com> Auto-Submit: zhi cheng yuan <jasonyuan@chromium.org> Tested-by: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* clock: Remove the weak definition clock_enable_moduleYi Chou2023-04-186-0/+35
| | | | | | | | | | | | | | | | | 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>
* zephyr: Eliminate pointer from SYS_INIT functionsKeith Short2023-04-1714-36/+16
| | | | | | | | | | | | | | | | | | | | 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>
* flash: cbi: Block the HCs from flash CBI section modificationMadhurima Paruchuri2023-04-172-17/+31
| | | | | | | | | | | 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>
* mchp: use microchip,xec-qmspi-ldma DT bindingPeter Marheine2023-04-171-1/+1
| | | | | | | | | | | | | | | The previous binding was deleted upstream, which also removed the port-sel property with no apparent replacement. BUG=b:278560668 BRANCH=none TEST=zmake build mtlrvpp_mchp Cq-Depend: chromium:4434469 Change-Id: Ie56d5350ab086f1e116a7a837ea052c7a804cf4b Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4431679 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: tcpc: Add TCPC alt support for all existing TCPCMadhurima Paruchuri2023-04-142-0/+48
| | | | | | | | | | | | | | Add TCPC alt support for all TCPCs and tests to test the working of TCPC alternatives BRANCH=none BUG=b:274126703 TEST=./twister -s drivers/drivers.usbc_tcpc -c Change-Id: Icafdaf8b940b09cfc3c17ed124e1b4a0a9427d01 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4375619 Reviewed-by: Keith Short <keithshort@chromium.org>
* power: Add s0ix counterGrzegorz Bernacki2023-04-141-0/+5
| | | | | | | | | | | | | | This commit adds counter which increments every time EC detects going into S0ix state. BUG=b:261869264 TEST=Tested on skyrim BRANCH=none Change-Id: I26475d80a891e64509686000e9fd37681553ef76 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4239441 Reviewed-by: Robert Zieba <robertzieba@google.com>
* zephyr: Add support for RNG devicesPatryk Duda2023-04-133-0/+75
| | | | | | | | | | | | | | | | | | | | | | | This patch provides implementation of trng_rand_bytes() using Zephyr's entropy API. Zephyr driver is responsible for hardware initialization, enabling and disabling, so trng_init() and trng_exit() are no-op. Add hostcmd and console command which can be used to test random number generator. Both commands have unit tests implemented. BUG=b:277029648 BRANCH=none TEST=zmake build bloonchipper TEST=Enable CONFIG_PLATFORM_EC_CONSOLE_CMD_RAND and compile firmware. Use 'rand' command to check if random values are generated. TEST=./twister -v -i -T zephyr/test/drivers/ --test drivers.random Change-Id: I3fa2c6a1aaf84dc23a8fbb06e557d9e07f5d1d32 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4381919 Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Kconfig: add FLASH_PSTATE_BANK / FLASH_PSTATE_LOCKEDTing Shen2023-04-131-0/+10
| | | | | | | | | | | | | | | BUG=b:277557274 TEST=1. `zmake compare-builds --all` This change should not affect existing boards 2. write protect works on roach BRANCH=none Change-Id: I697215c1990c7d12cd81e9b50b940485934da1bb Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4415812 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* RAA489110: Add RAA489110 driverDaisuke Nojiri2023-04-121-0/+5
| | | | | | | | | | | | | | | RAA489110 is an EPR capable version of ISL9241. BUG=b:277280318 BRANCH=None TEST=make BOARD=hades TEST=./twister --toolchain host -T zephyr/test/drivers -s drivers.isl9241 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I15eb1f652027f157ccb6b3a2d509531bef0c7c6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4409986 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* retimer: Add driver for ANX7452 retimerMadhurima Paruchuri2023-04-125-0/+63
| | | | | | | | | | | | BUG=b:267589042 BRANCH=None TEST=./twister -s drivers/drivers.anx7452 -c --coverage Change-Id: I99be488d82a58a5d38a2afcef0966b9c3236074d Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4226575 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* system_safe_mode: Print process stack dumpRob Barnes2023-04-113-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* zephyr: shim: Add GESTURE_DETECTION to enable/disable body detectionRuihai Zhou2023-04-111-0/+9
| | | | | | | | | | | | | | | | | 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_POWERINDEBUG flagKnox Chiou2023-04-111-0/+5
| | | | | | | | | | | | | | | | | | | Support PLATFORM_EC_CMD_POWERINDEBUG flag for `powerindebug` on zephyr. BUG=b:272185086 BRANCH=none TEST=zmake build geralt TEST=disable flag and check powerindebug Signed-off-by: Knox Chiou <knoxchiou@google.com> Change-Id: I89af4161b6bcc351e750d2716e0cc594cfe74814 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383291 Tested-by: 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> Code-Coverage: Knox Chiou <knoxchiou@chromium.org>
* zephyr: Support PLATFORM_EC_CMD_GPIO_EXTENDED flagKnox Chiou2023-04-111-0/+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>
* Zephyr: Add NX20P3481 CONFIGDiana Z2023-04-071-0/+5
| | | | | | | | | | | | | Add a configuration for the now lesser-used NX20P3481 chip. BRANCH=None BUG=b:276468569 TEST=CQ+1 Change-Id: I28c2cc4821e4e456571bfb5584fa746845c9a750 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4404284 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/tcpc_emul: automatically include prerequisitesPeter Marheine2023-04-061-0/+1
| | | | | | | | | | | | | | | The generic TCPCI emulator requires common I2C emulation code, so make it automatically select it. Also include i2c.h from tcpc_generic_emul.h because it uses the I2C_PORT_BY_DEV macro defined therein. BUG=b:271118112 TEST=./twister BRANCH=none Change-Id: I2282085ee00f49de7ae1a6a3bccff059d78d7400 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4402750 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* zephyr: Don't include autoconf.hJeremy Bettis2023-04-041-2/+0
| | | | | | | | | | | | | | | | | | Remove #include of autoconf.h, because it is already included on the command line for all files. BRANCH=None BUG=b:272518464 TEST=zmake build -a TEST=zmake build -a --coverage TEST=zmake compare-builds -a --ref1 HEAD --ref2 665509933e Change-Id: Ie09b66d71c546272aa70e2a64f94c88e85d6d16b Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4396144 Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* Charger: CONFIG gate bypass modeDiana Z2023-03-311-0/+5
| | | | | | | | | | | | | | | | Only two boards need the charger bypass mode feature, and it takes a fair amount of code space in flash (1.2k). Make this code logic opt-in to enable the bypass mode and enable the two boards which do use it. BRANCH=None BUG=b:273722902 TEST=util/compare_build.sh -b hades and util/compare_build.sh -b agah passes, other boards build and consume less flash space Change-Id: I90d781340389eb2f259d13b69eb2882b16bf0c4d Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388379 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: tcpc: add rt1718s as basic tcpc emulatorlschyi2023-03-302-1/+32
| | | | | | | | | | | | | | | Add a basic rt1718s tpcp emulator for future testing. BUG=b:273854897 BRANCH=none TEST=./twister -c -i -T zephyr/test/drivers -s drivers.rt1718s Change-Id: I0728be79d724ceea75a3a4189e10a50e6f8da0e8 Signed-off-by: lschyi <lschyi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4369109 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org>
* driver: shim: Port RT1715 TPCP driver to ZephyrMadhurima Paruchuri2023-03-283-0/+44
| | | | | | | | | | | | | | | | | | Make RT1715 driver available to be used by zephyr based projects. At present RT1715 driver is also used for RT1716 RT1716 is used as alternate TCPC chip in Rex, hence adding the capability to use it as a alternative TCPC chip BRANCH=none BUG=b:274151516 TEST=none Change-Id: If16c3a8f81799ceee9ab19c3ef4adfb63fc49164 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4348920 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: tcpc: Add support for multiple alternatives per portMadhurima Paruchuri2023-03-282-0/+51
| | | | | | | | | | | | | | | | | | | | | Add support for multiple TCPC alternatives on each USB-C port TCPC chips that are candidates for runtime selection must add the "is-alt" property to the TCPC definition. The board specific code then calls TCPC_ENABLE_ALTERNATE_BY_NODELABEL, specifying both the USB-C port to update, and the nodelabel of the new TCPC device. BRANCH=none BUG=b:274126703 TEST=none Change-Id: I3d6074f3afbf014101438dfeb535d08c4473e3f7 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4356351 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: move tcpc_get_alert_status to shimJason Yuan2023-03-249-13/+46
| | | | | | | | | | | | | | | | | | | | tcpc_get_alert_status is similar between multiple different projects. They have been now merged into common code. BUG=b:254148652 TEST=twister, usbc charging on villager, lazor BRANCH=none LOW_COVERAGE_REASON=the change from hardcoding to rst-gpios in board specific code is uncovered. The common code is 100% covered. This CL increases the absolute coverage. Change-Id: I3136bd5b600dbb385547e06490dcbf8815b85b85 Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4257651 Commit-Queue: zhi cheng yuan <jasonyuan@chromium.org> Auto-Submit: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: zhi cheng yuan <jasonyuan@chromium.org>
* ap_pwrseq: Adapt power interface components to AP Power Sequence driverstabilize-15395.B-mainBernardo Perez Priego2023-03-241-0/+31
| | | | | | | | | | | | | | | This CL make other components to follow AP Power Sequence driver. BUG=b:217952699 BRANCH=none TEST=zmake build Change-Id: I9d528fadd3074bfa9a2e9d1f36cfdeaf45015579 Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3996453 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Peter Marheine <pmarheine@chromium.org> Tested-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: tcpc: cleanup TCPC chip macroKeith Short2023-03-2313-32/+53
| | | | | | | | | | | | | | | | | Move the separator from each individual TCPC chip macro. This allows the same macro to be used outside an array definition. BUG=b:274126703 BRANCH=none TEST=zmake compare-builds -a Change-Id: Iabc8af8d0a5c32c4a24535c98b3d676083d7efb2 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4356026 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Madhu 🌱 <mparuchuri@google.com> Commit-Queue: caveh jalali <caveh@chromium.org> Tested-by: Madhu 🌱 <mparuchuri@google.com>
* zephyr: config_chip: Add the config of CONFIG_PLATFORM_EC_LID_SWITCHGwendal Grignou2023-03-231-0/+5
| | | | | | | | | | | | | | Add config option which prevent calls to lid_is_open() when CONFIG_PLATFORM_EC_LID_SWITCH is undefined. BUG=none BRANCH=none TEST=none Change-Id: Ie9f078377994cfd7625b3aaca71f7dc2cd342a57 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4363179 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: ppc: Add support for multiple altnernatesKeith Short2023-03-222-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for multiple PPC altnernate on each USB-C port. PPC chips that are candidates for runtime selection must add the "is-alt" property to the PPC definition. ppc_port0_alt: sn5s330@40 { compatible = "ti,sn5s330"; status = "okay"; reg = <0x40>; is-alt; }; The board specific code then calls PPC_ENABLE_ALTERNATE_BY_NODELABEL, specifying both the USB-C port to update, and the nodelabel of the new PPC device. PPC_ENABLE_ALTERNATE_BY_NODELABEL(0, ppc_nx20p348x_alt); BUG=b:274126703 BRANCH=none TEST=./twister -s drivers/drivers.usbc_ppc Change-Id: I8fff03beac8dbb98fea5b574e2ad456721cefe98 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4354880 Tested-by: Madhu 🌱 <mparuchuri@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* common: notify host via mkbp switch when body on/offRuihai Zhou2023-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | Add PLATFORM_EC_BODY_DETECTION_NOTIFY_MKBP to notify the host via EC_MKBP_FRONT_PROXIMITY when the body status on/off. BRANCH=corsola BUG=b:272655176 TEST=check ec log: 23-03-22 11:09:17.498 [333.643400 body detect mode enabled] 23-03-22 11:09:18.911 [333.644300 mkbp switches: 9] ... 23-03-22 11:09:21.690 [349.965200 body detect mode disabled] 23-03-22 11:09:35.269 [349.966100 mkbp switches: 1] Change-Id: If7161c8fd2365f2eb70ae158cea423382b782cad Signed-off-by: Ruihai Zhou <zhouruihai@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4344831 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
* zephyr: ppc: Cleanup PPC chip macroKeith Short2023-03-216-22/+25
| | | | | | | | | | | | | | | Move the separator from each individual PPC chip macro. This allows the same macro to be used outside an array definition. BUG=b:274126703 BRANCH=none TEST=zmake compare-builds Change-Id: I62307c5ba6c58f45566e2d65be491e56e9517fd9 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4354879 Tested-by: Madhu 🌱 <mparuchuri@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* Geralt: Enable CONFIG_IT83XX_TUNE_CC_PHYmike2023-03-201-0/+5
| | | | | | | | | | | | | | | Enable cc tune function to pass cc eye test BUG=b:270906647 BRANCH=none TEST=test geralt proto board C0 & C1 port cc eye test pass. Change-Id: Ie35517ba3e1fac95cd193eed64241972824c64da Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4339656 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* common: Move pse driver into driver placeDavid Huang2023-03-201-0/+5
| | | | | | | | | | | | | | Since there are more projects using this driver. Move it into driver place. BUG=b:273191751 BRANCH=None TEST=make buildall -j Change-Id: I50e2cb480a551ce19722edc2b6f70824f4b9147e Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4335461 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: power_button: convert to the input APIFabio Baltieri2023-03-153-28/+20
| | | | | | | | | | | | | | | | | 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>
* 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>
* Zephyr: Correct Temp sensor F75303 read methond.Logan_Liao2023-03-152-24/+19
| | | | | | | | | | | | | | | | 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>