Skip to contentSkip to conversation

pxa: move mmc drivers to drivers/mmc

PATCH New Jean-Christophe PLAGNIOL-VILLARD 1 participant 2 messages Feb 3, 2009 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa: move mmc drivers to drivers/mmc

introduce new macro CONFIG_PXA_MMC to activate it

---
 cpu/pxa/Makefile                       |    2 +-
 drivers/mmc/Makefile                   |    1 +
 cpu/pxa/mmc.c => drivers/mmc/pxa_mmc.c |    4 ----
 include/configs/delta.h                |    7 +++++--
 include/configs/lubbock.h              |    7 +++++--
 include/configs/pleb2.h                |    5 +++++
 include/configs/pxa255_idp.h           |    5 ++++-
 include/configs/trizepsiv.h            |    5 ++++-
 include/configs/xsengine.h             |    8 ++++++--
 include/configs/zylonite.h             |    8 ++++++--
 10 files changed, 37 insertions(+), 15 deletions(-)
 rename cpu/pxa/mmc.c => drivers/mmc/pxa_mmc.c (99%)
cpu/pxa/Makefile +1 -1
index 8b4367e..42903b2 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= serial.o interrupts.o cpu.o i2c.o pxafb.o mmc.o usb.o
+COBJS	= serial.o interrupts.o cpu.o i2c.o pxafb.o usb.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/mmc/Makefile +1 -0
index bb0d52e..b5f1b20 100644
@@ -27,6 +27,7 @@ LIB	:= $(obj)libmmc.a
 
 COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
+COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/mmc/pxa_mmc.c renamed from cpu/pxa/mmc.c +0 -4
similarity index 99%
rename from cpu/pxa/mmc.c
rename to drivers/mmc/pxa_mmc.c
index d735c8d..c7fa1ca 100644
@@ -28,8 +28,6 @@
 #include <asm/arch/hardware.h>
 #include <part.h>
 
-#ifdef CONFIG_MMC
-
 extern int fat_register_device(block_dev_desc_t * dev_desc, int part_no);
 
 static block_dev_desc_t mmc_dev;
@@ -658,5 +656,3 @@ int mmc2info(ulong addr)
 	}
 	return 0;
 }
-
-#endif /* CONFIG_MMC */
include/configs/delta.h +5 -2
index abb2676..1ee9712 100644
@@ -34,7 +34,6 @@
 #ifdef CONFIG_LCD
 #define CONFIG_SHARP_LM8V31
 #endif
-/* #define CONFIG_MMC		1 */
 #define BOARD_LATE_INIT		1
 
 #undef CONFIG_SKIP_RELOCATE_UBOOT
@@ -181,7 +180,11 @@
 						/* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
-/* #define CONFIG_SYS_MMC_BASE		0xF0000000 */
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_SYS_MMC_BASE		0xF0000000
+#endif
 
 /*
  * Stack sizes
include/configs/lubbock.h +5 -2
index 208910e..ef16b02 100644
@@ -40,7 +40,7 @@
 #ifdef CONFIG_LCD
 #define CONFIG_SHARP_LM8V31
 #endif
-#define CONFIG_MMC		1
+#define CONFIG_MMC
 #define BOARD_LATE_INIT		1
 #define CONFIG_DOS_PARTITION
 
@@ -83,7 +83,6 @@
  */
 #include <config_cmd_default.h>
 
-#define CONFIG_CMD_MMC
 #define CONFIG_CMD_FAT
 
 
@@ -133,7 +132,11 @@
 						/* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
 #define CONFIG_SYS_MMC_BASE		0xF0000000
+#endif
 
 /*
  * Stack sizes
include/configs/pleb2.h +5 -0
index 14f8917..59dffb7 100644
@@ -132,6 +132,11 @@
 						/* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
+#endif
+
 /*
  * Stack sizes
  *
include/configs/pxa255_idp.h +4 -1
index f81103b..2deee02 100644
@@ -119,7 +119,6 @@
  */
 #include <config_cmd_default.h>
 
-#define CONFIG_CMD_MMC
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_DHCP
 
@@ -249,7 +248,11 @@
 						/* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
 #define CONFIG_SYS_MMC_BASE		0xF0000000
+#endif
 
 /*
  * Stack sizes
include/configs/trizepsiv.h +4 -1
index 0a8e994..784a09f 100644
@@ -79,7 +79,6 @@
  */
 #include <config_cmd_default.h>
 
-#define CONFIG_CMD_MMC
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_IMLS
 #define CONFIG_CMD_PING
@@ -174,7 +173,11 @@
 						/* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
 #define CONFIG_SYS_MMC_BASE		0xF0000000
+#endif
 
 /*
  * Stack sizes
include/configs/xsengine.h +6 -2
index b727413..341c741 100644
@@ -118,7 +118,6 @@
  */
 #include <config_cmd_default.h>
 
-#define CONFIG_CMD_MMC
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_JFFS2
@@ -145,9 +144,14 @@
 #define CONFIG_SYS_MEMTEST_END			0xA0800000				/* 4 ... 8 MB in DRAM   */
 #undef  CONFIG_SYS_CLKS_IN_HZ								/* everything, incl board info, in Hz */
 #define CONFIG_SYS_BAUDRATE_TABLE		{ 9600, 19200, 38400, 57600, 115200 }	/* valid baudrates */
-#define CONFIG_SYS_MMC_BASE			0xF0000000
 #define CONFIG_SYS_LOAD_ADDR			0xA0000000				/* load kernel to this address   */
 
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_SYS_MMC_BASE			0xF0000000
+#endif
+
 /* Stack sizes - The stack sizes are set up in start.S using the settings below */
 #define CONFIG_STACKSIZE		(128*1024)	/* regular stack */
 #ifdef  CONFIG_USE_IRQ
include/configs/zylonite.h +6 -2
index f30eca1..4e55aec 100644
@@ -41,7 +41,7 @@
 #ifdef CONFIG_LCD
 #define CONFIG_SHARP_LM8V31
 #endif
-/* #define CONFIG_MMC		1 */
+#undef CONFIG_MMC
 #define BOARD_LATE_INIT		1
 
 #undef CONFIG_SKIP_RELOCATE_UBOOT
@@ -152,7 +152,11 @@
 						/* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
-/* #define CONFIG_SYS_MMC_BASE		0xF0000000 */
+#ifdef CONFIG_MMC
+#define CONFIG_PXA_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_SYS_MMC_BASE		0xF0000000
+#endif
 
 /*
  * Stack sizes
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH v2 4/8 Reduce the scope of PXA's mmc_read/mmc_write/mmc_bread functions

From: Andy Fleming <[email protected]>

These names are being taken over by the new MMC framework. Hopefuly the PXA can be easily ported, and these functions will go away entirely.

---
 drivers/mmc/pxa_mmc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/mmc/pxa_mmc.c +4 -4
index c7fa1ca..f3cb60a 100644
@@ -214,7 +214,7 @@ mmc_block_write(ulong dst, uchar * src, int len)
 
 int
 /****************************************************/
-mmc_read(ulong src, uchar * dst, int size)
+pxa_mmc_read(long src, uchar * dst, int size)
 /****************************************************/
 {
 	ulong end, part_start, part_end, part_len, aligned_start, aligned_end;
@@ -290,7 +290,7 @@ mmc_read(ulong src, uchar * dst, int size)
 
 int
 /****************************************************/
-mmc_write(uchar * src, ulong dst, int size)
+pxa_mmc_write(uchar * src, ulong dst, int size)
 /****************************************************/
 {
 	ulong end, part_start, part_end, part_len, aligned_start, aligned_end;
@@ -371,7 +371,7 @@ mmc_write(uchar * src, ulong dst, int size)
 	return 0;
 }
 
-ulong
+static ulong
 /****************************************************/
 mmc_bread(int dev_num, ulong blknr, lbaint_t blkcnt, void *dst)
 /****************************************************/
@@ -379,7 +379,7 @@ mmc_bread(int dev_num, ulong blknr, lbaint_t blkcnt, void *dst)
 	int mmc_block_size = MMC_BLOCK_SIZE;
 	ulong src = blknr * mmc_block_size + CONFIG_SYS_MMC_BASE;
 
-	mmc_read(src, (uchar *) dst, blkcnt * mmc_block_size);
+	pxa_mmc_read(src, (uchar *) dst, blkcnt * mmc_block_size);
 	return blkcnt;
 }
 
Signature · 1 line
1.5.6.5