summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hooks: add HOOK_PRIO_POST_POWER_BUTTONKeith Short2022-03-292-1/+2
| | | | | | | | | | | | | | | Add the HOOK_PRIO_POST_POWER_BUTTON alias for (HOOK_PRIO_INIT_POWER_BUTTON+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: Icc009a74cb87d3fdec1360e00bb41fdbb10a6e8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553678 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* hooks: add HOOK_PRIO_POST_DEFAULTKeith Short2022-03-292-1/+2
| | | | | | | | | | | | | | | 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-293-2/+3
| | | | | | | | | | | | | | | 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-294-3/+4
| | | | | | | | | | | | | | | 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_CHARGE_MANAGERKeith Short2022-03-292-1/+2
| | | | | | | | | | | | | | | Add the HOOK_PRIO_POST_CHARGE_MANAGER alias for (HOOK_PRIO_INIT_CHARGE_MANAGER+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: Id21405148cae59d8c2cf3a0519124b45e03a2c39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553674 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* hooks: rename charger init priority to match othersKeith Short2022-03-2911-12/+12
| | | | | | | | | | | | | | Rename HOOK_PRIO_CHARGE_MANAGER_INIT to HOOK_PRIO_INIT_CHARGE_MANAGER, matching the pattern used for the other initialization priorities. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Icb80b3cb1297888fcde2eb7d6de86fbc215fe212 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553673 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* hooks: add HOOK_PRIO_POST_LIDKeith Short2022-03-293-4/+5
| | | | | | | | | | | | | | Add the HOOK_PRIO_POST_LID alias for (HOOK_PRIO_INIT_LID+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: I7042b7f4244b5ed48dac67dc9eb4deaca81000b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553672 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* hooks: add HOOK_PRIO_POST_PWMKeith Short2022-03-293-2/+3
| | | | | | | | | | | | | | 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-292-1/+2
| | | | | | | | | | | | | 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-2914-13/+14
| | | | | | | | | | | | | | | | | 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>
* COIL: update chip/max32660Ricardo Quesada2022-03-292-125/+126
| | | | | | | | | | | | | | | | | This CL updates chip/max32660 according to the COIL guidelines. This CL only updates "slave" with "target". BRANCH=None BUG=b:163885307 TEST=compare_build.sh -b max32660-eval matches Change-Id: Ia2a2a9b8dca37cc190afda3f9281a77665191a2d Signed-off-by: Ricardo Quesada <ricardoq@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556503 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Ricardo Quesada <ricardoq@chromium.org> Tested-by: Ricardo Quesada <ricardoq@chromium.org> Auto-Submit: Ricardo Quesada <ricardoq@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>
* COIL: update chip/max32660Ricardo Quesada2022-03-292-167/+185
| | | | | | | | | | | | | | | | | This CL updates chip/max32660 according to the COIL guidelines. This CL only updates "master" with "controller". BRANCH=None BUG=b:163885307 TEST=compare_build.sh -b max32660-eval matches Change-Id: I8c4e7d7f2a90e46d2f4694ae936ed4447a72c229 Signed-off-by: Ricardo Quesada <ricardoq@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3555432 Tested-by: Ricardo Quesada <ricardoq@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Ricardo Quesada <ricardoq@chromium.org> Auto-Submit: Ricardo Quesada <ricardoq@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: update documentation after removing prompt for mkbp masksMichał Barnaś2022-03-291-12/+3
| | | | | | | | | | | | | | Remove the sentences that reference the mkbp wake-up masks Kconfigs and write that the Kconfigs are automatically selected. BRANCH=main BUG=b:222689734 TEST=read the doc Change-Id: I93424494f4e25c7ea22f9208106440b92c1568a6 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3550277 Reviewed-by: Keith Short <keithshort@chromium.org>
* 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>
* kinox: modify GPIO initial settingMatt Wang2022-03-298-406/+93
| | | | | | | | | | | | | | | | | | Modify the GPIO,TCPC,PPC,MUX,I2C setting base on the LA-M451PR01_20220304B.pdf. And remove the unused code. BUG=b:223950161 BRANCH=none TEST=make BOARD=kinox, On brask power on success. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Ia3242051c008273c388d8c39aa2a917c979e3e41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508119 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* 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>
* Prism: Enable USB host commandDaisuke Nojiri2022-03-293-4/+12
| | | | | | | | | | | | | | This patch enables a USB host command handler endpoint for Prism. BUG=b:223465912 BRANCH=None TEST=Prism on Vell. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Id29b91c38328b394ff20ec981a9c749eca792cce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546568 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* USBHC: Add USB host command interfaceDaisuke Nojiri2022-03-297-0/+296
| | | | | | | | | | | | | | 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>
* kappa: Fix LGC MPPHPPFO021C battery C/DFET reading methodDevin Lu2022-03-291-4/+4
| | | | | | | | | | | | | | LGC MPPHPPFO021C chagne BMU from TI bq40z551 to Renesas RAJ240045, This patch is the correct method to read C/D FET status. BUG=b:216430224 BRANCH=firmware-kukui-12573.B TEST=On Kappa, LGC battery can be recognized. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Iac204d59554bdc0532d39504b11b1e201bea0390 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3551998 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* ectool: Add USB interfaceDaisuke Nojiri2022-03-295-3/+409
| | | | | | | | | | | | | | | | | | | | | | | | Currently, ectool doesn't support USB as a host command protocol interface. This patch adds USB to ectool. localhost ~ # ectool --device 18d1:5022 version RO version: prism_v2.0.13019+1b97300a33 RO cros fwid: prism_14581.0.22_03_23 RW version: prism_v2.0.13019+1b97300a33 RW cros fwid: prism_14581.0.22_03_23 Firmware copy: RW Build info: prism_v2.0.13019+1b97300a33 prism_14581.0.22_03... Tool version: 1.1.9999-f8ebe02 @localhost BUG=b:211496726 BRANCH=None TEST=See above. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Iee4bbeb745e26ec3236233487ac4e8adcd1fb038 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546567 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* Banshee: modify fan frequencyfelixtwchang2022-03-291-2/+2
| | | | | | | | | | | | | | | Modify the Fan frequency to 25KHz to meet fan spec and remove the PWM_CONFIG_DSLEEP. BUG=b:223492897 BRANCH=none TEST=Use ectool commands to control and test with low, middle and high rpm. Signed-off-by: felixtwchang <felixtw_chang@compal.corp-partner.google.com> Change-Id: I96845d9b61dd8f0b2295a10f8e305555448a4742 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3552603 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* volmar: Initialize the vivaldi keyboardYu-An Chen2022-03-292-6/+23
| | | | | | | | | | | | | | | Initialize the vivaldi keyboard. BUG=b:220584239 BRANCH=brya TEST=make BOARD=volmar Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I555387ef459c53e6f5d615c5cb1ce45ebcaeeb5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3529605 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Ofer Fried <oferfried@google.com> Commit-Queue: Ofer Fried <oferfried@google.com>
* kinox: separate fw_config from the boardMatt Wang2022-03-295-46/+111
| | | | | | | | | | | | | | Put the fw_config control in the board.* and it would be better to separate it from the board.* and put it into the fw_config. BUG=b:223380935 BRANCH=none TEST=make BOARD=kinox pass Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I5e5ada0516d83fb00a2da14f9a4687183acc34ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3531869 Reviewed-by: Zhuohao Lee <zhuohao@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>
* Felwinter: Fixed EN_PP5000_PEN doesn't deasserted when pen is plug-outJosh Tsai2022-03-291-0/+1
| | | | | | | | | | | | | | | | | | | The first time we plug-out the pen, the pin EN_PP500_PEN does not deasserted. We need to record the initial pen detect status to avoid the EN_PP500_PEN status doesn't change when pen status is change at the first time BUG=b:196009529 BRANCH=brya TEST=ectool gpioget to check the EN_PP500_PEN status can be change when the pen status is changed at the first time. Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Change-Id: I42bc4ecf1714919fe2193087adcb00462644b6ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3552606 Reviewed-by: Ko Ko <ko_ko@compal.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org>
* 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>
* landia: Add supporting of 2nd source LID accel sensor BMA422Hank Xie2022-03-293-2/+42
| | | | | | | | | | | | | | | | Add SSFC field to support the 2nd source Lid accel sensor. BUG=b:226041272 BRANCH=dedede TEST=On landia. Set SSFC and make sure the LID sensor works normally. Signed-off-by: Hank Xie <hank.xie@quanta.corp-partner.google.com> Cq-Depend: chromium:3554182 Change-Id: Ibb24c7a797038660dff6c66d954c06b36c006d3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535547 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* landia: Tune lid and base accel rotation configuration.Hank Xie2022-03-291-4/+4
| | | | | | | | | | | | | | | | | This patch tunes the lid and base accel sensors based on the actual situation of product. BUG=none BRANCH=dedede TEST=On landia. Set SSFC and make sure the LID sensor works normally. Signed-off-by: Hank Xie <hank.xie@quanta.corp-partner.google.com> Cq-Depend: chromium:3535547 Change-Id: I32949737d600ed136d1e2d434c153d87c18dfb49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3554182 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* servo_v4p1: Detect and configure PCAL6524HESam Hurst2022-03-291-7/+50
| | | | | | | | | | | | | | | | | | Detect and configure PCAL6524HE if found. BUG=b:210015396 TEST=make -j BOARD=servo_v4p1 Test that the PCAL6524HE was detected and properly configured Test that the TCA6424 continued to work as expected. BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: If1dcd90fc76b2e04c4fccf375aa00d58c5039abf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556492 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Brian Nemec <bnemec@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* 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-283-1/+8
| | | | | | | | | | | | | | | | | | 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>
* zephyr: mchp: Add shim i2cmartin yan2022-03-281-0/+2
| | | | | | | | | | | | | | Add shim layer i2c function BUG=none BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: If6dc893ae720587b74db44ae22ff1747af158cc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546983 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: npcx: fix deep sleepKeith Short2022-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream PR https://github.com/zephyrproject-rtos/zephyr/pull/42040/ made the following change: 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); } If the PM state lock is set, then the chip is not allowed to enter deep sleep. Correct the logic to match the new API. BUG=b:227002506 BRANCH=none TEST=Boot zephyr on Herobrine. Valid deep sleep entered after the AP powers off and the UART is idle. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I7050dc326ab197e53a28cafca5896f6248883074 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3555433 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: mchp: Add shim gpiomartin yan2022-03-281-0/+54
| | | | | | | | | | | | | Add shim layer gpio code BUG=none BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I43334fae8fcedcf3154f2e579f8558716c480b1b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546982 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* util: Remove implementation of strtoull in Zephyr buildYuval Peress2022-03-281-0/+2
| | | | | | | | | | | | | | | | Zephyr defines it's own implementation of strtoull in a libc minimal implementation so this implementation causes a conflict. BRANCH=none BUG=none TEST=zmake build brya Cq-Depend: chromium:3552896 Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I6529639238adbf2baa75f699fe64df09c35910fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3554122 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* sn5s330: Test I2C fail in sn5s330_set_vconn()Tristan Honscheid2022-03-281-0/+13
| | | | | | | | | | | | | Test handling of a failed I2C read in sn5s330_set_vconn() BRANCH=None BUG=b:225245353 TEST=zmake -D configure --test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I1bb748a057b9b32e5340667546b698e7427539db Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546942 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* sn5s330: Test sn5s330_enter_low_power_mode() I2C failsTristan Honscheid2022-03-281-0/+28
| | | | | | | | | | | | | | Test failing on multiple I2C register reads in the sn5s330_enter_low_power_mode() function BRANCH=None BUG=b:225245353 TEST=zmake -D configure --test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I4aabbe57d9550ec478879d46de7376e8334e676b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546941 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* sn5s330: Test I2C fail in sn5s330_discharge_vbus()Tristan Honscheid2022-03-281-0/+12
| | | | | | | | | | | | | | Ensure we return an error code when an I2C read error occurs in sn5s330_discharge_vbus() BRANCH=None BUG=b:225245353 TEST=zmake -D configure --test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I6aa98c015378489dead1909c299ced751fcc6d5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546940 Reviewed-by: Keith Short <keithshort@chromium.org>
* sn5s330: Test set_vbus_source_current_limit() I2C read failTristan Honscheid2022-03-281-0/+13
| | | | | | | | | | | | | | Add a test for the set_vbus_source_current_limit() function for when the I2C read operation fails. BRANCH=None BUG=b:225245353 TEST=zmake -D configure --test test-drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ib5a0787dc4c93df859c577f3b8239e932be5fda1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546939 Reviewed-by: Sam Hurst <shurst@google.com>