[U-Boot] [PATCH 1/4] ARM:PXA Remove redefinition of mmc_cid and mmc_csd.

From: Tom Rix Tom.Rix@windriver.com
These structures are defined in the common mmc.h
This was compile checked on cerf250. --- cpu/pxa/mmc.h | 51 --------------------------------------------------- 1 files changed, 0 insertions(+), 51 deletions(-)
diff --git a/cpu/pxa/mmc.h b/cpu/pxa/mmc.h index 85e144b..6fa4268 100644 --- a/cpu/pxa/mmc.h +++ b/cpu/pxa/mmc.h @@ -135,55 +135,4 @@ #define MMC_R1B_ADDR_ERR 0x2000 #define MMC_R1B_PARAM_ERR 0x4000
-typedef struct mmc_cid -{ -/* FIXME: BYTE_ORDER */ - uchar year:4, - month:4; - uchar sn[3]; - uchar fwrev:4, - hwrev:4; - uchar name[6]; - uchar id[3]; -} mmc_cid_t; - -typedef struct mmc_csd -{ - uint8_t csd_structure:2, - spec_ver:4, - rsvd1:2; - uint8_t taac; - uint8_t nsac; - uint8_t tran_speed; - uint16_t ccc:12, - read_bl_len:4; - uint64_t read_bl_partial:1, - write_blk_misalign:1, - read_blk_misalign:1, - dsr_imp:1, - rsvd2:2, - c_size:12, - vdd_r_curr_min:3, - vdd_r_curr_max:3, - vdd_w_curr_min:3, - vdd_w_curr_max:3, - c_size_mult:3, - erase_blk_en:1, - sector_size:7, - wp_grp_size:7, - wp_grp_enable:1, - default_ecc:2, - r2w_factor:3, - write_bl_len:4, - write_bl_partial:1, - rsvd3:4, - content_prot_app:1; - uint8_t file_format_grp:1, - copy:1, - perm_write_protect:1, - tmp_write_protect:1, - file_format:2, - ecc:2; -} mmc_csd_t; - #endif /* __MMC_PXA_P_H__ */

introduce new macro CONFIG_PXA_MMC to activate it
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- cpu/pxa/Makefile | 2 +- drivers/mmc/Makefile | 1 + cpu/pxa/mmc.c => drivers/mmc/pxa_mmc.c | 6 +----- cpu/pxa/mmc.h => drivers/mmc/pxa_mmc.h | 0 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 ++++++-- 11 files changed, 38 insertions(+), 16 deletions(-) rename cpu/pxa/mmc.c => drivers/mmc/pxa_mmc.c (99%) rename cpu/pxa/mmc.h => drivers/mmc/pxa_mmc.h (100%)
diff --git a/cpu/pxa/Makefile b/cpu/pxa/Makefile index 8b4367e..42903b2 100644 --- a/cpu/pxa/Makefile +++ b/cpu/pxa/Makefile @@ -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)) diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index 6aa24f5..1b0af12 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile @@ -30,6 +30,7 @@ COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o +COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/cpu/pxa/mmc.c b/drivers/mmc/pxa_mmc.c similarity index 99% rename from cpu/pxa/mmc.c rename to drivers/mmc/pxa_mmc.c index 8f5277e..33da75f 100644 --- a/cpu/pxa/mmc.c +++ b/drivers/mmc/pxa_mmc.c @@ -28,9 +28,7 @@ #include <asm/arch/hardware.h> #include <part.h>
-#include "mmc.h" - -#ifdef CONFIG_MMC +#include "pxa_mmc.h"
extern int fat_register_device(block_dev_desc_t * dev_desc, int part_no);
@@ -646,5 +644,3 @@ mmc_legacy_init(int verbose)
return rc; } - -#endif /* CONFIG_MMC */ diff --git a/cpu/pxa/mmc.h b/drivers/mmc/pxa_mmc.h similarity index 100% rename from cpu/pxa/mmc.h rename to drivers/mmc/pxa_mmc.h diff --git a/include/configs/delta.h b/include/configs/delta.h index 9f7f0ff..001b48a 100644 --- a/include/configs/delta.h +++ b/include/configs/delta.h @@ -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 diff --git a/include/configs/lubbock.h b/include/configs/lubbock.h index 80cf44f..69774d7 100644 --- a/include/configs/lubbock.h +++ b/include/configs/lubbock.h @@ -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 diff --git a/include/configs/pleb2.h b/include/configs/pleb2.h index 23398e3..59741a9 100644 --- a/include/configs/pleb2.h +++ b/include/configs/pleb2.h @@ -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 * diff --git a/include/configs/pxa255_idp.h b/include/configs/pxa255_idp.h index fa53cf4..d1c2c65 100644 --- a/include/configs/pxa255_idp.h +++ b/include/configs/pxa255_idp.h @@ -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 diff --git a/include/configs/trizepsiv.h b/include/configs/trizepsiv.h index e124be4..70e5ce9 100644 --- a/include/configs/trizepsiv.h +++ b/include/configs/trizepsiv.h @@ -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 diff --git a/include/configs/xsengine.h b/include/configs/xsengine.h index 2fca956..6761438 100644 --- a/include/configs/xsengine.h +++ b/include/configs/xsengine.h @@ -115,7 +115,6 @@ */ #include <config_cmd_default.h>
-#define CONFIG_CMD_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_PING #define CONFIG_CMD_JFFS2 @@ -142,9 +141,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 diff --git a/include/configs/zylonite.h b/include/configs/zylonite.h index 58f35a9..6febeea 100644 --- a/include/configs/zylonite.h +++ b/include/configs/zylonite.h @@ -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

From: Andy Fleming afleming@freescale.com
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.
Signed-off-by: Andy Fleming afleming@freescale.com Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/mmc/pxa_mmc.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c index 33da75f..0fa249e 100644 --- a/drivers/mmc/pxa_mmc.c +++ b/drivers/mmc/pxa_mmc.c @@ -216,7 +216,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; @@ -292,7 +292,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; @@ -373,7 +373,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) /****************************************************/ @@ -381,7 +381,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; }

From: Tom Rix Tom.Rix@windriver.com
Signed-off-by: Tom Rix Tom.Rix@windriver.com Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/mmc/pxa_mmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c index 0fa249e..8225235 100644 --- a/drivers/mmc/pxa_mmc.c +++ b/drivers/mmc/pxa_mmc.c @@ -179,7 +179,7 @@ mmc_block_write(ulong dst, uchar * src, int len) MMC_STRPCL = MMC_STRPCL_STOP_CLK; MMC_NOB = 1; MMC_BLKLEN = len; - mmc_cmd(MMC_CMD_WRITE_BLOCK, argh, argl, + mmc_cmd(MMC_CMD_WRITE_SINGLE_BLOCK, argh, argl, MMC_CMDAT_R1 | MMC_CMDAT_WRITE | MMC_CMDAT_BLOCK | MMC_CMDAT_DATA_EN);
participants (1)
-
Jean-Christophe PLAGNIOL-VILLARD