From 7e982c956d74614fc59cacf39016fad8bbb194ed Mon Sep 17 00:00:00 2001
From: Sukumar Ghorai <s-ghorai@ti.com>
Date: Sat, 18 Sep 2010 20:56:18 -0700
Subject: [PATCH] ARMV7: OMAP4: Use generic mmc driver on Panda

This patch switches from the legacy mmc driver to the new generic mmc driver

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
Tested-by: Steve Sakoman <steve@sakoman.com>
---
 board/ti/panda/panda.c        | 9 +++++++++
 include/configs/omap4_panda.h | 9 ++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c
index 1b8153ba82..78e1910797 100644
--- a/board/ti/panda/panda.c
+++ b/board/ti/panda/panda.c
@@ -23,6 +23,7 @@
  */
 #include <common.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/arch/mmc_host_def.h>
 
 #include "panda.h"
 
@@ -87,3 +88,11 @@ void set_muxconf_regs(void)
 		   sizeof(wkup_padconf_array) /
 		   sizeof(struct pad_conf_entry));
 }
+
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+	omap_mmc_init(0);
+	return 0;
+}
+#endif
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index d4a1d1c234..2618f7df7c 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -89,7 +89,6 @@
 #define CONFIG_SYS_NS16550_COM3		UART3_BASE
 
 #define CONFIG_ENV_IS_NOWHERE
-#define CONFIG_ENV_OVERWRITE
 #define CONFIG_BAUDRATE			115200
 #define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
 					115200}
@@ -107,8 +106,9 @@
 #define CONFIG_TWL6030_POWER		1
 
 /* MMC */
+#define CONFIG_GENERIC_MMC		1
 #define CONFIG_MMC			1
-#define CONFIG_OMAP3_MMC		1
+#define CONFIG_OMAP_HSMMC		1
 #define CONFIG_SYS_MMC_SET_DEV		1
 #define CONFIG_DOS_PARTITION		1
 
@@ -150,7 +150,6 @@
 
 #define CONFIG_BOOTDELAY	3
 
-/* allow overwriting serial config and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
@@ -158,7 +157,7 @@
 	"console=ttyS2,115200n8\0" \
 	"usbtty=cdc_acm\0" \
 	"vram=16M\0" \
-	"mmcdev=1\0" \
+	"mmcdev=0\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
 	"mmcrootfstype=ext3 rootwait\0" \
 	"mmcargs=setenv bootargs console=${console} " \
@@ -174,7 +173,7 @@
 		"bootm ${loadaddr}\0" \
 
 #define CONFIG_BOOTCOMMAND \
-	"if mmc init ${mmcdev}; then " \
+	"if mmc rescan ${mmcdev}; then " \
 		"if run loadbootscript; then " \
 			"run bootscript; " \
 		"else " \
-- 
2.39.5