From c5879cf6a9fec40be9e9e63839de8879b3a3f701 Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Fri, 20 Aug 2010 08:55:39 +0900 Subject: [PATCH] s5pc210: universal: Enable MMC (not yet work) Signed-off-by: Kyungmin Park --- board/samsung/universal_c210/universal.c | 60 ++++++++++++++++++++++++++++++++ include/configs/s5pc210_universal.h | 4 +-- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index 8578515..dd3a2ae 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -23,11 +23,18 @@ */ #include +#include DECLARE_GLOBAL_DATA_PTR; +static struct s5pc210_gpio_part1 *gpio1; +static struct s5pc210_gpio_part2 *gpio2; + int board_init(void) { + gpio1 = (struct s5pc210_gpio_part1 *) S5PC210_GPIO_PART1_BASE; + gpio2 = (struct s5pc210_gpio_part2 *) S5PC210_GPIO_PART2_BASE; + gd->bd->bi_arch_number = MACH_TYPE_GONI; gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; @@ -43,3 +50,56 @@ int dram_init(void) return 0; } + +#ifdef CONFIG_GENERIC_MMC +int s5p_no_mmc_support(void) +{ + return 0; +} + +int board_mmc_init(bd_t *bis) +{ + int i; + + if (s5p_no_mmc_support()) + return -1; + + /* + * eMMC GPIO: + * SDR 8-bit@48MHz at MMC0 + * GPK0[0] SD_0_CLK(2) + * GPK0[1] SD_0_CMD(2) + * GPK0[2] SD_0_CDn -> Not used + * GPK0[3:6] SD_0_DATA[0:3](2) + * GPK1[3:6] SD_0_DATA[0:3](3) + * + * DDR 4-bit@26MHz at MMC4 + * GPK0[0] SD_4_CLK(3) + * GPK0[1] SD_4_CMD(3) + * GPK0[2] SD_4_CDn -> Not used + * GPK0[3:6] SD_4_DATA[0:3](3) + * GPK1[3:6] SD_4_DATA[4:7](4) + */ + for (i = 0; i < 7; i++) { + if (i == 2) + continue; + /* GPK0[0:6] special function 2 */ + gpio_cfg_pin(&gpio2->gpio_k0, i, 0x2); + /* GPK0[0:6] pull disable */ + gpio_set_pull(&gpio2->gpio_k0, i, GPIO_PULL_NONE); + /* GPK0[0:6] drv 4x */ + gpio_set_drv(&gpio2->gpio_k0, i, GPIO_DRV_4X); + } + + for (i = 3; i < 7; i++) { + /* GPK1[3:6] special function 3 */ + gpio_cfg_pin(&gpio2->gpio_k1, i, 0x3); + /* GPK1[3:6] pull disable */ + gpio_set_pull(&gpio2->gpio_k1, i, GPIO_PULL_NONE); + /* GPK1[3:6] drv 4x */ + gpio_set_drv(&gpio2->gpio_k1, i, GPIO_DRV_4X); + } + + return s5p_mmc_init(0); +} +#endif diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index 25c70ca..728843b 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -81,7 +81,7 @@ #define CONFIG_SERIAL2 1 /* we use SERIAL 2 on S5PC210 */ /* MMC */ -#if 0 +#if 1 #define CONFIG_GENERIC_MMC 1 #define CONFIG_MMC 1 #define CONFIG_S5P_MMC 1 @@ -123,7 +123,7 @@ #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MTDPARTS_LITE //#define CONFIG_CMD_I2C -//#define CONFIG_CMD_MMC +#define CONFIG_CMD_MMC #define CONFIG_CMD_SLEEP #define CONFIG_CMD_PMIC #define CONFIG_CMD_DEVICE_POWER -- 2.7.4