diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index 9891011fe4..7e1cd5797b 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -24,8 +24,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -35,6 +37,8 @@ #include "mainboard.h" +#define MMC0_GPIO_PIN (58) + #if 0 static int board_wakeup_permitted(void) { @@ -48,6 +52,24 @@ static int board_wakeup_permitted(void) } #endif +static void initialize_s5p_mshc(void) { + /* MMC0: Fixed, support 8 bit mode, connected with GPIO. */ + if (clock_set_mshci(PERIPH_ID_SDMMC0)) + printk(BIOS_CRIT, "Failed to set clock for SDMMC0.\n"); + if (gpio_direction_output(MMC0_GPIO_PIN, 1)) { + printk(BIOS_CRIT, "Unable to power on SDMMC0.\n"); + } + gpio_set_pull(MMC0_GPIO_PIN, EXYNOS_GPIO_PULL_NONE); + gpio_set_drv(MMC0_GPIO_PIN, EXYNOS_GPIO_DRV_4X); + /* TODO(hungte) Change 0 to PINMUX_FLAG_8BIT_MODE when the s5p_mshc + * driver is ready. */ + exynos_pinmux_config(PERIPH_ID_SDMMC0, 0); + + /* MMC2: Removable, 4 bit mode, no GPIO. */ + clock_set_mshci(PERIPH_ID_SDMMC2); + exynos_pinmux_config(PERIPH_ID_SDMMC2, 0); +} + void main(void) { struct mem_timings *mem; @@ -84,6 +106,8 @@ void main(void) mmu_setup(CONFIG_SYS_SDRAM_BASE, CONFIG_DRAM_SIZE_MB); + initialize_s5p_mshc(); + entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram"); printk(BIOS_INFO, "entry is 0x%p, leaving romstage.\n", entry);