aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2012-02-03 15:34:35 -0700
committerJohn Rigby <john.rigby@linaro.org>2012-04-19 02:18:31 -0600
commit49710a8a8d865e9c7137b92b2067550aa96934c4 (patch)
tree63e8f05708d5f579bc5883873b3ce5585cf24bfe
parentd6bc76ff339201de1bc875114ea3f642821dccb6 (diff)
downloadu-boot-linaro-next-49710a8a8d865e9c7137b92b2067550aa96934c4.tar.gz
MMC: arm_pl180_mmci: allow multiple devicestopic-2012.04-pl180-mmc
Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--board/armltd/vexpress/vexpress_common.c2
-rw-r--r--board/st-ericsson/u8500/u8500_href.c2
-rw-r--r--drivers/mmc/arm_pl180_mmci.c24
-rw-r--r--drivers/mmc/arm_pl180_mmci.h2
-rw-r--r--include/configs/u8500_href.h2
-rw-r--r--include/configs/vexpress_common.h2
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