summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/gru/board.h1
-rw-r--r--src/mainboard/google/gru/mainboard.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/src/mainboard/google/gru/board.h b/src/mainboard/google/gru/board.h
index 6d80cdfba3..382c462dfa 100644
--- a/src/mainboard/google/gru/board.h
+++ b/src/mainboard/google/gru/board.h
@@ -22,6 +22,7 @@
#define GPIO_BACKLIGHT GPIO(1, C, 1)
#define GPIO_EC_IN_RW GPIO(3, B, 0)
#define GPIO_EC_IRQ GPIO(0, A, 1)
+#define GPIO_POWEROFF GPIO(1, A, 6)
#define GPIO_RESET GPIO(0, B, 3)
#define GPIO_WP GPIO(1, C, 2)
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index 23051290a0..0c4489c9a3 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -62,6 +62,27 @@ static void register_reset_to_bl31(void)
register_bl31_param(&param_reset.h);
}
+static void register_poweroff_to_bl31(void)
+{
+ static struct bl31_gpio_param param_poweroff = {
+ .h = {
+ .type = PARAM_POWEROFF,
+ },
+ .gpio = {
+ .polarity = 1,
+ },
+ };
+
+ /*
+ * gru/kevin power off pin: gpio1a6,
+ * reuse with tsadc int pin, so iomux need set back to
+ * gpio in BL31 and depthcharge before you setting this gpio
+ */
+ param_poweroff.gpio.index = GET_GPIO_NUM(GPIO_POWEROFF),
+
+ register_bl31_param(&param_poweroff.h);
+}
+
static void configure_sdmmc(void)
{
gpio_output(GPIO(4, D, 5), 1); /* SDMMC_PWR_EN */
@@ -151,6 +172,7 @@ static void mainboard_init(device_t dev)
configure_display();
setup_usb();
register_reset_to_bl31();
+ register_poweroff_to_bl31();
}
static void enable_backlight_booster(void)