summaryrefslogtreecommitdiff
path: root/zephyr
Commit message (Collapse)AuthorAgeFilesLines
* kingler: fix board_vbus_source_enabledEric Yilun Lin2022-03-301-7/+1
| | | | | | | | | | | | | | | | | We use PPC nx20p3483 for source control. Also, drop unused function board_is_sourcing_vbus. BUG=b:223086905 TEST=FRS on C1 works BRANCH=none Change-Id: I19c28342a9544b7d094b4cc34389d003bbcbad45 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3512414 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* nissa/nereid: run USB-A configuration when port is presentPeter Marheine2022-03-301-13/+28
| | | | | | | | | | | | | | | | | | | The previous code configured the USB-A sub-board port in one configuration where it was missing (the LTE board) and didn't configure it in one configuration where it was present (the HDMI board). This corrects that mistake and reorganizes the sub-board configuration code for greater clarity. BUG=b:226513609 TEST=sb_2 now gets enabled when the AP is on when using the HDMI sub-board, and devices connected to the sub-board USB-A port work as expected. BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I3b41816361ce5e8273d80327ccfaf957e724d51a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3559689 Reviewed-by: Andrew McRae <amcrae@google.com>
* nissa: Add LED handling for nivviks and nereidAndrew McRae2022-03-305-1/+91
| | | | | | | | | | | | | Add LED configuration for nivviks and nereid BUG=b:225323731 TEST=zmake build nivviks; flash and look at LEDs BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ib46ffe48deb7c30948169b14b55ea48c3999e438 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3554171 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: Add alternative LED handlingAndrew McRae2022-03-3013-0/+1201
| | | | | | | | | | | | | | | | | | | | | | | | Add alternative LED handling. Provides a Zephyr based LED module that splits policy from LED behaviour and actions. Supports both multi or single PWM and GPIO based LEDs. v2: Use range instead of value, allow alt-colors for flash. v3: Use common dts and add LED PWM config to nereid. v4: Reworked to allow multiple color sets cycling through. Added charger support. v5: Added skeleton of GPIO support. Added common LED API. v6: Split from Nissa config v7: Move actions into policy. BUG=b:225323731 TEST=zmake build nivviks; flash and look at LEDs BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ied03970b6c4a50fe78f3bf7763672239a76a64b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3545737 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* ap_pwrseq: disable resume init events if disabled by configPeter Marheine2022-03-293-5/+7
| | | | | | | | | | | | | | | | The legacy code avoids even defining these hooks if configuration says to disable them; this code should do the same so it's a compile-time error to define handlers if it's disabled, rather than silently doing nothing. BUG=b:226513200 TEST=zmake testall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I15d32a212d8d3d0aaaa8b7fe9345409bab75af75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3554173 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Li1 Feng <li1.feng@intel.com>
* zephyr: isl923x: Test system_jumped_late() branch in init functionTristan Honscheid2022-03-291-4/+20
| | | | | | | | | | | | | | | | The isl923x init function returns early and skips setting a current limit if run again when the system jumped late. Add a test to ensure the current limit is still set when this happens. BRANCH=None BUG=b:219520539 TEST=zmake -D test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I413a025d2516824892719d3d9dd507727f6e8260 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3558910 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* sn5s330: Test system_jumped_late() branch in init funcTristan Honscheid2022-03-291-0/+49
| | | | | | | | | | | | | | | | * Add two interrupt tests to make sure they still work when init() is called again under a late jump scenario because interrupt setup is skipped by the init function after a late jump. BRANCH=None BUG=b:225245353 TEST=zmake -D test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Idc0c131b231c4931ad59190e55b8988876548801 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546943 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* zephyr: sn5s330: Move #ifdef to correct testTristan Honscheid2022-03-291-6/+5
| | | | | | | | | | | | | | | Per @aaronmassey, this #ifdef statement should not actually be there and belongs on test_sn5s330_set_vconn_fet. Use the preferred style for conditionally excluding tests. BRANCH=None BUG=b:225245353 TEST=zmake -D test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Id2035aa9d90841d81d814438cf9f4ac4d8e2e2ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3558909 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: add support for tcpc fusb302 in device treeRajesh Kumar2022-03-293-1/+46
| | | | | | | | | | | | | | | | | This commit adds support for tcpc fusb302 definition in device tree. It will allow to remove board specific files which implemented the tcpc fusb302 functionality. BRANCH=none BUG=none TEST=zmake configure -b adlrvp_npcx Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I096da76a3052cd6404fb55cb68451cd725b33184 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3524221 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* nissa: Add Nivviks ADC power signal handlingAndrew McRae2022-03-293-4/+49
| | | | | | | | | | | | | | | | | | | | | Split from chromium:3389663 Adds ADC signal processing for 3.3V and 1.05V rails. Depends-on: - https://github.com/zephyrproject-rtos/zephyr/pull/43398 - https://github.com/zephyrproject-rtos/zephyr/pull/41515 BUG=b:216667527 TEST=zmake build nivviks; flash and run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I55203f1c18ae5fca059cd3ff988cea025614ae74 Signed-off-by: Perez Priego, Bernardo <bernardo.perez.priego@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3518911 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
* nissa: Add keyboard scan customisationAndrew McRae2022-03-291-0/+24
| | | | | | | | | | | | | Add the top row keyboard customisation for Nissa. BUG=b:226296642 TEST=zmake build nivviks; flash and run, check evtest BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ia55784552f780bb0d9024de3c5ef46fb21e35eb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3557929 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: Consolidate stack size configurationAndrew McRae2022-03-293-125/+54
| | | | | | | | | | | | | | Consolidate the task stack size configuration in one config file for clarity. BUG=none TEST=zmake build {nivviks,nereid} BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Id4b818e40e2d1a5c324da9f9b49bc4d912bbba80 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3522467 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: eliminate use of node path for battery supportDawid Niedzwiecki2022-03-2914-27/+27
| | | | | | | | | | | | | | | | | | Creating the array board_battery_info bases on DT_PATH(batteries) call. Change it to use a compatible string that is more consistent and doesn't depend on a node name. Use "battery-smart" for that purpose. The commit shouldn't change the output binaries. BUG=b:226404277 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0c6ab3a02eb21c78c2b89480880a0d2ae8af3abb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3548917 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: adlrvp: Add support to get Board IDRajesh Kumar2022-03-299-1/+196
| | | | | | | | | | | | | | | Add support to get Board ID for ADL RVP BUG=b:218684235 BRANCH=none TEST=zmake configure -B ~/tmp/adlrvp_npcx/ adlrvp_npcx -b EC Boot up logs: BID:0x13, FID:0x1, BOM:0x4 Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I181e8c6eb5235547b36adf76519b3155affac572 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3462922 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: add FPU tests to math libYuval Peress2022-03-291-4/+3
| | | | | | | | | | | | | | | | Add the host test to BUILD.py for the math lib. Everything was already done and tested, the only blocked was an upstream change to enable the FPU. BRANCH=none BUG=b:224582527 TEST=zmake test test-math_float Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I7000237f79367c0f89f28e6da1f1125bfec0aa99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556287 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: map legacy hook priorities to Zephyr prioritiesKeith Short2022-03-292-2/+2
| | | | | | | | | | | | | | Map the HOOK_PRIO_PRE_DEFAULT, HOOK_PRIO_DEFAULT, and HOOK_PRIO_POST_DEFAULT to the Zephyr equivalents. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Icf7332bb8341adff185754ef159a83d1b4a8a824 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553850 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: shim: convert HOOK_INIT to SYS_INITKeith Short2022-03-298-18/+40
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ie046e07cf78a4f4b3704401a605d2fb15069479e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553849 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* lazor: convert HOOK_INIT to SYS_INITKeith Short2022-03-293-7/+25
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibab4047ffcba70606eea81d863e6d9db6219eb7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553848 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* skyrim: convert HOOK_INIT to SYS_INITKeith Short2022-03-295-18/+43
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ieec1ede6562a9faa62c838160f05b19f561f4166 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553847 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* nissa: convert HOOK_INIT to SYS_INITKeith Short2022-03-293-9/+22
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9fde383e7ee7ebf5e939e39ac4145b1d585b4a67 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553846 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* intelrvp: convert HOOK_INIT to SYS_INITKeith Short2022-03-291-2/+5
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If9c2313405aa4f38ad42503b8337dd565a26bd90 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553845 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* herobrine: convert HOOK_INIT to SYS_INITKeith Short2022-03-293-7/+21
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I40f720f4c4ff77b2644b22ea837caec8f68db87c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553844 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* corsola: convert HOOK_INIT to SYS_INITKeith Short2022-03-299-22/+59
| | | | | | | | | | | | | Convert all HOOK_INIT calls to the equivalent SYS_INIT. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib63d32bf88bbbcc74f1dc417c9e4b7ebd5ac5027 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553843 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* zephyr: brya: Convert HOOK_INIT to SYS_INITKeith Short2022-03-291-3/+5
| | | | | | | | | | | | | Convert HOOK_INIT to the equivalent SYS_INIT call. BUG=b:226434387 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If4a3dca9c8ec920946589c717599d3db51838cf1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553842 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: convert HOOK_INIT into SYS_INITKeith Short2022-03-293-42/+28
| | | | | | | | | | | | | | | | Convert HOOK_INIT calls to SYS_INIT. This creates wrappers for each HOOK_INIT to accommodate the unused, but required device driver instance structure. BUG=none BRANCH=none TEST=zmake testall TEST=Verify zephyr boots to OS on brya Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ie09add55a355d76e56fb324767f990ffd6d57bba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553841 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* hooks: add HOOK_PRIO_POST_FIRSTKeith Short2022-03-292-2/+2
| | | | | | | | | | | | | | Add the HOOK_PRIO_POST_FIRST alias for (HOOK_PRIO_INIT_FIRST+1). This more clearly identifies the intent of this priority level. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I1e14855b5d6cabe9af4307aa8451187b5f694e04 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553839 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* hooks: add HOOK_PRIO_POST_DEFAULTKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | | | Add the HOOK_PRIO_POST_DEFAULT alias for (HOOK_PRIO_DEFAULT+1). This more clearly identifies the intent of this priority level. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I58debd5545386a0ca01ebe59a431a2cfa997a32a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553677 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* hooks: add HOOK_PRIO_PRE_DEFAULTKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | | | Add the HOOK_PRIO_PRE_DEFAULT alias for (HOOK_PRIO_DEFAULT-1). This more clearly identifies the intent of this priority level. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I96d2a9951b3585ea07c28aa518204d1e20f306de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553676 Reviewed-by: Sam Hurst <shurst@google.com>
* hooks: add HOOK_PRIO_POST_CHIPSETKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | | | Add the HOOK_PRIO_POST_CHIPSET alias for (HOOK_PRIO_INIT_CHARGE_CHIPSET+1). This more clearly identifies the intent of this priority level. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I2fee7c2c055d6b361871620aea74b92977dd31d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553675 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* hooks: add HOOK_PRIO_POST_PWMKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | | Add the HOOK_PRIO_POST_PWM alias for (HOOK_PRIO_INIT_PWM+1). This more clearly identifies the intent of this priority level. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I2a589f0841c713d34434d9aae89b05db0a42c86e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553671 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* hooks: Create HOOK_PRIO_PRE_I2CKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | Replace (HOOK_PRIO_INIT_I2C-1) instances with (HOOK_PRIO_PRE_I2C). BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Id72dc7f6b80a36c2692e742a322022601450fd8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553670 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* hooks: add HOOK_PRIO_POST_I2CKeith Short2022-03-2910-10/+10
| | | | | | | | | | | | | | | | | 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: test: move include files to scoped directoryYuval Peress2022-03-2954-84/+84
| | | | | | | | | | | | | | | | The include path was getting too cluttered. In some cases seeing an include for "utils.h" and "util.h". These were difficult to understand, follow, and ensure uniqueness. Move all the test specific headers to their own path. BRANCH=none BUG=none TEST=zmake test test-drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Iab5e4d470321edb356c8b30f94c79b2ce1f38866 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556801 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: emul: fix tcpci dependency on test/driversYuval Peress2022-03-291-13/+13
| | | | | | | | | | | | | | | | Since emulators are only meant to be run in POSIX, we don't need Zephyr's heap abstraction here. Can just use malloc and free directly. Moving to these removes a dependency on the user having a utils.h with test_malloc and test_free defined. BRANCH=none BUG=none TEST=zmake test test-drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I5dccf85a05a366a1e7db98b4556ed03e59148ed4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3558209 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: mchp: Add shim Kconfigmartin yan2022-03-293-0/+34
| | | | | | | | | | | | | Add shim layer Kconfig and CMakeLists BUG=none BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: If768fbc694339d2e6439f30be54111c7a5aa9a28 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546985 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: mchp: Add shim flashmartin yan2022-03-294-0/+260
| | | | | | | | | | | | | Add shim layer flash code BUG=b:226599277 BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I509d27ec06922a0f51759fbf8c100f43e2ce08e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546981 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: mchp: Add shim kscanmartin yan2022-03-291-0/+24
| | | | | | | | | | | | | Add shim layer kscan code BUG=none BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I2b319e0ed90b9f65961c31a6ab2ccc7525dd6040 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546984 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: remove prompt for wakeup-mask KconfigsMichał Barnaś2022-03-296-20/+4
| | | | | | | | | | | | | | | | 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>
* nissa/nereid: increase C1 charger interrupt priorityPeter Marheine2022-03-291-1/+23
| | | | | | | | | | | | | | | | | Drawcia uses the same general topology on USB-C where chargers and TCPCs share an interrupt line, which was found to cause problems with excessive interrupt latency and fixed in commit e858299538e00490ccbab65e199307c455a7d1c8. This change does the same prioritization for Nereid. BUG=b:226669197 TEST=PD is no longer flaky on C1 with some partners sending hard resets BRANCH=none Change-Id: Ied32abc07f1b1c9b3c89130941f87cd469435630 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3554376 Reviewed-by: Andrew McRae <amcrae@google.com>
* kingler: set PD debug level to 2Eric Yilun Lin2022-03-291-1/+1
| | | | | | | | | | | | | | | | It hinders the FRS with massive logs, so disable it. BUG=b:223086905 TEST=C1 FRS works BRANCH=none Change-Id: Idebf58a15745db1d1b7a5e474596574cab1e9b3e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3512413 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* nissa/nereid: use TCPCI mux on usb-C1Peter Marheine2022-03-291-0/+15
| | | | | | | | | | | | | | | | | | | | The integrated mux in the PS8745 on the type-C sub-boards is controlled by the standard Config_Standard_Output register, but needs to be hooked up in the EC as a USB mux. Do that. PS8xxx also has a custom mux function for generating HPD on AUX to the AP, which should be used: we don't use a separate GPIO for HPD on this platform. BUG=b:226528343 TEST=`i2c read_byte I2C_SUB_C1_TCPC 0xb 0x18` changes to 0x68 for DP mode and back to 0x60 when a display is unplugged. BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ic14c53a3055233b450b4d6d6262de9db9741f3ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3555337 Reviewed-by: Andrew McRae <amcrae@google.com>
* USBHC: Add USB host command interfaceDaisuke Nojiri2022-03-292-0/+11
| | | | | | | | | | | | | | This patch adds a host command interface for USB. BUG=b:211496726 BRANCH=None TEST=Prism on Vell. Change-Id: Icead7a1bdc593b3c4740ede0ddd5fc2cf5700bfa Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3354039 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* Revert "nissa: Disable Power Management on nivviks"Peter Marheine2022-03-291-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 141901f91444de85bc4f492109a5b348038aa3af. Reason for revert: fixed by https://crrev.com/c/3555433 Original change's description: > nissa: Disable Power Management on nivviks > > Enabling the PM configuration causes a boot loop in nivviks. > > BUG=b:227002506 > TEST=zmake build nivviks; flash and run > BRANCH=none > > Signed-off-by: Andrew McRae <amcrae@google.com> > Change-Id: I196634c61349b2452381a100ad0fb34ebe9932ae > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3554165 > Reviewed-by: Peter Marheine <pmarheine@chromium.org> Bug: b:227002506 Change-Id: Iff54a555c9efb855a03ef0a3aef0d99462a9aa18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3551384 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Andrew McRae <amcrae@google.com> Tested-by: Andrew McRae <amcrae@google.com>
* zephyr: test: add missing .c files to testsYuval Peress2022-03-291-0/+2
| | | | | | | | | | | BRANCH=none BUG=none TEST=zmake test test-drivers Change-Id: I76811bab779cbf280682fd7c10e9630469f69b22 Signed-off-by: Yuval Peress <peress@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556500 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr:test: Add tests for CHARGER_RAMP_HWAl Semjonovs2022-03-294-4/+80
| | | | | | | | | | | | | Add tests for CHARGER_RAMP_HW BRANCH=none BUG=none TEST=zmake -D configure --coverage --test zephyr/test/drivers/ Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: I37e401ebc2ae4b6be3203409473d2ea1ebf88f12 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3523681 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: Add tests for AMON/BMONAl Semjonovs2022-03-296-1/+167
| | | | | | | | | | | | | Add test cases to validate AMON/BMON BRANCH=none BUG=b:184856906 TEST=zmake -D configure --coverage --test zephyr/test/drivers/ Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: Ia802e4c5c0203a8c0cd20925b8da3e7be68e174d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3454204 Reviewed-by: Yuval Peress <peress@google.com>
* Skyrim: Enable 4-byte port 80 codesDiana Z2022-03-291-0/+1
| | | | | | | | | | | | | | | | Enable the 4-byte port 80s we expect to see during boot. BRANCH=None BUG=b:226635441 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib5c984104fe11af6fbc15a371ff092ee40de1997 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556495 Reviewed-by: Raul Rangel <rrangel@chromium.org> Commit-Queue: Raul Rangel <rrangel@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Add mock for system_jumped_late() functionTristan Honscheid2022-03-282-0/+7
| | | | | | | | | | | | | | | | | | Certain drivers behave differently when the system has performed a late jump. For example, the SN5S330 skips certain initialization steps if its init function runs a second time under a late-jump situation. To allow testing these different branches in unit tests, add around this function. By default, its return value is `0`, indicating no late jump. BRANCH=None BUG=b:225245353 TEST=zmake -D configure --test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I2dc2132db3363606f0896d9c817e271ff3912190 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3552704 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: power_policy: Function content has changedTim Lin2022-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream change updated the function. From: bool pm_constraint_get(enum pm_state state) { return (atomic_get(&power_state_disable_count[state]) == 0); } To: bool pm_policy_state_lock_is_active(enum pm_state state) { return (atomic_get(&state_lock_cnt[state]) != 0); } So the function behavior here should be corrected. BRANCH=none BUG=none TEST=zmake build it8xxx2_evb --clobber It is normal to enter idle mode. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I570dad287b2eaa76c3ff522bd03e2b7b8c01e077 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3551740 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: drivers/cros_flash: it8xxx2: Add flash protect lock settingTim Lin2022-03-281-0/+10
| | | | | | | | | | | | | | | Add flash protect lock register setting. BUG=b:225013084 TEST=zmake build it8xxx2_evb --clobber BRANCH=none Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I923f6c05d118266bd94829674973b451cc6428ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3531871 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>