summaryrefslogtreecommitdiff
path: root/drivers/mmc/bfin_sdh.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-06-02 05:59:50 -0400
committerMike Frysinger <vapier@gentoo.org>2010-07-13 17:50:49 -0400
commita87589fcf9b58b599c5a9b07ab4ecbc42354348d (patch)
treec61123e71f9da35ff6e8faa3ad512c4a42a38749 /drivers/mmc/bfin_sdh.c
parent253f47f3a702fb202dead17cc3491a6ba26a2df4 (diff)
downloadu-boot-imx-a87589fcf9b58b599c5a9b07ab4ecbc42354348d.zip
u-boot-imx-a87589fcf9b58b599c5a9b07ab4ecbc42354348d.tar.gz
u-boot-imx-a87589fcf9b58b599c5a9b07ab4ecbc42354348d.tar.bz2
Blackfin: bfin_sdh: convert to portmux framework
Rather than bang MMRs directly, use the new portmux framework to handle the details. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/mmc/bfin_sdh.c')
-rw-r--r--drivers/mmc/bfin_sdh.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c
index f9d560a..4a77779 100644
--- a/drivers/mmc/bfin_sdh.c
+++ b/drivers/mmc/bfin_sdh.c
@@ -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>
@@ -41,11 +42,15 @@
# 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 */