]> git.sur5r.net Git - u-boot/commitdiff
Blackfin: bfin_sdh: convert to portmux framework
authorMike Frysinger <vapier@gentoo.org>
Wed, 2 Jun 2010 09:59:50 +0000 (05:59 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 13 Jul 2010 21:50:49 +0000 (17:50 -0400)
Rather than bang MMRs directly, use the new portmux framework to handle
the details.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
drivers/mmc/bfin_sdh.c

index f9d560a71b58efcfdbb2701af4fc0c1065bffd89..4a77779f5b6bfb5bdf20ad92ab52b9fbe53198bd 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/errno.h>
 #include <asm/byteorder.h>
 #include <asm/blackfin.h>
+#include <asm/portmux.h>
 #include <asm/mach-common/bits/sdh.h>
 #include <asm/mach-common/bits/dma.h>
 
 # define bfin_write_DMA_X_COUNT                bfin_write_DMA4_X_COUNT
 # define bfin_write_DMA_X_MODIFY       bfin_write_DMA4_X_MODIFY
 # define bfin_write_DMA_CONFIG         bfin_write_DMA4_CONFIG
+# define PORTMUX_PINS \
+       { P_RSI_DATA0, P_RSI_DATA1, P_RSI_DATA2, P_RSI_DATA3, P_RSI_CMD, P_RSI_CLK, 0 }
 #elif defined(__ADSPBF54x__)
 # define bfin_write_DMA_START_ADDR     bfin_write_DMA22_START_ADDR
 # define bfin_write_DMA_X_COUNT                bfin_write_DMA22_X_COUNT
 # define bfin_write_DMA_X_MODIFY       bfin_write_DMA22_X_MODIFY
 # define bfin_write_DMA_CONFIG         bfin_write_DMA22_CONFIG
+# define PORTMUX_PINS \
+       { P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0 }
 #else
 # error no support for this proc yet
 #endif
@@ -208,18 +213,13 @@ static void bfin_sdh_set_ios(struct mmc *mmc)
 
 static int bfin_sdh_init(struct mmc *mmc)
 {
-
+       const unsigned short pins[] = PORTMUX_PINS;
        u16 pwr_ctl = 0;
-/* Initialize sdh controller */
+
+       /* Initialize sdh controller */
+       peripheral_request_list(pins, "bfin_sdh");
 #if defined(__ADSPBF54x__)
        bfin_write_DMAC1_PERIMUX(bfin_read_DMAC1_PERIMUX() | 0x1);
-       bfin_write_PORTC_FER(bfin_read_PORTC_FER() | 0x3F00);
-       bfin_write_PORTC_MUX(bfin_read_PORTC_MUX() & ~0xFFF0000);
-#elif defined(__ADSPBF51x__)
-       bfin_write_PORTG_FER(bfin_read_PORTG_FER() | 0x01F8);
-       bfin_write_PORTG_MUX((bfin_read_PORTG_MUX() & ~0x3FC) | 0x154);
-#else
-# error no portmux for this proc yet
 #endif
        bfin_write_SDH_CFG(bfin_read_SDH_CFG() | CLKS_EN);
        /* Disable card detect pin */