All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX
@ 2010-03-26  5:57 Marek Vasut
  2010-03-26  5:57 ` [U-Boot] [PATCH 2/2] PXAMCI Monahans support Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Marek Vasut @ 2010-03-26  5:57 UTC (permalink / raw)
  To: u-boot

---
 common/lcd.c    |   12 ++++++------
 cpu/pxa/pxafb.c |    9 ++++++++-
 include/lcd.h   |    2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 64fb1c6..c2e350e 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -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++);
diff --git a/cpu/pxa/pxafb.c b/cpu/pxa/pxafb.c
index d56c5f0..1cb78f0 100644
--- a/cpu/pxa/pxafb.c
+++ b/cpu/pxa/pxafb.c
@@ -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);
diff --git a/include/lcd.h b/include/lcd.h
index 1f85daa..cd9d49d 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -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
  */
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] PXAMCI Monahans support
  2010-03-26  5:57 [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
@ 2010-03-26  5:57 ` Marek Vasut
  2010-04-24  1:22   ` Andy Fleming
  2010-03-31 12:10 ` [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
  2010-04-14 19:44 ` Marek Vasut
  2 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2010-03-26  5:57 UTC (permalink / raw)
  To: u-boot

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

diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
index 8225235..18d5df9 100644
--- a/drivers/mmc/pxa_mmc.c
+++ b/drivers/mmc/pxa_mmc.c
@@ -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);
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX
  2010-03-26  5:57 [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
  2010-03-26  5:57 ` [U-Boot] [PATCH 2/2] PXAMCI Monahans support Marek Vasut
@ 2010-03-31 12:10 ` Marek Vasut
  2010-04-14 19:44 ` Marek Vasut
  2 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2010-03-31 12:10 UTC (permalink / raw)
  To: u-boot

Dne P? 26. b?ezna 2010 06:57:50 Marek Vasut napsal(a):
> ---
>  common/lcd.c    |   12 ++++++------
>  cpu/pxa/pxafb.c |    9 ++++++++-
>  include/lcd.h   |    2 +-
>  3 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/common/lcd.c b/common/lcd.c
> index 64fb1c6..c2e350e 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -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++);
> diff --git a/cpu/pxa/pxafb.c b/cpu/pxa/pxafb.c
> index d56c5f0..1cb78f0 100644
> --- a/cpu/pxa/pxafb.c
> +++ b/cpu/pxa/pxafb.c
> @@ -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);
> diff --git a/include/lcd.h b/include/lcd.h
> index 1f85daa..cd9d49d 100644
> --- a/include/lcd.h
> +++ b/include/lcd.h
> @@ -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 ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX
  2010-03-26  5:57 [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
  2010-03-26  5:57 ` [U-Boot] [PATCH 2/2] PXAMCI Monahans support Marek Vasut
  2010-03-31 12:10 ` [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
@ 2010-04-14 19:44 ` Marek Vasut
  2 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2010-04-14 19:44 UTC (permalink / raw)
  To: u-boot

Dne P? 26. b?ezna 2010 06:57:50 Marek Vasut napsal(a):
> ---
>  common/lcd.c    |   12 ++++++------
>  cpu/pxa/pxafb.c |    9 ++++++++-
>  include/lcd.h   |    2 +-
>  3 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/common/lcd.c b/common/lcd.c
> index 64fb1c6..c2e350e 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -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++);
> diff --git a/cpu/pxa/pxafb.c b/cpu/pxa/pxafb.c
> index d56c5f0..1cb78f0 100644
> --- a/cpu/pxa/pxafb.c
> +++ b/cpu/pxa/pxafb.c
> @@ -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);
> diff --git a/include/lcd.h b/include/lcd.h
> index 1f85daa..cd9d49d 100644
> --- a/include/lcd.h
> +++ b/include/lcd.h
> @@ -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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] PXAMCI Monahans support
  2010-03-26  5:57 ` [U-Boot] [PATCH 2/2] PXAMCI Monahans support Marek Vasut
@ 2010-04-24  1:22   ` Andy Fleming
  2010-04-24  1:37     ` Marek Vasut
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Fleming @ 2010-04-24  1:22 UTC (permalink / raw)
  To: u-boot

On Fri, Mar 26, 2010 at 12:57 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> ---
> ?drivers/mmc/pxa_mmc.c | ? 13 ++++++++-----
> ?1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
> index 8225235..18d5df9 100644
> --- a/drivers/mmc/pxa_mmc.c
> +++ b/drivers/mmc/pxa_mmc.c
> @@ -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 */


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

Andy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] PXAMCI Monahans support
  2010-04-24  1:22   ` Andy Fleming
@ 2010-04-24  1:37     ` Marek Vasut
       [not found]       ` <w2s2acbd3e41004231854z53c38d06m101183ec4656d44e@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2010-04-24  1:37 UTC (permalink / raw)
  To: u-boot

Dne So 24. dubna 2010 03:22:08 Andy Fleming napsal(a):
> On Fri, Mar 26, 2010 at 12:57 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > ---
> >  drivers/mmc/pxa_mmc.c |   13 ++++++++-----
> >  1 files changed, 8 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
> > index 8225235..18d5df9 100644
> > --- a/drivers/mmc/pxa_mmc.c
> > +++ b/drivers/mmc/pxa_mmc.c
> > @@ -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 */
> 
> 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.
> 
> Andy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] PXAMCI Monahans support
       [not found]       ` <w2s2acbd3e41004231854z53c38d06m101183ec4656d44e@mail.gmail.com>
@ 2010-04-24 11:25         ` Marek Vasut
  0 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2010-04-24 11:25 UTC (permalink / raw)
  To: u-boot

Dne So 24. dubna 2010 03:54:19 Andy Fleming napsal(a):
> On Fri, Apr 23, 2010 at 8:37 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > Dne So 24. dubna 2010 03:22:08 Andy Fleming napsal(a):
> >> On Fri, Mar 26, 2010 at 12:57 AM, Marek Vasut <marek.vasut@gmail.com> 
wrote:
> >> > ---
> >> >  drivers/mmc/pxa_mmc.c |   13 ++++++++-----
> >> >  1 files changed, 8 insertions(+), 5 deletions(-)
> >> > 
> >> > diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
> >> > index 8225235..18d5df9 100644
> >> > --- a/drivers/mmc/pxa_mmc.c
> >> > +++ b/drivers/mmc/pxa_mmc.c
> >> > @@ -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 */
> >> 
> >> 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.
> 
> 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.
> 
> 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.
> 
> > 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.
> 
> Andy

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-24 11:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-26  5:57 [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
2010-03-26  5:57 ` [U-Boot] [PATCH 2/2] PXAMCI Monahans support Marek Vasut
2010-04-24  1:22   ` Andy Fleming
2010-04-24  1:37     ` Marek Vasut
     [not found]       ` <w2s2acbd3e41004231854z53c38d06m101183ec4656d44e@mail.gmail.com>
2010-04-24 11:25         ` Marek Vasut
2010-03-31 12:10 ` [U-Boot] [PATCH 1/2] Enable PXAFB for PXA27X and PXA3XX Marek Vasut
2010-04-14 19:44 ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.