aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>2011-07-18 12:53:17 +0530
committerMichael BRANDT <michael.brandt@stericsson.com>2011-08-09 09:59:45 +0200
commit8e9e8a2d4d046ddef2dcb9874a37f774285d69bd (patch)
tree342f7615007b48bf072e780c75b1d0e681e7faf6
parent9059b06f6516bbd6102d301eed9a11089ea782ed (diff)
u5500:Dynamic detection of bootable MMC
Dynamic detection of booting device by reading ROM debug register from BACKUP RAM and register the corresponding EMMC. This is done due to wrong configuration of MMC0 clock in ROM code for u5500 v2. ST-Ericsson ID: 352552 ST-Ericsson FOSS-OUT ID: NA Change-Id: Id5d2260626f57641a5e6124b5b1051edad57223a Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/27664 Reviewed-by: Preetham-rao K <preetham.rao@stericsson.com> Tested-by: Preetham-rao K <preetham.rao@stericsson.com> Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Reviewed-by: QATOOLS Reviewed-by: QATEST
-rw-r--r--board/st-ericsson/u5500/u5500.c50
1 files changed, 42 insertions, 8 deletions
diff --git a/board/st-ericsson/u5500/u5500.c b/board/st-ericsson/u5500/u5500.c
index 258644932..39a3ff0c9 100644
--- a/board/st-ericsson/u5500/u5500.c
+++ b/board/st-ericsson/u5500/u5500.c
@@ -28,6 +28,9 @@
/* offset for GPIO ALTB register */
#define DB5500_GPIO_AFSLB 0x24
+#define BACKUPRAM_ROM_DEBUG_ADDR 0xFFC
+#define MMC_BLOCK_ID 0x20
+
/*
* GPIO pin config
*/
@@ -50,7 +53,18 @@ static pin_cfg_t gpio_config[] = {
GPIO11_MC0_DAT6 | PIN_INPUT_PULLUP,
GPIO12_MC0_DAT7 | PIN_INPUT_PULLUP,
GPIO13_MC0_CMD | PIN_INPUT_PULLUP,
- GPIO14_MC0_CLK | PIN_OUTPUT_LOW
+ GPIO14_MC0_CLK | PIN_OUTPUT_LOW,
+
+ GPIO16_MC2_CMD | PIN_INPUT_PULLUP,
+ GPIO17_MC2_CLK | PIN_OUTPUT_LOW,
+ GPIO23_MC2_DAT0 | PIN_INPUT_PULLUP,
+ GPIO19_MC2_DAT1 | PIN_INPUT_PULLUP,
+ GPIO24_MC2_DAT2 | PIN_INPUT_PULLUP,
+ GPIO20_MC2_DAT3 | PIN_INPUT_PULLUP,
+ GPIO25_MC2_DAT4 | PIN_INPUT_PULLUP,
+ GPIO21_MC2_DAT5 | PIN_INPUT_PULLUP,
+ GPIO26_MC2_DAT6 | PIN_INPUT_PULLUP,
+ GPIO22_MC2_DAT7 | PIN_INPUT_PULLUP
};
static pin_cfg_t sdcard_gpio_config[] = {
@@ -191,26 +205,46 @@ int board_mmc_init(bd_t *bis)
{
int error;
struct mmc *dev;
+ int mmc_blk_id = 0;
debugX(DBG_LVL_VERBOSE, "mmc_host - board_mmc_init\n");
(void) bis; /* Parameter not used! */
+ /*
+ Fix me in 5500 v2.1
+ Dynamic detection of booting device by reading
+ ROM debug register from BACKUP RAM and register the
+ corresponding EMMC.
+ This is done due to wrong configuration of MMC0 clock
+ in ROM code for u5500 v2.
+ */
+ if (cpu_is_u5500v2())
+ mmc_blk_id = readl(U5500_BACKUPRAM1_BASE +
+ BACKUPRAM_ROM_DEBUG_ADDR);
+
dev = u8500_alloc_mmc_struct();
if (!dev)
return -1;
- error = u8500_emmc_host_init(dev,
+ if (mmc_blk_id & MMC_BLOCK_ID) {
+ error = u8500_emmc_host_init(dev,
+ (struct sdi_registers *)U5500_SDI2_BASE);
+ if (error) {
+ printf("emmc2 %d\n", error);
+ return -1;
+ }
+ } else {
+ error = u8500_emmc_host_init(dev,
(struct sdi_registers *)U5500_SDI0_BASE);
- if (error) {
- printf("emmc_host_init() %d \n", error);
- return -1;
+ if (error) {
+ printf("emmc_host_init() %d\n", error);
+ return -1;
+ }
}
-
mmc_register(dev);
debugX(DBG_LVL_VERBOSE, "registered emmc interface number is:%d\n",
- dev->block_dev.dev);
-
+ dev->block_dev.dev);
mmc_init(dev);
/*