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

login
register
mail settings
Submitter Marek Vasut
Date Sept. 8, 2011, 8:42 p.m.
Message ID <1315514579-19215-5-git-send-email-marek.vasut@gmail.com>
Download mbox | patch
Permalink /patch/113954/
State Changes Requested
Headers show

Comments

Marek Vasut - Sept. 8, 2011, 8:42 p.m.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Andy Fleming <afleming@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
---
 board/denx/m28evk/m28evk.c |   22 ++++++++++++++++++++++
 include/configs/m28evk.h   |   14 ++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)
Stefano Babic - Sept. 9, 2011, 8:28 a.m.
On 09/08/2011 10:42 PM, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Andy Fleming <afleming@gmail.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Detlev Zundel <dzu@denx.de>
> ---
>  board/denx/m28evk/m28evk.c |   22 ++++++++++++++++++++++
>  include/configs/m28evk.h   |   14 ++++++++++++++
>  2 files changed, 36 insertions(+), 0 deletions(-)

This is a new code. Please squash your patches regarding m28evk, so that
we can review the m28evk easier.

Best regards,
Stefano Babic

Patch

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