[U-Boot] [PATCH 04/31] M28EVK: Enable MMC support

Marek Vasut marek.vasut at gmail.com
Thu Sep 8 22:42:32 CEST 2011


Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
Cc: Andy Fleming <afleming at gmail.com>
Cc: Stefano Babic <sbabic at denx.de>
Cc: Wolfgang Denk <wd at denx.de>
Cc: Detlev Zundel <dzu at denx.de>
---
 board/denx/m28evk/m28evk.c |   22 ++++++++++++++++++++++
 include/configs/m28evk.h   |   14 ++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c
index 5f4f787..d3e6173 100644
--- a/board/denx/m28evk/m28evk.c
+++ b/board/denx/m28evk/m28evk.c
@@ -28,6 +28,8 @@
 #include <asm/arch/regs-common.h>
 #include <asm/arch/regs-base.h>
 #include <asm/arch/regs-clkctrl.h>
+#include <asm/arch/iomux-mx28.h>
+#include <asm/arch/gpio.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/mx28.h>
 
@@ -67,3 +69,23 @@ int dram_init(void)
 	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
 	return 0;
 }
+
+#ifdef	CONFIG_CMD_MMC
+static int m28_mmc_wp(int id)
+{
+	if (id != 0) {
+		printf("MXS MMC: Invalid card selected (card id = %d)\n", id);
+		return 1;
+	}
+
+	return mxs_gpio_get(MX28_PAD_AUART2_CTS__GPIO_3_10);
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	/* Configure WP as output */
+	mxs_gpio_direction(MX28_PAD_AUART2_CTS__GPIO_3_10, 0);
+
+	return mxsmmc_initialize(bis, 0, m28_mmc_wp);
+}
+#endif
diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 4f41e26..1b4db7b 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -41,7 +41,12 @@
  */
 #include <config_cmd_default.h>
 #define	CONFIG_DISPLAY_CPUINFO
+#define	CONFIG_DOS_PARTITION
+
 #define	CONFIG_CMD_CACHE
+#define	CONFIG_CMD_EXT2
+#define	CONFIG_CMD_FAT
+#define	CONFIG_CMD_MMC
 #undef	CONFIG_CMD_DHCP
 #undef	CONFIG_CMD_NET
 #undef	CONFIG_CMD_NFS
@@ -92,6 +97,15 @@
 #define	CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
 /*
+ * MMC Driver
+ */
+#ifdef	CONFIG_CMD_MMC
+#define	CONFIG_MMC
+#define	CONFIG_GENERIC_MMC
+#define	CONFIG_MXS_MMC
+#endif
+
+/*
  * Boot Linux
  */
 #define	CONFIG_CMDLINE_TAG
-- 
1.7.5.4



More information about the U-Boot mailing list