ARM: OMAP: Apollon MMC support
authorKyungmin Park <kyungmin.park@samsung.com>
Mon, 25 Sep 2006 09:41:25 +0000 (12:41 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 25 Sep 2006 09:41:25 +0000 (12:41 +0300)
Apollon board MMC supports on OMAP2

TODO:
        We have to check MMC on H4

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/mux.c
arch/arm/plat-omap/devices.c
include/asm-arm/arch-omap/irqs.h
include/asm-arm/arch-omap/mux.h

index 7993b7bae2bdaaae807305b54527bec43a40abae..2db6b732b084837fe29e7f4d5f7213b213c88ee9 100644 (file)
@@ -166,8 +166,8 @@ static struct omap_uart_config apollon_uart_config __initdata = {
 
 static struct omap_mmc_config apollon_mmc_config __initdata = {
        .mmc [0] = {
-               .enabled        = 0,
-               .wire4          = 0,
+               .enabled        = 1,
+               .wire4          = 1,
                .wp_pin         = -1,
                .power_pin      = -1,
                .switch_pin     = -1,
@@ -257,6 +257,9 @@ static void __init omap_apollon_init(void)
        /* REVISIT: where's the correct place */
        omap_cfg_reg(W19_24XX_SYS_NIRQ);
 
+       /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
+       CONTROL_DEVCONF |= (1 << 24);
+
        /*
         * Make sure the serial ports are muxed on at this point.
         * You have to mux them off in device drivers later on
index 60ef084faffd04e8102ac9c3dbbc94d58b0cef2c..f538d0fdb13c35a47ec2bca1c3996f1b8e44c9c0 100644 (file)
@@ -104,6 +104,20 @@ MUX_CFG_24XX("P20_24XX_TSC_IRQ",   0x108,  0,      0,      0,      1)
 MUX_CFG_24XX("K15_24XX_UART3_TX",      0x118,  0,      0,      0,      1)
 MUX_CFG_24XX("K14_24XX_UART3_RX",      0x119,  0,      0,      0,      1)
 
+/* MMC/SDIO */
+MUX_CFG_24XX("G19_24XX_MMC_CLKO",      0x0f3,  0,      0,      0,      1)
+MUX_CFG_24XX("H18_24XX_MMC_CMD",       0x0f4,  0,      0,      0,      1)
+MUX_CFG_24XX("F20_24XX_MMC_DAT0",      0x0f5,  0,      0,      0,      1)
+MUX_CFG_24XX("H14_24XX_MMC_DAT1",      0x0f6,  0,      0,      0,      1)
+MUX_CFG_24XX("E19_24XX_MMC_DAT2",      0x0f7,  0,      0,      0,      1)
+MUX_CFG_24XX("D19_24XX_MMC_DAT3",      0x0f8,  0,      0,      0,      1)
+MUX_CFG_24XX("F19_24XX_MMC_DAT_DIR0",  0x0f9,  0,      0,      0,      1)
+MUX_CFG_24XX("E20_24XX_MMC_DAT_DIR1",  0x0fa,  0,      0,      0,      1)
+MUX_CFG_24XX("F18_24XX_MMC_DAT_DIR2",  0x0fb,  0,      0,      0,      1)
+MUX_CFG_24XX("E18_24XX_MMC_DAT_DIR3",  0x0fc,  0,      0,      0,      1)
+MUX_CFG_24XX("G18_24XX_MMC_CMD_DIR",   0x0fd,  0,      0,      0,      1)
+MUX_CFG_24XX("H15_24XX_MMC_CLKI",      0x0fe,  0,      0,      0,      1)
+
 /* Keypad GPIO*/
 MUX_CFG_24XX("T19_24XX_KBR0",          0x106,  3,      1,      1,      1)
 MUX_CFG_24XX("R19_24XX_KBR1",          0x107,  3,      1,      1,      1)
index 1812f237d12f9f0327531d73db6b302356847339..dbc3f44e07a603f8b891c2901e1223a846dc34f1 100644 (file)
@@ -148,7 +148,7 @@ static inline void omap_init_kp(void) {}
 
 #ifdef CONFIG_ARCH_OMAP24XX
 #define        OMAP_MMC1_BASE          0x4809c000
-#define OMAP_MMC1_INT          83
+#define OMAP_MMC1_INT          INT_24XX_MMC_IRQ
 #else
 #define        OMAP_MMC1_BASE          0xfffb7800
 #define OMAP_MMC1_INT          INT_MMC
@@ -225,7 +225,14 @@ static void __init omap_init_mmc(void)
        /* block 1 is always available and has just one pinout option */
        mmc = &mmc_conf->mmc[0];
        if (mmc->enabled) {
-               if (!cpu_is_omap24xx()) {
+               if (cpu_is_omap24xx()) {
+                       omap_cfg_reg(H18_24XX_MMC_CMD);
+                       omap_cfg_reg(H15_24XX_MMC_CLKI);
+                       omap_cfg_reg(G19_24XX_MMC_CLKO);
+                       omap_cfg_reg(F20_24XX_MMC_DAT0);
+                       omap_cfg_reg(F19_24XX_MMC_DAT_DIR0);
+                       omap_cfg_reg(G18_24XX_MMC_CMD_DIR);
+               } else {
                        omap_cfg_reg(MMC_CMD);
                        omap_cfg_reg(MMC_CLK);
                        omap_cfg_reg(MMC_DAT0);
@@ -236,7 +243,14 @@ static void __init omap_init_mmc(void)
                        }
                }
                if (mmc->wire4) {
-                       if (!cpu_is_omap24xx()) {
+                       if (cpu_is_omap24xx()) {
+                               omap_cfg_reg(H14_24XX_MMC_DAT1);
+                               omap_cfg_reg(E19_24XX_MMC_DAT2);
+                               omap_cfg_reg(D19_24XX_MMC_DAT3);
+                               omap_cfg_reg(E20_24XX_MMC_DAT_DIR1);
+                               omap_cfg_reg(F18_24XX_MMC_DAT_DIR2);
+                               omap_cfg_reg(E18_24XX_MMC_DAT_DIR3);
+                       } else {
                                omap_cfg_reg(MMC_DAT1);
                                /* NOTE:  DAT2 can be on W10 (here) or M15 */
                                if (!mmc->nomux)
index 636f21cae3ee67a49c0802392656ca3dfe1a7fc8..c5bb05a69b81ec815c405d79b8b3bd553e29abc3 100644 (file)
 #define INT_24XX_UART1_IRQ     72
 #define INT_24XX_UART2_IRQ     73
 #define INT_24XX_UART3_IRQ     74
+#define INT_24XX_MMC_IRQ       83
 
 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
  * 16 MPUIO lines */
index 679869c5e68fbdd0ff4aca17028645cb9ee5bab6..a6df97c11839720ce2ccc4ad532470f6bc66043d 100644 (file)
@@ -461,6 +461,20 @@ enum omap24xx_index {
        K15_24XX_UART3_TX,
        K14_24XX_UART3_RX,
 
+       /* MMC/SDIO */
+       G19_24XX_MMC_CLKO,
+       H18_24XX_MMC_CMD,
+       F20_24XX_MMC_DAT0,
+       H14_24XX_MMC_DAT1,
+       E19_24XX_MMC_DAT2,
+       D19_24XX_MMC_DAT3,
+       F19_24XX_MMC_DAT_DIR0,
+       E20_24XX_MMC_DAT_DIR1,
+       F18_24XX_MMC_DAT_DIR2,
+       E18_24XX_MMC_DAT_DIR3,
+       G18_24XX_MMC_CMD_DIR,
+       H15_24XX_MMC_CLKI,
+
        /* Keypad GPIO*/
        T19_24XX_KBR0,
        R19_24XX_KBR1,