]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
da850/omap-l138: Add MMC support for DA850/OMAP-L138
authorLad, Prabhakar <prabhakar.lad@ti.com>
Sun, 24 Jun 2012 21:35:15 +0000 (21:35 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 1 Sep 2012 12:58:09 +0000 (14:58 +0200)
This patch adds support for MMC/SD on DA850/OMAP-L138.

Tested-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
arch/arm/include/asm/arch-davinci/hardware.h
arch/arm/include/asm/arch-davinci/pinmux_defs.h
board/davinci/da8xxevm/da850evm.c
include/configs/da850evm.h

index fa07fb591fb799fada3b191d5924ed9ec61a5a45..ad600b2b776e3e10ab90c61267658b66d275d7fb 100644 (file)
@@ -169,3 +169,14 @@ const struct pinmux_config emifa_pins_nor[] = {
        { pinmux(12), 1, 6 }, /* EMA_A[1] */
        { pinmux(12), 1, 7 }, /* EMA_A[0] */
 };
+
+/* MMC0 pin muxer settings */
+const struct pinmux_config mmc0_pins[] = {
+       { pinmux(10), 2, 0 },   /* MMCSD0_CLK */
+       { pinmux(10), 2, 1 },   /* MMCSD0_CMD */
+       { pinmux(10), 2, 2 },   /* MMCSD0_DAT_0 */
+       { pinmux(10), 2, 3 },   /* MMCSD0_DAT_1 */
+       { pinmux(10), 2, 4 },   /* MMCSD0_DAT_2 */
+       { pinmux(10), 2, 5 },   /* MMCSD0_DAT_3 */
+       /* DA850 supports only 4-bit mode, remaining pins are not configured */
+};
index b145c6e7f163b1e9992839b058d5425349320ea3..f6b7a2caef555fc4dea0b014b6379983003c512b 100644 (file)
@@ -446,6 +446,7 @@ struct davinci_pllc_regs {
 #define DAVINCI_SPI1_CLKID  (cpu_is_da830() ? 2 : ASYNC3)
 /* Clock IDs */
 enum davinci_clk_ids {
+       DAVINCI_MMCSD_CLKID = 2,
        DAVINCI_SPI0_CLKID = 2,
        DAVINCI_UART2_CLKID = 2,
        DAVINCI_MMC_CLKID = 2,
index 07aceaab037be590c122146cdabbcc3ad4d9d332..0db1e401af4c3037b0e69c1ac5233d11a8b06b94 100644 (file)
@@ -48,4 +48,7 @@ extern const struct pinmux_config emifa_pins_cs4[1];
 extern const struct pinmux_config emifa_pins_nand[12];
 extern const struct pinmux_config emifa_pins_nor[43];
 
+/* MMC pin muxer settings */
+extern const struct pinmux_config mmc0_pins[6];
+
 #endif
index 004d5ad6d493d80229865c09aee505a2b6c9936c..88337ffceb45522cace4f09ce421e15e1ddc2e55 100644 (file)
 #include <asm/errno.h>
 #include <hwconfig.h>
 
+#ifdef CONFIG_DAVINCI_MMC
+#include <mmc.h>
+#include <asm/arch/sdmmc_defs.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_DRIVER_TI_EMAC
@@ -204,11 +209,32 @@ int misc_init_r(void)
        return 0;
 }
 
+#ifdef CONFIG_DAVINCI_MMC
+static struct davinci_mmc mmc_sd0 = {
+       .reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
+       .host_caps = MMC_MODE_4BIT,     /* DA850 supports only 4-bit SD/MMC */
+       .voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
+       .version = MMC_CTLR_VERSION_2,
+};
+
+int board_mmc_init(bd_t *bis)
+{
+       mmc_sd0.input_clk = clk_get(DAVINCI_MMCSD_CLKID);
+
+       /* Add slot-0 to mmc subsystem */
+       return davinci_mmc_init(bis, &mmc_sd0);
+}
+#endif
+
 static const struct pinmux_config gpio_pins[] = {
 #ifdef CONFIG_USE_NOR
        /* GP0[11] is required for NOR to work on Rev 3 EVMs */
        { pinmux(0), 8, 4 },    /* GP0[11] */
 #endif
+#ifdef CONFIG_DAVINCI_MMC
+       /* GP0[11] is required for SD to work on Rev 3 EVMs */
+       { pinmux(0),  8, 4 },   /* GP0[11] */
+#endif
 };
 
 const struct pinmux_resource pinmuxes[] = {
@@ -236,6 +262,9 @@ const struct pinmux_resource pinmuxes[] = {
        PINMUX_ITEM(emifa_pins_nor),
 #endif
        PINMUX_ITEM(gpio_pins),
+#ifdef CONFIG_DAVINCI_MMC
+       PINMUX_ITEM(mmc0_pins),
+#endif
 };
 
 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
@@ -246,6 +275,9 @@ const struct lpsc_resource lpsc[] = {
        { DAVINCI_LPSC_EMAC },  /* image download */
        { DAVINCI_LPSC_UART2 }, /* console */
        { DAVINCI_LPSC_GPIO },
+#ifdef CONFIG_DAVINCI_MMC
+       { DAVINCI_LPSC_MMC_SD },
+#endif
 };
 
 const int lpsc_size = ARRAY_SIZE(lpsc);
index e6adb1fe5115ea9a7f26f7199f361d424b841c1e..dfbc6740646e07d3e0af41de83da0f6ed75e72fe 100644 (file)
 #undef CONFIG_CMD_ENV
 #endif
 
+/* SD/MMC configuration */
+#define CONFIG_MMC
+#define CONFIG_DAVINCI_MMC_SD1
+#define CONFIG_GENERIC_MMC
+#define CONFIG_DAVINCI_MMC
+
+/*
+ * Enable MMC commands only when
+ * MMC support is present
+ */
+#ifdef CONFIG_MMC
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_MMC
+#endif
+
 /* defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_SPI_SUPPORT