summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2012-03-19 03:50:53 +0000
committerAndy Fleming <afleming@freescale.com>2012-05-08 18:02:21 -0500
commitb1e725f2c6e2d8f9855a0b4cba508a2abe748b4d (patch)
tree3b7b816b096a641e10ee8174fe876cc83d0118bc /drivers/mmc
parent62722036410b7887a04cf6705effb3122fb9b549 (diff)
downloadu-boot-imx-b1e725f2c6e2d8f9855a0b4cba508a2abe748b4d.zip
u-boot-imx-b1e725f2c6e2d8f9855a0b4cba508a2abe748b4d.tar.gz
u-boot-imx-b1e725f2c6e2d8f9855a0b4cba508a2abe748b4d.tar.bz2
mmc: omap: follow TRM procedure to power on cards
According to OMAP3 TRM, PBIASLITEPWRDNZ bits must be cleared while MMC power supply is being enabled and is ramping up (those bits might be left set by the previous bootloader). It doesn't say what happens if this procedure is violated, but better not to risk here and do things as required. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/omap_hsmmc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 2400db2..2b12929 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -62,15 +62,21 @@ static void omap4_vmmc_pbias_config(struct mmc *mmc)
unsigned char mmc_board_init(struct mmc *mmc)
{
-#if defined(CONFIG_TWL4030_POWER)
- twl4030_power_mmc_init();
-#endif
-
#if defined(CONFIG_OMAP34XX)
t2_t *t2_base = (t2_t *)T2_BASE;
struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+ u32 pbias_lite;
- writel(readl(&t2_base->pbias_lite) | PBIASLITEPWRDNZ1 |
+ pbias_lite = readl(&t2_base->pbias_lite);
+ pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0);
+ writel(pbias_lite, &t2_base->pbias_lite);
+#endif
+#if defined(CONFIG_TWL4030_POWER)
+ twl4030_power_mmc_init();
+ mdelay(100); /* ramp-up delay from Linux code */
+#endif
+#if defined(CONFIG_OMAP34XX)
+ writel(pbias_lite | PBIASLITEPWRDNZ1 |
PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
&t2_base->pbias_lite);