#include "sdram.h"
#include "mt481c2m32b2tg.h"
Include dependency graph for mt481c2m32b2tg.c:
Go to the source code of this file.
Functions | |
| void | mt481c2m32b2tg_init (const sdram_info *info) |
| void mt481c2m32b2tg_init | ( | const sdram_info * | info | ) |
This function will initialize the mt481c2m32b2tg sdram.
| *info | The mt481c2m32b2tg hardware specific info |
Definition at line 39 of file mt481c2m32b2tg.c.
References MODE_AUTOREFRESH, MODE_LOAD_MR, MODE_NORMAL, MODE_PRECHARGE, mt481c2m32b2tg_tr, and sdram_info::physical_address.
Referenced by main().
00040 { 00041 volatile unsigned long *sdram = (unsigned long *) info->physical_address; 00042 unsigned long dummy_read; 00043 unsigned int i; 00044 00045 volatile avr32_sdramc_t *sdramc = &AVR32_SDRAMC; 00046 00047 // Precharge All command is issued to the SDRAM 00048 sdramc->mr = MODE_PRECHARGE; 00049 dummy_read = sdramc->mr; 00050 sdram[0] = 0; 00051 00052 // Provide eight auto-refresh (CBR) cycles 00053 sdramc->mr = MODE_AUTOREFRESH; 00054 dummy_read = sdramc->mr; 00055 for (i = 0; i < 8; i++) 00056 { 00057 sdram[0] = 0; 00058 } 00059 00060 // A mode register set (MRS) cycle is issued to program 00061 // SDRAM parameters, in particular CAS latency and burst 00062 // length. 00063 00064 // CAS from info struct, burst length 1, serial burst type 00065 sdramc->mr = MODE_LOAD_MR; 00066 dummy_read = sdramc->mr; 00067 sdram[0x020] = 0; 00068 00069 // A Normal Mode command is provided, 3 clocks after tMRD is met. 00070 dummy_read = sdramc->mr; 00071 sdramc->mr = MODE_NORMAL; 00072 dummy_read = sdramc->mr; 00073 sdram[0] = 0; 00074 00075 // Write refresh rate into SDRAMC refresh timer count register 00076 sdramc->tr = mt481c2m32b2tg_tr; 00077 }
1.5.1