aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/gru/mainboard.c
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-05-19 11:11:23 +0800
committerMartin Roth <martinroth@google.com>2016-06-21 22:50:28 +0200
commit9a5c4fefec14302ca70e8f1ac046ce03fcbb728b (patch)
tree308defb17a93932e2947ab5cc53c19f03ac8d9c6 /src/mainboard/google/gru/mainboard.c
parent5a4be8a2c738a8424bf78b072d9a397f5bddca39 (diff)
rockchip: gru: pass poweroff gpio parameter to BL31
To support gpio power off SOC, we need to pass the power off gpio parameter to BL31. Gru reuse tsadc overtemp pin as power off gpio, so need to iomux to gpio function when use gpio power off function, either in bl31 or depthcharge. BRANCH=None BUG=chrome-os-partner:53448 TEST=Build gru Change-Id: Ibfe64042f39f6df1b87536b50fe432859bf74426 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: Original-Change-Id: Ie7a1bbea4a12753f0abac7a9142f2e032686ce31 Original-Signed-off-by: Lin Huang <hl@rock-chips.com> Original-Signed-off-by: Douglas Anderson <dianders@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/349703 Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://review.coreboot.org/15119 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/gru/mainboard.c')
-rw-r--r--src/mainboard/google/gru/mainboard.c22
1 files changed, 22 insertions, 0 deletions
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)