if(!DRAM_Test())
{
Led_Display_On(1); //RED
RAM_Error();
}
}
BOOL DRAM_Test(void);
unsigned long* DRAM_DeviceTest(unsigned long *BaseAddr, unsigned long nBytes);
unsigned long* DRAM_AddrBusTest(unsigned long *BaseAddr, unsigned long nBytes);
unsigned long DRAM_DataBusTest(unsigned long *Addr);
//*----------------------------------------------------------------------------
//* \fn DRAM_DataBusTest
//* \brief Test the DRAM Data Bus
//* return succeed return 0 / fail return Data Value
//*----------------------------------------------------------------------------
unsigned long DRAM_DataBusTest(unsigned long *Addr)
{
unsigned long pattern;
return 0;
}
//*----------------------------------------------------------------------------
//* \fn DRAM_DeviceTest
//* \brief Test the DRAM
//*----------------------------------------------------------------------------
unsigned long* DRAM_DeviceTest(unsigned long *BaseAddr, unsigned long nBytes)
{
unsigned long offset;
unsigned long nDWords = nBytes/4;
unsigned long pattern=0xAAAAAAAA;
unsigned long antipattern=0x55555555;
/*
//將整個記憶體填入已知的資料數值
for(offset = 0;offset < nDWords; offset++)
{
BaseAddr[offset] = pattern;
if(offset % 0x100000 == 0)
DebugString(".");
}
//*----------------------------------------------------------------------------
//* \fn DRAM_Test
//* \brief Test All the DRAM: Data/Address/Every Bit
//*----------------------------------------------------------------------------
BOOL DRAM_Test(void)
{
unsigned long Value;
unsigned long *pValue;
unsigned long DRAM0_BASE = 0x20000000;
unsigned long DRAM0_SIZE = 0x8000000; //128M
unsigned long DRAM1_BASE = 0x40000000;
unsigned long DRAM1_SIZE = 0x8000000; //128M