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>
This commit is contained in:
Lin Huang 2016-05-19 11:11:23 +08:00 committed by Martin Roth
parent 5a4be8a2c7
commit 9a5c4fefec
2 changed files with 23 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#define GPIO_BACKLIGHT GPIO(1, C, 1) #define GPIO_BACKLIGHT GPIO(1, C, 1)
#define GPIO_EC_IN_RW GPIO(3, B, 0) #define GPIO_EC_IN_RW GPIO(3, B, 0)
#define GPIO_EC_IRQ GPIO(0, A, 1) #define GPIO_EC_IRQ GPIO(0, A, 1)
#define GPIO_POWEROFF GPIO(1, A, 6)
#define GPIO_RESET GPIO(0, B, 3) #define GPIO_RESET GPIO(0, B, 3)
#define GPIO_WP GPIO(1, C, 2) #define GPIO_WP GPIO(1, C, 2)

View File

@ -62,6 +62,27 @@ static void register_reset_to_bl31(void)
register_bl31_param(&param_reset.h); 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) static void configure_sdmmc(void)
{ {
gpio_output(GPIO(4, D, 5), 1); /* SDMMC_PWR_EN */ gpio_output(GPIO(4, D, 5), 1); /* SDMMC_PWR_EN */
@ -151,6 +172,7 @@ static void mainboard_init(device_t dev)
configure_display(); configure_display();
setup_usb(); setup_usb();
register_reset_to_bl31(); register_reset_to_bl31();
register_poweroff_to_bl31();
} }
static void enable_backlight_booster(void) static void enable_backlight_booster(void)