summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu, Josh <Josh.wu@atmel.com>2012-09-13 22:22:05 +0000
committerJosh Wu <josh.wu@atmel.com>2013-03-25 17:41:26 +0800
commitb3ffff01d16f5b3ddc786385eca5537f4bc57965 (patch)
treef7cc9b4e5b87e2c6b6fd6e98c7b08e9de32e6685
parent35678b66c2615ba6dec8e040fe7f9a38beb2b381 (diff)
ARM: at91sam9x5: enable MCI0 support for 9x5ek board.
Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
-rw-r--r--arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c15
-rw-r--r--board/atmel/at91sam9x5ek/at91sam9x5ek.c10
-rw-r--r--include/configs/at91sam9x5ek.h10
3 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
index 3c5853648b..a1eea2a754 100644
--- a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
+++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
@@ -106,6 +106,21 @@ void at91_serial2_hw_init(void)
writel(1 << ATMEL_ID_USART2, &pmc->pcer);
}
+void at91_mci_hw_init(void)
+{
+ /* Initialize the MCI0 */
+ at91_set_a_periph(AT91_PIO_PORTA, 17, 1); /* MCCK */
+ at91_set_a_periph(AT91_PIO_PORTA, 16, 1); /* MCCDA */
+ at91_set_a_periph(AT91_PIO_PORTA, 15, 1); /* MCDA0 */
+ at91_set_a_periph(AT91_PIO_PORTA, 18, 1); /* MCDA1 */
+ at91_set_a_periph(AT91_PIO_PORTA, 19, 1); /* MCDA2 */
+ at91_set_a_periph(AT91_PIO_PORTA, 20, 1); /* MCDA3 */
+
+ /* Enable clock for MCI0 */
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+ writel(1 << ATMEL_ID_HSMCI0, &pmc->pcer);
+}
+
#ifdef CONFIG_ATMEL_SPI
void at91_spi0_hw_init(unsigned long cs_mask)
{
diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
index 06028aa01e..edb088680d 100644
--- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
+++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
@@ -31,6 +31,7 @@
#include <asm/arch/clk.h>
#include <lcd.h>
#include <atmel_hlcdc.h>
+#include <atmel_mci.h>
#ifdef CONFIG_MACB
#include <net.h>
#endif
@@ -258,6 +259,15 @@ void spi_cs_deactivate(struct spi_slave *slave)
}
#endif /* CONFIG_ATMEL_SPI */
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bd)
+{
+ at91_mci_hw_init();
+
+ return atmel_mci_init((void *)ATMEL_BASE_HSMCI0);
+}
+#endif
+
int board_early_init_f(void)
{
at91_seriald_hw_init();
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index c71cca5ee5..e1117dd86d 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -90,6 +90,7 @@
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_NAND
#define CONFIG_CMD_SF
+#define CONFIG_CMD_MMC
/* SDRAM */
#define CONFIG_NR_DRAM_BANKS 1
@@ -138,6 +139,15 @@
#define CONFIG_CMD_UBIFS
#endif
+/* MMC */
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_CMD_FAT
+#define CONFIG_GENERIC_MMC
+#define CONFIG_GENERIC_ATMEL_MCI
+#define CONFIG_DOS_PARTITION
+#endif
+
/* Ethernet */
#define CONFIG_MACB
#define CONFIG_RMII