diff options
Diffstat (limited to 'board/hatch_fp')
-rw-r--r-- | board/hatch_fp/board_rw.c | 24 | ||||
-rw-r--r-- | board/hatch_fp/gpio_rw.inc | 4 |
2 files changed, 17 insertions, 11 deletions
diff --git a/board/hatch_fp/board_rw.c b/board/hatch_fp/board_rw.c index 40ab5092a7..74794647cf 100644 --- a/board/hatch_fp/board_rw.c +++ b/board/hatch_fp/board_rw.c @@ -23,18 +23,24 @@ * Some platforms have a broken SLP_S0_L signal (stuck to 0 in S0) * if set, ignore it and only uses SLP_S3_L for the AP state. */ -static bool broken_slp_s0; +static bool broken_slp; static void ap_deferred(void) { /* - * in S3: SLP_S3_L is 0 and SLP_S0_L is X. - * in S0ix: SLP_S3_L is 1 and SLP_S0_L is 0. - * in S0: SLP_S3_L is 1 and SLP_S0_L is 1. + * Behavior: + * AP Active (ex. Intel S0): SLP_L is 1 + * AP Suspend (ex. Intel S0ix): SLP_L is 0 + * The alternative SLP_ALT_L should be pulled high at all the times. + * + * Legacy Intel behavior: + * in S3: SLP_ALT_L is 0 and SLP_L is X. + * in S0ix: SLP_ALT_L is 1 and SLP_L is 0. + * in S0: SLP_ALT_L is 1 and SLP_L is 1. * in S5/G3, the FP MCU should not be running. */ - int running = gpio_get_level(GPIO_PCH_SLP_S3_L) && - (gpio_get_level(GPIO_PCH_SLP_S0_L) || broken_slp_s0); + int running = gpio_get_level(GPIO_SLP_ALT_L) && + (gpio_get_level(GPIO_SLP_L) || broken_slp); if (running) { /* S0 */ disable_sleep(SLEEP_MASK_AP_RUN); @@ -85,15 +91,15 @@ void board_init_rw(void) * TODO(b/174695987) once the RW AP firmware has been updated * on all those machines, remove this workaround. */ - broken_slp_s0 = true; + broken_slp = true; } /* Configure and enable SPI as master for FP sensor */ configure_fp_sensor_spi(); /* Enable interrupt on PCH power signals */ - gpio_enable_interrupt(GPIO_PCH_SLP_S3_L); - gpio_enable_interrupt(GPIO_PCH_SLP_S0_L); + gpio_enable_interrupt(GPIO_SLP_ALT_L); + gpio_enable_interrupt(GPIO_SLP_L); /* enable the SPI slave interface if the PCH is up */ hook_call_deferred(&ap_deferred_data, 0); diff --git a/board/hatch_fp/gpio_rw.inc b/board/hatch_fp/gpio_rw.inc index 50d1e76f50..fdc6428b3a 100644 --- a/board/hatch_fp/gpio_rw.inc +++ b/board/hatch_fp/gpio_rw.inc @@ -10,8 +10,8 @@ /* Interrupts */ GPIO_INT(FPS_INT, PIN(A, 0), GPIO_INT_RISING, fps_event) -GPIO_INT(PCH_SLP_S0_L, PIN(A, 8), GPIO_INT_BOTH, slp_event) -GPIO_INT(PCH_SLP_S3_L, PIN(B, 6), GPIO_INT_BOTH, slp_event) +GPIO_INT(SLP_L, PIN(A, 8), GPIO_INT_BOTH, slp_event) +GPIO_INT(SLP_ALT_L, PIN(B, 6), GPIO_INT_BOTH, slp_event) /* Inputs */ GPIO(FP_SENSOR_SEL, PIN(B, 0), GPIO_INPUT) |