summaryrefslogtreecommitdiff
path: root/zephyr/projects
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: create led.c file local to Lazor projectParth Malkan2021-09-282-3/+158
| | | | | | | | | | | | | | Add led.c file locally to zephyr lazor project and unlink from CrOs led.c file BRANCH=None BUG=b:201007290 TEST=builds Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: Ibf3223da8889233cbc7cb3b21e78c6ea0773201a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183184 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: convert fwctrl register to syscon driverYuval Peress2021-09-2710-0/+20
| | | | | | | | | | | | | | | | Note that currently CONFIG_SYSCON=y is required. There's an ongoing PR (https://github.com/zephyrproject-rtos/zephyr/pull/38762) to remove that requirement in favor of simply detecting an enabled node in DT via the compatible string. BRANCH=none BUG=b:179900857, b:165777478, b:200642229 TEST=zmake testall Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Idad1f53afbda503e0e0b2fdf2931d5267a391d4d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3177749 Reviewed-by: Sam Hurst <shurst@google.com>
* zephyr: drivers: thermistors are device tree nodesAaron Massey2021-09-241-1/+0
| | | | | | | | | | | | | | | | | | | Thermistor drivers now query the device tree for configuration. Thermistor tests have been updated to be parameterized on all thermistors enabled in the device tree. BRANCH=none BUG=b:184374937 TEST= 1) zmake testall 2) make runhosttests Cq-Depend: chromium:3161332 Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Change-Id: Ic5330cd5c33e79e192428ca857651de9a225856e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3133812 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com>
* Guybrush: Add keyboard and volume buttonsstabilize-14238.B-mainDiana Z2021-09-233-3/+10
| | | | | | | | | | | | | | Add configuration for the keyboard and volume buttons. BRANCH=None BUG=b:195137794 TEST=load on guybrush, confirm volume up and down prints Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I89306402474ec72455ff999f9da8a35b3eb4139a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176403 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Guybrush: Correct zephyr power interruptsDiana Z2021-09-231-1/+1
| | | | | | | | | | | | | | | Correct the S5 PGOOD interrupt to go to the baseboard function to process it. BRANCH=None BUG=b:195137794 TEST=builds, continues to "boot" to S0 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0fb631eb67b662698b889171c399d968da788cb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176393 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim: implement a generic led_get_brightness_rangeFabio Baltieri2021-09-221-0/+2
| | | | | | | | | | | | | | | | | | | Implement a generic led_get_brightness_range function using static values from the device tree. This is currently ignoring led_id, but no pwm_led based device is using it right now anyway, so this could cover all existing use cases. BRANCH=none BUG=b:177452529 TEST=called the function, verified the values in runtime Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I67dc7564eb6724e401961261ff5cc5892899ad5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170401 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: lazor: add history and kernel threads commandsMichał Barnaś2021-09-221-0/+8
| | | | | | | | | | | | | | Enable commands for displaying shell history and threads statistics. BRANCH=main BUG=b:190224781 TEST=Check if "history" and "kernel threads" commands work Change-Id: Iedfaa3856c065120966f4d683646fa51218f1e0a Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174057 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: shim: define led_color_map from the devicetreeFabio Baltieri2021-09-221-0/+7
| | | | | | | | | | | | | | | | | | | This adds a set of properties for color mapping in the device tree for the pwm-leds device, and maps them to the internal "struct pwm_led_color_map". BRANCH=none BUG=b:177452529 TEST=compared the structure on gdb TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib3a704afccad40eab7115371dbf72c568f5602d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170400 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Explicitly enable the I2C controllerKeith Short2021-09-201-0/+28
| | | | | | | | | | | | | | | | | Explicitly enable the I2C controller node that is used on each board using the Nuvoton NPCX7 or NPCX9 chipset. This is a no-op at the moment, but prepares for an upstream change that will disable the I2C controller nodes by default. BUG=b:200292035 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I158ae44090a719ef20930350d89efd7903e6e531 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169389 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: guybrush: Bringup power sequencingJack Rosenthal2021-09-175-6/+150
| | | | | | | | | | | | | | | | | Bringup power sequencing for AMD and enable for guybrush. Note that at the moment we had to copy-paste the power signals and related funcitons, the code was a bit too far from shimming without extensive editing. We can try and merge together later. BUG=b:195137794 BRANCH=none TEST=power sequence to S0, nothing useful on ap console (yet!) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I9a577e24d80fe0ff992af4b847e14695b82f871d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169568 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: guybrush: Enable shell candyJack Rosenthal2021-09-171-0/+6
| | | | | | | | | | | | | Enable help, tab complete, and history for much tasty. BUG=b:195137794 BRANCH=none TEST=use the features Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ia27b9a1b0338d5ada6db5ba3c1893cea398ca78c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169567 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: guybrush: Enable ESPI driverJack Rosenthal2021-09-172-0/+2
| | | | | | | | | | | | | | | Got it to compile with just one extra gpio. Not sure if it actually works yet. BUG=b:195137794 BRANCH=none TEST=compiles Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8103ba697206ce5350c2d353dbd3e05cec76eb40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169566 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: kconfig: Add options for AMD power sequencingJack Rosenthal2021-09-171-1/+2
| | | | | | | | | | | | | | Add config options for AMD power sequencing and wire up to guybrush. Note this doesn't toggle any more code to compile yet. BUG=b:195137794 BRANCH=none TEST=compile for guybrush Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ifd17c6eec05335079bd52955c37f37407501e270 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169565 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: guybrush: Bringup power buttonJack Rosenthal2021-09-173-4/+7
| | | | | | | | | | | | | | | Enable power button interrupt and module. Don't have the x86 state machine going yet. BUG=b:195137794 BRANCH=none TEST=push the button, see the prints Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5996a65fe40afd58027452e5b44a60becbbdfa0d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169199 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: guybrush: Enable extpower gpio detectionJack Rosenthal2021-09-172-3/+7
| | | | | | | | | | | | | | | | Bring up GPIOs for ACOK, and wire the interrupts. Note we needed to set certain Kconfigs to n due to incorrectly specified defaults. BUG=b:195137794 BRANCH=none TEST=compiles Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I64f935895a74a5df2dbcd1122623788f91ef89fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169198 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: guybrush: Populate GPIOsJack Rosenthal2021-09-173-5/+313
| | | | | | | | | | | | | | | | | Initial population converted from gpio.inc. IOEX gpios not handled yet. Added lid switch support as a first (useful) gpio. BUG=b:195137794 BRANCH=none TEST=observe uart prints with lid open/close Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ie4ac37d11ca01594b390b999516e93462b1e4691 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169197 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: Initial port for GuybrushJack Rosenthal2021-09-175-0/+94
| | | | | | | | | | | BUG=b:195137794 BRANCH=none TEST=uart works Change-Id: Ib7e177cfd501f78afb6edf943f078466dca455a6 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3168392 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: brya: delete duplicate GPIO interrupt definitionKeith Short2021-09-171-3/+1
| | | | | | | | | | | | BUG=none BRANCH=none TEST=zmake configure -b zephyr/projects/brya/brya Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If780dd6dfc92e0dabbe7c1aff19d2c0fe945c6d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169561 Commit-Queue: Yuval Peress <peress@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* herobrine: Enable rtc_alarm console commandWai-Hong Tam2021-09-171-0/+1
| | | | | | | | | | | | | | The command is useful to debug. BRANCH=None BUG=b:194710429 TEST=Used the rtc_alarm command to trigger RTC interrupt. Change-Id: Iefcbd2d982494044109994a1fe082041d4de215a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3166997 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: herobrine_npcx9: Set TCPC I2C speed to 400 kHzKeith Short2021-09-171-2/+12
| | | | | | | | | | | | | | | | The PS8805 supports 1 MHz operation normally, but only 400 kHz operation during flash updates. The I2C passthru interface used by depthcharge doesn't support changing the I2C frequency or informing the EC that a firmware update is going to start, so the lower frequency must be used. BUG=b:199550987 BRANCH=none TEST=Verify PS8805-A3 firmware updates Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9be242ce03cc29c74559c6012b5cc83680b7b288 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3166998 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* herobrine: Always enable the 5V railWai-Hong Tam2021-09-162-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare the next hardware revision. It has a PPC chip which requires 5V rail in S5. The 5V rail enable pin should be turned on whenever the EC is powered. Since the existing 5V rail enabling is done inside the qcom power sequence. Trogdor and Herobrine both shares this qcom power sequence. For Trogdor, this CL moves the 5V rail enabling from the qcom power sequence to the board level hook. For Herobrine, this CL updates the GPIO name and modifies the default level to HIGH. The CONFIG of 5V control should be disabled. As no board level hook to modify the 5V rail, the 5V is always on. BRANCH=None BUG=b:199804198 TEST=Booted both Zephyr and EC-OS images on Herobrine. Checked the 5V rail is enabled in S0 and S5. TEST=Booted both Zephyr and EC-OS images on Lazor. Checked the 5V rail is enabled in S0 and disabled in S5. Change-Id: Ifa98ee0c4e970dd89952e94cc6a0e289798e6a57 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3163918 Reviewed-by: Keith Short <keithshort@chromium.org>
* USB MUX: Update mux HPD update interface to use mux_state_tDiana Z2021-09-162-3/+8
| | | | | | | | | | | | | | | | | Since the drivers are now taking a mux_state_t set of flags to update, go ahead and unify the usb_mux API this way as well. It makes the parameters more apparent than the 1/0 inputs, and aligns the stack to use the same parameters. BRANCH=None BUG=b:172222942 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie943dbdf03818d8497c0e328adf2b9794585d96e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095438 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: Remove herobrine_npcx7 buildJack Rosenthal2021-09-139-860/+0
| | | | | | | | | | | | | | Obsolete since the NPCX9 IOB is now widely available. BUG=b:191803008 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I3865dcf368d7542abaf5126ccb7548933b4ab25f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150053 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: shim: set pwm_led data from device treeFabio Baltieri2021-09-104-7/+32
| | | | | | | | | | | | | | | | Set up the pwm_leds data from the device tree, gets rid of most static map defines and sets CONFIG_LED_PWM_COUNT automatically. BRANCH=none BUG=b:177452529 TEST=build and run on volteer TEST=compared the built up pwm_leds structure with gdb Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib41faf86ae018f5a1ed8a1c96c4b6ec081e175d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3154256 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: hayato: enable hibernate mode on hayatoTim Lin2021-09-101-3/+10
| | | | | | | | | | | | | | | | | | | | | | The GPIO interrupts that can be waked up in hibernate mode include GPIO_AC_PRESENT, GPIO_LID_OPEN and GPIO_POWER_BUTTON_L. BUG=b:198305804 BRANCH=none TEST=test1: console command: hibernate Wake-up GPIO interrupt: GPIO_AC_PRESENT, GPIO_LID_OPEN and GPIO_POWER_BUTTON_L test pass! test2: console command: hibernate [seconds] [microseconds] After the specified seconds, the EC will wake-up from sleep mode. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: Ibd19f14b3a5e2bf47f8edd9205761333d7b0318f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3146774 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* asurada: move the hibernate routine into separate fileTim Lin2021-09-101-0/+1
| | | | | | | | | | | | | | | | | | Move the hibernate routine from baseboard.c to separate hibernate.c files. BUG=b:198305804 BRANCH=none TEST=make BOARD=asurada -j The interrupt of GPIO_AC_PRESENT can wake up CPU in hibernate mode. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I0aea0b812f535c907ac8963fc1f09206dfef5956 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3146773 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr:herobrine_npcx9: Enable kernel shell ec commandsDenis Brockus2021-09-101-0/+1
| | | | | | | | | | | | | | BUG=b:199328071 BRANCH=none TEST=ec console command 'kernel' Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I5ad1686e0a472123180587e2584ad79e29da65dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3152315 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* NPCX: RTC: Add CONFIG_CROS_RTC_NPCX=y to prj.confSam Hurst2021-09-073-0/+3
| | | | | | | | | | | | | | | The CONFIG_CROS_RTC_NPCX config defaults to 'n'. Explicitly add CONFIG_CROS_RTC_NPCX=y to herobrine_npcx7, lazor, and trogor devices. BRANCH=none BUG=b:194710429 TEST=none Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I7a551f5574a645ea5e1495c19ec6ed09c4866ea5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3144534 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* herorbrine_npcx9: Use PCF85063A RTC Zephyr driverSam Hurst2021-09-043-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the RTC driver from the Zephyr MTC driver to the Zephyr PCF85063A driver. BRANCH=none BUG=b:194710429 TEST=ectool rtcset 30000 ectool rtcget Current time: 0x0000753d (30013) ectool rtcsetalarm 10 after ~10 (measured with a timer) printed on ec console: [160.248900 event set 0x0000000002000000] I tested the alarm up to one hour. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6e6f8bb65cb515e0997687ff4beef7620506a57d herorbrine_npcx9: Configure PCF85063A RTC Alert Configure the PCF85063A RTC Alert pin so that it can interrupt the EC on an alarm event. BRANCH=none BUG=b:194710429 TEST=ectool rtcset 30000 ectool rtcget Current time: 0x0000753d (30013) ectool rtcsetalarm 10 after ~10 (measured with a timer) printed on ec console: [160.248900 event set 0x0000000002000000] I tested the alarm up to one hour. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I58ac585c2d566d306625dd8034377925eba36293 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3140328 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: define hayato's batteries in device tree and change enum nameMichał Barnaś2021-09-032-8/+3
| | | | | | | | | | | | | | | | | | | This commit adds asurada/hayato's batteries definitions to device tree and removes old battery.c usage in Zephyr. BRANCH=main BUG=b:183544739 TEST=Compile and flash CrOS EC firmware to hayato. It should work the same as without this commit. TEST=Compile and flash Zephyr, battery should be detected correctly and its model should be logged in EC console. Change-Id: I009a1b6d25e72e1c0145f5e8dda38243dfb9a8c8 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3107389 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* zephyr: define herobrine's batteries in device treeMichał Barnaś2021-09-033-76/+3
| | | | | | | | | | | | | | | | | This commit adds herobrine's batteries definitions to device tree and removes old battery.c usage in Zephyr. BRANCH=main BUG=b:183544739 TEST=Compile and flash Zephyr, battery should be detected correctly and its model should be logged in EC console. Change-Id: I1783715b72863fb947077f8dbde396071433bb44 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3107388 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* zephyr: define lazor's batteries in device treeMichał Barnaś2021-09-032-14/+7
| | | | | | | | | | | | | | | | | | | This commit adds lazor's batteries definitions to device tree and removes old battery.c usage in Zephyr. BRANCH=main BUG=b:183544739 TEST=Compile and flash CrOS EC firmware to lazor. It should work the same as without this commit. TEST=Compile and flash Zephyr, battery should be detected correctly and its model should be logged in EC console. Change-Id: I937f7b56cb5acdea949a655cc2a107f360cbf535 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3107387 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* zephyr: define trogdor's batteries in device treeMichał Barnaś2021-09-032-6/+3
| | | | | | | | | | | | | | | | | | | This commit adds trogdor's batteries definitions to device tree and removes old battery.c usage in Zephyr. BRANCH=main BUG=b:183544739 TEST=Compile and flash CrOS EC firmware to trogdor. It should work the same as without this commit. TEST=Compile and flash Zephyr, battery should be detected correctly and its model should be logged in EC console. Change-Id: I75c30b4d278dbb88ff4e0776924d9b85d3d0b4ad Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3107386 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* zephyr: zmake: implement multiple toolchain support/probingJack Rosenthal2021-09-0113-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our GitLab builder uses different toolchains than the supported ones we use for development. At present, this means that the GitLab CI needs to call -t for each build with the desired toolchain, preventing us from using the more general commands "zmake coverage" or "zmake testall". Extend the idea of toolchain in our config files to be "supported toolchains" instead (i.e., multiple toolchains can be supported instead of one. We do this by refactoring our toolchain support code to consist of two related methods: - "probe" returns True if the toolchain is detected on the system, or False otherwise - "get_toolchain_config" returns the BuildConfig associated with the toolchain for the system, mirroring the functionality previously implemented in lambda functions. Also dropped support for arm-none-eabi, as I believe this was only used early on during scarlet development, and am not aware of any current users. BUG=b:178731498 BRANCH=none TEST=./run_tests.sh TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I9b2ad508ae6703f0c3b56518fc32606c0ff1777c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3134668 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* TCPM: Rename enum tcpm_sop_type and its constantsAbe Levkoy2021-08-311-1/+1
| | | | | | | | | | | | | | | As a followup to CL:3104290, give the TCPCI TRANSMIT and RX_BUF_FRAME_TYPE types more consistent names. Most of them can be used for receiving, not just transmitting. Fix lint errors thus revealed. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I399ec479eacc18622fc4d3f55f8bdabf4560fcff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3125995 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: herobrine_npcx9: Enable PSL and define psl-in-pads bindingWai-Hong Tam2021-08-242-0/+29
| | | | | | | | | | | | | | | | | | | | | | Enable the PSL mode for EC hibernate and define psl-in-pads DT binding. After EC enters hibernate, the PSL_OUT is off and the PPC chip is powered off. So the PPC chip can be woken up from the dead battery mode when the external AC is plugged. The DT binding is defined in the project DT. It enables the board DT more shareable, no custom-board configuration. BRANCH=None BUG=b:193583152, b:196405396 TEST=Entered EC hibernate, verified the following wake sources: * plugging AC, * pressing power button, * lid open (servo emulated). Change-Id: Ibe12d6ec45980cd41a306ad01f39e45456f3bcdd Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115437 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: herobrine: Enable shell helpKeith Short2021-08-181-0/+1
| | | | | | | | | | | | | | | Enable the shell help on Herobrine. BUG=b:192253134 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I64388ed56182f4e361bc03239101ca2fbbf32851 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3098591 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* herobrine_npcx9: Make WARM_RESET and POWER_GOOD power signalsWai-Hong Tam2021-08-181-3/+2
| | | | | | | | | | | | | | | | | | Herobrine uses the SPI mux to separate the SPI bus from the AP when programming the AP firmware. Overdriving signals on WARM_RESET is not needed. Make the WARM_RESET and POWER_GOOD GPIOs like normal power signals. BRANCH=None BUG=b:187098628 TEST=Booted AP properly. Flashed the AP firmware, even AP is off. Change-Id: Ie8e42de8174bc71c29424697810e46a2367e3e54 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3105006 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* herobrine_npcx9: Detect the Refresh key at row 3Wai-Hong Tam2021-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Herobrine uses the Vivaldi keyboard. The Refresh key is at T2 (col:2, row:3), instead of T3 (col:2, row:2). The code filters out the Refresh key and check any boot key remaining, like the Esc key. Misconfiguring it fails the recovery boot, as EC detects a redundant key pressed. BRANCH=None BUG=b:196885613 TEST=Pressed Refresh (T2) + Esc and booted EC. Checked the message: [0.005749 KB boot key mask 1] which showed the Esc key was recognized. Without this CL, the message won't show up, as a redundant key (T2 not recognized as Refresh) is pressed. Both EC-OS and Zephyr images behave the same. Change-Id: Iee82d7d4d6b3301ac342abc384488842a9858b7e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3102287 Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: add herobrine_npcx9 definitions of sku id and board versionMichał Barnaś2021-08-181-6/+30
| | | | | | | | | | | | | | | | | Add pins definitions in device tree file used to build zephyr BRANCH=main BUG=b:194136536 TEST=Build zephyr for herobrine npcx9 and verify if sku id and board version in EC console are correct. Change-Id: Ib5d36d0089e79b9202af0ecdd173490caf443e0d Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077543 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com>
* zephyr: add herobrine_npcx7 definitions of sku id and board versionMichał Barnaś2021-08-181-6/+30
| | | | | | | | | | | | | | | | | Add pins definitions in device tree file used to build zephyr BRANCH=main BUG=b:194136536 TEST=Build zephyr for herobrine npcx7 and verify if sku id and board version in EC console are correct. Change-Id: Ib47a4cafcd74c816ae26f884f811898eb2d46b89 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077542 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com>
* zephyr: add lazor definitions of sku id and board version in dtMichał Barnaś2021-08-181-6/+30
| | | | | | | | | | | | | | | | | Add pins definitions in device tree file used to build zephyr BRANCH=main BUG=b:194136536 TEST=Build zephyr for lazor and verify if sku id and board version in EC console are correct. Change-Id: Ibdc1dcb456b5cecd48ddafeafff0f765ffa45081 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077541 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com>
* zephyr: npcx_evb: add the PSL hibernate wake-up pinsJun Lin2021-08-172-6/+6
| | | | | | | | | | | | | | | | | | | | Add PSL_IN1/PSL_IN2/PSL_IN3 as the hibernate wakeup pins. Also map the non-PSL (low power RAM) hibernate wakeup source to the same pads. (i.e. GPIOD2/GPIO00/GPIO01.) Then we can use either PSL hibernate mode (CONFIG_PLATFORM_EC_HIBERNATE_PSL=y) or non-PSL hibernate mode (CONFIG_PLATFORM_EC_HIBERNATE_PSL=n) on the EVB. BUG=none BRANCH=none TEST=pass "zmake testall" TEST='hibernate' & wake-up ec by those wakeup pins. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I4175bdabee138c7bac25f8b43774268ae336d989 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3089083 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com>
* zephyr: Add switchcap for herobrine_npcx9 to device treeMichał Barnaś2021-08-166-26/+19
| | | | | | | | | | | | | | | This patch removes custom switchcap logic and uses device tree implementation instead. BRANCH=main BUG=b:194211207 TEST=Compile and flash Zephyr's EC for herobrine_npcx9 Powering on and off should work correctly Change-Id: Ice51e097c2126e78c6dbfb933a10724cf0374f67 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3089119 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: npcx_evb: Enable RTCWealian Liao2021-08-162-0/+8
| | | | | | | | | | | | | This CL enables RTC for npcx7/9_evb. BUG=none BRANCH=none TEST='rtc' console command Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Icc5d79d16ba2e4073ce39d38f0942a050d128e82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088961 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: volteer: Set fixed PD debug levelKeith Short2021-08-141-0/+2
| | | | | | | | | | | | | | | | Set a fixed PD debug level to match cros-ec builds for better size comparisons. BUG=none BRANCH=none TEST=zmake testall TEST=Boot zephyr on Volteer Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I07a4ae25901db05c8cec1485b70ffe29bb49b4f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093490 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: herobrine_npcx9: Enable tab autocompletionWai-Hong Tam2021-08-131-1/+3
| | | | | | | | | | | | | | | | | Convenient to list all possible arguments for developers who are not very familiar with the Zephyr commands. The RW code size increases from 196,200 to 197,280 bytes (diff: 1,080 bytes). BRANCH=None BUG=b:187352210, b:192253134 TEST=Typed TAB and checked all possible arguments showing up. Change-Id: I97622f32d62a9447b7b33ee085ce5413e4096f9c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094310 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: npcx_evb: Enable KeyboardWealian Liao2021-08-128-6/+74
| | | | | | | | | | | | | | | | | | This CL enables keyboard function for npcx7/9_evb. The keyboard sets to the following config: * kso0-12 are selected for keyboard scan * enable CONFIG_CROS_KB_RAW_NPCX_KSO_HIGH_DRIVE * set keyscan_config to meet the config in npcx_evb board.c BRANCH=none BUG=none TEST='ksstate on' & check actual key setting Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I059e1f8d07558a0f465769ecffd4246dcda1a608 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077764 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Fix keyscan_configWealian Liao2021-08-121-2/+0
| | | | | | | | | | | | | | | | DT_DRV_COMPAT doesn't have the compatible node. Fix it to use cros_keyscan. BRANCH=none BUG=none TEST=zmake testall TEST=check volteer & lazor key by "ksstate on" Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ib1280f64ac2fa42539fb93d24922626c9adf2278 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088960 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: rename kconfig PLATFORM_EC_VBOOTJack Rosenthal2021-08-1111-15/+15
| | | | | | | | | | | | | | | | | | | 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>