diff options
author | Devin Lu <devin.lu@quantatw.com> | 2020-04-01 15:19:14 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-07 01:25:47 +0000 |
commit | 2dd71e66565bc09852567958b1f48748b7d20a49 (patch) | |
tree | 6877ec5ec13381a33642808ae95d8c4084cff62e | |
parent | 3163d24804d637f4c4cf3350b432889f07ac1ae1 (diff) | |
download | chrome-ec-2dd71e66565bc09852567958b1f48748b7d20a49.tar.gz |
HACK: dratini: Prevent system can't power on
Apply CL:2014001 to dratini.
Currently few systems can't power on, because pp2500_dram_u doesn't assert.
To prevent potential risk, this patch trigger re-power on again.
BUG=b:152456965
BRANCH=firmware-hatch-12672.B
TEST=Verified with defect system and make sure boot up normally.
Change-Id: Ia88703286ed6b9d26060cb7fee8cfce98a500d26
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130151
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
-rw-r--r-- | board/dratini/board.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/board/dratini/board.c b/board/dratini/board.c index 08710c8a3b..7c46a421ed 100644 --- a/board/dratini/board.c +++ b/board/dratini/board.c @@ -47,6 +47,9 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) +static void check_reboot_deferred(void); +DECLARE_DEFERRED(check_reboot_deferred); + /* GPIO to enable/disable the USB Type-A port. */ const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = { GPIO_EN_USB_A_5V, @@ -493,3 +496,21 @@ static void enable_hdmi(void) } DECLARE_HOOK(HOOK_CHIPSET_RESUME, enable_hdmi, HOOK_PRIO_DEFAULT); DECLARE_HOOK(HOOK_CHIPSET_STARTUP, enable_hdmi, HOOK_PRIO_DEFAULT); + +void all_sys_pgood_check_reboot(void) +{ + hook_call_deferred(&check_reboot_deferred_data, 3000 * MSEC); +} + +__override void board_chipset_forced_shutdown(void) +{ + hook_call_deferred(&check_reboot_deferred_data, -1); +} +DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_forced_shutdown, + HOOK_PRIO_DEFAULT); + +static void check_reboot_deferred(void) +{ + if (!gpio_get_level(GPIO_PG_EC_ALL_SYS_PWRGD)) + system_reset(SYSTEM_RESET_MANUALLY_TRIGGERED); +} |