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=0X10000001DCR=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 occurDACR0=0X1300DMR0=0X3C0001DACR0=0X1304write -l 0X00000000 = 0XA5A59696DACR1=0X401300DMR1=0X3C0001DACR1=0X401304write -l 0X00400000 = 0XA5A59696CSAR0=0XFFE00000CSMR0=0XF0001CSCR0=0XD80CSAR1=0XFFFE0000CSMR1=0X0CSCR1=0X2DF8CSBAR=0XFECSMR2=0X101CSCR2=0X40CSMR3=0X15CSCR3=0X80CSMR4=0X1FCSCR4=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 modeDACR0=0X9340write -l 0X00000400 = 0XA5A59696DACR1=0X409340write -l 0X00400400 = 0XA5A59696RAMBAR=0X800021