Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2006 18:10:13 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 94927 for review
Message-ID:  <200604101810.k3AIADQC008301@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=94927

Change 94927 by imp@imp_Speedy on 2006/04/10 18:09:42

	Use a volatile pointer to write to the memory, rather than just
	a bunch of back to back writes.  This bloats us back to 1084,
	but is necessary to stabilize the SDRAM.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/at91rm9200_lowlevel.c#5 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/at91rm9200_lowlevel.c#5 (text+ko) ====

@@ -49,6 +49,7 @@
 
 	register unsigned	value;
 	int i;
+	volatile unsigned short *p = (unsigned short *)SDRAM_BASE;
 
 	AT91C_BASE_PIOC->PIO_PER = AT91C_PIO_PC10;
 	AT91C_BASE_PIOC->PIO_OER = AT91C_PIO_PC10;
@@ -139,30 +140,30 @@
 
 	AT91C_BASE_SDRC->SDRC_MR =
 		AT91C_SDRC_DBW_16_BITS | AT91C_SDRC_MODE_PRCGALL_CMD;
-	*(unsigned short*)SDRAM_BASE = 0;
+	*p = 0;
 
 	AT91C_BASE_SDRC->SDRC_MR = 
 		AT91C_SDRC_DBW_16_BITS | AT91C_SDRC_MODE_RFSH_CMD;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
-	*(unsigned short*)SDRAM_BASE = 0;
+	*p = 0;
+	*p = 0;
+	*p = 0;
+	*p = 0;
+	*p = 0;
+	*p = 0;
+	*p = 0;
+	*p = 0;
 
 	AT91C_BASE_SDRC->SDRC_MR =
 		AT91C_SDRC_DBW_16_BITS | AT91C_SDRC_MODE_LMR_CMD;
-	*(unsigned short*)SDRAM_BASE = 0;
+	*p = 0;
 
 	AT91C_BASE_SDRC->SDRC_TR = 7 * AT91C_MASTER_CLOCK / 1000000;
 
-	*(unsigned short*)SDRAM_BASE = 0;
+	*p = 0;
 
 	AT91C_BASE_SDRC->SDRC_MR =
 	    AT91C_SDRC_DBW_16_BITS | AT91C_SDRC_MODE_NORMAL_CMD;
-	*(unsigned short*)SDRAM_BASE = 0;
+	*p = 0;
 
 	// Configure DBGU -use local routine optimized for space
 	pPio->PIO_ASR = AT91C_PA31_DTXD | AT91C_PA30_DRXD;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604101810.k3AIADQC008301>