diff options
author | John Rigby <john.rigby@linaro.org> | 2012-02-03 15:34:35 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-05-02 19:44:06 -0600 |
commit | cf29ddf58a91db2fd4e741a5355160e19402c448 (patch) | |
tree | 43d599d266bdb5ffd4522e7ac08d4748e797998f | |
parent | 8ad9947ed55372436151d2b6b8862d5d6ef4dc34 (diff) |
MMC: arm_pl180_mmci: allow multiple devices
Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r-- | board/armltd/vexpress/vexpress_common.c | 2 | ||||
-rw-r--r-- | board/st-ericsson/u8500/u8500_href.c | 2 | ||||
-rw-r--r-- | drivers/mmc/arm_pl180_mmci.c | 24 | ||||
-rw-r--r-- | drivers/mmc/arm_pl180_mmci.h | 2 | ||||
-rw-r--r-- | include/configs/u8500_href.h | 2 | ||||
-rw-r--r-- | include/configs/vexpress_common.h | 2 |
6 files changed, 24 insertions, 10 deletions
diff --git a/board/armltd/vexpress/vexpress_common.c b/board/armltd/vexpress/vexpress_common.c index 2fd9f6de2..62815bdcf 100644 --- a/board/armltd/vexpress/vexpress_common.c +++ b/board/armltd/vexpress/vexpress_common.c @@ -90,7 +90,7 @@ int cpu_mmc_init(bd_t *bis) { int rc = 0; #ifdef CONFIG_ARM_PL180_MMCI - rc = arm_pl180_mmci_init(); + rc = arm_pl180_mmci_init(0); #endif return rc; } diff --git a/board/st-ericsson/u8500/u8500_href.c b/board/st-ericsson/u8500/u8500_href.c index 5f85fdcbf..8170a8773 100644 --- a/board/st-ericsson/u8500/u8500_href.c +++ b/board/st-ericsson/u8500/u8500_href.c @@ -451,7 +451,7 @@ int board_mmc_init(bd_t *bd) if (u8500_mmci_board_init()) return -ENODEV; - if (arm_pl180_mmci_init()) + if (arm_pl180_mmci_init(CONFIG_MMC_DEV_NUM)) return -ENODEV; return 0; } diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index 09d443ee3..877fd3011 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -360,12 +360,26 @@ err: * Set initial clock and power for mmc slot. * Initialize mmc struct and register with mmc framework. */ -static int arm_pl180_mmci_host_init(struct mmc *dev) +static int arm_pl180_mmci_host_init(int index, struct mmc *dev) { struct mmc_host *host = dev->priv; u32 sdi_u32; - host->base = (struct sdi_registers *)CONFIG_ARM_PL180_MMCI_BASE; + switch (index) { +#ifdef CONFIG_ARM_PL180_MMCI_BASE0 + case 0: + host->base = (struct sdi_registers *)CONFIG_ARM_PL180_MMCI_BASE0; + break; +#endif +#ifdef CONFIG_ARM_PL180_MMCI_BASE1 + case 1: + host->base = (struct sdi_registers *)CONFIG_ARM_PL180_MMCI_BASE1; + break; +#endif + default: + printf("Bad index in %s\n", __FUNCTION__); + return 1; + } /* Initially set power-on, full voltage & MMCI read */ sdi_u32 = INIT_PWR; @@ -394,7 +408,7 @@ static int arm_pl180_mmci_host_init(struct mmc *dev) return 0; } -int arm_pl180_mmci_init(void) +int arm_pl180_mmci_init(int index) { int error; struct mmc *dev; @@ -403,9 +417,9 @@ int arm_pl180_mmci_init(void) if (!dev) return -1; - error = arm_pl180_mmci_host_init(dev); + error = arm_pl180_mmci_host_init(index, dev); if (error) { - printf("mmci_host_init error - %d\n", error); + printf("mmci_host_init index %d error - %d\n", index, error); return -1; } diff --git a/drivers/mmc/arm_pl180_mmci.h b/drivers/mmc/arm_pl180_mmci.h index 42fbe3e38..43aef3481 100644 --- a/drivers/mmc/arm_pl180_mmci.h +++ b/drivers/mmc/arm_pl180_mmci.h @@ -26,7 +26,7 @@ #ifndef __ARM_PL180_MMCI_H__ #define __ARM_PL180_MMCI_H__ -int arm_pl180_mmci_init(void); +int arm_pl180_mmci_init(int); #define COMMAND_REG_DELAY 300 #define DATA_REG_DELAY 1000 diff --git a/include/configs/u8500_href.h b/include/configs/u8500_href.h index 4747fbd35..292ad8c42 100644 --- a/include/configs/u8500_href.h +++ b/include/configs/u8500_href.h @@ -220,7 +220,7 @@ */ #define MMC_BLOCK_SIZE 512 #define CONFIG_ARM_PL180_MMCI -#define CONFIG_ARM_PL180_MMCI_BASE 0x80126000 /* MMC base for 8500 */ +#define CONFIG_ARM_PL180_MMCI_BASE1 0x80126000 /* MMC base for 8500 */ #define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 6250000 #define CONFIG_MMC_DEV_NUM 1 diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h index e81a379a3..096929cfb 100644 --- a/include/configs/vexpress_common.h +++ b/include/configs/vexpress_common.h @@ -185,7 +185,7 @@ #define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC #define CONFIG_ARM_PL180_MMCI -#define CONFIG_ARM_PL180_MMCI_BASE V2M_MMCI +#define CONFIG_ARM_PL180_MMCI_BASE0 V2M_MMCI #define CONFIG_SYS_MMC_MAX_BLK_COUNT 127 #define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 6250000 |