mt481c2m32b2tg.h File Reference

#include "sdram.h"

Include dependency graph for mt481c2m32b2tg.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define mt481c2m32b2tg_banks   2
#define mt481c2m32b2tg_cas   3
#define mt481c2m32b2tg_cols   8
#define mt481c2m32b2tg_rows   11
#define mt481c2m32b2tg_tr   312
#define mt481c2m32b2tg_tras   5
#define mt481c2m32b2tg_trc   7
#define mt481c2m32b2tg_trcd   2
#define mt481c2m32b2tg_trp   2
#define mt481c2m32b2tg_twr   2
#define mt481c2m32b2tg_txsr   5

Functions

void mt481c2m32b2tg_init (const sdram_info *info)


Define Documentation

#define mt481c2m32b2tg_banks   2

The number of banks for this sdram.

Definition at line 62 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_cas   3

The CAS latency for this sdram.

Definition at line 81 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_cols   8

The number of columns for this sdram.

Definition at line 50 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_rows   11

The number of rows for this sdram.

Definition at line 56 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_tr   312

The refresh rate. NOTE: This is dependant on the clock frequency

Definition at line 73 of file mt481c2m32b2tg.h.

Referenced by mt481c2m32b2tg_init().

#define mt481c2m32b2tg_tras   5

Minimal ACTIVE to PRECHARGE command. NOTE: This setting is dependant on the clock frequency.

Definition at line 111 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_trc   7

Minimal ACTIVE to ACTIVE command period. NOTE: This setting is dependant on the clock frequency

Definition at line 94 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_trcd   2

Minimal ACTIVE to READ or WRITE delay. NOTE: This setting is dependant on the clock frequency

Definition at line 105 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_trp   2

Minimal PRECHARGE command period. NOTE: This setting is dependant on the clock frequency

Definition at line 100 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_twr   2

The write recovery time. NOTE: This setting is dependant on the clock frequency

Definition at line 87 of file mt481c2m32b2tg.h.

Referenced by main().

#define mt481c2m32b2tg_txsr   5

Minimal exit SELF REFREASH to ACTIVE command. NOTE: This setting is dependant on the clock frequency

Definition at line 117 of file mt481c2m32b2tg.h.

Referenced by main().


Function Documentation

void mt481c2m32b2tg_init ( const sdram_info info  ) 

This function will initialize the mt481c2m32b2tg sdram.

Parameters:
*info The mt481c2m32b2tg hardware specific info
Returns:
Nothing

Definition at line 39 of file mt481c2m32b2tg.c.

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 }


Generated on Thu May 10 13:52:44 2007 for AVR32102 - Using the AVR32 SDRAM controller by  doxygen 1.5.1