aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/gru/mainboard.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2017-07-14 14:30:29 -0700
committerJulius Werner <jwerner@chromium.org>2017-07-19 18:15:15 +0000
commit6486e7819ccf4acf923d934d4293861f394cc065 (patch)
tree5b90d178a021829b9e268b9229b5e9e843668b32 /src/mainboard/google/gru/mainboard.c
parent4ed8b305539f661895d9fa950bb32fc653e37f47 (diff)
google/gru: Add support for Scarlet rev1
This patch adds the necessary changes to support Scarlet revision 1. Since the differences to revision 0 are so deep, we have decided not to continue support for it in the same image. Therefore, this patch will break Scarlet rev0. All the deviations from other Gru boards are currently guarded by CONFIG_BOARD_GOOGLE_SCARLET. This should be changed later if we introduce more variants based on the newer Scarlet board design. Change-Id: I7a7cc11d9387ac1d856663326e35cfa5371e0af2 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/20587 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Schneider <dnschneid@chromium.org>
Diffstat (limited to 'src/mainboard/google/gru/mainboard.c')
-rw-r--r--src/mainboard/google/gru/mainboard.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index fa127edf82..2542d74106 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -34,21 +34,21 @@
/*
* We have to drive the stronger pull-up within 1 second of powering up the
- * touchpad to prevent its firmware from falling into recovery.
+ * touchpad to prevent its firmware from falling into recovery. Not on Scarlet.
*/
static void configure_touchpad(void)
{
- gpio_output(GPIO(3, B, 4), 1); /* TP's I2C pull-up rail */
+ gpio_output(GPIO_TP_RST_L, 1); /* TP's I2C pull-up rail */
}
/*
* Wifi's PDN/RST line is pulled down by its (unpowered) voltage rails, but
* this reset pin is pulled up by default. Let's drive it low as early as we
- * can.
+ * can. Scarlet uses a different WiFi chip that doesn't have this pin anymore.
*/
-static void deassert_wifi_power(void)
+static void assert_wifi_reset(void)
{
- gpio_output(GPIO(1, B, 3), 0); /* Assert WLAN_MODULE_RST# */
+ gpio_output(GPIO_WLAN_RST_L, 0); /* Assert WLAN_MODULE_RST# */
}
static void configure_emmc(void)
@@ -234,11 +234,21 @@ static void configure_codec(void)
static void configure_display(void)
{
- /* set pinmux for edp HPD*/
- gpio_input_pulldown(GPIO(4, C, 7));
- write32(&rk3399_grf->iomux_edp_hotplug, IOMUX_EDP_HOTPLUG);
-
- gpio_output(GPIO(4, D, 3), 1); /* CPU3_EDP_VDDEN for P3.3V_DISP */
+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) {
+ gpio_output(GPIO(4, D, 1), 0); /* DISPLAY_RST_L */
+ gpio_output(GPIO(4, D, 3), 1); /* PPVARP_LCD */
+ mdelay(10);
+ gpio_output(GPIO(4, D, 4), 1); /* PPVARN_LCD */
+ mdelay(20 + 2); /* add 2ms for bias rise time */
+ gpio_output(GPIO(4, D, 1), 1); /* DISPLAY_RST_L */
+ mdelay(30);
+ } else {
+ /* set pinmux for edp HPD */
+ gpio_input_pulldown(GPIO(4, C, 7));
+ write32(&rk3399_grf->iomux_edp_hotplug, IOMUX_EDP_HOTPLUG);
+
+ gpio_output(GPIO(4, D, 3), 1); /* P3.3V_DISP */
+ }
}
static void usb_power_cycle(int port)
@@ -321,18 +331,20 @@ static void setup_usb(int port)
static void mainboard_init(device_t dev)
{
- deassert_wifi_power();
- configure_touchpad();
configure_sdmmc();
configure_emmc();
configure_codec();
- configure_display();
+ if (display_init_required())
+ configure_display();
setup_usb(0);
- if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET))
- setup_usb(1);
+ if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) {
+ assert_wifi_reset(); /* Scarlet: no WIFI_PD# line */
+ configure_touchpad(); /* Scarlet: works differently */
+ setup_usb(1); /* Scarlet: only one USB port */
+ register_gpio_suspend(); /* Scarlet: all EC-controlled */
+ }
register_reset_to_bl31();
register_poweroff_to_bl31();
- register_gpio_suspend();
register_apio_suspend();
}