PERFORCE change 94927 for review
Warner Losh
imp at FreeBSD.org
Mon Apr 10 18:10:14 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94927
Change 94927 by imp at 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;
More information about the p4-projects
mailing list