summaryrefslogtreecommitdiff
path: root/zephyr/projects/herobrine
Commit message (Collapse)AuthorAgeFilesLines
* hooks: add HOOK_PRIO_POST_I2CKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | | | | | Add the HOOK_PRIO_POST_I2C alias for (HOOK_PRIO_INIT_I2C+1). This more clearly identifies the intent of this priority level. Applied only to common code and to Zephyr boards. BUG=none BRANCH=none TEST=compare_build.sh TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ia5b8c594e1f06ae1a982770f75b63bb4ba44191f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553669 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: remove prompt for wakeup-mask KconfigsMichał Barnaś2022-03-291-4/+0
| | | | | | | | | | | | | | | | This commit removes the Kconfig prompt for event and host event wakeup masks and enables them automatically based on device-tree nodes. If nodes that specify the masks exist, then the Kconfig will be enabled. BRANCH=main BUG=b:222689734 TEST=zmake testall, grep for WAKEUP Kconfigs in .config Change-Id: I6d85d7118e74c668120129879c32ade93169e761 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3525177 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* villager: Reconfig LED GPIO pin defineben chen2022-03-283-1/+324
| | | | | | | | | | | | | | Add gpio_villager.dts BUG=b:226475779 BRANCH=none TEST=zmake build villager PASS Change-Id: Iec357400a8fd29bee77b8ce2e2c9886217ff5990 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535543 Reviewed-by: Parth Malkan <parthmalkan@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: villager: Fix FRS Enable pin configurationSam Hurst2022-03-231-0/+2
| | | | | | | | | | | | | Fix FRS Enable pin configuration BUG=b:218692410 TEST=zmake configure -b villager BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I3d991e3fc94f17cbfdcbc6166d258e575bf0db6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3541334 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: hoglin: Fix FRS Enable pin configurationSam Hurst2022-03-232-2/+5
| | | | | | | | | | | | | Fix FRS Enable pin configuration BUG=b:218692410 TEST=zmake configure -b hoglin BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ie22d0ccd0523fb620fd4f8cc8a2d06fb30bfdb9d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3541333 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: herobrine: Fix FRS Enable pin configurationSam Hurst2022-03-232-2/+4
| | | | | | | | | | | | | Fix FRS Enable pin configuration BUG=b:218692410 TEST=zmake configure -b herobrine BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I04d87a9ee0b05692fa828d4a11fbb8eec15a1e70 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3537266 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* i2c: Add addr_flags and cmd to board_allow_i2c_passthru()Ricardo Quesada2022-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds addr_flags and cmd_id (AKA offset) to board_allow_i2c_passthru(). This CL is a kind-of-cherrypick of this other CL: https://crrev.com/c/1588492 BRANCH=none BUG=b:135642493 TEST=make buildall passes tested in Madoo where I manually added a board_allow_i2c_passthru() function that was blocking port 5 (battery) and did: With EC unlocked: dut # ectool i2cread 8 0x05 22 1 Read from I2C port 5 at 0x16 offset 0x1 = 0x67 With EC locked: dut # ectool i2cread 8 0x05 22 1 EC result 4 (ACCESS_DENIED) Change-Id: Ifba59f21f63f99345b81dd250296214a5cd29eba Signed-off-by: Ricardo Quesada <ricardoq@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3466422 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Ricardo Quesada <ricardoq@chromium.org> Auto-Submit: Ricardo Quesada <ricardoq@chromium.org> Commit-Queue: Ricardo Quesada <ricardoq@chromium.org>
* herobrine: Fix LED config for hoglinMatthias Kaehlcke2022-03-161-0/+7
| | | | | | | | | | | | | | | | | | | | | Hoglin has a single blue/red LED on the right side, adjust the LED configuration to reflect that. BUG=b:223102797 TEST=ectool led right query Brightness range for LED 4: red : 0x1 green : 0x0 blue : 0x1 yellow : 0x0 white : 0x0 amber : 0x0 BRANCH=None Change-Id: Ia005a0de2c94bfbbcf8025492a57858b78888da6 Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3530953 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: Remove use of GPIO_OUT_HIGH/LOW from dts filesKeith Short2022-03-162-38/+38
| | | | | | | | | | | | | | | | The correct Zephyr GPIO flags are GPIO_OUTPUT_HIGH and GPIO_OUTPUT_LOW. Use these flags in place of GPIO_OUT_HIGH and GPIO_OUT_LOW in all devicetree files. BUG=b:224821728 BRANCH=none TEST=zmake testall TEST=verify Herobrine boots the AP Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I3b21920a7da21973467dfcf04de5bed7a2bdb2c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3526269 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: support smart USB-A port controlPeter Marheine2022-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | This enables support for "smart" USB-A ports in addition to the existing "dumb" support, allowing one of them to be selected as well as implementing kconfig support for most of the other options for "smart" ports. For existing boards that enabled USB-A support with the default "dumb" support, their configuration is changed to specifically select that mode because the new choice option cannot have a default. BUG=b:223937974 TEST="smart" port control can be turned on for Nereid BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: If5b0fb393451d31a937c73be2aa3b9623c69307f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3517929 Reviewed-by: Andrew McRae <amcrae@google.com>
* zephyr: shim: drop empty pwm.dts overlaysFabio Baltieri2022-03-152-11/+0
| | | | | | | | | | | | | | | Make the PWM shim compile with no named-pwms node defined and drop all empty pwm.dts files. This also drops the one adlrvp_npcx, that currently defines an fan PWM but no matching named-fan. BRANCH=none BUG=b:217741090 TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib2d4e3a12ed688ba38fb6bbba9afb11f9d900ee6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521941 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: hoglin: Board creationKshitiz Godara2022-03-116-4/+558
| | | | | | | | | | | | | | Created hoglin board using herobrine as reference board BRANCH=None BUG=None TEST=Tested image on hoglin board and board is booting up fine. Change-Id: I81a8b97d5d4bf7c1e40267dd399dc4a8060ce2b4 Signed-off-by: Kshitiz Godara <kgodara@qualcomm.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3334736 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* zephyr: herobrine: enable 1Mhz I2C speed for TCPC chipsDawid Niedzwiecki2022-03-111-12/+2
| | | | | | | | | | | | | | | | | | | | Once changing I2C speed is possible in runtime, reenable 1MHz(I2C_BITRATE_FAST_PLUS) for the TCPC ports. Also, add remote-port property to named-i2c-port nodes in dts to define how to access a desired port. It is done based on an enum in registers-npcx9.h file. BUG=b:201408942 TEST=zmake testall & Verify PD works on herobrine BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ie304bd6ad38fd8c7f6b33b3de8a97c175d9edf28 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3269840 Tested-by: Keith Short <keithshort@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* herobrine: enable I2C speed controlKeith Short2022-03-112-1/+7
| | | | | | | | | | | | | | | | | | The Parade flash-window update mode can only operate at 400 KHz. Enable the I2C speed control so the Parade firmware update can dynamically change the I2C bus speed for successful firmware update. BUG=b:201408942 BRANCH=none TEST=Run "ectool i2cspeed 1 400" and "ectool i2cspeed 1 1000" to verify I2C_CONTROL host command TEST=Perform Parade PS8805 firmware update with CONFIG_DRIVER_EC_PS8751_FLASH_WINDOW option enabled. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibc59d003bb23e428ee7bc7679b13b9c38e0b2cfc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3518082 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* herobrine: Use remote-port property only for batteryKeith Short2022-03-111-0/+3
| | | | | | | | | | | | | | | | The remote-port property is only needed by the kernel to access the battery fuel gauge. Specifying the remote-port for the TCPC buses and EEPROM buses causes misnumbering during TCPC firmware updates. BUG=none BRANCH=none TEST=zmake testall TEST=Test TCPC firmware update on herorine Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Id48eacc81478ff9b02a189eec08cd802d87fe68d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3518081 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: herobrine: Enable FRS FunctionalitySam Hurst2022-03-111-0/+1
| | | | | | | | | | | | | | Enable Fast Role Swap Functionality BUG=b:218692410 TEST=zmake configure -b herobrine BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I5d8ab10eddb0174047d52e04eda2866f74c045ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3518072 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: herobrine: Enable FRSSam Hurst2022-03-091-0/+1
| | | | | | | | | | | | | Enable Fast Role Swap BUG=b:218692410 TEST=zmake configure -b herobrine BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ie327bda24405c7ec04ffa0c9cd6253fb13b504e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508586 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* villager: Update the default batteryWai-Hong Tam2022-03-093-1/+15
| | | | | | | | | | | | | Villager board uses a different battery which is 3S. BRANCH=None BUG=b:222312301 TEST=Built the villager, herobrine, and hoglin images. Change-Id: Ice4ea033d751fac1cc202fcbf228f6c9f212ff3e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3503399 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: herobrine: Enable PD REV3.0Sam Hurst2022-03-081-1/+1
| | | | | | | | | | | | | Enable PD Rev 3.0 BUG=b:218692410 TEST=zmake configure -b herobrine BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6817603f4edcf7aec6d6a12ad9b743ac302a6b77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508585 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Herobrine: Add debug messages to show the HPD changeWai-Hong Tam2022-03-081-0/+5
| | | | | | | | | | | | | Show the HPD change message to help debugging issues. BRANCH=None BUG=b:170598152,b:209092452 TEST=Plug and unplug a Type-C monitor and check the messages. Change-Id: I5ee5252ef7a50f976ee9ff0077aaa6df774f5013 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3503403 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* zephyr: shim: set generic-pwm-channel on herobrine or trogdorFabio Baltieri2022-03-082-0/+2
| | | | | | | | | | | | | | | | | | | | | Set the generic-pwm-channel label on ARM platforms so that they work correctly with the current AP firmware. It should restore the order in which they were declared before: 66fa9b729c zephyr: replace the ecos kblight driver for a deshimmed one BRANCH=none BUG=b:217741090, b:222516095 TEST=zmake testall TEST=run on lazor Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reported-by: Michał Barnaś <mb@semihalf.com> Tested-by: Michał Barnaś <mb@semihalf.com> Change-Id: I09ce1bf3ba1aa6617fbcd3631727a5a5d942aead Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3503648 Reviewed-by: Michał Barnaś <mb@semihalf.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: add a new displight Zephyr driverFabio Baltieri2022-03-083-10/+17
| | | | | | | | | | | | | | | | | Add a new Zephyr driver for controlling the display backlight, very similar to the keyboard backlight one, using a devicetree node and Zephyr PWM APIs. This is used by the host through the PWM HC functions. BRANCH=none BUG=b:217741090 TEST=zmake testall Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ibd48aaa750eed9fb7a85568cfdbd166a41498021 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3500629 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Herobrine: Enable ISL9238C DriverSam Hurst2022-03-041-1/+1
| | | | | | | | | | | | | | Enable ISL9238C Driver BUG=b:215406071 TEST=Verify charging works from Port0 and Port1 BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I8a869a8632c620412f83b4289eca4ec257b0f7a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3461188 Reviewed-by: Mike Goodey <mgoodey@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: herobrine: Set number of 3A ports to 2Sam Hurst2022-03-041-0/+1
| | | | | | | | | | | | | | | | | Set CONFIG_PLATFORM_EC_USB_PD_3A_PORTS=2 BUG=b:220704808 TEST=zmake configure -b herobrine Verified the port count by printing the config: note: '#pragma message: PORTS 2' 44 | #pragma message "PORTS " XSTR(CONFIG_USB_PD_3A_PORTS BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I7a53caf79266a8f7b763f9d55a43545ed59217a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3499543 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* villager: Update the USB-C dts overlayWai-Hong Tam2022-02-263-1/+66
| | | | | | | | | | | | | | | Fork the USBC dts overlay and update the PPC nodes to reflect the component change. BRANCH=None BUG=b:221444985 TEST=Built the villager EC image without breaking the herobrine and hoglin images. Change-Id: Ia1af9366c7cc6198172bc9f4188d2b080ba15fd3 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3491321 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: shim: replace few pwm flags with PWM_POLARITY_NORMALFabio Baltieri2022-02-252-2/+2
| | | | | | | | | | | | | | | | | Zephyr PWM flag is commonly either PWM_POLARITY_NORMAL or PWM_POLARITY_INVERTED. Replacing few instances of flag being set to "0" for PWM_POLARITY_NORMAL to match how this is commonly done in Zephyr upstream. BRANCH=none BUG=b:217741090 TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I7c36989696824e2bf2401cc5695978a71197b668 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3488368 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* villager: Create initial Villager EC imageWai-Hong Tam2022-02-254-0/+20
| | | | | | | | | | | | | | | | | | | | Fork the Villager build from the Herobrine's. These 2 images are the same so far except the runtime Herobrine-specific component swap, which depends on the CONFIG_BOARD_HEROBRINE. The villager image doesn't care about the BOARD ID and just uses the static configs. More changes will be added later. BRANCH=None BUG=b:221444985 TEST=Built the villager EC image. Change-Id: I0c8d71c4b664d6c8b80e94debab0cccf79030778 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489825 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Fix GPIO includes for herobrineKeith Short2022-02-253-3/+6
| | | | | | | | | | | | | | Use the Zephyr driver GPIO include for Zephyr shim code instead of the legacy EC GPIO header. BUG=b:218856245 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9ae2595e16e8b0ef95f5f0eea9f9387b2ec5e97f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489247 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: split legacy and shimmed codes into librariesKeith Short2022-02-251-1/+1
| | | | | | | | | | | | | | | Split the legacy EC code and shimmed code into separate libraries. This allows for declaring different compiler definitions to the legacy and shim code. BUG=b:218856245 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ice25c21409d33594e7d465092ad5066be7336dbe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489101 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: npcx: add build time check for the hibernate DT nodeJun Lin2022-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nuvoton EC supports two hibernate mode: - PSL mode - non-PSL (disable RAM) mode The PSL mode uses the DT node vsby-psl-in-list to configure the PSL input wakeup pins. The non-PSL mode uses the DT node hibernate-wake-pins to configure the GPIO wakeup pins. This CL adds a build time assert to prevent a user from using the incorrect DT node for different mode. Also, add status = "okay" to the vsby-psl-in-list node because the status was disabled at default with PR:42668. BUG=b:216893756 BRANCH=none TEST=set "zmake testall --clobber" TEST=add "CONFIG_PLATFORM_EC_HIBERNATE_PSL=y" and define hibernate-wake-pins node in the prj.conf of npcx9_evb; see the build error. TEST=set "CONFIG_PLATFORM_EC_HIBERNATE_PSL=n" and define vsby-psl-in-list node in the prj.conf of npcx9_evb; see the build error. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I83f4c3d427ef479445d5e5b992f53056da9bf1ef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3449996 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: keyboard: set active low flag for column 2Keith Short2022-02-251-1/+1
| | | | | | | | | | | | | | | | | Explicitly set the active low flag for the column 2 output pin. Modify cros_kb_raw_set_col2() to drive the logic level instead of the physical state of the pin when CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED is enabled. BUG=b:218904113 BRANCH=none TEST=Verify all keypresses on herobrine using "ksstat on" Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If6098226d5551c2a3aa8374f7b17e2fad396c006 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3488786 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Andrew McRae <amcrae@google.com>
* zephyr: update keyboard drivers to use Zephyr GPIOsKeith Short2022-02-241-2/+2
| | | | | | | | | | | | | | | Add alias node gpio-kbd-kso2 to replace the legacy GPIO_KBD_KSO2 signal. BUG=b:218904113 BRANCH=none TEST=On herobrine, verify all keypresses Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I834cc7af68e721597e7509187266c509a50fab12 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3485956 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Andrew McRae <amcrae@google.com> Commit-Queue: Andrew McRae <amcrae@google.com>
* zephyr: config: drop a bunch of CONFIG_PLATFORM_EC_PWM=yFabio Baltieri2022-02-241-1/+0
| | | | | | | | | | | | | | | Drop all CONFIG_PLATFORM_EC_PWM=y, this is now default if CONFIG_PWM=y so the platform config is now redundant. Add explicit CONFIG_PWM=y for npcx_evb configs. BRANCH=none BUG=b:217926701 TEST=zmake configure -b volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ia785d37929bd550f46f05d5c84b11d9e1de5339a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3488367 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: replace the ecos kblight driver for a deshimmed oneFabio Baltieri2022-02-183-9/+17
| | | | | | | | | | | | | | | | | | | | | | | Replace the ECOS pwm_kblight driver with one using the Zephyr APIs for pwm and devicetree. BRANCH=none BUG=b:217741090 TEST=build and run on volteer, play with the keyboard backlight TEST=zmake configure -b brya TEST=zmake configure -b herobrine TEST=zmake configure -b skyrim TEST=zmake configure -b lazor TEST=zmake configure -b npcx9 TEST=zmake configure -b npcx7 TEST=zmake configure -b nivviks TEST=zmake configure -b nereid Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Idb58f6bbecad4337148fd6a279ef0625247df6fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3468505 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Reland "zephyr: Remove unused enum-name entries"Andrew McRae2022-02-161-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0f6242e8bd99e0b1fe4d2f15e95bf48eb7daa516. Someone added a new reference to one of the removed enums. Reason for revert: Fixed build. BUG=b:216466985 TEST=zmake testall BRANCH=none Original change's description: > Revert "zephyr: Remove unused enum-name entries" > > This reverts commit 112bc3616b55421af4ae5003c542e9a425128650. > > Reason for revert: suspected at fault for postsubmit failures > https://ci.chromium.org/p/chromeos/builders/postsubmit/firmware-zephyr-postsubmit/14846 > > Original change's description: > > zephyr: Remove unused enum-name entries > > > > After removal of the unsupported projects, > > take another run through the enum-names to > > remove the unused entries. > > > > BUG=b:216466985 > > TEST=zmake testall > > BRANCH=none > > > > Signed-off-by: Andrew McRae <amcrae@google.com> > > Change-Id: Id652c4fda7dd64a59b3776bb52640413a31e4e3e > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3446945 > > Reviewed-by: Tristan Honscheid <honscheid@google.com> > > Reviewed-by: Keith Short <keithshort@chromium.org> > > Commit-Queue: Keith Short <keithshort@chromium.org> > > Bug: b:216466985 > Change-Id: I97e4ba659b15a8860d408ec46a6629a8d292b05e > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3465516 > Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> > Tested-by: Jack Rosenthal <jrosenth@chromium.org> > Auto-Submit: Jack Rosenthal <jrosenth@chromium.org> > Reviewed-by: Keith Short <keithshort@chromium.org> > Commit-Queue: Keith Short <keithshort@chromium.org> Bug: b:216466985 Change-Id: I51284582ad8e17ab2016b65f8a31944702d70579 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3466674 Reviewed-by: Dawid Niedzwiecki <dawidn@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* herobrine: Rename project to 'herobrine' (was 'herobrine_npcx9')Matthias Kaehlcke2022-02-165-8/+8
| | | | | | | | | | | | | | | | The NPCX9 is the only EC chip that will be used by herobrine, rename the project from 'herobrine_npcx9' to 'herobrine'. BRANCH=None BUG=b:215771396 TEST=zmake configure -b herobrine Cq-Depend: chrome-internal:4546687 Change-Id: I206a65f253ce38d1b263a13df6ace90c90a0e450 Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3459518 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Revert "zephyr: Remove unused enum-name entries"Jack Rosenthal2022-02-151-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 112bc3616b55421af4ae5003c542e9a425128650. Reason for revert: suspected at fault for postsubmit failures https://ci.chromium.org/p/chromeos/builders/postsubmit/firmware-zephyr-postsubmit/14846 Original change's description: > zephyr: Remove unused enum-name entries > > After removal of the unsupported projects, > take another run through the enum-names to > remove the unused entries. > > BUG=b:216466985 > TEST=zmake testall > BRANCH=none > > Signed-off-by: Andrew McRae <amcrae@google.com> > Change-Id: Id652c4fda7dd64a59b3776bb52640413a31e4e3e > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3446945 > Reviewed-by: Tristan Honscheid <honscheid@google.com> > Reviewed-by: Keith Short <keithshort@chromium.org> > Commit-Queue: Keith Short <keithshort@chromium.org> Bug: b:216466985 Change-Id: I97e4ba659b15a8860d408ec46a6629a8d292b05e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3465516 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Auto-Submit: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Remove unused enum-name entriesAndrew McRae2022-02-151-16/+0
| | | | | | | | | | | | | | | | | After removal of the unsupported projects, take another run through the enum-names to remove the unused entries. BUG=b:216466985 TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Id652c4fda7dd64a59b3776bb52640413a31e4e3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3446945 Reviewed-by: Tristan Honscheid <honscheid@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Add USBA for herobrine_npcx9 to device treeSam Hurst2022-02-122-5/+6
| | | | | | | | | | | | | | | | This patch removes custom USBA logic and uses device tree implementation instead. BRANCH=main BUG=b:194432779 TEST=zmake configure -b herobrine_npcx9 Signed-off-by: Sam Hurst <shurst@google.org> Change-Id: I2c75c325822ada4f06be173f3ac7c5d687c50f9c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3451517 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* zephyr: Add tcpc for herobrine_npcx9 to device treeSam Hurst2022-02-112-20/+12
| | | | | | | | | | | | | | | | | This patch removes custom tcpc logic and uses device tree implementation instead. BRANCH=main BUG=b:194432779 TEST=zmake configure -b herobrine_npcx9 Verified that the system was able to charge from both ports. Signed-off-by: Sam Hurst <shurst@google.org> Change-Id: Ifc8dd3ed89ad08fb3ec43b40c01497f7bb6e1e60 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3449111 Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* 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>
* write protect: extract checking write protectDawid Niedzwiecki2022-02-112-1/+8
| | | | | | | | | | | | | | | | | | | | | | The write-protect state can be checked on 2 pins GPIO_WP or GPIO_WP_L. The CONFIG_WP_ACTIVE_HIGH config is used to distinguish these two cases. Move the checking the config and pin state to a separate header file. For Zephyr, start using the gpio_get_level function that takes into account the GPIO_ACTIVE_LOW flag. Also, use 'gpio-wp' alias to the WP pin instead of the legacy enum-name property and 'int-wp' alias to the WP GPIO interrupt. BUG=b:211779766 TEST=zmake testall & make sure WP works BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I70bfbcd5e539fcc8cd157f2feae1a6c8e25083a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3447404 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* TCPM: Change the PS8xxx I2C flags name to match the driverSam Hurst2022-02-101-2/+2
| | | | | | | | | | | | | | | | Change the PS8xxx I2C flags name from PS8751_I2C_ADDR to PS8XXX_I2C_ADDR. BRANCH=main BUG=b:194432779 TEST=make -j buildall Signed-off-by: Sam Hurst <shurst@google.org> Change-Id: Ie8ac1c922c46bb425b7e7b1a39173872d48f6353 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3449669 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* zephyr: update definition of WP pinDawid Niedzwiecki2022-02-091-1/+1
| | | | | | | | | | | | | | | | | | The WP pin for most boards is logically high when the pin is low - WP is active when the pin is low. Add GPIO_ACTIVE_LOW flag to the WP_L pins. It allows using Zephyr GPIO API to get the logical state without checking CONFIG_WP_ACTIVE_HIGH define. BUG=b:211779766 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I48594c5c7bc4deb452d6922d0b07f57055240d5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3437445 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Andrew McRae <amcrae@google.com> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* zephyr: Remove the hibernate-wake-pins nodes on projects using PSLWai-Hong Tam2022-02-091-13/+0
| | | | | | | | | | | | | | | The hibernate-wake-pins node is only used for the non-PSL mode. When the PSL mode is enabled, this node is unused and should be removed. BRANCH=None BUG=b:216893756 TEST=Tested the hibernate mode on herobrine. Change-Id: I17a6acbe3edcc9a8f17daa99daecac694d895ebb Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3449128 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: Remove enum-names that are not used by common codeAndrew McRae2022-02-021-4/+0
| | | | | | | | | | | | | | | | Clean up the named-gpios enum-names to remove names that are not referenced in common code or shimmed in baseboard code. BUG=b:216466985 TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Cq-Depend: chromium:3426250, chromium:3427097 Change-Id: Ifb65c76ef17afec7df1e0b857f666c600d60e6f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3428601 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* herobrine: Migrate GPIO access to use Zephyr APIAndrew McRae2022-02-024-34/+44
| | | | | | | | | | | | | Migrate GPIO access to use Zephyr GPIO API. BUG=b:216466985 TEST=zmake configure -b herobrine_npcx9 BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ifb8591dc282fd367e389d4a0902ea8c001fc82b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3426250 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Fix named-gpios et al to drop #gpio-cellsAndrew McRae2022-02-011-21/+0
| | | | | | | | | | | | | | | | | | | | | The #gpio-cells property is only required when the referenced node is a GPIO controller. named-gpios is not a GPIO controller, and cannot be used as a GPIO reference. DTS and code can refer to named-gpios directly, and then retrieve the GPIO from the named-gpio gpios property. Also rename irq-gpio to irq-pin so that DTS does not complain about missing #gpio-cells. BUG=b:216402316 TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Cq-Depend: chromium:3418800, chromium:3418799, chromium:3423294 Change-Id: Ifdea8662647c092950962d3b6b0f32acda23aa5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3412626 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: Convert wake-pins to use interrupt configAndrew McRae2022-02-011-5/+8
| | | | | | | | | | | | | | Convert the hibernate wake-pins to use the new interrupt config. BUG=b:214608987,b:216869126 TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Cq-Depend: chromium:3423294,chromium:3423295 Change-Id: Iaaf03da88ead8bce7b2b428c265434a5a17b4ab7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3422856 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* herobrine: Include the missing project configWai-Hong Tam2022-01-311-0/+1
| | | | | | | | | | | | | | | | | Need to include the project config prj_herobrine_npcx9.conf to the build. It defines CONFIG_BOARD_HEROBRINE_NPCX9=y. The board specific alternative component code (alt_dev_replacement.c) requires this Kconfig option. BRANCH=None BUG=b:216836197 TEST=Booted the herobrine_npcx9 image. No PPC access error and PD message loop. Change-Id: I73a9987ff49a4dfb346ebe7c994418278817c03b Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3422771 Reviewed-by: Keith Short <keithshort@chromium.org>