Skip to contentSkip to conversation

PXA: New MMC driver

PATCH New Marek Vasut 2 participants 4 messages Aug 6, 2010 – Aug 11, 2010 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PXA: New MMC driver

The new driver is a complete rewrite. It uses the MMC framework and should support both pxa2xx and pxa3xx.

Tested on:
- Palm Tungsten|C PXA255
- Aeronix ZipitZ2 PXA270
- Marvell Zylonite 300 PXA300

This driver needs testing though.

---
 drivers/mmc/Makefile      |    1 +
 drivers/mmc/pxa_mmc.h     |   21 +++
 drivers/mmc/pxa_mmc_gen.c |  335 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 357 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/pxa_mmc_gen.c
drivers/mmc/Makefile +1 -0
index 6fa04b8..01338a4 100644
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
+COBJS-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/mmc/pxa_mmc.h +21 -0
index 6fa4268..a5b7351 100644
@@ -135,4 +135,25 @@
 #define MMC_R1B_ADDR_ERR		0x2000
 #define MMC_R1B_PARAM_ERR		0x4000
 
+/* PXAMMC Generic default config for various CPUs */
+#if defined(CONFIG_PXA250)
+#define	PXAMMC_FIFO_SIZE	1
+#define	PXAMMC_MIN_SPEED	312500
+#define	PXAMMC_MAX_SPEED	20000000
+#define	PXAMMC_HOST_CAPS	(0)
+#elif defined(CONFIG_PXA27X)
+#define	PXAMMC_CRC_SKIP
+#define	PXAMMC_FIFO_SIZE	32
+#define	PXAMMC_MIN_SPEED	304000
+#define	PXAMMC_MAX_SPEED	19500000
+#define	PXAMMC_HOST_CAPS	(MMC_MODE_4BIT)
+#elif defined(CONFIG_CPU_MONAHANS)
+#define	PXAMMC_FIFO_SIZE	32
+#define	PXAMMC_MIN_SPEED	304000
+#define	PXAMMC_MAX_SPEED	26000000
+#define	PXAMMC_HOST_CAPS	(MMC_MODE_4BIT | MMC_MODE_HS)
+#else
+#error	"Unknown CPU for PXAMMC"
+#endif
+
 #endif /* __MMC_PXA_P_H__ */
drivers/mmc/pxa_mmc_gen.c new file +335 -0

335 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 PXA: New MMC driver

Dear Marek Vasut,

Quoted 2 lines · In message <[email protected]> you wrote:

The new driver is a complete rewrite. It uses the MMC framework and should support both pxa2xx and pxa3xx.

Did you even compile test this driver?

Quoted 4 lines

Tested on:
- Palm Tungsten|C PXA255
- Aeronix ZipitZ2 PXA270
- Marvell Zylonite 300 PXA300

Really?

I would expect the compiler throws a bunch of error messages due to missing semicolons, like

drivers/mmc/pxa_mmc_gen.c line 107

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_CLK_EN)
+	if (ret)
+		return ret;

here.

drivers/mmc/pxa_mmc_gen.c line 177

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_DATA_TRAN_DONE)
+	if (ret)
+		return ret;

And here.

drivers/mmc/pxa_mmc_gen.c line 177

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_DATA_TRAN_DONE)
+	if (ret)
+		return ret;

And here.

drivers/mmc/pxa_mmc_gen.c line 216

Quoted 4 lines
drivers/mmc/pxa_mmc_gen.c new file +4 -0
+	/* Wait until the data are really written to the card */
+	ret = pxa_mmc_wait(MMC_STAT_PRG_DONE)
+	if (ret)
+		return ret;

And here.

drivers/mmc/pxa_mmc_gen.c line 255

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_END_CMD_RES)
+	if (ret)
+		return ret;

And here.

Does this really compile for you?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The complexity of software is an essential property, not an  acciden-
tal  one. Hence, descriptions of a software entity that abstract away
its complexity often abstract away its essence.    - Fred Brooks, Jr.
#2 lore raw

PATCH 1/1 PXA: New MMC driver

Dne ?t 10. srpna 2010 23:08:15 Wolfgang Denk napsal(a):

Quoted 3 lines

Dear Marek Vasut,

In message <[email protected]> you

Quoted 12 lines · wrote:
Quoted 2 lines

The new driver is a complete rewrite. It uses the MMC framework and should support both pxa2xx and pxa3xx.

Did you even compile test this driver?

Quoted 4 lines

Tested on:
- Palm Tungsten|C PXA255
- Aeronix ZipitZ2 PXA270
- Marvell Zylonite 300 PXA300

Really?

All right, not the version where I added requested changes. I fixed it in my tree, any other problems with this or is this all? Sorry for causing you so many trouble.

Quoted 40 lines

I would expect the compiler throws a bunch of error messages due to missing semicolons, like

drivers/mmc/pxa_mmc_gen.c line 107

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_CLK_EN)
+	if (ret)
+		return ret;

here.

drivers/mmc/pxa_mmc_gen.c line 177

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_DATA_TRAN_DONE)
+	if (ret)
+		return ret;

And here.

drivers/mmc/pxa_mmc_gen.c line 177

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_DATA_TRAN_DONE)
+	if (ret)
+		return ret;

And here.

drivers/mmc/pxa_mmc_gen.c line 216

Quoted 4 lines
drivers/mmc/pxa_mmc_gen.c new file +4 -0
+	/* Wait until the data are really written to the card */
+	ret = pxa_mmc_wait(MMC_STAT_PRG_DONE)
+	if (ret)
+		return ret;

And here.

drivers/mmc/pxa_mmc_gen.c line 255

Quoted 3 lines
drivers/mmc/pxa_mmc_gen.c new file +3 -0
+	ret = pxa_mmc_wait(MMC_STAT_END_CMD_RES)
+	if (ret)
+		return ret;

And here.

Does this really compile for you?

Best regards,

Wolfgang Denk

#3 lore raw

PATCH 1/1 PXA: New MMC driver

Dear Marek Vasut,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 8 lines

Did you even compile test this driver?

Quoted 4 lines

Tested on:
- Palm Tungsten|C PXA255
- Aeronix ZipitZ2 PXA270
- Marvell Zylonite 300 PXA300

Quoted 5 lines
Quoted 2 lines

Really?

All right, not the version where I added requested changes. I fixed it in my tree, any other problems with this or is this all? Sorry for causing you so many trouble.

It is a mandatory requirement to run MAKEALL (also for at least one other architecture) before submitting patches...

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Imagination is more important than knowledge.      -- Albert Einstein