summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Monkey Island: Add SBU fault printstabilize-14790.B-mainDiana Z2022-05-071-0/+1
| | | | | | | | | | | | | | | | Add a print to the SBU fault interrupt. Otherwise, since the interrupt is triggering the OCP module it may produce confusion as to what happened on the connection. BRANCH=guybrush BUG=b:230345619 TEST=make buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ieb459d9fa499d5f3073f48d348c2da22d7224b86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3632815 Commit-Queue: Robert Zieba <robertzieba@google.com> Reviewed-by: Robert Zieba <robertzieba@google.com>
* TCPMV2: Followup on Revision additionJameson Thies2022-05-061-4/+12
| | | | | | | | | | | | | Addressing comments on http://crrev/c/3607054 BUG=b:214087135 TEST="make runhosttests" and "make try_build_boards" BRANCH=NONE Signed-off-by: Jameson Thies <jthies@google.com> Change-Id: I558044230aa5548f284f44f6818bb8ad412b646c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631299 Reviewed-by: Diana Z <dzigterman@chromium.org>
* gitlab: Use the same filter in coverage_templateJeremy Bettis2022-05-061-5/+21
| | | | | | | | | | | | | | | | | | | | We were filtering out some directories that are impossible to test with coverage right now from the tests, but not from the boards. Change filters to match in all 3 places. BRANCH=None BUG=None TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I17ff82e277069ecddb7c61b61e9ba089a3c54cc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3632182 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* TCPMV2: Followup on Give_Status additionJameson Thies2022-05-061-15/+17
| | | | | | | | | | | | | | | Addressing comments on http://crrev/c/3587509, and moving Get_Status request case from extended messages to control messages. BUG=b:227236917 TEST=observed Status response on twinkie, plus "make runhosttests" and "make try_build_boards" BRANCH=NONE Signed-off-by: Jameson Thies <jthies@google.com> Change-Id: I0702cdda58a302e8ecfb7cc977273d12a6fdb4fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631298 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zork/guybrush: Add missing FP_PWR_EN configurationOfer Fried2022-05-061-6/+4
| | | | | | | | | | | | | | | | | | | FP_PWR_EN is not required for flashing the FPMCU. It is required for POR after the flash is complete. Add FP_PWR_EN configuration for Zork and Guybrush. BRANCH=None BUG=b:229784281 TEST=Toggle the FPMCU_PWR_EN GPIO and confirm an additional `power-on` log appears in /var/log/cros_fp.log Signed-off-by: Ofer Fried <oferfried@chromium.org> Change-Id: I3375936496b40d6361c198a12643414600b0d080 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615482 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Ofer Fried <oferfried@google.com> Tested-by: Ofer Fried <oferfried@google.com>
* zephyr: enable ectool reboot_ap_on_g3B R, Harsha2022-05-067-0/+62
| | | | | | | | | | | | | | | | | | | | reboot_ap_on_g3 is not visible in zephyr EC as the file containing the legacy implementation is not loaded as part of ectool build. BUG=b:228775663 BRANCH=none TEST=zmake build nivviks, make utils, ectool reboot_ap_on_g3 shutdown -h now ectool reboot_ap_on_g3 10 shutdown -h now Signed-off-by: B R, Harsha <harsha.b.r@intel.com> Change-Id: I19031381ded02b36d211a5787fb00747e9e8d55f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3611263 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Li1 Feng <li1.feng@intel.com>
* zephyr: Add PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT optionAndrew McRae2022-05-063-1/+17
| | | | | | | | | | | | | | | Add a PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT Kconfig to set CONFIG_POWER_BUTTON_INIT_TIMEOUT so that the powerbtn task startup timeout can be configurable. BUG=b:231675142 TEST=zmake build nereid; flash & run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I5eb3ebadbaa9a0d9f433acc7bbf07807f2e3a1c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631720 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: move Herobrine USB mux configuration into the DTSTomasz Michalec2022-05-064-20/+24
| | | | | | | | | | | | | | | | | | | Move Herobrine, Hoglin, and Villager USB mux configuration into the devicetree. BUG=b:227757117 TEST=zmake testall TEST=check if usb_muxes structure is correct using gdb: gdb ./build/zephyr/{herobrine|hoglin|villager}/output/zephyr.ro.elf p usb_muxes BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6fa1483e9f536a503e85e61be0b21119c9c4d3b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575158 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: Add TCPCI USB-C mux DTS configurationTomasz Michalec2022-05-064-3/+153
| | | | | | | | | | | | | | | | | | | | Add necessary changes to make it possible to configure TCPCI USB-C mux using devicetree. TCPCI USB-C mux has hpd-update property which allows to select hpd_update callback. Right now it allows to select NULL (by not selecting any value) or ps8xxx_tcpc_update_hpd_status. Because it is common to use PS8xxx as a mux, special parade,usbc-mux-ps8xxx compatible is made to automatically select default hpd_update callback. BUG=b:227757117 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I2b5a98de58aa9fe8c47da69dff9151fd34f2a62b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3586441 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: move Krabby USB mux configuration into the DTSTomasz Michalec2022-05-063-31/+24
| | | | | | | | | | | | | | | | | | | USB muxes configuration of the Krabby is moved to the device tree. BUG=b:227757117 TEST=zmake testall TEST=check if usb_muxes structure is correct using gdb: gdb ./build/zephyr/krabby/output/zephyr.ro.elf p usb_muxes BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ib50e830ca028ec6e3c78bfd17695f695c883b1b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3579119 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: move USB mux configuration into the device treeTomasz Michalec2022-05-0613-0/+563
| | | | | | | | | | | | | | | | | | | | | Create a separated usb_muxes.c file in the shim layer to define the usb_muxes array. Additional USB muxes in a chain are created in the same file. Common properties of the usb_mux DTS node are in cros-ec,usb-mux.yaml file. BUG=b:227757117 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6cb26404b5cb44c6fce29f4176ebb6707af71d21 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575157 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com>
* kinox: implement OBP functionMatt Wang2022-05-064-0/+358
| | | | | | | | | | | | | | | | | | Add the two ADC pins to detect the ADP_ID and the PWR_IN_IMON. ADP_ID can identify the Barrel power device and the PWR_IN_IMON can detect the adapter input voltage. Use those ADC values to set the OBP pointer then trigger PROCHOT. BUG=b:211806236;b:213955278 BRANCH=none TEST=Kinox can get the 90w barrel adapter. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I84455d1028b2cfc4297e10410092454f3dd61bc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521743 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* mithrax: Initial EC imageJohn Su2022-05-0620-0/+2507
| | | | | | | | | | | | | | | | | | | Create the initial EC image for the mithrax variant by copying the brya reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:223091246 BRANCH=None TEST=make BOARD=mithrax Signed-off-by: John Su <john_su@compal.corp-partner.google.com> Change-Id: I7418b531c297464d1cb2e35c07b8263ecb283a78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3602112 Reviewed-by: Ko Ko <ko_ko@compal.corp-partner.google.com> Tested-by: Ko Ko <ko_ko@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* ap_pwrseq: Use the power button task to start the CPUAndrew McRae2022-05-062-30/+19
| | | | | | | | | | | | | | | | | | | | | Use the power button task processing to leave the CPU off or to start it, rather than automatically starting it. Run the check to discover the CPU state earlier so that the power button init code can check the state of the CPU. Refactor ap_power_force_shutdown() to avoid sending the notification. BUG=b:223113743 TEST=zmake build nivviks; flash & run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Id66a95390d054d8530e39dd6ce7088621eda6b86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627374 Reviewed-by: Li1 Feng <li1.feng@intel.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* nissa: Turn off CONFIG_BRINGUPAndrew McRae2022-05-061-1/+1
| | | | | | | | | | | | | | | | | | CONFIG_BRINGUP by default will not start the CPU, though the current power sequence code starts automatically. Turn off CONFIG_BRINGUP in preparation for a fix that changes the way the power sequence code handles the starting of the CPU (the power button logic should be used to control the starting of the CPU). BUG=b:223113743 TEST=zmake build nivviks; flash & run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I496bacf9f5e9da09260fd813aade84eca80dd57b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3626855 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* moli: power_monitor functionalityElsie Shih2022-05-065-10/+387
| | | | | | | | | | | | | | Integrate power_monitor code from Brask into the Moli design. BUG=b:222550779, b:229788499 TEST=make BOARD=moli Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Change-Id: I1af34e2dc0ced24c92c8a868709bf063b3b35471 Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3476660 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* moli: modify rpm deviationElsie Shih2022-05-061-5/+3
| | | | | | | | | | | | | Currently rpm deviation is 7%, It will cause [ectool pwmsetfanrpm 5000] and [ectool pwmgetfanrpm] not accurate. BUG=b:231542804 TEST=make -j BOARD=moli Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Change-Id: Ibba4b3bae04ceddd9952490ec11c5ede22b88a9e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627615 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* zephyr: subsys/ap_pwrseq: S0ix sleep transition checkLi Feng2022-05-064-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In power state S0, "ap_power_sleep_notify_transition()" is called continually. This is confusing since it should only be called when AP sleep status changes in S0ix exit. This CL adds condition check before calling it. Now the S0ix handling has flow as: 1. Receive host command about AP sleep state changes(resume, suspend); 2. Process sleep state and send sleep notify for power state transition. ap_power_chipset_handle_host_sleep_event() ap_power_sleep_set_notify() 3. Power state machine will check current sleep notify and call the transition. ap_power_sleep_get_notify() ap_power_sleep_notify_transition() BUG=none BRANCH=none TEST=Run s0ix test on Nivviks for 100 times, pass. Signed-off-by: Li Feng <li1.feng@intel.com> Change-Id: I01c184da0f1aea2e9b99fda901f3df50555e126e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3628829 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* zephyr: Move system pre-init earlierAndrew McRae2022-05-054-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | The system_common_pre_init() function detects whether a warm boot (sysjump) has been performed, and sets the reset flags accordingly. A number of modules rely on detecting whether a warm boot has happened (e.g the GPIO init, AP power sequence etc.), and previously the check was performed as part of the main EC task initialisation, after the kernel and application init phases. With more Zephyr based modules using SYS_INIT, moving the check will allow modules using POST_KERNEL and APPLICATION phase initialisation to check this flag as needed. BUG=b:230691031 TEST=zmake testall; zmake build nivviks; flash and run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I772b57c32b3176a539d464d5d301ff9b87b9d8ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3612983 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* zephyr: zmake: Skip running flake8 on BUILD.py files during pre-uploadJack Rosenthal2022-05-051-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | flake8 reports more errors than necessary on BUILD.py files because: - They are out of the zmake tree, and therefore do not have the correct .flake8 config file. - flake8 is confused by undefined variables like "here" and "register_project", which come from the execution context zmake provides. These are just config files anyway, running flake8 on them is likely overkill. Turn that off. BUG=none BRANCH=none TEST=for f in $(git ls-files); do zephyr/zmake/pre-upload.sh "$(realpath "${f}")" done Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ia6eae025ec560d3f6dbdc5c8a4ce50d7b9b94459 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3630476 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chargesplash: State machine implementationJack Rosenthal2022-05-0513-0/+706
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is much of the legwork required for go/cros-charging-splash, at least the portion of connecting the charger from chipset off state. What remains is: - Examining battery state and charger supply to make better decisions about when we can show the splash. - Consider assertion of PROCHOT during bootup of a low power charger, or after display initialization before the power button is pressed. The next CL adds a simple text-based UI on top of this. BUG=b:228370390 BRANCH=none TEST=connect charger and boot to splash on brya (using ghost image) (with full CL stack) TEST=provided integration tests pass Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ic114e975109a338ffaa3be977094020251fc36e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575089 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* volteer: Disable board-specific debug messagesJack Rosenthal2022-05-052-9/+10
| | | | | | | | | | | | | | | | | | | | | No room left in flash. If we wish to keep volteer building on ToT, we need to figure out a way to get more bytes. This disables some debug messages in board-specific code only. This buys us another ~400 bytes of flash space in RO. BUG=b:231623330 BRANCH=none TEST=flash space increases: *** 480 bytes in flash and 21760 bytes in RAM still available on volteer RO **** *** 616 bytes in flash and 21760 bytes in RAM still available on volteer RW **** Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I56eaff7b4fbe7546e8f3c1253fdb66e70b794029 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3630477 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* i2c_controller: Fix buffer overrun in `i2c_read_sized_block`Robert Zieba2022-05-052-4/+2
| | | | | | | | | | | | | | | | | | | | When passed a length of zero, the current behavior of `i2c_read_sized_block` is to read up to 255 bytes from the i2c bus. This commit changes that behavior so that passing a length of zero is an error. `i2c_read_sized_block` is only used by the smart battery driver, either directly or indirectly through `i2c_read_string`. I've checked that there do not appear to be any places that currently rely on this behavior. BUG=b:228589840 TEST=Verified that battery strings are still read correctly, smart battery mfg access still works BRANCH=guybrush Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: Ic025cd3cc805e6bd935b26100171a13e90b478a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3605885 Reviewed-by: Diana Z <dzigterman@chromium.org>
* smart battery: Fix mfgacc access function reading wrong number of bytesRobert Zieba2022-05-052-3/+37
| | | | | | | | | | | | | | | | | | | | | `sb_read_mfgacc` currently uses `sb_read_string`. This function reads a null-terminated string. However, the data that is being read is not a null-terminated string. This is causing N-1 bytes to be read instead of N bytes. This commit adds an `sb_read_sized_block` function that is used instead. Only PARAM_SAFETY_STATUS and PARAM_OPERATION_STATUS are read with `sb_read_mfgacc` and neither of these values are a string. BUG=b:228589840 TEST=Ran i2ctrace to verify that right number of bytes are now being read, tested with CL:3578293 to ensure no errors BRANCH=guybrush Change-Id: Iaedb4d28274bda8b6d1ee6d2021ebd04f83767f8 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3606146 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Brask: Enable Qi chargingDaisuke Nojiri2022-05-054-4/+39
| | | | | | | | | | | | | | | CPS8100 is a Qi wireless power transmitter. This patch enables it for Brask. BUG=b:191418683, b:207658344 BRANCH=Brask TEST=On Brask. /sys/class/power_supply/PCHG0/capacity, charge_type, status change as a PRx is placed on or removed from the coil. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I66df4ec473517de1707a0dbb74dd699497daeb6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3595283 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* PCHG: Remove device_enable_eventDaisuke Nojiri2022-05-051-9/+0
| | | | | | | | | | | | | | | | PCHG no longer uses the device event subsystem for EC-AP notification. This patch removes unused hook and device_enable_event. This is basically a revert of CL:2863564. BUG=None BRANCH=None TEST=Brask Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I0ca713253c3a802f977144ea8f0c0f728d9bebb5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3609109 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Parth Malkan <parthmalkan@google.com>
* i2c_controller: Add i2c_read_sized_block functionRobert Zieba2022-05-052-7/+37
| | | | | | | | | | | | | | | | | | | | | Currently there is `i2c_read_string` that reads data in the form `[Length] [byte 0] ... [byte Length-1]`. However this function only reads null terminated strings. This commit adds `i2c_read_sized_block` to support reading a general block of data with a length. This commit also re-implements `i2c_read_string` in terms of `i2c_read_sized_block` This changes the behavior of `i2c_read_string` to produce an empty string on failure. BUG=b:228589840 TEST=Verified that battery strings are read properly, used i2ctrace to verify that `i2c_read_sized_block` reads the correct number of bytes BRANCH=none Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: Id4aaf727048329776311eec5d392aafbd1eef2b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3605884 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* common/usbc: add new DPM for sink capability and request mismatchScott Chao2022-05-055-0/+43
| | | | | | | | | | | | | | | | | | | | | | In TBT EV - Host Source Power Provisioning test item. The port partner will return sink capability that it can support 3A, but it will request 1.5A at the end. In this case, EC will provide 3A for it and provide 1.5A for the second port partner. This case will cause test failed due to EC only provide 1.5A for both port. BUG=b:229683022 BRANCH=none TEST=make -j BOARD=primus TEST=make buildall TEST=verified by GRL Change-Id: Icc4904ec1267b7a34e64c01b626f607999072410 Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3592313 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* agah: bypass power on signalZick Wei2022-05-054-11/+32
| | | | | | | | | | | | | | This CL bypass PG_PP3300_S5_OD to PG_PP3300_S5_EC_SEQ_OD, follow HW change in b:226438219#34. BUG=b:226438219 BRANCH=none TEST=make BOARD=agah Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Icaa9c9a8d9d7ddd60c7e0e1a208a513c37e9eb37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3622000 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* vell: Limit input current to fraction of negotiated limitDevin Lu2022-05-051-1/+6
| | | | | | | | | | | | | Limit input current to 96% of negotiated limit BUG=none BRANCH=none TEST=Connect adapter then check input current. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I89cf7b1d9a8b8a022e1312dad5de853d53cf7308 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3626851 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* vell: Change Battery LEDs signalDevin Lu2022-05-052-13/+27
| | | | | | | | | | | | | | This patch changes battery LEDs from active low to active high for new board version. BUG=b:231281125 BRANCH=none TEST=On Vell reworked board. Make sure LEDs work. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I546b8f21116a72a91d64ce990ffac4adb26fd8d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627376 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr/usba: unconstify usb_port_enable if neededPeter Marheine2022-05-051-1/+4
| | | | | | | | | | | | | | | | | | | The changes in commit 7dc9537d7a56dab267e4facb3c1398e1d0e44175 added support in Zephyr for CONFIG_PLATFORM_EC_USB_PORT_ENABLE_DYNAMIC with the same semantics as the equivalent option in the legacy EC, but failed to change the definition in the shim code to remove the const qualifier. This would cause code that believed it could write to the usb_port_enable array to instead trigger undefined behavior. BUG=b:231512828 TEST=Nereid no longer hangs at boot when CBI fw_config is set to 0 (unknown sub-board) BRANCH=none Change-Id: I747c9f1c1f02847cc367da38da1d4c7a12037516 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627094 Reviewed-by: Andrew McRae <amcrae@google.com>
* osiris: Remove unused sensorfactory-firmware-ti50-guc-14778.B-mainfactory-14778.B-mainYu-An Chen2022-05-055-150/+2
| | | | | | | | | | | | | Remove motion sensor task and configuration BUG=b:224423318 BRANCH=none TEST=make BOARD=osiris Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I3a222620acaa26bcdcc0e5d4403fb04c63477cb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627370 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* TCPMv2: Request partner's revision information in src/snk startupJameson Thies2022-05-045-6/+189
| | | | | | | | | | | | | | | | | | | | | Adding features from the USB PD 3.1 revision of the specification requires us to know the difference between USB PD Rev 3.0 and USB PD Rev 3.1 devices. But, the message header only has 2 bits for revision and only provides the major revision. To determine a devices minor revision, TCPMv2 will need to send a Get_Revision command and store the Revision response which has major/minor revision/version information. This CL adds support for sending Get_Revision, and receiving Revision. BUG=b:214087135 TEST=Checked that the PE state was correctly holding the Revision response from a USB PD Rev 3.1 partner, and also checked that the stored RMDO value was 0 for a USB PD Rev 3.0 partner. BRANCH=none Signed-off-by: Jameson Thies <jthies@google.com> Change-Id: I99f10c15750c3a1fee1d8bad89b0c4a0b0a6b2ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607054 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* osiris: Remove GPIO_ID_1_EC_KB_BL_ENYu-An Chen2022-05-041-2/+0
| | | | | | | | | | | | | Remove GPIO_ID_1_EC_KB_BL_EN due to outdated BUG=b:224423318 BRANCH=none TEST=make BOARD=osiris Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I380d03da1f8a93259a015746ea77062d2e4ad423 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627371 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* volmar: undefine unnecessary PD configBoris Mittelberg2022-05-041-2/+0
| | | | | | | | | | | | | Volmar doesn't support USB4, so this config is not needed. BUG=b:231458203 BRANCH=none TEST=make -j BOARD=volmar Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I77e98cb856077ffe448db06b72f843d419e7a31b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3628190 Reviewed-by: Prashant Malani <pmalani@chromium.org>
* taniks: undefine unnecessary PD configBoris Mittelberg2022-05-041-3/+1
| | | | | | | | | | | | | Taniks doesn't support USB4, so this config is not needed. BUG=b:231457091 BRANCH=none TEST=make -j BOARD=taniks Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I1c996e8de5e614d1edb70764c0b545bad34529b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3628191 Reviewed-by: Prashant Malani <pmalani@chromium.org>
* TCPMv2: Verify data role in incoming messagesDiana Z2022-05-041-0/+23
| | | | | | | | | | | | | | | | | | We're required to exeute Error Recovery when we see a partner set the data role bit we believe ourselves to have. The spec gives no specific state this should be performed from, so centralize it to the PRL RX. BRANCH=None BUG=b:155418161,b:228478468 TEST=with a normal charger, verify connection completes successfully. With bad apple charger connection, verify error recovery is performed Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I82071d01ece105dbfc483446995e7f423bd9804e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3602225 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Michał Barnaś <barnas@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Lazor: Reduce flash usageDiana Z2022-05-041-0/+3
| | | | | | | | | | | | | | | Lazor has less than 100 bytes free flash on ToT. Reduce the flash usage by compiling out the higher-level PD debug strings. BRANCH=None BUG=None TEST=build and observe lazor now has 700 bytes free flash Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I9bbc5bb13dfc9ba020903c9966edcb0714e7b516 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627804 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* zephyr: drivers: Add test for uart host commandsTomasz Michalec2022-05-042-0/+232
| | | | | | | | | | | | | | | | Test CONSOLE_READ and CONSOLE_SNAPSHOT host commands if correct content of buffer is returned in read next and read recent variants. BUG=b:229935172 BRANCH=none TEST=zmake -D test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I90af94c0851fc7311236beeba8108e36e53c49c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310859 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com>
* zephyr: Fix duplicated output in EC_CMD_CONSOLE_READTomasz Michalec2022-05-041-5/+21
| | | | | | | | | | | | | | | | | | | | | | | Zephyr and CrEC implementation of EC_CMD_CONSOLE_READ is different. CrEC allows to read the UART buffer upto character written before EC_CMD_CONSOLE_SNAPSHOT host command. Also an index for CONSOLE_READ_NEXT and CONSOLE_READ_RECENT subcommands is separated. This CL changes Zephyr implementation to match CrEC. BUG=b:229935172 TEST=zmake testall TEST=check if /var/log/cros_ec.log has correct content and messages are not duplicated BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I5256b45d04ff8d3994bcbaf2722bacc1f37d73b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3613912 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* PRL test: Correct received data and power rolesDiana Z2022-05-041-4/+16
| | | | | | | | | | | | | | | Simulated partner messages should contain the opposite data and power roles to our own unless they're specifically testing error handling for data role mismatch. BRANCH=None BUG=b:155418161 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I38879eb5e2caf9833d6efa8cd0d36f9363a80fe5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3612213 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* prism: Update LED mappingDevin Lu2022-05-041-64/+70
| | | | | | | | | | | | | | This patch fixes the Key-LED mapping for Vell. BUG=b:227512417 BRANCH=none TEST=On Vell, run ectool --device 18d1:5022 rgbkbd <key> <color> Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ieec408883d3a3e3fe381a29e374a48210e06f66a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615955 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* burnet: Add more 44W batteriesDevin Lu2022-05-042-0/+90
| | | | | | | | | | | | | | | | This patch adds battery parameter as following: 1. DynaPack CosMX 44Wh 2. DynaPack ATL 44Wh 3. Simplo HIGHPOWER 44Wh BUG=b:231377901, b:231378635, b:231378985 BRANCH=firmware-kukui-12573.B TEST=make sure battery charging, battery cutoff works. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Iffa28caca72a38e6f2fae2470405ac2b439c9885 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3626852 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* crota: add battery supportPeter Chi2022-05-042-32/+330
| | | | | | | | | | | | BUG=b:229938038 BRANCH=none TEST=make -j BOARD=crota TEST=check "cutoff" in EC console Change-Id: I0584ee5f2d8d694cbca9436babcc813f1a1bb894 Signed-off-by: Peter Chi <peter_chi@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3588128 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* ap_pwrseq: Re-arrange signal handling in power state G3S5Li Feng2022-05-043-40/+37
| | | | | | | | | | | | | | | | | | Move SLP_SUS_L checking to chipset specific file because not all have SLP_SUS_L signal. BUG=none BRANCH=none TEST=build nivviks; flash, power on successfully; test AP shutdown, system enter S5 then G3; then press power button to bring system back to S0 and AP is running. Signed-off-by: Li Feng <li1.feng@intel.com> Change-Id: I580b19499f472a199319359a251ba19a66b4838a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3622494 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Commit-Queue: Andrew McRae <amcrae@google.com> Reviewed-by: Andrew McRae <amcrae@google.com>
* osiris: Remove unused pwm and update LED behaviorYu-An Chen2022-05-044-113/+63
| | | | | | | | | | | | Remove unused pwm and update LED behavior BUG=b:229352299 BRANCH=none TEST=make BOARD=osiris Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I675c6742fee51a2f109860a4cd382e173031dd76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607469 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* Felwinter : Fix bc12 interrupt eventLeila Lin2022-05-041-2/+2
| | | | | | | | | | | | | | | | | This patch fix bc12 interrupt event to the right task id. BUG=b:226315400 BRANCH=none TEST=Type power_supply_info and check information is correct. Change-Id: I4a0a0c2f925444d7246183f5f4a16c6b7688e55d Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615963 Reviewed-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Reviewed-by: Ko Ko <ko_ko@compal.corp-partner.google.com> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
* Felwinter : Correct temp_fan_off setting to make fan control normally.Logan_Liao2022-05-041-3/+3
| | | | | | | | | | | | | | | | | | | | | Atfer enter OS : DPTF control. Before OS : thermal control base on temps sensor linear control. Thermal control work abnormally because temp_fan_off is 0 in Felwinter. This patch modifies temp_fan_off value that make thermal control properly. BUG=b:229665979 BRANCH=none TEST=test Felwinter thermal control function normal. Change-Id: Icf421d1bed50bb03e344a270e277cbc09b022f6c Signed-off-by: Logan_Liao <logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615964 Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Ko Ko <ko_ko@compal.corp-partner.google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
* osiris: Modify USB type-c configurationYu-An Chen2022-05-045-317/+45
| | | | | | | | | | | | | | | | Change C0 TCPM to PS8815 Change C1 PPC to syv682x Change C0 usb_mux to PS8815 Remove C2 function Remove intel BB retime BUG=b:224423318 BRANCH=none TEST=make BOARD=osiris Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I21492e5a4e792d4305c4a0e1bbf28f47907e61d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3601919 Reviewed-by: Boris Mittelberg <bmbm@google.com>