summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: drop various empty named-pwms nodesstabilize-14616.B-mainFabio Baltieri2022-03-223-12/+0
| | | | | | | | | | | | | | | Drop few empty named-pwms nodes from top level dts files. Having those laying around generates compiler warning if the board is built with CONFIG_LTO=n. BRANCH=none BUG=b:217741090 TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib18620668716e5ad9a25526585a063e356b02f20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3542405 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: change config that enables LED PWM in CMakeListsMichał Barnaś2022-03-222-2/+2
| | | | | | | | | | | | | | This commit fixes the misleading comment in lazor led implementation and changes the config option that adds the led_pwm.c to compilation. BRANCH=main BUG=b:222684744 TEST=zmake testall Change-Id: Ied2ae753b2a2e32243d07697b8fb05d4a06d1f53 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528407 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* test: Introduce system_is_locked unit testPatryk Duda2022-03-226-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | The test is intended to check system_is_locked() behaviour in the following conditions: - Hardware write protect is off - Hardware write protect is on but software write protect is off - Hardware write protect is on but software write protect is on BUG=b:217946520 BRANCH=none TEST=run_device_test.py --board dartmonkey \ --tests system_is_locked_wp_on TEST=run_device_test.py --board dartmonkey \ --tests system_is_locked_wp_off TEST=run_device_test.py --board bloonchipper \ --tests system_is_locked_wp_on TEST=run_device_test.py --board bloonchipper \ --tests system_is_locked_wp_off Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Ibf90829c4a36fb5e5c8e790c598c26297fbba5b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528399 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com>
* nivviks/usbc: enable vbus voltage monitoringDeepti Deshatty2022-03-221-2/+4
| | | | | | | | | | | | | | | | | | RAA489000 tcpc shows TCPC_REG_VBUS_VOLTAGE register value as zero always. Set bit in tcpc_config flags to enable vbus voltage reporting by tcpc. This will help to debug issues related to USB-C VBUS voltage. BUG=b:219891340 BRANCH=none TEST=TCPC RAA489000 reports measured vbus voltage in TCPC_REG_VBUS_VOLTAGE register. Change-Id: Ifa95132a9646e318b3734ab6b012de76adf47d79 Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3476655 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Nissa: Set LIS2DWL_ADDR0_FLAGS for Nivviks lid accelerometer.Sam McNally2022-03-221-0/+1
| | | | | | | | | | | | | | If unset, it defaults to LIS2DWL_ADDR1_FLAGS. On Nivviks, it should be set to LIS2DWL_ADDR0_FLAGS. BUG=b:223545495, b:225289936 TEST=ectool motionsense shows output for sensor 2 BRANCH=None Change-Id: Ic6576dc0bf88f0fb20f869361a4b7cd3054bb13d Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3538159 Reviewed-by: Andrew McRae <amcrae@google.com>
* Scout: Power off TPU and IMX8 in S0ixSue Chen2022-03-224-1/+31
| | | | | | | | | | | | | | | Turn off PP3300_TPU_A_EN and EC_IMX8_EN in S0ix. EC_IMX8_EN is for PP5000_MX8M. BUG=b:200923497 BRANCH=puff TEST=check power consumption in suspend. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I9bd4bfa945cb95d62fc104670089e51f7bbb40ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3382598 Reviewed-by: Joe Tessler <jrt@chromium.org> Commit-Queue: Joe Tessler <jrt@chromium.org>
* zephyr/ap_pwrseq: use backward-compatible powerinfo formatPeter Marheine2022-03-222-15/+15
| | | | | | | | | | | | | | | | | servo tooling expects a particular format for output from the powerinfo command. This change modifies the ap_pwrseq implementation of the command to use the same format as the old implementation, to maintain compatibility with the outside tooling that depends on it. BUG=b:224657603 TEST=`powerinfo` output now has expected format BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ideeced578dc4f5bdb9c9513524b390f701452d3a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3539774 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com>
* Banshee:Initialize the vivaldi keyboardLeo-Tsai2022-03-224-43/+82
| | | | | | | | | | | | | | | Initialize vivaldi keyboard. modify combination key row and col BUG=b:220996030,b:225754859 BRANCH=none TEST=build make -j BOARD=Banshee pass and verify with evtest 2 Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: I9e476a883016c3c24d07faf6b5926fb5c7807b2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535540 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* corsola: delay the timing to enter DP modeTing Shen2022-03-221-0/+42
| | | | | | | | | | | | | | | | | Corsola uses USB_PD_MUX_DP_ENABLED flag to select DP path, so we have to delay the USB_PD_MUX_DP_ENABLED flag toggle until attention is received. BUG=b:223087778 TEST=See DP=1 only when connected to display. No "The other port is already muxed" error BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I3563c818829407c1387016f7a7517f877b648283 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3534748 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* taeko/tarlo: Top row key T12, T13, T14 can't workamber.chen2022-03-221-6/+9
| | | | | | | | | | | | | | | To fix on top row keys T12, T13, T14 no function, search key no function, and verify on taeko and tarlo at the same time BUG=b:221390875,b:222026259 BRANCH=main TEST=make -j BOARD=taeko Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: I4a756b850df46ac30a803f2f806b882c9d70b16e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3532503 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* common: vivaldi: modify key struct to be overridableLeo-Tsai2022-03-221-1/+1
| | | | | | | | | | | | | | | | change common struct key to be overridable let board layer can customize row col struct. BUG=b:220996030 BRANCH=none TEST=build make -j BOARD=Banshee pass Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: Ic86a24b82ddee1c59474971e042ff06d69f6d69a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535539 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* dojo: Remove bringup featuresTommy Chung2022-03-221-4/+0
| | | | | | | | | | | | | | Remove bringup features from dojo since we don't need them anymore. BUG=none BRANCH=cherry TEST=make BOARD=dojo Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ibfc9601b6b4e991157720c8e6e836c769803a20f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535541 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
* gimble: remove obsolete C1 reset configurationScott Chao2022-03-221-24/+1
| | | | | | | | | | | | | | This problem was fixed by PS8815 FW version 0x3. And we are now using 0x25. BUG=b:223315425 TEST=Check with Parade Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: Ifc554ed750b1e886efe741396f6cf45bc13a1e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3533299 Tested-by: Peter Chi <peter_chi@wistron.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* taniks: fix LG battery cut off fail issuearthur.lin2022-03-221-1/+1
| | | | | | | | | | | | | | | Modify manuf_name to LGES to fix battery cut off fail issue. BUG=b:208724534 BRANCH=none TEST=make buildall -j TEST=(on taniks) use LG battery and set ectool batterycutoff. Then battery can cut off successfully. Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: Ica09f43bb4aeabbb0851b532dbbd67926425df41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3539765 Reviewed-by: Parth Malkan <parthmalkan@google.com>
* banshee: modify current limit settingMatt Wang2022-03-223-1/+42
| | | | | | | | | | | | | | | | | | | | | | | This modify is prevent the power lose when ac only power on the system. Set the 0x4C bit5 to 1 when AC only then set to 0 when battery present. When the charger input current over the InputCurrentLimit(0x3F) setting. Charger IC will decrease the Vsys until Vsys is under battery voltage and let the battery supplement the adapter(hybrid mode). Therefore, AC only mode should disable the input current limit loop for preventing Vsys drop too low and causing system shutdown. BUG=b:222038282 BRANCH=none TEST=1. AC only can power on the system to OS success. 2. AC+DC boot to OS then unplug the battery the system power not lose. 3. System can power on success from shipping mode. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Ibadef0f523eaca532ec20cbff8a17ec14b6a4d19 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3512113 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr: Add FRS enable pin to SYV682x dts binginds nodeSam Hurst2022-03-222-8/+13
| | | | | | | | | | | | | | Add the FRS enable pin property to the SYV682X PPC dts bindings node BUG=b:218692410 TEST=zmake configure -b herobrine BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I5d3385ba78dbebee229876756ef94e50ec7de75c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3537265 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* ap_pwrseq: Increase AP_PWRSEQ_STACK_SIZEPerez Priego, Bernardo2022-03-221-1/+1
| | | | | | | | | | | | | | | | | This is required to avoid stack overflow when triggering system shutdown. BUG=b:225756599 TEST=Boot SOC to OS; issue command 'shutdown -h now'; System should power down to G3. BRANCH=none Signed-off-by: Perez Priego, Bernardo <bernardo.perez.priego@intel.com> Change-Id: If7b67443b8d67ab1ff91e8b095cbcd4b28d3cabd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3541339 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Li1 Feng <li1.feng@intel.com> Commit-Queue: Andrew McRae <amcrae@google.com>
* zephyr: test: Enable USB PD rev3 for drivers buildAaron Massey2022-03-211-0/+1
| | | | | | | | | | | | | | | | | The Zephyr test-drivers build should also make use of the USB PD revision 3 to both match Herobrine and also verify most USB PD 2 features in addition to enabling verification of USB PD 3 features. Enable USB PD revision 3. BRANCH=none BUG=b:223448788 TEST=zmake configure --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ide592f558c6a809104b86be378f5e3cd0934cb33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3537254 Reviewed-by: Sam Hurst <shurst@google.com>
* zephyr test: Test port discoveryAbe Levkoy2022-03-212-0/+161
| | | | | | | | | | | | | | Add a test for port partner discovery. Add 219 lines of coverage to common/usbc. BUG=b:219556831 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ib5117bcae7f44dae74b72db428d6db6a4f207693 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498714 Reviewed-by: Sam Hurst <shurst@google.com>
* zephyr test: Support EC_CMD_TYPEC_DISCOVERYAbe Levkoy2022-03-212-0/+33
| | | | | | | | | | | | | | Add a utility function to wrap the Type-C Discovery host command. BUG=b:219556831 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I1737eadd58febfc7a4bd0a15098840ace510df08 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3502649 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr test: Support discovery VDMs in partnerAbe Levkoy2022-03-212-3/+104
| | | | | | | | | | | | | Handle port discovery VDM REQs in TCPC partner emulator. BUG=b:219556831 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I2a227c02f09c0272b3bdafe0837579e1f83b80c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498713 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* zephyr: Set gpio pin nodes and update set color fnParth Malkan2022-03-215-28/+129
| | | | | | | | | | | | | | Convert led_set_color fn to make use of devicetree to set gpio pins instead of using hard-coded GPIO pin enums BRANCH=None BUG=b:225917471, b:194430340 TEST=manual led test on lazor Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: I08f0b82d7db00370dc9ebe6e016d822645fea1cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3383912 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* guybrush: Detect and recover from hard S0ix sleep hangsRob Barnes2022-03-212-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a sleep hang is detected, a wake event is sent to the host. Sometimes this isn't enough to wake the host, aka a hard hang. When a hard hang is detected, first try to reset the AP. If this fails, aka a vary hard hang, force shutdown the AP. Also detect consecutive hard hangs and skip the AP reset and go directly to AP shutdown. This is done to avoid getting stuck in a loop and draining the battery. This change is only applied to RW to avoid the risk of getting a false positive detection during recovery. BUG=b:218892808 BRANCH=guybrush TEST=Recover from a hard suspend hang on Nipperkin with KI Recover from hard resume hang on Nipperkin with KI Recover from simulated very hard suspend hang on Nipperkin No false positives after 2500 suspend stress cycles on Nipperkin no KI Change-Id: Idf1f010c2fcdc2b561c83845dce3cdacc24f1427 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3526173 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
* zephyr: remove Volteer boardDawid Niedzwiecki2022-03-2121-1599/+16
| | | | | | | | | | | | | | | | Volteer was the first reference board with EC based on Zephyr. At this stage of migrating to Zephyr, the support for Volteer can be dropped, so remove volteer project. BUG=b:218888909 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ie78cc69e478267f45446b9d11fc2f433136ebfe0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521781 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* zephyr: add support for CONFIG_BC12_DETECT_DATA_ROLE_TRIGGERKeith Short2022-03-213-1/+12
| | | | | | | | | | | | | | | The config option CONFIG_BC12_DETECT_DATA_ROLE_TRIGGER is unconditionally enabled in the legacy EC code when using the PI3USB9201 BC1.2 chip. Add an equivalent Kconfig option. BUG=b:215776286 BRANCH=none TEST=Connect DCP device, verify charging at 1.5 A Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Idd762d8801ad7e62c02e36c892d5e49a01068d92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3536624 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: add common tcpc_config shimTing Shen2022-03-218-46/+113
| | | | | | | | | | | | | | | | | Move the ps8xxx tcpc_config definition to a common file, and add support for two more drivers: it8xxx2 and tcpci. BUG=b:220814055 TEST=1) Pass the device tree unit test in CL:3521085 2) zmake configure -b {krabby,herobrine} BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I4e646e90fc6529f1d80cb94db54503cea50ba8fd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521086 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: remove the named-ioexes and move ioex logic to gpioMichał Barnaś2022-03-2115-636/+258
| | | | | | | | | | | | | | | This commit removes the named-ioexes node in device tree and moves the io expanders logic to gpio one. The ioex_* functions are now a wrappers to gpio_* ones. BRANCH=main BUG=b:216644442 TEST=zmake testall Change-Id: I61b341a1b968ce376b0420ff05b50f910c75a168 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3471601 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* primus: remove CONFIG_SYSTEM_UNLOCKEDZhuohao Lee2022-03-211-2/+0
| | | | | | | | | | | | | | The CONFIG_SYSTEM_UNLOCKED is not required now. Let's remove it from the setting. BUG=b:225786668 TEST=make BOARD=primus Change-Id: I682e026e00122c5739e06eb2a91bc6184a52bbf1 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3537003 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* brya: enable CONFIG_BOARD_HAS_RTC_RESET for brya baseboardSugnan Prabhu S2022-03-211-7/+3
| | | | | | | | | | | | | | | | | | | This patch enables CONFIG_BOARD_HAS_RTC_RESET for brya baseboard by updating the S5 wait timeout value. This reverts commit 7aa6adaf53f99f3b3d03fbd935c930ce3f46cc66. BRANCH=None BUG=b:191742284 TEST=Boot test on Brya with the DAM enabled coreboot Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com> Change-Id: I6332418aad97048485ef895aa4b798101dc0c38d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3432665 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.corp-partner.google.com>
* npcx: adc: support faster ADC conversion speedJun Lin2022-03-211-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | In the ADC keyboard scan application, it requires higher ADC sampling time to meet the keyboard scan timing specification. To meet the timing constraint, this CL increases the ADC clock frequency from ~2 to 7.5 MHz. This change can apply to npcx7 and later chips because the basic clock (APB1) of the ADC module is at 15 MHz. For npcx5, the ADC clock frequency keeps at ~2 MHz because the APB1 clock is at (15/4) MHz. BUG=b:208773873 BRANCH=none test=read 8 ADC channels in board npcx9_evb via console command "adc"; it spent ~0.92 milli-seconds to read 8 ADC channels; test = "make buildall" Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ife59f667b1aafc926b2ad05209e7cc6185b82f21 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3505688 Reviewed-by: Parth Malkan <parthmalkan@google.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* Taniks: Enable RGB keyboardfactory-guybrush-14600.B-mainDaisuke Nojiri2022-03-197-22/+64
| | | | | | | | | | | | | | This patch enables the RGB keyboard module for Taniks. BUG=b:199995751 BRANCH=None TEST=make BOARD=taniks Change-Id: I2d95bb2f56a5f8e6505cb902aa67ee05e053acf3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3394288 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* flash_fp_mcu: Add power en gpio on strongbadStephen Boyd2022-03-181-3/+8
| | | | | | | | | | | | | | | There's a gpio for the power enable signal in the latest revision of the hardware (i.e. not rev0/rev1). Search for the gpio by name and use -1 if it fails. BRANCH=none BUG=b:179839337 TEST=flash_fp_mcu on coachz (rev1/rev3) Change-Id: I047236bd9a7bd3b34f2771576ff2b31952e0b094 Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3534745 Reviewed-by: Alexandru Stan <amstan@chromium.org>
* zephyr: test-drivers: Set EC GPIO init before I2CJack Rosenthal2022-03-182-0/+5
| | | | | | | | | | | | | | | | | CL:3520139 changes the I2C init priority from 60 to 50, thus, blowing up a write failed when GPIO wasn't initialized yet. Change the init priority for this test. BUG=none BRANCH=none TEST=With CL:3520139, test passes Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I3ccfbbb2bb160b9b94a29dc10c8a6847221548d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3536610 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* sn5s330: return when PP FET cannot be enabledTristan Honscheid2022-03-181-0/+3
| | | | | | | | | | | | | | | | | | Bug fixed identified while writing unit tests: the init function should return an error code when the sn5s330_pp_fet_enable() function fails. The fixed code is the intended behavior according to Aseda (aaboagye@google.com), who wrote the original driver. BRANCH=None BUG=b:225245353 TEST=zmake -D configure --test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ib85b67da98832cef6b0f820323eae270392bc4f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535000 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: zmake: Add warnings about deprecated flagsJack Rosenthal2022-03-181-0/+9
| | | | | | | | | | | | | | | | | | Hopefully we can get people to stop using these flags as we want to remove them. Let this land for a week or so then we can rip the band-aid. BUG=b:225379781 BRANCH=none TEST="zmake configure -b lazor" -> see warning "zmake configure --test test-drivers" -> see warning "zmake test test-drivers" -> no warning Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ia6e33f438237a5541cacb51b2479d8554197dbac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3536609 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Add tests for motion_sense host commandsYuval Peress2022-03-183-0/+95
| | | | | | | | | | | | | | | | Add tests for the `dump` motion-sense host command. These tests do not cover the case where the report size is larger than motion_sensor_count. This can only be done with activity sensors which have not yet been added to the drivers test. BRANCH=none BUG=b:224614211 TEST=zmake test test-drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I1e2fb22b29fbcc20c42070eaae258761e9816ccc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3530114 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: emul: Add support for reset message from partnerTomasz Michalec2022-03-181-22/+43
| | | | | | | | | | | | | | | | | Add support in TCPCI emulator to send HardReset and CableReset from partner emulator. These two messages are handled differently and require additional actions in TCPCI upon receiving. BUG=b:223766685 BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I1adfdb7dc363fedd62937e76f66862aa32f9eceb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528404 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com>
* zephyr: emul: Add support for RECEIVE_DETECT in TCPCITomasz Michalec2022-03-1810-41/+135
| | | | | | | | | | | | | | | | | | | TCPCI handle RECEIVE_DETECT register properly. TCPM should set this register only when it is ready to receive this certain kind of messages. Partner emulators are notified when send fail because of RECEIVE_DETECT value. In real world it would be the same as not receiving GoodCRC message from partner point of view. BUG=b:224927648 BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ia6f2c16e94c600a81b9071d11ea79514f02a2081 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3515942 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com>
* zephyr: emul: Resend source capabilitiesTomasz Michalec2022-03-186-18/+174
| | | | | | | | | | | | | | | | | Resend source capabilities message from TCPC source partner emulator, when previous message couldn't be send. This is in line with PD specification. BUG=b:224927648 BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I34a6b3d08546f3a17dcad629f4c6f09cd189f15f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528403 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: emul: Add disconnect callback to TCPCI partnerTomasz Michalec2022-03-188-52/+138
| | | | | | | | | | | | | | | | | | | Add disconnect callback which is used by TCPCI to inform partner emulator. Partner emulator clears delayed messages queue and stops timers on disconnection. PD messages cannot be send when partner emulator is disconnected. BUG=none BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Idd3023a268affcdd1417b40745a24e297df74f8e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528402 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com>
* zephyr: emul: Fix TCPCI partner emulator hard resetTomasz Michalec2022-03-186-17/+26
| | | | | | | | | | | | | | | | | Sink and source TCPCI partner emulators require pointer to emulator data, not emulator structure in hard reset callback function. DRP TCPCI partner still uses emulator structure. BUG=none BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I0da673fbeeb3c8ae082987bf0ef21cb7d8d8fed2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528401 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: emul: generate I2C error on too short TCPCI messageTomasz Michalec2022-03-181-0/+8
| | | | | | | | | | | | | | | | TCPCI should generate a FAULT_STATUS.I2CInterfaceError on transmitting too short SOP* message. BUG=b:223766685 BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ife86d0581de01fb8980e58ecd675fcafa3e670ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3515941 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: emul: Fix sending Hard and Cable reset in TCPCI emulatorTomasz Michalec2022-03-183-31/+90
| | | | | | | | | | | | | | | | | | | | | Transmitting Hard or Cable reset should alywas set TransmitSOP*MessageSuccessful and TransmitSOP*MessageFailed bits in ALERT register. Now partner emulators aren't reporting message status using tcpci_emul_partner_msg_status() when receive Hard or Cable reset. Instead TCPCI emulator transmit handler set correct ALERT state. Additionally transmitting Hard Reset sets RECEIVE_DETECT register to 0, clears receive buffer and resets mask registers. BUG=b:223766685 BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I686e4001b65cc05621563861903c76e620224e3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3515940 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* Banshee: Remove useless functionLeo-Tsai2022-03-183-129/+5
| | | | | | | | | | | | | | | | This patch removes useless function as following: 1. Remove Accelerometers. 2. Remove tablet mode. BUG=none BRANCH=none TEST=make BOARD=banshee Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: Id24a45e80e276175594d7fe35ac39e642da07811 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3511588 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* krabby: workaround for RT9490 IBUS ADCTing Shen2022-03-182-1/+43
| | | | | | | | | | | | | | | | | Implemented the IBUS ADC workaround for krabby rev0. The code is provided from vendor in b/194967754#comment5. BUG=b:194967754 TEST=none BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I4ea98aa91a0d35b8b8665c08db413c0503f7baef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3415389 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: Add tests for motion_sense.h inline static functionsYuval Peress2022-03-181-0/+35
| | | | | | | | | | | | | | Get the motion_sense header to 100% coverage by testing a simple copy function and a clamp function. BRANCH=none BUG=b:224614211 TEST=zmake test test-drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ibe254e04ad93f3014d64355fd5a281b1ce98e2c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3530113 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: add tests to math library to fill in the gapsYuval Peress2022-03-1810-0/+173
| | | | | | | | | | | | | Get the coverage of the math_util.c file to 100% BRANCH=none BUG=b:224582527 TEST=zmake test test-math_float && zmake test test-math_fixed Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Iae45f38b56c4bd2573e9981af59edbda0c72e04a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3530112 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Zephyr: Correct adlrvp and intelrvp baseboard to select correct configBrandon Breitenstein2022-03-174-2/+3
| | | | | | | | | | | | | | | Since there are now multiple intelrvp boards no longer select the power sequencing in the baseboard and move the selection to the specific rvp. Also set the default for icelake to n to avoid always pulling it. BUG=none BRANCH=none TEST=zmake testall and verify that there are no build issues with new prj.conf Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com> Change-Id: I266d74b75628156668ec9d40f6ffec7315c53224 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3516596 Reviewed-by: Keith Short <keithshort@chromium.org>
* power: Add chipset and board callbacks for sleep hangsRob Barnes2022-03-178-26/+79
| | | | | | | | | | | | | | | | | | Instead of passing a callback to host_sleep, define overridable board and chipset callbacks for sleep hang detection. Introduce a sleep_hang_type enum that identifies the type of sleep hang (suspend or resume). These changes make it eaier for boards to implement custom logic to handle sleep hangs. BUG=b:218892808 BRANCH=guybrush TEST=Observe suspend hang detection on Nipperkin with KI Change-Id: Ifacf90f808b1447633f7cfc2d570209d1e233950 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3529606 Reviewed-by: Diana Z <dzigterman@chromium.org>
* test-drivers: Specify sources explicitlyAbe Levkoy2022-03-171-2/+45
| | | | | | | | | | | | | Do not use globs to avoid stale dependencies during incremental builds. BUG=b:222148760 TEST=zmake testall -c; no change in covered lines BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I36851a88511f3a2fdf0f945146cc534ddc477f7c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498712 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>