summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig
Commit message (Collapse)AuthorAgeFilesLines
...
* zephyr: Create Kconfig.usbaSam Hurst2022-02-111-0/+1
| | | | | | | | | | | | | | | Split USBA Kconfig options from Kconfig.usbc and place in separate file named Kconfig.usba. BUG=b:208437225 TEST=Verified Kconfig options with menuconfig zmake configure -b herobrine_npcx9 BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ifaac7cd4e44390b0c216fc3bf5588c8bdf851d3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3444582 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: npcx: Fix code RAM size checkWealian Liao2022-02-081-2/+1
| | | | | | | | | | | | | | | | | | | On zephyr upstream, NPCX series map code RAM to flash0. Zephyr uses CONFIG_FLASH_SIZE for the code RAM size. However, this is overridden by Kconfig. This removes CONFIG_FLASH_SIZE in the cros repo. For the zmake, change to use CONFIG_FLASH_SIZE_BYTES for flash size check. BUG=b:216385443 BRANCH=none TEST=linker show the error for the code RAM size out of range TEST="zmake testall --clobber" Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I0942f18bd3b145c4d35eb15a44169f217496a6a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3419936 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* COIL: Update Kconfig docRicardo Quesada2022-02-071-5/+5
| | | | | | | | | | | | | | | | | | | | Updates internal documentation to use the new filename called i2c_controller.c The previous one no longer exists. Also updates the documentation to reflect the new naming convention. BRANCH=None BUG=b:163885307 TEST=No tests were done Change-Id: If93ce1a20a4a44c224ad680b1f42fe0fee203211 Signed-off-by: Ricardo Quesada <ricardoq@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3444585 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Ricardo Quesada <ricardoq@chromium.org> Tested-by: Ricardo Quesada <ricardoq@chromium.org> Auto-Submit: Ricardo Quesada <ricardoq@chromium.org>
* Zephyr: Add support for active low backlight enableDiana Z2022-01-311-0/+7
| | | | | | | | | | | | | | Add support for having an active low line in our backlight enable code. BRANCH=None BUG=b:208515128,b:195137794 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Id60de51d400740db1480e34fb9d3ed6d2a860042 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3425759 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: cortex-m: Add irq counter console commandWealian Liao2022-01-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This adds the 'irq' console command for arm cortex-m. It records the number of IRQ invoked times, which helps debug. ``` uart:~$ irq IRQ 28: 326 IRQ 33: 432 IRQ 47: 6 IRQ 54: 1 ``` BUG=none BRANCH=none TEST=Enable corresponding config. See IRQ number by 'irq' console command. Cq-Depend: chromium:3410281 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I72482463059c3cc56ddd5a4619179e6a0aee706d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3411681 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Allow explicit setting of PLATFORM_EC_EXTPOWERAndrew McRae2022-01-201-0/+11
| | | | | | | | | | | | | | | | Setting PLATFORM_EC_EXTPOWER imports support for checking the preseence of external power by calling board_check_extpower. Separate this from PLATFORM_EC_EXTPOWER_GPIO so that other methods can be supported. BUG=b:215509337 TEST=zmake configure -b nivviks BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I5dd2430ad47f1b0b27a04be38a7a210c1a275783 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3403831 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: throttling config should depends on temp sensorMichał Barnaś2022-01-101-0/+1
| | | | | | | | | | | | | | Enabling AP throttling shouldn't be possible when there's no temp sensor enabled. BRANCH=main BUG=b:181983966 TEST=zmake testall Change-Id: I9742f1971b9836f28d097e6ee50802f00b7a951d Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3314584 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr/usbc: require MATH_UTIL to enable USB-CPeter Marheine2021-12-301-0/+1
| | | | | | | | | | | | | | | | | | | | The TCPM implementation depends on the bitmask_uint64 function in multiple locations, so it should depend on the option that causes that function to be built. Since MATH_UTIL should have no effect on code size in most configurations (especially with LTO enabled), its default is set to y in order to simplify the configuration. BUG=b:211693800 TEST=zmake testall; math_util is now built when PLATFORM_EC_USBC is enabled and MATH_UTIL is unconfigured BRANCH=None Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: If3b18d43bd2e2cb21b22f57f298f942eadc2a963 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3360316 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: Organize host interface as Kconfig choiceKeith Short2021-12-171-18/+5
| | | | | | | | | | | | | | | | Organize the host interface selection as a choice as the options are mutually exclusive. BUG=b:195416058 BRANCH=main TEST=zmake testall TEST=verify lazor boots to kernel (SHI interface) TEST=verify volteer boots to kernel (eSPI interface) Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I6ae9b113b88b35ade91a5ef3ffb72d01b4df5702 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3096005 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: Rename eSPI configuration to match cros-ecKeith Short2021-12-171-2/+2
| | | | | | | | | | | | | | Rename PLATFORM_EC_ESPI to PLATFORM_EC_HOST_INTERFACE_ESPI to match the cros-ec config CONFIG_HOST_INTERFACE_ESPI. BUG=b:195416058 BRANCH=main TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I30d8448854601c137f54152424c5ddac62a21cce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095844 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: add support for CONFIG_PLATFORM_EC_POWER_COMMONTim Lin2021-12-141-0/+7
| | | | | | | | | | | | | | | Add Kconfig option which will compile common code for AP power state machine. BUG=b:192354255 BRANCH=none TEST=zmake testall Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I12d097c339b9978168dc31dd3250249a7431d1f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3325866 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* COIL: Update links for inclusive languageTom Hughes2021-11-291-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:163885307 TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I03e1cc19240cc651d4d0e9225b48f1f6962506a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3298870 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: kconfig: add PLATOFRM_EC_MATH_UTILEric Yilun Lin2021-11-291-0/+6
| | | | | | | | | | | | | | | | | Make this config independent since it has been dependent to many configs includes motion sensors and USB-PD. BUG=none TEST=zmake testall; grep math_util.o and no config directly uses it. BRANCH=none Change-Id: Id755a28e3f3da99a32b22c0d2e0b1228e7d7e6d0 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3305648 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: add shim layer for ioexMichał Barnaś2021-11-161-0/+1
| | | | | | | | | | | | | | | | | Add support for io expanders layer in zephyr. This layer allows to use zephyr gpios drivers as ioex pins. BRANCH=main BUG=b:202701452 TEST=enable ioex and shell commands define some ioex pins using zephyr drivers on board without ioexes, errors should be seen on console Change-Id: I18110f442bfb9419af249ade6ab2c8988f5cb4c8 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262097 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: i2c: add config to enable I2C_CONTROL HCDawid Niedzwiecki2021-11-091-0/+11
| | | | | | | | | | | | | | | | | | Add config to enable handling the I2C_CONTROL host command to set/get i2c speed. To change the speed use dynamic-speed flag in dts and define remote-port. BUG=b:201408931 TEST=zmake testall & get and set i2c freq via ectool e.g. ectool i2cspeed 0 (400) BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ib0d00471debeb79e50ccb7a7aafa795ce0a84849 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3264186 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Add Kconfig for init_rom regionTristan Honscheid2021-11-021-0/+6
| | | | | | | | | | | | | | | Add support for setting CONFIG_CHIP_INIT_ROM_REGION in unit tests. Add FFF mocks for init_rom functions. BRANCH=None BUG=b:184856157 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ife649a4341381dbe2f5e10b87fa767ed14b6bc5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252365 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: shim: set PWM displight channel from the device treeFabio Baltieri2021-10-291-3/+3
| | | | | | | | | | | | | | | | This drops the PWM_CH_DISPLIGHT define from the individual board pwm_map, and replaces with a single reference to a named pwm labeled displight. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I17ca620097a4b0fd6907672e340415d1963740a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3245507 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* common/i2c: Implement i2cspeed console commandCaveh Jalali2021-09-281-0/+10
| | | | | | | | | | | | | | | | | | This adds the "i2cspeed port [speed]" console command. If only the port number is given, then the current port bus speed is reported. With 2 arguments, the port bus speed is changed. Valid speeds are 100, 400, 1000 and the unit is kHz. BRANCH=none BUG=b:201039003 TEST=with follow-on patches, switched I2C bus speed between 400 kHz and 1 MHz. Change-Id: I7ca6b2c7a8fd9abe8e8ec77e4d1702529b297fe8 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181504 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: add support for I2C debuggingKeith Short2021-09-151-0/+21
| | | | | | | | | | | | | | | | | | | Add support for CONFIG_I2C_DEBUG and CONFIG_I2C_DEBUG_PASSTHRU options to zephyr. BUG=none BRANCH=none TEST=zmake testall TEST=Add CONFIG_PLATFORM_EC_I2C_DEBUG=y on herobrine, verify "i2ctrace" command is available and functional. TEST=Add CONFIG_PLATFORM_EC_I2C_DEBUG_PASSTHRU=y on herobrine, verify I2C passthru messages shown during TCPC firmware sync. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ic2d9977af4fa707dab4fdaff332fbcc34491c5fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3163211 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Automatically detect shared I2C portsKeith Short2021-09-141-0/+9
| | | | | | | | | | | | | | | | | | | Delete the "physical-port" node from named-i2c-ports, and automatically detected when multiple children point to the same I2C bus. This ensures that the I2C bus locking always blocks all matching I2C nodes, without the user needing to specify this relationship manually in the devicetree. BUG=none BRANCH=none TEST=Dump out i2c_physical_ports[] on herobrine. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I3d254684483a95af12e7940446f4cd8743684708 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3154694 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* system: Add CrOS FWID to version outputRob Barnes2021-09-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EC version does not follow the the AP and OS version. This causes confusion during development. This change augments the EC version output to include the CrOS FWID when available. The CrOS FWID will be missing when the CrOS EC is built outside of cros_sdk. When CrOS FWID is missing 'CROS_FWID_MISSING' will be used. Zephyr/zmake support will be added later, CROS_FWID32 is set to 'CROS_FWID_MISSING' in zephyr builds until then. BUG=b:188073399 TEST=version 21-05-20 16:43:18.627 Chip: Nuvoton NPCX993F A.00160101 21-05-20 16:43:18.631 Board: 1 21-05-20 16:43:18.631 RO: guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.634 guybrush_13983.0.21_05_20 21-05-20 16:43:18.639 RW_A: * guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.641 * guybrush_13983.0.21_05_20 21-05-20 16:43:18.644 RW_B: guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.644 guybrush_13983.0.21_05_20 21-05-20 16:43:18.647 Build: guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.651 guybrush_13983.0.21_05_20 2021-05-20 21-05-20 16:43:18.657 16:31:19 robbarnes@robbarnes0 ectool version RO version: guybrush_v2.0.8770+f47439f75 RO cros fwid: guybrush_13983.0.21_05_20 RW version: guybrush_v2.0.8770+f47439f75 RW cros fwid: guybrush_13983.0.21_05_20 Firmware copy: RO Build info: guybrush_v2.0.8770+f47439f75 guybrush_13983.0.21_05_20 2021-05-20 16:31:19 robbarnes@robbarnes0 Tool version: 1.1.9999-f47439f @robbarnes0 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ief0a0c6e9d35edc72ac2d4780ee203be41d7305f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2894145 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: Use NOP to wait for the external reset from H1Wealian Liao2021-09-131-0/+16
| | | | | | | | | | | | | | | | The current initial stage couldn't use the kernel delay function. Use CPU nop instruction to wait for the external reset from H1. BUG=b:182875520 BRANCH=none TEST=Enable CONFIG_BOARD_RESET_AFTER_POWER_ON for evb & toggle GPIO. Check the delay is 2 seconds. Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: If221181358c2a4df758d5bb9b57c3fbba31100aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3143633 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* driver/amd_stt: Add AMD STT driverRob Barnes2021-08-161-0/+11
| | | | | | | | | | | | | | | | | | Add a driver for writing Skin Temperature Tracking (STT) sensor readings to the SB-RMI interface. STT readings are used to maximize the SOc performance while keeping the skin temperature within specification. BUG=b:176994331 TEST=Build and run on guybrush BRANCH=None Change-Id: If655545158e7dc05946bc67686b1b0b40a40a713 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078050 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Commit-Queue: Raul E Rangel <rrangel@chromium.org>
* driver/sb_rmi: Add AMD SB-RMI driverRob Barnes2021-08-161-0/+8
| | | | | | | | | | | | | | | | | | Add Side-Band Remote Management Interface driver. SB-RMI can be used to manage power limits of the SOC. SB-RMI uses a soft mail box for executing transactions. BUG=b:176994331 TEST=Build BRANCH=None Change-Id: Ie185985e4c8d2c2d915b2ae2447709ddc16adda6 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078049 Tested-by: Rob Barnes <robcb85@gmail.com> Commit-Queue: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Fanli Zhou <fanliccc@gmail.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* zephyr: add support for switchcap in device treeMichał Barnaś2021-08-161-1/+20
| | | | | | | | | | | | | | | | | | This commit adds support for switchcap definition in device tree. It will allow to remove board specific files which implemented the switchcap functionalities. This will unify the logic between different board in zephyr. BRANCH=main BUG=b:194211207 TEST=Use linked TEST commits to see example of definitions for lazor Use GPIO or LN9310 version, build and flash to lazor. Board should be able to boot correctly. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: Ib80a73dcb2db95e2dcf48e33f876a39246fd506a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3085670 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: shim: add CONFIG_HOSTCMD_DEBUG shimDenis Brockus2021-08-121-7/+35
| | | | | | | | | | | | | | | BUG=b:195948807 BRANCH=none TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I6de387725db11ad00356c7cf47cb9c0e2e109652 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3087619 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: rename kconfig PLATFORM_EC_VBOOTJack Rosenthal2021-08-111-2/+2
| | | | | | | | | | | | | | | | | | | Rename CONFIG_PLATFORM_EC_VBOOT to CONFIG_PLATFORM_EC_VBOOT_EFS2, since this is what is actually toggled by the config. EFS2 is only a small component of verified boot, and we have many boards which don't actually use it (e.g., trogdor family) for verified boot, making the existing name very confusing. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I68ea5815b4a001c680fc78196bb7a02815799b52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088164 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: add support for CONFIG_HOST_COMMAND_STATUSTim Lin2021-08-051-0/+12
| | | | | | | | | | | | | Add Kconfig option for CONFIG_HOST_COMMAND_STATUS. BUG=b:195342437 BRANCH=none TEST=zmake testall Change-Id: Ia5adab17904cb3982788d642bc7c08b0bef69b6f Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3068489 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cbi: Add CONFIG_EEPROM_CBI_WPAseda Aboagye2021-07-291-0/+8
| | | | | | | | | | | | | | | | | | | | | This commit adds the config option, CONFIG_EEPROM_CBI_WP. It is to be defined when the EC directly controls the CBI EEPROM WP signal. The EC will set the WP according to the result of `system_is_locked()`. Note that once the WP is set, the EC must be reset via EC_RST_ODL in order for the WP to become unset. This is enabled by the accompanying hardware. BUG=b:181769483 BRANCH=None TEST=`make -j buildall` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: If490594ab4dd24af98119b01299215b997913b66 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3046412 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: add support for CONFIG_SMBUS_PECDino Li2021-07-231-0/+12
| | | | | | | | | | | | | Add Kconfig option to enable packet error checking of SMBus. BUG=b:189855648 BRANCH=none TEST=zmake testall Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Iec9f318aebed97f28e199054aae558bb8a500d52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045034 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: add support for CONFIG_HOSTCMD_REGULATORDino Li2021-07-231-0/+7
| | | | | | | | | | | | | Add Kconfig option to enable host command of voltage regulator control. BRANCH=none BUG=b:189855648 TEST=zmake testall Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I3cb8a875f8354f4223d31e2d54319f0fb2690b5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045033 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cbi: Introduce CONFIG_CBI_GPIOPhilip Chen2021-07-141-5/+20
| | | | | | | | | | | | | | | | | | | For the boards where SKU_ID/BRD_ID comes from the strapping pins on EC, this new config enables AP to ask EC for those hardware configs using the CBI host command `EC_CMD_GET_CROS_BOARD_INFO`. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=Enabled CONFIG_CBI_GPIO for lazor and manually verified with `ectool cbi get`. Change-Id: I7ec9097bab96d2076d9d42db2d003460db000113 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002452 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* system: Clean up system_get_board_version()Philip Chen2021-07-091-11/+0
| | | | | | | | | | | | | | | | | | | Refactor system_get_board_version() a bit so that we can remove CONFIG_BOARD_VERSION_CUSTOM and CONFIG_BOARD_VERSION from config.h. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=zmake testall Cq-Depend: chromium:3015243 Change-Id: Id5ab809493c297b7d330ea13dcd6934ec00042a6 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3004112 Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: add support for mkbp wake event maskSam Hurst2021-06-281-0/+26
| | | | | | | | | | | | | | | Add support in the devicetree for masking mkbp events to prevent said events from waking up a suspended system. BUG=b:190503252 BRANCH=none TEST=make buildall TEST=zmake testall Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ib53b8f96c2fb4704e25ce4fb62eb277a16d92cd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985820
* config: Rename CONFIG_CROS_BOARD_INFOPhilip Chen2021-06-161-1/+1
| | | | | | | | | | | | | | | | | | Rename CONFIG_CROS_BOARD_INFO to CONFIG_CBI_EEPROM to make it clear that the information comes from on-board EEPROM. It sets up the groundwork for adding more options of CBI sources later. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: I9a6feee0a8b35bbf29e445544243485507767ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2945792 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* zephyr: shim: add mpu enable and disable supportFabio Baltieri2021-06-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for allowing the EC code to control the MPU setup. ECOS code used to handle configuration as well as MPU enable/disable. Zephyr has its own way of handling MPU configuration, so that part of the EC code is compiled out, instead make sure that the fixed MPU regions (that cover code & data) are disabled before the EC code starts, and then enable them when mpu_enable() is called Zephyr APIs do not expose any memory protection funciontality outside of the arch specific code, so this sets the MPU regiers directly. That's not very elegant, but it's done in a sample application as well [1], so it should be an acceptable approach. Disabling the MPU unit entirely could also be an option, but only doing the fixed regions has the advantage of leaving the stack protection and null pointer detection regions enabled. [1] https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/application_development/code_relocation/src/main.c BRANCH=none BUG=b:180039888 TEST=actually tried to write in the static region, verified it fauls after sysjump disable Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I020c347e5f1b929500d4cf1c4c400dcd67e78dfa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2950168 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Add I2C_PASSTHRU_RESTRICTED configDawid Niedzwiecki2021-06-091-0/+8
| | | | | | | | | | | | | | Add the I2C_PASSTHRU_RESTRICTED config to Zephyr. BUG=b:188885798 BRANCH=none TEST=zmake testall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I8338921da350cbe0a24f12686aa6ff06de57eca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2939674 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Add config to enable resume-init/suspend-complete hooksWai-Hong Tam2021-06-051-0/+9
| | | | | | | | | | | | | Add the new PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK option to Zephyr Kconfig. BRANCH=None BUG=b:190224781, b:183054226 TEST=Pending test. The following CL enables the option. Change-Id: I98b8c19fa53ef59ca58a8aafd4bde00dc8e8ed58 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941805 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Add config to emulate sysrq eventsWai-Hong Tam2021-06-051-0/+13
| | | | | | | | | | | | | Add the new PLATFORM_EC_EMULATED_SYSRQ option to Zephyr Kconfig. BRANCH=None BUG=b:190224781 TEST=Pending test. The following CL enables the option. Change-Id: I8baf204045a95c3e0d39a448cb3cf2c9bc4d9a2a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940581 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Default not enable throttling APWai-Hong Tam2021-06-051-1/+0
| | | | | | | | | | | | | | | Only x86 boards requires throttling AP. ARM boards don't. Change the default to not enable it. It matches the original CrOS EC setting. BRANCH=None BUG=b:190224781 TEST=Checked the apthrottle command not enabled on Lazor. Built the Volteer image without error. Change-Id: I47b38ed3cd4050cebcce9d7b8edd48686dc64fad Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940579 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: npcx9: add kconfig option for flash api workaroundYuval Peress2021-06-041-0/+8
| | | | | | | | | | | | | | This is needed for the ES1 version of the npcx9 chip. BRANCH=none BUG=b:188605676 TEST=none Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I80ddc717165788248f8260050fc55ffb0bd4d11e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2927770 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* usb_common: Assert CCD_MODE when DTS connectedRob Barnes2021-05-261-0/+13
| | | | | | | | | | | | | | | | | | Drive CCD_MODE_ODL from EC when EC sees DTS connected to CCD port. This will fix some cases where the Cr50 is not able to detect that a CCD debug cable has been connected. BUG=b:175056327 TEST=Connect/disconnect SuzyQ cable, see assert/unassert in log Check gpioget on CR50 and ec, confirm CCD_MODE_ODL is correct Connect/disconnect charger, do not see assert/unassert in log Repeat with ServoV4 BRANCH=None Change-Id: I411e75a47f2e1303ddbd9caa63a9417630c99b46 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659282 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TDP142: Initial driverDiana Z2021-05-251-0/+7
| | | | | | | | | | | | | | | Initial driver for the TDP142, a DisplayPort redriver chip. The initial implementation simply provides access to the chip's control selection since it must be explicitly enabled after the chip powers on. BRANCH=None BUG=b:187856682 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4afe4b0453ef49154b766166f608bd3d0fb8848f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2915823 Reviewed-by: Rob Barnes <robbarnes@google.com>
* zephyr: Add Smart Battery emulatorTomasz Michalec2021-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | Add Smart Battery emulator which is emulated device on i2c bus. Emulated battery properties are defined through device tree, but they can be changed in runtime through Smart Battery emulator API. It allows to set custom handlers for write and read messages to emulate more complex scenarios or malfunctioning device. BUG=b:184855975 BRANCH=none TEST=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ia94a0a122123e3259882dfdc80d067c61c98379b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2903206 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: asurada: Enable I2CDenis Brockus2021-05-131-0/+1
| | | | | | | | | | | | | | | | | | | Hold off on merging this until https://chromium-review.googlesource.com/#/q/2859183 and https://chromium-review.googlesource.com/#/q/2857993 or their equivalent have been landed by ITE BUG=b:180980668,b:186673243 BRANCH=none TEST=i2c shell "i2c scan I2C_0" Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I6c8bbe9e6aef1ab24fc25797e379b0e5cf8a070f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2855217 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* mkbp: EC buttons and switches via MKBPBoris Mittelberg2021-05-101-0/+7
| | | | | | | | | | | | | | Allowing EC buttons and switches to be signaled via MKBP protocol, using CONFIG_MKBP_INPUT_DEVICES. Default behaviour is unchanged. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Cq-Depend: chromium:2824044 Change-Id: Ib96f98ecb3717a8ee8963be69fb7d7eb72e6d132 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796382
* zephyr: Add Port80 Kconfig optionJun Lin2021-05-041-0/+1
| | | | | | | | | | | | | | | | | | | Add the new config CONFIG_PORT80_4_BYTE option to the Zephyr Kconfig tree. BRANCH=none BUG=b:184872297 TEST=New config option is in Zephyr menuconfig. TEST="BOARD="npcx9_evb make"; the checker doesn't complain the missing of new config option. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ifa5d91cb315f85d452996a47f9f715fe16f49b51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2866029 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Raul E Rangel <rrangel@chromium.org>
* zephyr: add sleepmask commandKeith Short2021-04-291-0/+32
| | | | | | | | | | | | | Add KConfig options to enable the "sleepmask" console command. BUG=b:186307921 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I36c01317bc593242e549e154c26caff13000d766 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829983 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Kconfig: disable CONFIG_TIMESLICINGFabio Baltieri2021-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a Kconfig file for overriding Zephyr defaults and adds an entry to disable CONFIG_TIMESLICING. The feature is compiled in by default but not enabled, and we don't enable it at runtime. Compiling it out saves a few bytes. Before: FLASH: 233760 B 512 KB 44.59% SRAM: 48344 B 62 KB 76.15% After: FLASH: 233344 B 512 KB 44.51% SRAM: 48328 B 62 KB 76.12% BUG=b:183748844 BRANCH=none TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I5587a553197ca0101e9d7047f6ce7a988dd0b36d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2854844 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* config: rename CONFIG_FLASH to CONFIG_FLASH_CROSJeremy Bettis2021-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4ac1d81e1430dbfbfba1376a23ab19dfa845d7ef. The config name collides with the same config name in zephyr. Also, renames zephyr Kconfig CONFIG_PLATFORM_EC_FLASH to CONFIG_PLATFORM_EC_FLASH_CROS as the corresponding change at Kconfig side. BUG=chromium:1202406,b:180980668 TEST=make -j16 runhosttests buildall && zmake testall && \ /mnt/host/source/src/platform/ec/zephyr/firmware_builder.py --metrics \ /tmp/tmplt8ty8ci test ; echo $? BRANCH=none Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I5b5e58b30d936b5232e049827f458d9a2ed06340 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2855320 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>