diff options
author | Sue Chen <sue.chen@quanta.corp-partner.google.com> | 2021-12-22 15:37:19 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-08 01:34:04 +0000 |
commit | 596a6254a87227b57abd22c835b543b77e7cd882 (patch) | |
tree | e1e5964eea08a4cd02dbc9f187b9f30752e91423 | |
parent | e904f4224392fa96c630252e904985a361c1ad50 (diff) | |
download | chrome-ec-596a6254a87227b57abd22c835b543b77e7cd882.tar.gz |
Quackingstick: fix hibernate behavior for rev1
The power of hall sensor and the LID_OPEN_EC on rev1 are
different, and it cause LID_OPEN_EC wake the EC immediately
when EC enter hibernate.
Remove GPIO_LID_OPEN from hibernate_wake_pins for
board_id <= 1 to let rev1 dut can enter hibernate.
Rev1 needs the workaround for ACOK can't go High to wake EC up.
Set GPIO_HIBERNATE_L always open-drain.
BUG=none
BRANCH=trogdor
TEST=Rev1 dut can enter hibernate
Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Change-Id: Idc533cb9e216b9e220bb9b2dcc5b2f98975c40d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3353051
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Bob Moragues <moragues@chromium.org>
Commit-Queue: Bob Moragues <moragues@chromium.org>
-rw-r--r-- | baseboard/trogdor/baseboard.c | 5 | ||||
-rw-r--r-- | baseboard/trogdor/baseboard.h | 2 | ||||
-rw-r--r-- | board/quackingstick/board.c | 16 |
3 files changed, 14 insertions, 9 deletions
diff --git a/baseboard/trogdor/baseboard.c b/baseboard/trogdor/baseboard.c index de01d58211..21fb7cd9e1 100644 --- a/baseboard/trogdor/baseboard.c +++ b/baseboard/trogdor/baseboard.c @@ -8,13 +8,14 @@ #include "i2c.h" /* Wake-up pins for hibernate */ -const enum gpio_signal hibernate_wake_pins[] = { +enum gpio_signal hibernate_wake_pins[] = { GPIO_LID_OPEN, GPIO_AC_PRESENT, GPIO_POWER_BUTTON_L, GPIO_EC_RST_ODL, }; -const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); +int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); +BUILD_ASSERT(ARRAY_SIZE(hibernate_wake_pins) >= 3); int board_allow_i2c_passthru(int port) { diff --git a/baseboard/trogdor/baseboard.h b/baseboard/trogdor/baseboard.h index d361aeaac8..d65fb2dc1e 100644 --- a/baseboard/trogdor/baseboard.h +++ b/baseboard/trogdor/baseboard.h @@ -56,6 +56,8 @@ #define CONFIG_LID_SWITCH #define CONFIG_EXTPOWER_GPIO +#define CONFIG_HIBERNATE_WAKE_PINS_DYNAMIC + /* * On power-on, H1 releases the EC from reset but then quickly asserts and * releases the reset a second time. This means the EC sees 2 resets: diff --git a/board/quackingstick/board.c b/board/quackingstick/board.c index d0552b9f05..749bcdc4fd 100644 --- a/board/quackingstick/board.c +++ b/board/quackingstick/board.c @@ -393,13 +393,15 @@ void motion_interrupt(enum gpio_signal signal) static void board_init(void) { /* - * The rev-1 hardware doesn't have the external pull-up fix for the bug - * b/177611071. It requires rework to stuff the resistor. For people who - * has difficulty to do the rework, this is a workaround, which makes - * the GPIO push-pull, instead of open-drain. + * The rev-1 hardware use PP1800_SENSORS as the power of the hall IC, + * it cause the LID_OPEN_EC wake EC immediately when EC enter hibernate. */ - if (system_get_board_version() == 1) - gpio_set_flags(GPIO_HIBERNATE_L, GPIO_OUTPUT); + if (system_get_board_version() <= 1) { + hibernate_wake_pins[0] = GPIO_AC_PRESENT; + hibernate_wake_pins[1] = GPIO_POWER_BUTTON_L; + hibernate_wake_pins[2] = GPIO_EC_RST_ODL; + hibernate_wake_pins_used = 3; + } /* Enable BC1.2 interrupts */ gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L); @@ -469,7 +471,7 @@ void board_hibernate(void) * Board rev 1+ has the hardware fix. Don't need the following * workaround. */ - if (system_get_board_version() >= 1) + if (system_get_board_version() > 1) return; /* |