Crossware

Table of Contents        Previous topic       Next topic       

Downloading and Running a Program->Scripts to Initialise SDRAM

The script to initialise chips which use SDRAM are slightly more complicated.  The SDRAM must be initialised in a particular sequence and the SDRAM must be written to in order to initiate a precharge and to set it's
on-board mode.  This is a typical script for a target board with SDRAM:
    
[VARIANT=5307A]
; This configuration script was created on 15 May 2000 13:46:47
; using information gathered from the target hardware.
MBAR=0X10000001
DCR=0X8230
; Synchronous DRAM banks must be initialised in stages
; First set the address control register with refresh disabled
; Second set the address control register with precharge enabled
; Then write into the DRAM to initiate the precharge
; Then set the refresh bit
; Then wait (do something else) while the required refreshes occur
DACR0=0X1300
DMR0=0X3C0001
DACR0=0X1304
write -l 0X00000000 = 0XA5A59696
DACR1=0X401300
DMR1=0X3C0001
DACR1=0X401304
write -l 0X00400000 = 0XA5A59696
CSAR0=0XFFE00000
CSMR0=0XF0001
CSCR0=0XD80
CSAR1=0XFFFE0000
CSMR1=0X0
CSCR1=0X2DF8
CSBAR=0XFE
CSMR2=0X101
CSCR2=0X40
CSMR3=0X15
CSCR3=0X80
CSMR4=0X1F
CSCR4=0X40
; We must now set the mode on-board the SDRAM chips
; First set the IMRS bit
; Then write to the appropriate DRAM address to set the mode
DACR0=0X9340
write -l 0X00000400 = 0XA5A59696
DACR1=0X409340
write -l 0X00400400 = 0XA5A59696
RAMBAR=0X800021