diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-10-01 17:30:29 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-08 02:07:12 +0000 |
commit | 37a2a114e66a9832605282b7b14285bcee965e9f (patch) | |
tree | 908a02b168f8bb2a3a037336cd954bea825e0f36 /board/coachz | |
parent | a8dec10c9da00eca5284ee34246fdeadf1ba9179 (diff) | |
download | chrome-ec-37a2a114e66a9832605282b7b14285bcee965e9f.tar.gz |
Trogdor: Disable PSL mode hibernate
The RTC stops counting under PSL mode. The Trogdor design relies on
EC to give the RTC counter. Disable the PSL mode hibernate and use
the traditional non-PSL mode way, i.e. power down all RAM blocks
except the last one.
BRANCH=None
BUG=b:169595541
TEST=Tested on Lazor; triggered hibernate, and waked it up using:
* power button press
* lid open
* servo toggling EC_RST_ODL
* AC plug (doesn't work, need to investigate why)
TEST=Verified RTC still counting in hibernate:
2020-10-07 14:35:53 [244.922648 power state 9 = S5->G3, in 0x0005]
2020-10-07 14:35:53 RTC: 0x5f7e34b9 (1602106553.00 s)
2020-10-07 14:35:53 [244.923417 power state 0 = G3, in 0x0005]
2020-10-07 14:35:53 [244.926855 SDC Safe]
2020-10-07 14:35:53 [244.927138 Hibernate due to G3 idle]
2020-10-07 14:36:20
2020-10-07 14:36:20
2020-10-07 14:36:20 --- UART initialized after reboot ---
2020-10-07 14:36:20 [Image: RO, lazor_v2.0.5690-d95436fd6 ...]
2020-10-07 14:36:20 [Reset cause: hibernate wake-pin]
2020-10-07 14:36:20
...
2020-10-07 14:36:23 > rtc
2020-10-07 14:36:25 RTC: 0x5f7e34d9 (1602106585.00 s)
First RTC diff from the wall clock: 6553-53 = 6500
Second RTC diff from the wall clock: 6585-(60+25) = 6500
TEST=Verified RTC wake up from hibernate:
2020-10-07 14:59:25 > hibernate 10
2020-10-07 14:59:27 Hibernating for 10.000000 s
2020-10-07 14:59:37
2020-10-07 14:59:37
2020-10-07 14:59:37 --- UART initialized after reboot ---
Change-Id: I23f6a65115d5722cf183948fad81dc16d3a6af47
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2447049
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Diffstat (limited to 'board/coachz')
-rw-r--r-- | board/coachz/gpio.inc | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/board/coachz/gpio.inc b/board/coachz/gpio.inc index d60d49fd77..00c70fc2e8 100644 --- a/board/coachz/gpio.inc +++ b/board/coachz/gpio.inc @@ -17,13 +17,13 @@ GPIO_INT(USB_C0_BC12_INT_L, PIN(6, 1), GPIO_INT_FALLING, usb0_evt) /* Interr GPIO_INT(USB_C1_BC12_INT_L, PIN(8, 2), GPIO_INT_FALLING, usb1_evt) /* Interrupt from port-1 BC1.2 */ /* System interrupts */ -GPIO_INT(CHG_ACOK_OD, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt) /* AC OK? */ +GPIO_INT(CHG_ACOK_OD, PIN(0, 0), GPIO_INT_BOTH, extpower_interrupt) /* ACOK */ GPIO_INT(CCD_MODE_ODL, PIN(E, 3), GPIO_INT_FALLING, board_connect_c0_sbu) /* Case Closed Debug Mode */ GPIO_INT(EC_PWR_BTN_ODL, PIN(0, 1), GPIO_INT_BOTH, power_button_interrupt) /* Power button */ GPIO_INT(EC_VOLDN_BTN_ODL, PIN(7, 0), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Up button */ GPIO_INT(EC_VOLUP_BTN_ODL, PIN(F, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Down button */ GPIO_INT(EC_FLASH_WP_ODL, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* Write protection */ -GPIO_INT(LID_OPEN_EC, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt) /* Lid open? */ +GPIO_INT(LID_OPEN_EC, PIN(D, 2), GPIO_INT_BOTH, lid_interrupt) /* Lid open */ GPIO_INT(AP_RST_L, PIN(C, 1), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_ap_rst_interrupt) /* PMIC to signal AP reset */ GPIO_INT(PS_HOLD, PIN(A, 4), GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, power_signal_interrupt) /* Indicate when AP triggers reset/shutdown */ GPIO_INT(PMIC_FAULT_L, PIN(A, 3), GPIO_INT_BOTH | GPIO_SEL_1P8V, power_signal_interrupt) /* Any PMIC fault? */ @@ -45,16 +45,10 @@ GPIO_INT(BASE_DET_L, PIN(3, 7), GPIO_INT_BOTH, base_detect_interrupt) /* GPIO_INT(ACCEL_GYRO_INT_L, PIN(A, 0), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt) /* Accelerometer/gyro interrupt */ /* - * EC_RST_ODL acts as a wake source from PSL hibernate mode. However, it does - * not need to be an interrupt for normal EC operations. Thus, configure it as - * GPIO_INT_BOTH with wake on low-to-high edge using GPIO_HIB_WAKE_HIGH so that - * PSL common code can configure PSL_IN correctly. - * - * Use the rising edge to wake EC up. If we chose the falling edge, it would - * still wake EC up, but EC is in an intermediate state until the signal goes - * back to high. + * EC_RST_ODL acts as a wake source from hibernate mode. However, it does not + * need to be an interrupt for normal EC operations. Simply set it an INPUT. */ -GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) /* Wake source: EC reset */ +GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INPUT) /* EC reset */ GPIO(EC_ENTERING_RW, PIN(E, 1), GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ GPIO(EC_BATT_PRES_ODL, PIN(E, 5), GPIO_INPUT) /* Battery Present */ @@ -154,7 +148,3 @@ ALTERNATE(PIN_MASK(4, 0x1C), 0, MODULE_ADC, 0) /* ADC1 (GPIO44), ADC ALTERNATE(PIN_MASK(4, 0xC0), 1, MODULE_SPI, GPIO_SEL_1P8V) /* SHI_SDO (GPIO47), SHI_SDI (GPIO46) */ ALTERNATE(PIN_MASK(5, 0x28), 1, MODULE_SPI, GPIO_SEL_1P8V) /* SHI_SCLK (GPIO55), SHI_CS# (GPIO53) */ ALTERNATE(PIN_MASK(B, 0x80), 1, MODULE_PWM, 0) /* PWM5 (GPIOB7) - EDP_BKLTCTL */ -ALTERNATE(PIN_MASK(D, 0x04), 1, MODULE_PMU, 0) /* PSL_IN1 (GPIOD2) - LID_OPEN_EC */ -ALTERNATE(PIN_MASK(0, 0x01), 1, MODULE_PMU, 0) /* PSL_IN2 (GPIO00) - ACOK_OD */ -ALTERNATE(PIN_MASK(0, 0x02), 1, MODULE_PMU, 0) /* PSL_IN3 (GPIO01) - EC_PWR_BTN_ODL */ -ALTERNATE(PIN_MASK(0, 0x04), 1, MODULE_PMU, 0) /* PSL_IN4 (GPIO02) - EC_RST_ODL */ |