aboutsummaryrefslogtreecommitdiff
path: root/board/Marvell
diff options
context:
space:
mode:
authorLei Wen <leiwen@marvell.com>2011-10-03 20:33:42 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-10-27 21:56:37 +0200
commit19d3dbe2440d7efdf0e7c1d7c489cccbbdb44171 (patch)
treec55de50f0fc814edf52435b2b6369c34289b06c3 /board/Marvell
parent3d90a2adcb1c240c9ef9e9088a4d49a40a3c9504 (diff)
downloadu-boot-linaro-stable-19d3dbe2440d7efdf0e7c1d7c489cccbbdb44171.tar.gz
Marvell: dkb: add mmc support
Signed-off-by: Lei Wen <leiwen@marvell.com>
Diffstat (limited to 'board/Marvell')
-rw-r--r--board/Marvell/dkb/dkb.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/board/Marvell/dkb/dkb.c b/board/Marvell/dkb/dkb.c
index 00f73e79f..4a9abee0f 100644
--- a/board/Marvell/dkb/dkb.c
+++ b/board/Marvell/dkb/dkb.c
@@ -24,8 +24,12 @@
#include <common.h>
#include <mvmfp.h>
+#include <i2c.h>
#include <asm/arch/mfp.h>
#include <asm/arch/cpu.h>
+#ifdef CONFIG_GENERIC_MMC
+#include <sdhci.h>
+#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -40,6 +44,20 @@ int board_early_init_f(void)
MFP53_CI2C_SCL,
MFP54_CI2C_SDA,
+ /* MMC1 */
+ MFP_MMC1_DAT7,
+ MFP_MMC1_DAT6,
+ MFP_MMC1_DAT5,
+ MFP_MMC1_DAT4,
+ MFP_MMC1_DAT3,
+ MFP_MMC1_DAT2,
+ MFP_MMC1_DAT1,
+ MFP_MMC1_DAT0,
+ MFP_MMC1_CMD,
+ MFP_MMC1_CLK,
+ MFP_MMC1_CD,
+ MFP_MMC1_WP,
+
MFP_EOC /*End of configureation*/
};
/* configure MFP's */
@@ -56,3 +74,28 @@ int board_init(void)
gd->bd->bi_boot_params = panth_sdram_base(0) + 0x100;
return 0;
}
+
+#ifdef CONFIG_GENERIC_MMC
+#define I2C_SLAVE_ADDR 0x34
+#define LDO13_REG 0x28
+#define LDO_V30 0x6
+#define LDO_VOLTAGE(x) ((x & 0x7) << 1)
+#define LDO_EN 0x1
+int board_mmc_init(bd_t *bd)
+{
+ ulong mmc_base_address[CONFIG_SYS_MMC_NUM] = CONFIG_SYS_MMC_BASE;
+ u8 i, data;
+
+ /* set LDO 13 to 3.0v */
+ data = LDO_VOLTAGE(LDO_V30) | LDO_EN;
+ i2c_write(I2C_SLAVE_ADDR, LDO13_REG, 1, &data, 1);
+
+ for (i = 0; i < CONFIG_SYS_MMC_NUM; i++) {
+ if (mv_sdh_init(mmc_base_address[i], 0, 0,
+ SDHCI_QUIRK_32BIT_DMA_ADDR))
+ return 1;
+ }
+
+ return 0;
+}
+#endif