diff --git a/board/veyron/gpio.inc b/board/veyron/gpio.inc index 37c91c80f7..e38ac5aea7 100644 --- a/board/veyron/gpio.inc +++ b/board/veyron/gpio.inc @@ -27,6 +27,7 @@ GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO(WP_L, B, 4, GPIO_INPUT, NULL) /* Outputs */ +GPIO(5V_DRV, A, 8, GPIO_OUT_LOW, NULL) GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) diff --git a/power/rockchip.c b/power/rockchip.c index 2397ef9d6a..62ec073675 100644 --- a/power/rockchip.c +++ b/power/rockchip.c @@ -163,6 +163,17 @@ static void set_pmic_source(int asserted) gpio_set_level(GPIO_PMIC_SOURCE_PWREN, asserted ? 1 : 0); } +/** + * Power on or off the VCC_5V + * + * @param asserted Assert (=1) or deassert (=0) the signal. + */ +static void set_5v_power(int asserted) +{ + /* Signal is active-high */ + gpio_set_level(GPIO_5V_DRV, asserted ? 1 : 0); +} + /** * Check for some event triggering the shutdown. * @@ -400,6 +411,7 @@ static void power_on(void) /* Call hooks now that AP is running */ hook_notify(HOOK_CHIPSET_STARTUP); + set_5v_power(1); CPRINTS("AP running ..."); } @@ -439,6 +451,7 @@ static int wait_for_power_button_release(unsigned int timeout_us) */ static void power_off(void) { + set_5v_power(0); /* Call hooks before we drop power rails */ hook_notify(HOOK_CHIPSET_SHUTDOWN); /* switch off all rails */