diff options
author | Ege Mihmanli <egemih@google.com> | 2017-11-15 17:19:58 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2017-11-20 18:56:45 +0000 |
commit | 75b154334d0e1273a4164fea87730c28d47109a5 (patch) | |
tree | 788a7631dd35041a8caff2407f98bca5c1a644c8 /src/mainboard | |
parent | 21573e9f4e6c5ec1c5ab7da265f42642f832394b (diff) |
google/gru: Add config for scarlet-derived boards
There is merit in having new boards use the pinouts and controls
in scarlet. This adds a config so new scarlet-derived boards can
easily use scarlet structure without going through every file
and adding new logic.
TEST=Run "emerge-scarlet coreboot"
Signed-off-by: egemih@chromium.org
Change-Id: I5808f93f4563033ce93050e1eedb6eac2b52c3b3
Reviewed-on: https://review.coreboot.org/22517
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/google/gru/Kconfig | 5 | ||||
-rw-r--r-- | src/mainboard/google/gru/board.h | 8 | ||||
-rw-r--r-- | src/mainboard/google/gru/bootblock.c | 8 | ||||
-rw-r--r-- | src/mainboard/google/gru/mainboard.c | 20 | ||||
-rw-r--r-- | src/mainboard/google/gru/pwm_regulator.c | 6 |
5 files changed, 27 insertions, 20 deletions
diff --git a/src/mainboard/google/gru/Kconfig b/src/mainboard/google/gru/Kconfig index 5eb35d49a5..3026c7e4ec 100644 --- a/src/mainboard/google/gru/Kconfig +++ b/src/mainboard/google/gru/Kconfig @@ -35,6 +35,11 @@ config GRU_HAS_WLAN_RESET default y if BOARD_GOOGLE_GRU || BOARD_GOOGLE_KEVIN || BOARD_GOOGLE_BOB default n +config GRU_BASEBOARD_SCARLET + bool + default y if BOARD_GOOGLE_SCARLET + default n + config BOARD_SPECIFIC_OPTIONS def_bool y select BOARD_ID_AUTO diff --git a/src/mainboard/google/gru/board.h b/src/mainboard/google/gru/board.h index f95db57e36..5722260bc9 100644 --- a/src/mainboard/google/gru/board.h +++ b/src/mainboard/google/gru/board.h @@ -24,15 +24,15 @@ #define GPIO_RESET GPIO(0, B, 3) #define GPIO_SDMMC_PWR GPIO(4, D, 5) -#if IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET) +#if IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET) #define GPIO_BACKLIGHT GPIO(4, C, 5) #define GPIO_EC_IN_RW GPIO(0, A, 1) #define GPIO_EC_IRQ GPIO(1, C, 2) -#define GPIO_P15V_EN dead_code_t(gpio_t, "PP1500 doesn't exist on Scarlet") -#define GPIO_P18V_AUDIO_PWREN dead_code_t(gpio_t, "doesn't exist on Scarlet") +#define GPIO_P15V_EN dead_code_t(gpio_t, "PP1500 doesn't exist on scarlet.") +#define GPIO_P18V_AUDIO_PWREN dead_code_t(gpio_t, "doesn't exist on scarlet.") #define GPIO_P30V_EN GPIO(0, B, 1) #define GPIO_SPK_PA_EN GPIO(0, A, 2) -#define GPIO_TP_RST_L dead_code_t(gpio_t, "don't need TP_RST_L on Scarlet") +#define GPIO_TP_RST_L dead_code_t(gpio_t, "don't need TP_RST_L on scarlet.") #define GPIO_TPM_IRQ GPIO(1, C, 1) #define GPIO_WP GPIO(0, B, 5) #else diff --git a/src/mainboard/google/gru/bootblock.c b/src/mainboard/google/gru/bootblock.c index 162a7e51f1..a18a61c101 100644 --- a/src/mainboard/google/gru/bootblock.c +++ b/src/mainboard/google/gru/bootblock.c @@ -44,8 +44,8 @@ void bootblock_mainboard_early_init(void) */ write32(&rk3399_grf->io_vsel, RK_SETBITS(1 << 0)); - /* Scarlet gpio4cd iodomain is 1.8V */ - if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) + /* Scarlet-based gpio4cd iodomain is 1.8V */ + if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) write32(&rk3399_grf->io_vsel, RK_SETBITS(1 << 3)); /* Reconfigure GPIO1 from dynamic voltage selection through GPIO0_B1 to @@ -56,7 +56,7 @@ void bootblock_mainboard_early_init(void) /* Enable rails powering GPIO blocks, among other things. */ gpio_output(GPIO_P30V_EN, 1); - if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) + if (!IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) gpio_output(GPIO_P15V_EN, 1); /* Scarlet: EC-controlled */ #if IS_ENABLED(CONFIG_DRIVERS_UART) @@ -102,7 +102,7 @@ static void configure_tpm(void) if (IS_ENABLED(CONFIG_GRU_HAS_TPM2)) { rockchip_spi_init(CONFIG_DRIVER_TPM_SPI_BUS, 1500*KHz); - if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) { + if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) { gpio_input(GPIO(2, B, 1)); /* SPI2_MISO no-pull */ gpio_input(GPIO(2, B, 2)); /* SPI2_MOSI no-pull */ gpio_input(GPIO(2, B, 3)); /* SPI2_CLK no-pull */ diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c index 3721ce8d87..99b335a810 100644 --- a/src/mainboard/google/gru/mainboard.c +++ b/src/mainboard/google/gru/mainboard.c @@ -34,7 +34,8 @@ /* * We have to drive the stronger pull-up within 1 second of powering up the - * touchpad to prevent its firmware from falling into recovery. Not on Scarlet. + * touchpad to prevent its firmware from falling into recovery. Not on + * Scarlet-based boards. */ static void configure_touchpad(void) { @@ -90,9 +91,10 @@ static void register_gpio_suspend(void) * 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. - * 1.5V and 1.8V are EC-controlled on Scarlet, so we skip them. + * 1.5V and 1.8V are EC-controlled on Scarlet derivatives, + * so we skip them. */ - if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) { + if (!IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) { static struct bl31_gpio_param param_p15_en = { .h = { .type = PARAM_SUSPEND_GPIO }, .gpio = { .polarity = BL31_GPIO_LEVEL_LOW }, @@ -159,7 +161,7 @@ static void configure_sdmmc(void) gpio_output(GPIO(2, A, 2), 1); /* SDMMC_SDIO_PWR_EN */ /* set SDMMC_DET_L pin */ - if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) + if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) /* * do not have external pull up, so need to * set this pin internal pull up @@ -170,10 +172,10 @@ static void configure_sdmmc(void) /* * Keep sd card io domain 3v - * In Scarlet this GPIO set to high will get 3v, + * In Scarlet derivatives, this GPIO set to high will get 3v, * With other board variants setting this GPIO low results in 3V. */ - if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) + if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) gpio_output(GPIO(2, D, 4), 1); else gpio_output(GPIO(2, D, 4), 0); @@ -226,7 +228,7 @@ static void configure_codec(void) /* AUDIO IO domain 1.8V voltage selection */ write32(&rk3399_grf->io_vsel, RK_SETBITS(1 << 1)); - if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) + if (!IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) gpio_output(GPIO_P18V_AUDIO_PWREN, 1); gpio_output(GPIO_SPK_PA_EN, 0); @@ -235,7 +237,7 @@ static void configure_codec(void) static void configure_display(void) { - if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) { + if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) { gpio_output(GPIO(4, D, 1), 0); /* DISPLAY_RST_L */ gpio_output(GPIO(4, D, 3), 1); /* PPVARP_LCD */ mdelay(10); @@ -340,7 +342,7 @@ static void mainboard_init(device_t dev) setup_usb(0); if (IS_ENABLED(CONFIG_GRU_HAS_WLAN_RESET)) assert_wifi_reset(); - if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) { + if (!IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) { configure_touchpad(); /* Scarlet: works differently */ setup_usb(1); /* Scarlet: only one USB port */ } diff --git a/src/mainboard/google/gru/pwm_regulator.c b/src/mainboard/google/gru/pwm_regulator.c index 6a9f1714e8..3ea37cfebf 100644 --- a/src/mainboard/google/gru/pwm_regulator.c +++ b/src/mainboard/google/gru/pwm_regulator.c @@ -48,7 +48,7 @@ int pwm_design_voltage[][2] = { [PWM_REGULATOR_CENTERLOG] = {7994, 10499} }; -/* Applies for Scarlet */ +/* Applies for Scarlet-based boards. */ int scarlet_pwm_design_voltage[][2] = { [PWM_REGULATOR_GPU] = {7996, 10990}, [PWM_REGULATOR_BIG] = {8000, 12992}, @@ -63,7 +63,7 @@ int pwm_enum_to_pwm_number[] = { #else [PWM_REGULATOR_CENTERLOG] = -1, #endif -#if IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET) +#if IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET) [PWM_REGULATOR_BIG] = 3, #else [PWM_REGULATOR_BIG] = 1, @@ -85,7 +85,7 @@ void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt) } else if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() >= 6) { voltage_min = kevin6_pwm_design_voltage[pwm][0]; voltage_max = kevin6_pwm_design_voltage[pwm][1]; - } else if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) { + } else if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) { voltage_min = scarlet_pwm_design_voltage[pwm][0]; voltage_max = scarlet_pwm_design_voltage[pwm][1]; } |