We have an custom board based on J5 ti811x
NOR flash: 4MB
SD-card connected to MMC1 (0x481D8000)
eMMC 4GB connected to MMC2 (0x47810000)
ezsdk uboot version :u-boot-2010.06-psp04.07.00.02
ezsdk kernel version :linux-2.6.37-psp04.07.00.02
As per our booting scheme, we need to configure and copy uboot into NOR flash, kernel and RFS into eMMC. I have added support for eMMC in kernel and able to partition the eMMC. But to achieve booting scheme we need eMMC support in uboot. But current uboot have only sd card support. I did some modification to bring up eMMC in uboot. But the information listed while using 'mmcinfo 1' is wrong. Actual capacity is 4 GB, but it shows some huge number. Also copied the changes which I did in uboot. Am I missing anything. Could someone help me to bring up eMMC in uboot.
TI811X_EVM#mmcinfo 1
Nid: mmc_init:
Nid: mmc_init_setup: mmc_base: 0x47810100
Nid: mmc_set_bus_width: bus width = 1
Nid: mmc_set_ios: bus width set to 8
Nid: mmc_set_ios: bus width set to 8
Nid: mmc_startup:
Nid: mmc_startup: err=0
Nid: mmc_startup: its an MMC
Nid: mmc_startup: high capacity
Nid: mmc_startup: Capacity1: 0
Nid: mmc_startup: Capacity2: 0
Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC04
Tran Speed: 25000000
Rd Block Len: 512
MMC version 4.0
High Capacity: Yes
Capacity: 2199023255552
Bus Width: 1-bit
Code change in uboot:
---------------------
modified: board-support/u-boot-2010.06-psp04.07.00.02/arch/arm/include/asm/arch-ti81xx/mmc_host_def.h
# define OMAP_HSMMC_BASE 0x481D8100
+//Nid added to support MMC2
+# define OMAP_HSMMC2_BASE 0x47810100 /* TI811X MMC/SD2 config base */
#endif
---------------------------------------
modified: board-support/u-boot-2010.06-psp04.07.00.02/arch/arm/include/asm/arch-ti81xx/cpu.h
#ifdef CONFIG_TI814X
#define CM_ALWON_HSMMC_CLKCTRL (PRCM_BASE + 0x1620)
+//Nid added to support eMMC
+#define CM_ALWON_HSMMC_2_CLKCTRL (PRCM_BASE + 0x1624)
#endif
----------------------------------------------------
modified: board-support/u-boot-2010.06-psp04.07.00.02/board/ti/ti811x/evm.c
/* HSMMC */
__raw_writel(0x2, CM_ALWON_HSMMC_CLKCTRL);
while (__raw_readl(CM_ALWON_HSMMC_CLKCTRL) != 0x2)
;
+/* Nid added to support eMMC */
+__raw_writel(0x2, CM_ALWON_HSMMC_2_CLKCTRL);
+while (__raw_readl(CM_ALWON_HSMMC_2_CLKCTRL) != 0x2)
-------------------------------------
modified: board-support/u-boot-2010.06-psp04.07.00.02/drivers/mmc/omap_hsmmc.c
int omap_mmc_init(int dev_index)
{
struct mmc *mmc;
mmc = &hsmmc_dev[dev_index];
sprintf(mmc->name, "OMAP SD/MMC");
mmc->block_dev.removable = 1;
mmc->send_cmd = mmc_send_cmd;
mmc->set_ios = mmc_set_ios;
mmc->init = mmc_init_setup;
printf("Nid: %s: MMC:%d\n", __func__, dev_index);
#if !defined(CONFIG_TI81XX)
switch (dev_index) {
------
----
}
#else
//Nid modified to support eMMC
//mmc->priv = (hsmmc_t *)OMAP_HSMMC_BASE;
switch (dev_index) {
case 0:
mmc->priv = (hsmmc_t *)OMAP_HSMMC_BASE;
break;
case 1:
mmc->priv = (hsmmc_t *)OMAP_HSMMC2_BASE;
printf("Nid: %s: mmc2: mmc_base: 0x%x\n", __func__, mmc->priv);
break;
default:
mmc->priv = (hsmmc_t *)OMAP_HSMMC_BASE;
return 1;
}
#endif
#if defined(CONFIG_TI81XX)
if(dev_index){
printf("Nid: %s: mmc2: \n", __func__);
mmc->voltages = MMC_VDD_33_34;
mmc->host_caps = MMC_MODE_8BIT | MMC_MODE_HS;
mmc->block_dev.removable = 0;
mmc->bus_width = 8;
}else{
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
mmc->host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS;
}
#else
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
mmc->host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS;
#endif
}
----------------------------------------------