summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Cherry: move isl9238c_hibernate to board_hibernatefirmware-cherry-14454.B-mainSue Chen2023-05-051-1/+5
| | | | | | | | | | | | | | | move isl9238c_hibernate from board_hibernate_late to board_hibernate. BUG=none BRANCH=cherry TEST=none Change-Id: I37ad977db73410c9e68a2850a5984df052e86db1 Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4225332 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit dae3a7f0100c8150c39d527c77bced1898f6b2e1) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4230455
* motion_sense_fifo: Move lost to motion_sensor_fifoGwendal Grignou2022-12-153-12/+19
| | | | | | | | | | | | | | | | | | | | | | Move lost field from the sensor object to inside motion_sense_fifo: It is not used anywhere else. BUG=b:237305991 BRANCH=brya TEST=make -j BOARD=crota Conflicts: zephyr//motion_sense.c: no zephyr (cherry picked from commit a2efacf4a0a5857176bc6f39c9bd1e4cd2e1d6ec) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3754211 Reviewed-by: Yuval Peress <peress@google.com> Change-Id: Idfb159ed9025e859e86bb494cf5da98df9cf4a36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3788022 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* motion_sense_fifo: Reset timestamp only when ODR changesGwendal Grignou2022-11-154-46/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | Timestamp spreading is reset after each fifo commit. It prevents the fifo logic to operate when the EC takes more than a period to collect the samples. Reset timestamp spreading only when ODR changes. Move needed fields inside motion_sense_fifo to handle virtual sensors. Fixes commit bc9660a4b3e8 ("common: motionsense fifo: Reset the initialized bits after commit") BUG=b:168335284,b:237305991,b:217580259 BRANCH=all TEST=make run-motion_sense_fifo Conflicts: common/motion_sense_fifo.c: Clang changes not in. (cherry picked from commit 1404036c889324442a9559812f5c4ed6143506f3) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: If7265079f7fc7f4e7e22dd80865305f4553df020 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3754212 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3788023
* dojo: Add suspend_resume_power_signal_interruptTommy Chung2022-10-213-13/+34
| | | | | | | | | | | | | | | | | | | | | Put nvme_enable in AP_IN_SLEEP_L interrput routine to ensure that the timing of EN_PP3300_SSD can be enabled right after chipset resume so that the PCIe driver timeout will not happen. BUG=b:236790585 BRANCH=cherry TEST=make sure nvme enable timing will not cause PCIe driver timeout when chipset resume. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I34e1c6ad820cb33cdba272dc6f1f22fd52eeacc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3793403 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Devin Lu <devin.lu@quantatw.com> (cherry picked from commit 4c145878ab754468cdb67fa10543063f902f47fe) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967914 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* gitlab: Only run CI in main and coverage branchesJeremy Bettis2022-09-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This workflow rule will prevent this CI config from running unless the branch name is "main" or "coverage". It will have to be cherry-picked into all the other branches to make them stop running sadly. BRANCH=None BUG=b:244766499 TEST=Used yaml validator at https://gitlab.com/zephyr-ec/ec/-/ci/editor?branch_name=main&tab=2 Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I536de3e3fdbca1c48505e61de5737f865bd0e233 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872545 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit 15612bc4af40cb2a824ff2590508df29f27fbf56) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3929558 Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* mt8195/mt_scp: enable av1 decoder driverXiaoyong Lu2022-09-301-1/+1
| | | | | | | | | | | | | | | | | | | enable av1 decoder driver in mt8195 platform. BUG=b:205889935 TEST= av1/vp9/h264/vp8 fluster test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Change-Id: Ie58827559cb144d7ef63545d3c4ff2bbb70db603 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3585271 Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> (cherry picked from commit f5dbc95a734234a74043377d3cca49c4e98f2115) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3924930 Tested-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Wei-Shun Chang <weishunc@chromium.org> Commit-Queue: Chen-Yu Tsai <wenst@chromium.org>
* chip/mt_scp: add define to support av1 decoderXiaoyong Lu2022-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | Add define to support av1 decoder in scp: VDEC_CAP_AV1_FRAME BIT(11) BUG=b:205889935 TEST= av1/vp9/h264/vp8 fluster test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Change-Id: I29de57ae4cb15fee30b2082c688ff446c2360fea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771327 Tested-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Commit-Queue: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> (cherry picked from commit 740c71abbdfb89b23ba04bb8561102b07ebb35a6) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3925088 Reviewed-by: Wei-Shun Chang <weishunc@chromium.org> Auto-Submit: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Commit-Queue: Wei-Shun Chang <weishunc@chromium.org>
* dojo: Add keyboard factory testTommy Chung2022-09-023-0/+33
| | | | | | | | | | | | | | | BUG=none BRANCH=cherry TEST=make sure that `ectool kbfactory test` works. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I7189a240e3e21cbaed04ce3cfbfe36192e643bf3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3865212 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Devin Lu <devin.lu@quantatw.com> (cherry picked from commit 9157996e3713ac5c774196151539c2925db715c7) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3870109 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* chip/mt_scp: remove gpio configurationTinghan Shen2022-08-312-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UART console is mainly for debug purpose. Remove it to prevent malicious usage of this interface. If required, a user can configure the pin mux by kernel dts. Take mt8195 as an example to enable the SCP UART in dts, scp_pins: scp { pins_scp_vreq { pinmux = <PINMUX_GPIO76__FUNC_SCP_VREQ_VAO>; bias-disable; input-enable; }; + + pins_uart { + pinmux = <PINMUX_GPIO102__FUNC_TP_UTXD1_AO>, + <PINMUX_GPIO103__FUNC_TP_URXD1_AO>; + bias-pull-up; + }; }; -- Conflicts on branch factory-cherry-14455.B-main: There's no mt818x folder on this branch. Remove changes for chip/mt_scp/mt818x/uart.c from original CL:3791283 -- BUG=none TEST=boot cherry scp ok. scp boot log still records in /var/log/cros_scp.log Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Change-Id: I37bc65b47e7423e9def5a399ba7ceb2761dc9615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791283 Tested-by: TingHan Shen <tinghan.shen@mediatek.corp-partner.google.com> Reviewed-by: Wei-Shun Chang <weishunc@chromium.org> Commit-Queue: Wei-Shun Chang <weishunc@chromium.org> (cherry picked from commit 2e68f3ee03f51fb0a3f8c0cad6868b2f1fb34a5a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3835234 (cherry picked from commit e703f17abef41dda0f0ea80c441bbd056581e1e5) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864745
* motion_sense_fifo: use is_new_timestampGwendal Grignou2022-08-121-2/+2
| | | | | | | | | | | | | | | | Hide bit field inside is_new_timestamp() for consistency BUG=none BRANCH=brya TEST=make runtests Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: Ide3c2d9beeee131c49c5dcf9a9a0055540b8e6a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3754210 Reviewed-by: Yuval Peress <peress@google.com> (cherry picked from commit 13c3d7e861b177d65ef996f9eb907aebdfc41538) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3788021 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* motion_sense_fifo: Add tests for the get_info functionYuval Peress2022-08-122-1/+37
| | | | | | | | | | | | | | | | | | | Verify that all the fields returned by the get_info function are correctly filled per several different test scenarios. BRANCH=none BUG=b:224614211 TEST=make run-motion_sense_fifo -j Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ib544e3f1acbca21eb0d8a2bf7bf8ecf351a0a172 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3572852 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> (cherry picked from commit 47e51bbb819b2966c2920bb47eb09bda70603843) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3811788 Tested-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
* test: add test for fifo popYuval Peress2022-08-121-0/+53
| | | | | | | | | | | | | | | | | | | | | | Test the case where the entry being removed has fewer than 2 entries in the fifo. This would trigger us to look at other sensors to see if timestamp spreading is still needed. The test verifies that the correct sample is at the head of the sensor data and that the timestamps were spread. BRANCH=none BUG=b:224614211 TEST=make run-motion_sense_fifo -j Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I5771247722d0e2cc4b1765d9da2b6d66e649303d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575698 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> (cherry picked from commit 39ac0322e2b2772615f8a73ae7a6cae5ac185b4c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3811787 Tested-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
* Revert "mkbp: don't queue mkbp events in S3"Ting Shen2022-08-041-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 524cba08cceb373050cf79c41e4f6f92ff519c5e. Reason for revert: b/241036338 we need EC_MKBP_EVENT_BUTTON queued in S3. Original change's description: > mkbp: don't queue mkbp events in S3 > > In S3, if a mkbp event is not a wake source, we should not queue it in > the mkbp fifo, otherwise the system will see a bunch of outdated event > after resume. > > mkbp_fifo_add() uses the return value from mkbp_send_event() to > decide if it needs to queue the event. So we need to pass the decision > through the path activate_mkbp_with_events() -> mkbp_send_event() -> > mkbp_fifo_add(). > > BUG=b:238057993 > TEST=suspend -> lidclose -> lidopen(=resume) > verify that powerd does not see the lid close event. > BRANCH=cherry > > Signed-off-by: Ting Shen <phoenixshen@google.com> > Change-Id: I3e1c58f97020d7ee2e3b4b56f14c4cadf51bef64 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3765440 > Reviewed-by: Jett Rink <jettrink@chromium.org> > Commit-Queue: Ting Shen <phoenixshen@chromium.org> > Reviewed-by: Mengqi Guo <mqg@chromium.org> > Tested-by: Ting Shen <phoenixshen@chromium.org> Bug: b:238057993 Change-Id: I0b66b06d3c834641426dda24d71fc462d0030f92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3809734 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* mt8195/mt_scp: enable mt8195 inner racing modeXiaoyong Lu2022-07-261-2/+2
| | | | | | | | | | | | | | | | | | enable inner racing mode in mt8195 platform. BUG=b:209531198 TEST=cts/gts test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Change-Id: Ie58827559cb144d7ef63545d3c4ff2bbb70db609 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3261922 Commit-Queue: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> (cherry picked from commit 1b110c88080d31a1a4b996da2906c216ebb298ee) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3787367 Tested-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Wei-Shun Chang <weishunc@chromium.org>
* chip/mt_scp: add define to support inner racing modeXiaoyong Lu2022-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add define to support inner racing in scp: VDEC_CAP_INNER_RACING BIT(17). BUG=b:209531198 TEST=cts/gts test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Change-Id: I292645a7d976c7a88fae831ae38cd47dad1c7aaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771682 Tested-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Commit-Queue: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> (cherry picked from commit bb7ced2804e10f7320270536ce2ce33f7c761a99) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3787362 Commit-Queue: Wei-Shun Chang <weishunc@chromium.org> Reviewed-by: Wei-Shun Chang <weishunc@chromium.org> Auto-Submit: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Chen-Yu Tsai <wenst@chromium.org>
* mkbp: don't queue mkbp events in S3Ting Shen2022-07-181-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In S3, if a mkbp event is not a wake source, we should not queue it in the mkbp fifo, otherwise the system will see a bunch of outdated event after resume. mkbp_fifo_add() uses the return value from mkbp_send_event() to decide if it needs to queue the event. So we need to pass the decision through the path activate_mkbp_with_events() -> mkbp_send_event() -> mkbp_fifo_add(). BUG=b:238057993 TEST=suspend -> lidclose -> lidopen(=resume) verify that powerd does not see the lid close event. BRANCH=cherry Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I3e1c58f97020d7ee2e3b4b56f14c4cadf51bef64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3765440 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Mengqi Guo <mqg@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit 524cba08cceb373050cf79c41e4f6f92ff519c5e) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3768135 Reviewed-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* cherry: do not use the cached VBUS valueEric Yilun Lin2022-07-061-6/+1
| | | | | | | | | | | | | | | | | | Ignore the cached value in case of the FRS happening and let the cached VBUS status outdated. BUG=b:234352018 TEST=unplug FRS hub with adapter connected, and the VBUS supplier disappeared. BRANCH=cherry Change-Id: Ie87734976fc24eb1618e166d9eca0462f97d6ab8 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3747175 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s: ignore cached source flag for enable sourcingEric Yilun Lin2022-07-061-10/+2
| | | | | | | | | | | | | | | | | | | | When FRS happens (failed or succeed), the cached source flag may not reflect the correct status immediately. So, ignore the source flag to update the VBUS charge supplier and enable source control. BUG=b:234352018 TEST=unplug FRS hub with adapter connected, and the VBUS supplier disappeared. BRANCH=cherry Change-Id: Ia735efb3ea15733be01990613ab256d8e73a7f4a Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3747174 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* charge_manager: return max available power in PD_POWER_INFO commandTing Shen2022-07-061-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | When DPS enabled, it could select a low but more efficient PDO for charging. If the selected power is less than usb-min-ac-watts, a "low-power charger connected" popup appears and causes user confution. In this case, we should return the maximum available power instead the current selected power. BUG=b:237988097 TEST=When DPS picks a PDO less than usb-min-ac-watts, verify: 1) no "low-power charger" warning popup 2) `ectool usbpdpower` prints the maximum possible PDO power BRANCH=tomato Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Iaec76c9c81ee930222841b047efefb12162086c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3747172 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit e205e2fe5e7eb5c10afba2b35704a66db86a8cc4) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3748018 Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org>
* driver/ppc/rt1718s.c: Format with clang-formatJack Rosenthal2022-07-061-26/+18
| | | | | | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: If6d586013cc8c1ab0dea66a0e8bd31542265d239 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730034 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3747173 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s: Implement set_sbulschyi2022-07-061-0/+19
| | | | | | | | | | | | | | | | | | | | | | | The rt1718s can enable the SBU protection and control in the SBU_CTRL register. Implement the set_sbu function to make projects set the SBU line protection and function within the application. BUG=b:208372205 TEST=manually test with inserting a type c display, then check the SBU register is set enabled and external display is functioning. BRANCH=none Change-Id: I13f3881ddbb3b70f04e8ea88fcb51b1cf37fd517 Signed-off-by: lschyi <lschyi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3682600 Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Sung-Chi Li <lschyi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723368 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s: fix re-entry FRS stateEric Yilun Lin2022-07-061-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | RT1718S FRS RX interrupt may re-raise sometimes even if there's only one RX signal on CC lines. We filtered the second FRS RX in case of breaking the state machine since the state machine had entered the FRS AMS already. Also, ensure that the FRS AMS states are entered only when the FRS is enabled. Sometimes the FRS Rx interrupt will raise when FRS is disabled. BUG=b:223086905 TEST=success to 5V sink-to-source FRS on kingler BRANCH=none Change-Id: I12de944849041bcb42a9d35c981fafb35f9f6bd8 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3593761 Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723367 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* tcpc/rt1718s: disable FRS until valid FRS VBUS dropEric Yilun Lin2022-07-063-7/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `rt1718s_set_frs_enable` does three things: 1. enable/disable FRS RX detection 2. enable/disable auto asserting EN_SRC when FRS happened 3. enable/disable EN_FRS RT1718S EN_SRC GPIO auto-enablement is only working when EN_FRS is asserted and the VBUS drop below Vsafe5VMax. However, some of the FRS hubs have a higher capacitance, and this makes the VBUS discharging slowly, and currently, EN_FRS is disabled after we got FRS RX signal on CC line, and it might happen before the VBUS discharged to Vsafe5VMax, and the FRS won't source in that case because EN_FRS was deasserted at the moment. Also, some of the PPC (e.g. nx20p348x and hl5099) requiring the EN_FRS asserting longer even after the EN_SRC asserted (power is sourcing), so that the VBUS can be maintained. To fix these issues, we defer deasserting the EN_FRS for 5ms after RT1718S reports VBUS valid low (4.75V), and EN_SRC is asserted. The 5ms is recommended by HL5099 vendor to maintain the VBUS. BUG=b:223086905 b/228422539 TEST=kingler C1 FRS works BRANCH=none Change-Id: Idc1fc8614b30275b825a655d7af821c1a1c99ee0 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3544748 Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723366 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s: enable bist test modeEric Yilun Lin2022-07-061-0/+1
| | | | | | | | | | | | | | | | | | | | | Enable this for PD compliance test. BUG=b:216533755 TEST=pass TD.PD.PHY.E1 BIST Test Data BRANCH=none Change-Id: I0bed829c2d9a6bb504e8a981cfe81929236782a7 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3585179 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Tested-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723365 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* rt1718s: move FRS function from ppc to tcpc driverEric Yilun Lin2022-07-063-47/+5
| | | | | | | | | | | | | | | | | | | | RT1718S is a TCPC/PPC-in-one module. However the PPC is an optional module, and TCPC is mandatory. So we drop the mirror implementation in PPC side. BUG=b:223086905 TEST=zmake build kingler && make BOARD=cherry BRANCH=none Change-Id: I6e78b6cbe769456433359dd371657c48b581c337 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3583700 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> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723364 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s/bc12: fix typoTing Shen2022-07-061-1/+1
| | | | | | | | | | | | | | | | | BUG=none TEST=manually BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Iaf26700de1b94b245196f24699a40c2c90513b76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575704 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723363 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1739/rt9490/rt1718s: fix bc12 detection logicTing Shen2022-07-061-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | Update the BC1.2 detection code to avoid race condition: - don't check power role since it might be inaccurate during initial USB handshaking, use vbus_present instead. - After BC1.2 detection done, double check if we are a source. Bulk change for all drivers that has similar logic. BUG=b:225765067 TEST=none BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie84fcc8fa5e594b451657ec245c48ec376931d74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489816 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723362 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s: fix FRS support by decoupling PPC/TCPC driverEric Yilun Lin2022-07-062-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | Decouples the FRS functions by not making TCPC driver calling functions in PPC driver, or it may access the wrong i2c device (ppc_config[port].driver) when we don't use (configure) rt1718s PPC. BUG=b:223086905 TEST=ensure the rt1718s tcpc frs function is accessing the correct i2c address BRANCH=none Change-Id: Ib17db466abd30406606cc7af3ebf457681ea2843 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3506875 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723361 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* rt1718s: fix rt1718s_gpio indexEric Yilun Lin2022-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | The index is counted starting by 1 in the datasheet. BUG=b:223086905 TEST=ec:~$ rt1718s_gpio C1 GPIO1 OD=0 PU=0 PD=0 OE=1 HL=0 C1 GPIO2 OD=0 PU=0 PD=0 OE=1 HL=0 C1 GPIO3 OD=0 PU=0 PD=0 OE=1 HL=0 BRANCH=none Change-Id: Ib7f7e9114c03fe39cc828c7942743a75351cf98d Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3506874 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723360 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* tcpm/rt1718s: add board hook for set_snk_ctrl()Eric Yilun Lin2022-07-062-1/+27
| | | | | | | | | | | | | | | | | | | | | | | RT1718S provides 3 GPIO for universal uses, and one of the use is making one of the GPIO a SNK enable pin. For such case, we add a board hook for board customization, so the board can control the pin as their needs. BUG=b:214146359 TEST=ensure the board hook is called BRANCH=none Change-Id: I15955e07bfcd192ea79ab891da58021a2ec153c6 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3386981 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3723359 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* dojo: Apply HOOK_CHIPSET_RESUME_INIT on enable_nvmeTommy Chung2022-07-062-1/+4
| | | | | | | | | | | | | | BUG=b:236790585 BRANCH=cherry TEST=make sure that nvme power on timing will not cause PCIe driver timeout when chipset resume. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I8e6e0960f0bcdc60b9280392e2bc0da54ec8c2c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3742851 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3747168
* power/mt8192: Apply chipset resume init and suspend complete hooksTommy Chung2022-07-061-0/+9
| | | | | | | | | | | | | BUG=b:236790585 BRANCH=cherry TEST=make buildall -j Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Icfadb0368a85d4829cf6b12510ecf8ffb7f4632b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3742850 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3747167
* dojo: Update base sensor by board version and SSFC valueTommy Chung2022-07-062-46/+112
| | | | | | | | | | | | | | | | BUG=b:237963220 BRANCH=cherry TEST=make sure that all base sensors work correctly with corresponding board version and ssfc value. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I2ba9d3bf3bc4b93ebefae466b8f1027d4bfb6aa7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3739114 Reviewed-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3746507 Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* dojo: Set up board SSFC parsingTommy Chung2022-07-063-1/+94
| | | | | | | | | | | | | | | | | | | Set up basic file to use for parsing SSFC. Currently, SSFC is set to recognize 2nd source of base sensor and lid sensor. BUG=b:237963220 BRANCH=cherry TEST=make BOARD=dojo Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I50af96214b2e263e704580b06ecf93d4f9c95295 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3742857 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Devin Lu <devin.lu@quantatw.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3746056 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* driver: icm42607: rename the registerSue Chen2022-07-051-3/+3
| | | | | | | | | | | | | | | | | | | | | ICM426XX_REG_DEVICE_CONFIG would be redefined while the project is using both icm426xx and icm42607 so rename it to ICM42607_REG_DEVICE_CONFIG. BUG=b:217971875 BRANCH=zork TEST=make build=ezkinil Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Iee5fac247346dde8995580cfa223dcc851357cc8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3442907 Reviewed-by: Keith Short <keithshort@chromium.org> (cherry picked from commit 11c0ad4a2334595bc249ce98c013986113445aa9) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3552484 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* dojo: Add CONFIG_BATTERY_REVIVE_DISCONNECTTommy Chung2022-07-041-0/+1
| | | | | | | | | | | | | | | | | If battery is found to be in disconnect state, take it out of this state by applying this config to force-apply precharge current. BUG=none BRANCH=cherry TEST=make sure that battery can be taken out of disconnect state. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I97c64fd8e96d6b3af117221874fb769f5fb2935b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3742843 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit 712c9294e62ff28c7ae8f8da7deda2d7b9551e87) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3739113 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* dojo: Do enable/disable nvme separatelyTommy Chung2022-07-041-2/+12
| | | | | | | | | | | | | | | | | | | Enable/Disable nvme sould be done separately for specific SOC PCIE function demand. Also, set enable nvme priority to HOOK_PRIO_FIRST when chipset resume (see bug for more details). BUG=b:236790585 BRANCH=cherry TEST=make sure that nvme power on timing will not cause PCIe driver timeout when chipset resume. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I60b84b3f2c29f6886269cf5fbe78054d93a5a85e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734209 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit 1eb23b30eb80a9f7d47dd8490f155c0f453b227e) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3742848 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* power/mt8192: Do not exit hard off when ap idleTommy Chung2022-07-011-2/+4
| | | | | | | | | | | | | | | | | | | To prevent system power on from POWER_G3 when ap idle (such as power off the system in recovery mode), set exit_hard_off to 0 for this condition. BUG=b:237230874 BRANCH=cherry TEST=make sure that system will not power on when power off in recovery mode. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I27697a030f3fdb128ea87b559add0a4a05399c56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3737702 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit 373f3daa4e5e44c3350393b4b4995e7cc10f2312) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3739992 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* dojo: Set KB_BL PWM freq to 2400HzTommy Chung2022-06-291-1/+1
| | | | | | | | | | | | | | | | | To make the variation of KB_BL brightness clear, lower the PWM signal freq to 2400Hz. BUG=b:237232105 BRANCH=cherry TEST=adjust the KB_BL brightness and see the variation. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I630869a90cfa5c5be8fac36211567dade1e0ceb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3733880 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit 8e0fcd95431605b75e0344b9cfd66e5e7f0a2b7d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734787 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* dojo: Set max input current limit to 2944mATommy Chung2022-06-291-0/+3
| | | | | | | | | | | | | | | | Limit input current lower than 2944mA for safety. BUG=b:236911774 BRANCH=cherry TEST=make sure safety test pass. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Id7707a2d919889308d0cbbca6fe94a3fcf003b7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3721950 Reviewed-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734035 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* cherry/dojo: Move board_set_charge_limit to board levelTommy Chung2022-06-293-7/+18
| | | | | | | | | | | | | | BUG=none BRANCH=cherry TEST=make BOARD=cherry, dojo Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I5868ce77b6d85b9755e74c16e9430224bdfe8dde Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3721949 Reviewed-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734353 Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* baseboard/cherry/baseboard.c: Format with clang-formatJack Rosenthal2022-06-291-59/+55
| | | | | | | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I41bb3ea958013fa4f4405b57f200b2d490e64f3e Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727867 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit 1eb973efe763dda5e76ab0574b31319e368ed20c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734030 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* baseboard/cherry/usb_pd_policy.c: Format with clang-formatJack Rosenthal2022-06-291-5/+4
| | | | | | | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I562bea82b7465bb07817b1d496bba70927dfdaab Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727869 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit 9947ec380852bb7adac76022e8fd12d15864da94) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734031 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* board/dojo/cbi_fw_config.c: Format with clang-formatJack Rosenthal2022-06-291-4/+4
| | | | | | | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I5d0f8cff04906b9f6180884373cd6cd9e7cc4fa7 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728250 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit 28a4ebe9617f89e429fa54537ae2cba685fe041b) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734029 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
* board/dojo/board.c: Format with clang-formatJack Rosenthal2022-06-291-37/+29
| | | | | | | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I76a3f7411d657598cbd6480263847d6abbff528a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728229 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit bc8f5701f751a53b95c67032f98bbae7d39f5d61) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3733876 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* board/dojo/board.h: Format with clang-formatJack Rosenthal2022-06-291-2/+3
| | | | | | | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I9d71a7a6b5660b6568faa98e084e0dd732746790 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728230 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit 65bfc1b6949e775092df522ff8fac42ece71052d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3733875 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* battery/smart: Don't update fields if reading failsDaisuke Nojiri2022-06-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, battery_get_params starts with batt_new = {0} and ends with memcpy(batt, batt_new). That is, if battery_get_params fails to read a field, we set a BATT_FLAG_BAD_* and clear the field. This behavior forces us to check the flags everywhere fields are read (to distinguish 0 v.s. invalid 0). It also makes EC forget the last known good values. Instead, we will always keep good values in the global batt_params. That is, we update fields only if reads are successful. (That's how other implementations of battery_get_params behave.) Thus, if display_soc is zero, it was computed legitimately as zero (except the very initial value). BUG=b:217401040,b:222722611 BRANCH=None TEST=Guybrush Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I5b69b708d149d1c750551d8cf957eab3fdc8aa64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3514489 Reviewed-by: Rob Barnes <robbarnes@google.com> (cherry picked from commit d7509398b30ece7df78884ed6f309f0e1b6c3127) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3734407 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* dojo: Set watchdog period to 2500msTommy Chung2022-06-221-0/+4
| | | | | | | | | | | | | | | | | | | | To avoid watchdog due to race condiftion of uart tx buf flush INT and i2c large transfer (accelgyro BMI260 init) INT, extend the watchdog period to 2500ms. BUG=b:235297476 BRANCH=cherry TEST=make sure there's no ec watchdog reset during firmware-update and faft firmware_ECWatchdog pass. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ie6a03a99bc3e87b525346bf39a07a4ba10134b92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3709282 Reviewed-by: Eric Yilun Lin <yllin@google.com> (cherry picked from commit 95b3e9ab4879f356a0f14cafb4a2185538ba3f4c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3716413 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* it83xx: reload watchdog on system jumpDino Li2022-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | This ensures that a new FW image will have full watchdog period during initialization. BUG=b:235297476 BRANCH=cherry TEST=The watchdog_reload() routine is called every time the system jumps. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I103cb2c738b26a1000a72617706f4c30e8c952b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3708382 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> (cherry picked from commit 66f81102e8bfdb8338c76b8f6dd991c58ca1b0c3) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3716177 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* it8xxx2: The "M" extension is disabled by defaultDino Li2022-06-206-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | There is a mul instruction bug. The bug may cause instructions of writing back CPU GPR (e.g mv a0,s2) which following the mul instruction to fail. This patch disables the 'M' extension and overwrite integer multiplication and division arithmetic library routines with using hardware multiplication and division and nop instructions. This will ensure that there is no write back GPR instruction to follow mul instruction to avoid the bug. BUG=b:235297478 BRANCH=asurada,cherry,icarus TEST=- buildall - The "M" extension is disabled on cherry image (-march=rv32iac) Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I39b34a91dd77d975b78b6756494691c6b28dc42d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3690042 Reviewed-by: Eric Yilun Lin <yllin@google.com> (cherry picked from commit 4a2e334030cf936cc5bc59b034b8bbbb6aa55caa) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3707071 Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>