summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-08-22 17:35:40 -0700
committerPatrick Georgi <pgeorgi@google.com>2016-10-07 17:09:02 +0200
commit7d8ccfb9b32cbffca1fb36cc775d399ace1b4cca (patch)
tree3d49f801a52fa9cf369947edcb8f1541e76f4db8 /src/mainboard/google
parent0b1a90da76cc1e81b6a1a43a8ffc2ddd97b84377 (diff)
downloadcoreboot-7d8ccfb9b32cbffca1fb36cc775d399ace1b4cca.tar.xz
google/gru: pass the gpio power supply enable pin to bl31
We need to disable some regulators when the device goes into suspend. This means that we need to pass some gpios to bl31, and disable these gpios when bl31 runs the suspend function. BRANCH=None BUG=chrome-os-partner:56423 TEST=enter suspend, measure suspend gpio go to low [pg: also update arm-trusted-firmware to match] Change-Id: Ia0835e16f7e65de6dd24a892241f0af542ec5b4b Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 0f3332ef2136fd93f7faad579386ba5af003cf70 Original-Change-Id: I03d0407e0ef035823519a997534dcfea078a7ccd Original-Signed-off-by: Lin Huang <hl@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/374046 Original-Commit-Ready: Caesar Wang <wxt@rock-chips.com> Original-Tested-by: Caesar Wang <wxt@rock-chips.com> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/16719 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/gru/board.h3
-rw-r--r--src/mainboard/google/gru/mainboard.c44
2 files changed, 47 insertions, 0 deletions
diff --git a/src/mainboard/google/gru/board.h b/src/mainboard/google/gru/board.h
index 382c462dfa..7880cca70d 100644
--- a/src/mainboard/google/gru/board.h
+++ b/src/mainboard/google/gru/board.h
@@ -25,6 +25,9 @@
#define GPIO_POWEROFF GPIO(1, A, 6)
#define GPIO_RESET GPIO(0, B, 3)
#define GPIO_WP GPIO(1, C, 2)
+#define GPIO_P15V_EN GPIO(0, B, 2)
+#define GPIO_P30V_EN GPIO(0, B, 4)
+#define GPIO_P18V_AUDIO_PWREN GPIO(0, A, 2)
void setup_chromeos_gpios(void);
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index 8359ca49dc..1812a2ab41 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -43,6 +43,49 @@ static void configure_emmc(void)
rkclk_configure_emmc();
}
+static void register_gpio_suspend(void)
+{
+ /*
+ * These three GPIO params are used to shut down the 1.5V, 1.8V and
+ * 3.3V power rails, which need to be shut down ordered by voltage,
+ * with highest voltage first.
+ * Since register_bl31() appends to the front of the list, we need to
+ * register them backwards, with 1.5V coming first.
+ */
+ static struct bl31_gpio_param param_p15_en = {
+ .h = {
+ .type = PARAM_SUSPEND_GPIO,
+ },
+ .gpio = {
+ .polarity = BL31_GPIO_LEVEL_LOW,
+ },
+ };
+ param_p15_en.gpio.index = GET_GPIO_NUM(GPIO_P15V_EN);
+ register_bl31_param(&param_p15_en.h);
+
+ static struct bl31_gpio_param param_p18_audio_en = {
+ .h = {
+ .type = PARAM_SUSPEND_GPIO,
+ },
+ .gpio = {
+ .polarity = BL31_GPIO_LEVEL_LOW,
+ },
+ };
+ param_p18_audio_en.gpio.index = GET_GPIO_NUM(GPIO_P18V_AUDIO_PWREN);
+ register_bl31_param(&param_p18_audio_en.h);
+
+ static struct bl31_gpio_param param_p30_en = {
+ .h = {
+ .type = PARAM_SUSPEND_GPIO,
+ },
+ .gpio = {
+ .polarity = BL31_GPIO_LEVEL_LOW,
+ },
+ };
+ param_p30_en.gpio.index = GET_GPIO_NUM(GPIO_P30V_EN);
+ register_bl31_param(&param_p30_en.h);
+}
+
static void register_reset_to_bl31(void)
{
static struct bl31_gpio_param param_reset = {
@@ -184,6 +227,7 @@ static void mainboard_init(device_t dev)
setup_usb();
register_reset_to_bl31();
register_poweroff_to_bl31();
+ register_gpio_suspend();
}
static void enable_backlight_booster(void)