Skip to contentSkip to conversation

fsl-diu: Using I/O accessor to CCSR space

PATCH New Dave Liu 3 participants 5 messages Apr 8, 2010 – May 17, 2010

lore
Share & tools
lore

Dave Liu

author
#0 lore raw

PATCH 1/3 fsl-diu: Using I/O accessor to CCSR space

From: Jerry Huang <[email protected]>

Using PPC I/O accessor to DIU I/O space instead of directly read/write. It will prevent the dozen of compiler order issue and PPC hardware order issue for accessing I/O space.

Using the toolchain(tc-fsl-x86lnx-e500-dp-4.3.74-2.i386.rpm) can show up the order issue of DIU driver.

---
* address Timur's comments

 board/freescale/common/fsl_diu_fb.c |   55 ++++++++++++++++++-----------------
 1 files changed, 28 insertions(+), 27 deletions(-)
board/freescale/common/fsl_diu_fb.c +28 -27
index 2fc878b..d6c10d9 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Freescale Semiconductor, Inc.
+ * Copyright 2007, 2010 Freescale Semiconductor, Inc.
  * York Sun <[email protected]>
  *
  * FSL DIU Framebuffer driver
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <malloc.h>
+#include <asm/io.h>
 
 #include "fsl_diu_fb.h"
 
@@ -246,9 +247,9 @@ int fsl_diu_init(int xres,
 
 	memset(info->screen_base, 0, info->smem_len);
 
-	dr.diu_reg->desc[0] = (unsigned int) &dummy_ad;
-	dr.diu_reg->desc[1] = (unsigned int) &dummy_ad;
-	dr.diu_reg->desc[2] = (unsigned int) &dummy_ad;
+	out_be32(&dr.diu_reg->desc[0], &dummy_ad);
+	out_be32(&dr.diu_reg->desc[1], &dummy_ad);
+	out_be32(&dr.diu_reg->desc[2], &dummy_ad);
 	debug("dummy dr.diu_reg->desc[0] = 0x%x\n", dr.diu_reg->desc[0]);
 	debug("dummy desc[0] = 0x%x\n", hw->desc[0]);
 
@@ -310,26 +311,26 @@ int fsl_diu_init(int xres,
 
 	/* Program DIU registers */
 
-	hw->gamma = (unsigned int) gamma.paddr;
-	hw->cursor= (unsigned int) cursor.paddr;
-	hw->bgnd = 0x007F7F7F;				/* BGND */
-	hw->bgnd_wb = 0;				/* BGND_WB */
-	hw->disp_size = var->yres << 16 | var->xres;	/* DISP SIZE */
-	hw->wb_size = 0;				/* WB SIZE */
-	hw->wb_mem_addr = 0;				/* WB MEM ADDR */
-	hw->hsyn_para = var->left_margin << 22 |	/* BP_H */
+	out_be32(&hw->gamma, gamma.paddr);
+	out_be32(&hw->cursor, cursor.paddr);
+	out_be32(&hw->bgnd, 0x007F7F7F);
+	out_be32(&hw->bgnd_wb, 0);				/* BGND_WB */
+	out_be32(&hw->disp_size, var->yres << 16 | var->xres);	/* DISP SIZE */
+	out_be32(&hw->wb_size, 0);				/* WB SIZE */
+	out_be32(&hw->wb_mem_addr, 0);				/* WB MEM ADDR */
+	out_be32(&hw->hsyn_para, var->left_margin << 22 |	/* BP_H */
 			var->hsync_len << 11   |	/* PW_H */
-			var->right_margin;		/* FP_H */
-	hw->vsyn_para = var->upper_margin << 22 |	/* BP_V */
-			var->vsync_len << 11    |	/* PW_V  */
-			var->lower_margin;		/* FP_V  */
+			var->right_margin);		/* FP_H */
 
-	hw->syn_pol = 0;			/* SYNC SIGNALS POLARITY */
-	hw->thresholds = 0x00037800;		/* The Thresholds */
-	hw->int_status = 0;			/* INTERRUPT STATUS */
-	hw->int_mask = 0;			/* INT MASK */
-	hw->plut = 0x01F5F666;
+	out_be32(&hw->vsyn_para, var->upper_margin << 22 |	/* BP_V */
+			var->vsync_len << 11    |	/* PW_V  */
+			var->lower_margin);		/* FP_V  */
 
+	out_be32(&hw->syn_pol, 0);			/* SYNC SIGNALS POLARITY */
+	out_be32(&hw->thresholds, 0x00037800);		/* The Thresholds */
+	out_be32(&hw->int_status, 0);			/* INTERRUPT STATUS */
+	out_be32(&hw->int_mask, 0);			/* INT MASK */
+	out_be32(&hw->plut, 0x01F5F666);
 	/* Pixel Clock configuration */
 	debug("DIU pixclock in ps - %d\n", var->pixclock);
 	diu_set_pixel_clock(var->pixclock);
@@ -369,8 +370,8 @@ static int fsl_diu_enable_panel(struct fb_info *info)
 	struct diu_ad *ad = &fsl_diu_fb_ad;
 
 	debug("Entered: enable_panel\n");
-	if (hw->desc[0] != (unsigned int)ad)
-		hw->desc[0] = (unsigned int)ad;
+	if (in_be32(&hw->desc[0]) != (u32)ad)
+		out_be32(&hw->desc[0], ad);
 	debug("desc[0] = 0x%x\n", hw->desc[0]);
 	return 0;
 }
@@ -380,8 +381,8 @@ static int fsl_diu_disable_panel(struct fb_info *info)
 	struct diu *hw = dr.diu_reg;
 
 	debug("Entered: disable_panel\n");
-	if (hw->desc[0] != (unsigned int)&dummy_ad)
-		hw->desc[0] = (unsigned int)&dummy_ad;
+	if (in_be32(&hw->desc[0]) != (u32)&dummy_ad)
+		out_be32(&hw->desc[0], &dummy_ad);
 	return 0;
 }
 
@@ -422,7 +423,7 @@ static void enable_lcdc(void)
 
 	debug("Entered: enable_lcdc, fb_enabled = %d\n", fb_enabled);
 	if (!fb_enabled) {
-		hw->diu_mode = dr.mode;
+		out_be32(&hw->diu_mode, dr.mode);
 		fb_enabled++;
 	}
 	debug("diu_mode = %d\n", hw->diu_mode);
@@ -434,7 +435,7 @@ static void disable_lcdc(void)
 
 	debug("Entered: disable_lcdc, fb_enabled = %d\n", fb_enabled);
 	if (fb_enabled) {
-		hw->diu_mode = 0;
+		out_be32(&hw->diu_mode, 0);
 		fb_enabled = 0;
 	}
 }
Signature · 1 line
1.6.4
Applied
#1 lore raw

PATCH 1/3 fsl-diu: Using I/O accessor to CCSR space

Quoted 9 lines · Dave Liu

From: Jerry Huang <[email protected]>

Using PPC I/O accessor to DIU I/O space instead of directly read/write. It will prevent the dozen of compiler order issue and PPC hardware order issue for accessing I/O space.

Using the toolchain(tc-fsl-x86lnx-e500-dp-4.3.74-2.i386.rpm) can show up the order issue of DIU driver.

Quoted 7 lines

---
* address Timur's comments

board/freescale/common/fsl_diu_fb.c | 55 ++++++++++++++++++-----------------

1 files changed, 28 insertions(+), 27 deletions(-)

applied to mpc85xx

- k

#2 lore raw

PATCH 1/3 fsl-diu: Using I/O accessor to CCSR space

Dear Kumar Gala,

Quoted 17 lines · In message <[email protected]> you wrote:
Quoted 14 lines · Dave Liu

From: Jerry Huang <[email protected]>

Using PPC I/O accessor to DIU I/O space instead of directly read/write. It will prevent the dozen of compiler order issue and PPC hardware order issue for accessing I/O space.

Using the toolchain(tc-fsl-x86lnx-e500-dp-4.3.74-2.i386.rpm) can show up the order issue of DIU driver.

---
* address Timur's comments

Quoted 4 lines
Quoted 2 lines

board/freescale/common/fsl_diu_fb.c | 55 ++++++++++++++++++-----------------

1 files changed, 28 insertions(+), 27 deletions(-)

applied to mpc85xx

Am I missing a pull request from you here?

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
We want to create puppets that pull their own strings.   - Ann Marion
#3 lore raw

PATCH 1/3 fsl-diu: Using I/O accessor to CCSR space

In reply to Dave Liu

Dear Dave Liu,

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

From: Jerry Huang <[email protected]>

Using PPC I/O accessor to DIU I/O space instead of directly read/write. It will prevent the dozen of compiler order issue and PPC hardware order issue for accessing I/O space.

Using the toolchain(tc-fsl-x86lnx-e500-dp-4.3.74-2.i386.rpm) can show up the order issue of DIU driver.

Quoted 7 lines

---
* address Timur's comments

 board/freescale/common/fsl_diu_fb.c |   55 ++++++++++++++++++-----------------
 1 files changed, 28 insertions(+), 27 deletions(-)

It seems this commit is causing a lot of build warnings:

...
Configuring for aria board...
../../../../board/freescale/common/fsl_diu_fb.c: In function 'fsl_diu_init':
../../../../board/freescale/common/fsl_diu_fb.c:271: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast ../../../../board/freescale/common/fsl_diu_fb.c:272: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast ../../../../board/freescale/common/fsl_diu_fb.c:273: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast ../../../../board/freescale/common/fsl_diu_fb.c:335: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast ../../../../board/freescale/common/fsl_diu_fb.c:336: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast ../../../../board/freescale/common/fsl_diu_fb.c: In function 'fsl_diu_enable_panel':
../../../../board/freescale/common/fsl_diu_fb.c:395: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast ../../../../board/freescale/common/fsl_diu_fb.c: In function 'fsl_diu_disable_panel':
../../../../board/freescale/common/fsl_diu_fb.c:406: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast
...
Configuring for mpc5121ads board...
fsl_diu_fb.c: In function 'fsl_diu_init':
fsl_diu_fb.c:271: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast fsl_diu_fb.c:272: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast fsl_diu_fb.c:273: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast fsl_diu_fb.c:335: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast fsl_diu_fb.c:336: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast fsl_diu_fb.c: In function 'fsl_diu_enable_panel':
fsl_diu_fb.c:395: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast fsl_diu_fb.c: In function 'fsl_diu_disable_panel':
fsl_diu_fb.c:406: warning: passing argument 2 of 'out_be32' makes integer from pointer without a cast

etc.

Patch following, but could you please run MAKEALL on your submissions? Thanks.

Best regards,

Wolfgang Denk

Signature · 5 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
Peace was the way.
	-- Kirk, "The City on the Edge of Forever", stardate unknown
#4 lore raw

PATCH 1/1 fsl_diu_fb.c: fix build warnings

In reply to Dave Liu

Commit 15351855 "fsl-diu: Using I/O accessor to CCSR space" caused a number of "passing argument 2 of 'out_be32' makes integer from pointer without a cast" warnings; fix these.

Cc Dave Liu <[email protected]>
Cc Jerry Huang <[email protected]>
Cc Kumar Gala <[email protected]>
---
 board/freescale/common/fsl_diu_fb.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
board/freescale/common/fsl_diu_fb.c +9 -9
index e7f077e..e740ad8 100644
@@ -268,9 +268,9 @@ int fsl_diu_init(int xres,
 
 	memset(info->screen_base, 0, info->smem_len);
 
-	out_be32(&dr.diu_reg->desc[0], &dummy_ad);
-	out_be32(&dr.diu_reg->desc[1], &dummy_ad);
-	out_be32(&dr.diu_reg->desc[2], &dummy_ad);
+	out_be32(&dr.diu_reg->desc[0], (int)&dummy_ad);
+	out_be32(&dr.diu_reg->desc[1], (int)&dummy_ad);
+	out_be32(&dr.diu_reg->desc[2], (int)&dummy_ad);
 	debug("dummy dr.diu_reg->desc[0] = 0x%x\n", dr.diu_reg->desc[0]);
 	debug("dummy desc[0] = 0x%x\n", hw->desc[0]);
 
@@ -332,8 +332,8 @@ int fsl_diu_init(int xres,
 
 	/* Program DIU registers */
 
-	out_be32(&hw->gamma, gamma.paddr);
-	out_be32(&hw->cursor, cursor.paddr);
+	out_be32(&hw->gamma, (int)gamma.paddr);
+	out_be32(&hw->cursor, (int)cursor.paddr);
 	out_be32(&hw->bgnd, 0x007F7F7F);
 	out_be32(&hw->bgnd_wb, 0);				/* BGND_WB */
 	out_be32(&hw->disp_size, var->yres << 16 | var->xres);	/* DISP SIZE */
@@ -391,8 +391,8 @@ static int fsl_diu_enable_panel(struct fb_info *info)
 	struct diu_ad *ad = &fsl_diu_fb_ad;
 
 	debug("Entered: enable_panel\n");
-	if (in_be32(&hw->desc[0]) != (u32)ad)
-		out_be32(&hw->desc[0], ad);
+	if (in_be32(&hw->desc[0]) != (unsigned)ad)
+		out_be32(&hw->desc[0], (unsigned)ad);
 	debug("desc[0] = 0x%x\n", hw->desc[0]);
 	return 0;
 }
@@ -402,8 +402,8 @@ static int fsl_diu_disable_panel(struct fb_info *info)
 	struct diu *hw = dr.diu_reg;
 
 	debug("Entered: disable_panel\n");
-	if (in_be32(&hw->desc[0]) != (u32)&dummy_ad)
-		out_be32(&hw->desc[0], &dummy_ad);
+	if (in_be32(&hw->desc[0]) != (unsigned)&dummy_ad)
+		out_be32(&hw->desc[0], (unsigned)&dummy_ad);
 	return 0;
 }
 
Signature · 1 line
1.6.6.1