如题:主板DM6437,DDR为镁光MT47H32M16H
DDR控制初始化程序如下,但程序下载到主板上发现程序不是每次都能跑起来,大虾们,帮我看看吧
DDR_DDRPHYCR = 0 // DDR PHY Control Re gister
| ( 0x1400190 << 6 ) // Magic number
| ( 0 << 5 ) // DLL release
| ( 0 << 4 ) // DLL powered up
| ( 5 << 0 ); // Read latency ( CAS + RT - 1 )
DDR_SDBCR = 0 // DDR Bank Config
| ( 0 << 23 ) // Boot unlock = No
| ( 2 << 19 ) // Reserved = ( 2 )
| ( 0 << 18 ) // Drive Strength= Normal
| ( 3 << 16 ) // Reserved = ( 3 )
| ( 1 << 15 ) // Modify SDBCR = Yes
| ( 0 << 14 ) // Bus width = 32-bit
| ( 4 << 9 ) // CAS latency = 4
| ( 2 << 4 ) // Bank Setup = 4 banks
| ( 2 << 0 ); // Page Size = 1024-word / 10 column bits
DDR_SDTIMR = 0 // DDR Timing Register
| ( 17 << 25 ) // tRFC = ( 105 ns / 6.17 ns ) - 1
| ( 2 << 22 ) // tRP = ( 15 ns / 6.17 ns ) - 1
| ( 2 << 19 ) // tRCD = ( 15 ns / 6.17 ns ) - 1
| ( 2 << 16 ) // tWR = ( 15 ns / 6.17 ns ) - 1
| ( 6 << 11 ) // tRAS = ( 40 ns / 6.17 ns ) - 1
| ( 8 << 6 ) // tRC = ( 55 ns / 6.17 ns ) - 1
| ( 1 << 3 ) // tRRD = ( 7.5 ns / 6.17 ns ) - 1
| ( 1 << 0 ); // tWTR = ( 7.5 ns / 6.17 ns ) - 1
DDR_SDTIMR2 = 0 // DDR Timing Register
| ( 18 << 16 ) // tXSNR= ( 115 ns / 6.17 ns ) - 1
| ( 199 << 8 ) // tXSRD= ( 200 - 1 ) cycles
| ( 1 << 5 ) // tRTP = ( 7.5 ns / 6.17 ns ) - 1
| ( 2 << 0 ); // tCKE = ( 3 - 1 ) cycles
DDR_SDBCR &= ~0x00008000; // SDBCR cannot be modified
refresh_rate = ( freq * 78 ) / 10;
DDR_SDRCR = 0
| ( 0 << 31 ) // Exits self-refresh
| ( 0 << 30 ) // Disable MCLK stopping
| refresh_rate; // Refresh Control = 7.8 usec * freq |