diff mbox

[4/7,v3] integrator: use io-accessors for board init

Message ID 1320855280-4170-1-git-send-email-linus.walleij@linaro.org
State Accepted
Commit 7c045d0bfec1e2990e19d3eb1852839e27270387
Headers show

Commit Message

Linus Walleij Nov. 9, 2011, 4:14 p.m. UTC
Casting around to *(volatile ulong *) doesn't look good, so include
the <asm/io.h> macros and use good old readl() instead.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Rebased to U-Boot ARM HEAD at Alberts request, see message
  4EA1C8E7.7090105@aribaud.net
ChangeLog v2->v3:
- Rebased to U-Boot ARM HEAD at Alberts request, see message
  4EB84700.1030109@aribaud.net
---
 board/armltd/integrator/integrator.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c
index 83f047c..780218c 100644
--- a/board/armltd/integrator/integrator.c
+++ b/board/armltd/integrator/integrator.c
@@ -35,6 +35,7 @@ 
 
 #include <common.h>
 #include <netdev.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -101,15 +102,15 @@  int dram_init (void)
 #ifdef CONFIG_CM_SPD_DETECT
 	{
 extern void dram_query(void);
-	unsigned long cm_reg_sdram;
-	unsigned long sdram_shift;
+	u32 cm_reg_sdram;
+	u32 sdram_shift;
 
 	dram_query();	/* Assembler accesses to CM registers */
 			/* Queries the SPD values	      */
 
 	/* Obtain the SDRAM size from the CM SDRAM register */
 
-	cm_reg_sdram = *(volatile ulong *)(CM_BASE + OS_SDRAM);
+	cm_reg_sdram = readl(CM_BASE + OS_SDRAM);
 	/*   Register	      SDRAM size
 	 *
 	 *   0xXXXXXXbbb000bb	 16 MB
@@ -119,7 +120,7 @@  extern void dram_query(void);
 	 *   0xXXXXXXbbb100bb	256 MB
 	 *
 	 */
-	sdram_shift		 = ((cm_reg_sdram & 0x0000001C)/4)%4;
+	sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4;
 	gd->ram_size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE +
 				    REMAPPED_FLASH_SZ,
 				    0x01000000 << sdram_shift);