Skip to contentSkip to conversation

Enable PXAFB for PXA27X and PXA3XX

PATCH New Marek Vasut 2 participants 7 messages Mar 26, 2010 – Apr 24, 2010 1 message not in the archive MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Enable PXAFB for PXA27X and PXA3XX

---
 common/lcd.c    |   12 ++++++------
 cpu/pxa/pxafb.c |    9 ++++++++-
 include/lcd.h   |    2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)
common/lcd.c +6 -6
index 64fb1c6..c2e350e 100644
@@ -41,7 +41,7 @@
 #include <lcd.h>
 #include <watchdog.h>
 
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS
 #include <asm/byteorder.h>
 #endif
 
@@ -503,7 +503,7 @@ void bitmap_plot (int x, int y)
 	uchar *bmap;
 	uchar *fb;
 	ushort *fb16;
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS
 	struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
@@ -519,7 +519,7 @@ void bitmap_plot (int x, int y)
 
 	if (NBITS(panel_info.vl_bpix) < 12) {
 		/* Leave room for default color map */
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS
 		cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]);
@@ -615,7 +615,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	unsigned long pwidth = panel_info.vl_col;
 	unsigned colors, bpix, bmp_bpix;
 	unsigned long compression;
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS
 	struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
@@ -656,7 +656,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #if !defined(CONFIG_MCC200)
 	/* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
 	if (bmp_bpix == 8) {
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS
 		cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
@@ -745,7 +745,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 			WATCHDOG_RESET();
 			for (j = 0; j < width; j++) {
 				if (bpix != 16) {
-#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS || defined(CONFIG_ATMEL_LCD)
 					*(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
 					*(fb++) = 255 - *(bmap++);
cpu/pxa/pxafb.c +8 -1
index d56c5f0..1cb78f0 100644
@@ -292,7 +292,9 @@ static int pxafb_init_mem (void *lcdbase, vidinfo_t *vid)
 
 	return 0;
 }
-
+#ifdef	CONFIG_CPU_MONAHANS
+static inline void pxafb_setup_gpio (vidinfo_t *vid) {}
+#else
 static void pxafb_setup_gpio (vidinfo_t *vid)
 {
 	u_long lccr0;
@@ -349,6 +351,7 @@ static void pxafb_setup_gpio (vidinfo_t *vid)
 		printf("pxafb_setup_gpio: unable to determine bits per pixel\n");
 	}
 }
+#endif
 
 static void pxafb_enable_controller (vidinfo_t *vid)
 {
@@ -363,7 +366,11 @@ static void pxafb_enable_controller (vidinfo_t *vid)
 	FDADR1 = vid->pxa.fdadr1;
 	LCCR0 |= LCCR0_ENB;
 
+#ifdef	CONFIG_CPU_MONAHANS
+	CKENA |= CKENA_1_LCD;
+#else
 	CKEN |= CKEN16_LCD;
+#endif
 
 	debug("FDADR0 = 0x%08x\n", (unsigned int)FDADR0);
 	debug("FDADR1 = 0x%08x\n", (unsigned int)FDADR1);
include/lcd.h +1 -1
index 1f85daa..cd9d49d 100644
@@ -87,7 +87,7 @@ typedef struct vidinfo {
 	u_char	vl_wbf;		/* Wait between frames */
 } vidinfo_t;
 
-#elif defined CONFIG_PXA250
+#elif defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS
 /*
  * PXA LCD DMA descriptor
  */
Signature · 1 line
1.7.0
#1 lore raw

PATCH 1/2 Enable PXAFB for PXA27X and PXA3XX

Dne P? 26. b?ezna 2010 06:57:50 Marek Vasut napsal(a):

Quoted 106 lines
---
 common/lcd.c    |   12 ++++++------
 cpu/pxa/pxafb.c |    9 ++++++++-
 include/lcd.h   |    2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)
common/lcd.c +6 -6
index 64fb1c6..c2e350e 100644
@@ -41,7 +41,7 @@
 #include <lcd.h>
 #include <watchdog.h>
 
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS #include <asm/byteorder.h>
 #endif
 
@@ -503,7 +503,7 @@ void bitmap_plot (int x, int y)
 	uchar *bmap;
 	uchar *fb;
 	ushort *fb16;
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
@@ -519,7 +519,7 @@ void bitmap_plot (int x, int y)
 
 	if (NBITS(panel_info.vl_bpix) < 12) {
 		/* Leave room for default color map */
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]);
@@ -615,7 +615,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	unsigned long pwidth = panel_info.vl_col;
 	unsigned colors, bpix, bmp_bpix;
 	unsigned long compression;
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
@@ -656,7 +656,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #if !defined(CONFIG_MCC200)
 	/* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
 	if (bmp_bpix == 8) {
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
@@ -745,7 +745,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 			WATCHDOG_RESET();
 			for (j = 0; j < width; j++) {
 				if (bpix != 16) {
-#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS || defined(CONFIG_ATMEL_LCD) *(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
 					*(fb++) = 255 - *(bmap++);
cpu/pxa/pxafb.c +3 -1
index d56c5f0..1cb78f0 100644
@@ -292,7 +292,9 @@ static int pxafb_init_mem (void *lcdbase, vidinfo_t
 *vid)
 
 	return 0;
 }
-
+#ifdef	CONFIG_CPU_MONAHANS
+static inline void pxafb_setup_gpio (vidinfo_t *vid) {}
+#else
 static void pxafb_setup_gpio (vidinfo_t *vid)
 {
cpu/pxa/pxafb.c +5 -0
 	u_long lccr0;
@@ -349,6 +351,7 @@ static void pxafb_setup_gpio (vidinfo_t *vid)
 		printf("pxafb_setup_gpio: unable to determine bits per pixel\n");
 	}
 }
+#endif
 
 static void pxafb_enable_controller (vidinfo_t *vid)
 {
@@ -363,7 +366,11 @@ static void pxafb_enable_controller (vidinfo_t *vid)
 	FDADR1 = vid->pxa.fdadr1;
 	LCCR0 |= LCCR0_ENB;
 
+#ifdef	CONFIG_CPU_MONAHANS
+	CKENA |= CKENA_1_LCD;
+#else
 	CKEN |= CKEN16_LCD;
+#endif
 
 	debug("FDADR0 = 0x%08x\n", (unsigned int)FDADR0);
 	debug("FDADR1 = 0x%08x\n", (unsigned int)FDADR1);
include/lcd.h +0 -0
index 1f85daa..cd9d49d 100644

include/lcd.h typedef struct vidinfo { · line 93

Quoted 8 lines
include/lcd.h +1 -1
@@ -87,7 +87,7 @@ typedef struct vidinfo {
 	u_char	vl_wbf;		/* Wait between frames */
 } vidinfo_t;
 
-#elif defined CONFIG_PXA250
+#elif defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS /*
  * PXA LCD DMA descriptor
  */

Hi,
any updates on this ?

#2 lore raw

PATCH 1/2 Enable PXAFB for PXA27X and PXA3XX

In reply to Marek Vasut

Dne P? 26. b?ezna 2010 06:57:50 Marek Vasut napsal(a):

Quoted 82 lines
---
 common/lcd.c    |   12 ++++++------
 cpu/pxa/pxafb.c |    9 ++++++++-
 include/lcd.h   |    2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)
common/lcd.c +1 -1
index 64fb1c6..c2e350e 100644
@@ -41,7 +41,7 @@
 #include <lcd.h>
 #include <watchdog.h>
 
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined

CONFIG_CPU_MONAHANS #include <asm/byteorder.h>
#endif

common/lcd.c +2 -2
@@ -503,7 +503,7 @@ void bitmap_plot (int x, int y)
 	uchar *bmap;
 	uchar *fb;
 	ushort *fb16;
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
@@ -519,7 +519,7 @@ void bitmap_plot (int x, int y)
 
 	if (NBITS(panel_info.vl_bpix) < 12) {
 		/* Leave room for default color map */
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp-

lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]);

common/lcd.c +3 -3
@@ -615,7 +615,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	unsigned long pwidth = panel_info.vl_col;
 	unsigned colors, bpix, bmp_bpix;
 	unsigned long compression;
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
@@ -656,7 +656,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #if !defined(CONFIG_MCC200)
 	/* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
 	if (bmp_bpix == 8) {
-#if defined(CONFIG_PXA250)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
@@ -745,7 +745,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 			WATCHDOG_RESET();
 			for (j = 0; j < width; j++) {
 				if (bpix != 16) {
-#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
+#if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
 CONFIG_CPU_MONAHANS || defined(CONFIG_ATMEL_LCD) *(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
 					*(fb++) = 255 - *(bmap++);
cpu/pxa/pxafb.c +3 -1
index d56c5f0..1cb78f0 100644
@@ -292,7 +292,9 @@ static int pxafb_init_mem (void *lcdbase, vidinfo_t
 *vid)
 
 	return 0;
 }
-
+#ifdef	CONFIG_CPU_MONAHANS
+static inline void pxafb_setup_gpio (vidinfo_t *vid) {}
+#else
 static void pxafb_setup_gpio (vidinfo_t *vid)
 {
cpu/pxa/pxafb.c +0 -0
 	u_long lccr0;

cpu/pxa/pxafb.c static void pxafb_setup_gpio (vidinfo_t *vid) · line 351

Quoted 1 line
cpu/pxa/pxafb.c +0 -0
@@ -349,6 +351,7 @@ static void pxafb_setup_gpio (vidinfo_t *vid)
 		printf("pxafb_setup_gpio: unable to determine bits per 

pixel\n");

Quoted 28 lines
cpu/pxa/pxafb.c +5 -0
 	}
 }
+#endif
 
 static void pxafb_enable_controller (vidinfo_t *vid)
 {
@@ -363,7 +366,11 @@ static void pxafb_enable_controller (vidinfo_t *vid)
 	FDADR1 = vid->pxa.fdadr1;
 	LCCR0 |= LCCR0_ENB;
 
+#ifdef	CONFIG_CPU_MONAHANS
+	CKENA |= CKENA_1_LCD;
+#else
 	CKEN |= CKEN16_LCD;
+#endif
 
 	debug("FDADR0 = 0x%08x\n", (unsigned int)FDADR0);
 	debug("FDADR1 = 0x%08x\n", (unsigned int)FDADR1);
include/lcd.h +1 -1
index 1f85daa..cd9d49d 100644
@@ -87,7 +87,7 @@ typedef struct vidinfo {
 	u_char	vl_wbf;		/* Wait between frames */
 } vidinfo_t;
 
-#elif defined CONFIG_PXA250
+#elif defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined
Quoted 3 lines

CONFIG_CPU_MONAHANS /*
* PXA LCD DMA descriptor
*/

Hi, any updates?

#3 lore raw

PATCH 2/2 PXAMCI Monahans support

In reply to Marek Vasut
---
 drivers/mmc/pxa_mmc.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/mmc/pxa_mmc.c +8 -5
index 8225235..18d5df9 100644
@@ -126,7 +126,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
 	MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ;
 	while (len) {
 		if (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ) {
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
 			int i;
 			for (i = min(len, 32); i; i--) {
 				*dst++ = *((volatile uchar *)&MMC_RXFIFO);
@@ -558,8 +558,11 @@ mmc_legacy_init(int verbose)
 	set_GPIO_mode(GPIO6_MMCCLK_MD);
 	set_GPIO_mode(GPIO8_MMCCS0_MD);
 #endif
+#ifdef CONFIG_CPU_MONAHANS	/* pxa3xx */
+	CKENA |= CKENA_12_MMC0 | CKENA_13_MMC1;
+#else	/* pxa2xx */
 	CKEN |= CKEN12_MMC;	/* enable MMC unit clock */
-
+#endif
 	MMC_CLKRT = MMC_CLKRT_0_3125MHZ;
 	MMC_RESTO = MMC_RES_TO_MAX;
 	MMC_SPI = MMC_SPI_DISABLE;
@@ -584,7 +587,7 @@ mmc_legacy_init(int verbose)
 			debug("Detected SD card\n");
 			break;
 		}
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
 		udelay(10000);
 #else
 		udelay(200000);
@@ -598,7 +601,7 @@ mmc_legacy_init(int verbose)
 
 		retries = 10;
 		while (retries-- && resp && !(resp[0] & 0x80000000)) {
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
 			udelay(10000);
 #else
 			udelay(200000);
@@ -632,7 +635,7 @@ mmc_legacy_init(int verbose)
 	MMC_CLKRT = 0;		/* 20 MHz */
 	resp = mmc_cmd(MMC_CMD_SELECT_CARD, rca, 0, MMC_CMDAT_R1);
 
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
 	if (IF_TYPE_SD == mmc_dev.if_type) {
 		resp = mmc_cmd(MMC_CMD_APP_CMD, rca, 0, MMC_CMDAT_R1);
 		resp = mmc_cmd(SD_CMD_APP_SET_BUS_WIDTH, 0, 2, MMC_CMDAT_R1);
Signature · 1 line
1.7.0
#4 lore raw

PATCH 2/2 PXAMCI Monahans support

Quoted 21 lines · Marek Vasut

---
?drivers/mmc/pxa_mmc.c | ? 13 ++++++++-----
?1 files changed, 8 insertions(+), 5 deletions(-)

drivers/mmc/pxa_mmc.c +1 -1
index 8225235..18d5df9 100644
@@ -126,7 +126,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
 ? ? ? ?MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ;
 ? ? ? ?while (len) {
 ? ? ? ? ? ? ? ?if (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ) {
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
 ? ? ? ? ? ? ? ? ? ? ? ?int i;
 ? ? ? ? ? ? ? ? ? ? ? ?for (i = min(len, 32); i; i--) {
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*dst++ = *((volatile uchar *)&MMC_RXFIFO);
@@ -558,8 +558,11 @@ mmc_legacy_init(int verbose)
 ? ? ? ?set_GPIO_mode(GPIO6_MMCCLK_MD);
 ? ? ? ?set_GPIO_mode(GPIO8_MMCCS0_MD);

?#endif

drivers/mmc/pxa_mmc.c

Quoted 3 lines
drivers/mmc/pxa_mmc.c +3 -0
+#ifdef CONFIG_CPU_MONAHANS ? ? /* pxa3xx */
+ ? ? ? CKENA |= CKENA_12_MMC0 | CKENA_13_MMC1;
+#else ?/* pxa2xx */

Let's try to find a solution to this that doesn't require filling this driver with more #ifdefs.

Andy

#5 lore raw

PATCH 2/2 PXAMCI Monahans support

Dne So 24. dubna 2010 03:22:08 Andy Fleming napsal(a):

Quoted 20 lines · Marek Vasut
Quoted 19 lines
---
 drivers/mmc/pxa_mmc.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/mmc/pxa_mmc.c +1 -1
index 8225235..18d5df9 100644
@@ -126,7 +126,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
       MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ;
       while (len) {
               if (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ) {
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
                       int i;
                       for (i = min(len, 32); i; i--) {
                               *dst++ = *((volatile uchar *)&MMC_RXFIFO);
@@ -558,8 +558,11 @@ mmc_legacy_init(int verbose)
       set_GPIO_mode(GPIO6_MMCCLK_MD);
Quoted 8 lines

drivers/mmc/pxa_mmc.c mmc_legacy_init(int verbose) · line 563

Quoted 5 lines
drivers/mmc/pxa_mmc.c +3 -0
       set_GPIO_mode(GPIO8_MMCCS0_MD);
 #endif
+#ifdef CONFIG_CPU_MONAHANS     /* pxa3xx */
+       CKENA |= CKENA_12_MMC0 | CKENA_13_MMC1;
+#else  /* pxa2xx */

Let's try to find a solution to this that doesn't require filling this driver with more #ifdefs.

That won't make too much sense. You won't run the same binary on both pxa2xx and pxa3xx ... ever. Increasing the bootloader size only because you want to avoid ifdef makes no sense either.

There are other ifdefs in that driver that need to go away (will in further patches), this one is the least harmful one.

Quoted 2 lines

Andy

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

PATCH 2/2 PXAMCI Monahans support

Dne So 24. dubna 2010 03:54:19 Andy Fleming napsal(a):

Quoted 3 lines · Marek Vasut
Quoted 2 lines

Dne So 24. dubna 2010 03:22:08 Andy Fleming napsal(a):

Quoted 1 line

On Fri, Mar 26, 2010 at 12:57 AM, Marek Vasut <[email protected]>

Quoted 32 lines · wrote:
Quoted 28 lines
Quoted 19 lines
Quoted 19 lines
---
 drivers/mmc/pxa_mmc.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/mmc/pxa_mmc.c +1 -1
index 8225235..18d5df9 100644
@@ -126,7 +126,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
       MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ;
       while (len) {
               if (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ) {
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
                       int i;
                       for (i = min(len, 32); i; i--) {
                               *dst++ = *((volatile uchar

*)&MMC_RXFIFO); @@ -558,8 +558,11 @@ mmc_legacy_init(int verbose)

       set_GPIO_mode(GPIO6_MMCCLK_MD);
Quoted 8 lines

drivers/mmc/pxa_mmc.c mmc_legacy_init(int verbose) · line 563

Quoted 5 lines
       set_GPIO_mode(GPIO8_MMCCS0_MD);

#endif

drivers/mmc/pxa_mmc.c +3 -0
+#ifdef CONFIG_CPU_MONAHANS     /* pxa3xx */
+       CKENA |= CKENA_12_MMC0 | CKENA_13_MMC1;
+#else  /* pxa2xx */

Let's try to find a solution to this that doesn't require filling this driver with more #ifdefs.

Quoted 3 lines

That won't make too much sense. You won't run the same binary on both pxa2xx and pxa3xx ... ever. Increasing the bootloader size only because you want to avoid ifdef makes no sense either.

Quoted 6 lines

Just to be clear, I'm not objecting to #ifdefs. I'm objecting to #ifdefs that cause the driver to become more and more rigidly tied to the system. As more and more systems use this driver, such #ifdefs become impossible to manage, and very hard to read. I don't want the code to be binary-compatible. I just want the code to be independent of the board and cpu.

And how do you expect a CPU series-specific driver be CPU-independent?

btw. please don't remove the u-bootML from the mail.

Quoted 5 lines

I'd rather the #ifdef were something that could be reused by a non-monahans cpu, unless the fields being set are specific to the monahans cpu and only will ever be used by it. Otherwise, come up with another name, please.

This will only ever be used by PXA3xx aka monahans. PXA168 might use it as well, but the TRM is still NDAed.

Quoted 6 lines
Quoted 3 lines

There are other ifdefs in that driver that need to go away (will in further patches), this one is the least harmful one.

Yeah, I suspected that was the case. However, doesn't this patch conflict with the other one which removes the #ifdef CONFIG_PXA27X ?

No, the one removing ifdef PXA27X fixes a problem with the card timing out on both monahans and pxa27x because the delay was too short (and it didn't make sense why it even was there that way, probably someone measured it on his board, it worked for him and that value was board-specific!). The PXAMCI haven't changed much ever since pxa21x. The clock management did change since pxa27x, that's why there's the new ifdef.

PXA21x,PXA25x,PXA26x,PXA27x -- CKEN clock enable reg PXA3xx -- CKENA/CKENB clock enable regs

Makes the ifdef clear finally I hope.

Quoted 2 lines

Andy