/*----------------------------------------------------- DDR3A : DDR1333, 64bit--------------------------------------------------------------------------*/ ddr3A_64bit_DDR1333_setup() { unsigned int multiplier = 39; unsigned int divider = 0; int temp,i, delay=1000; unsigned int OD_val = 12; KICK0 = 0x83E70B13; KICK1 = 0x95A4F1E0; //1. Poll for IDONE=1 in the PHY General Status Register 0 (address offset 0x010). do { read_val = DDR3A_PGSR0; } while ((read_val&0x00000001) != 0x00000001); // Clocks are enabled and frequency is stable--------------------------------------- // DDR3A PLL setup GEL_TextOut ( "DDR3 PLL Setup ... \n"); // DDR3APLLCTL0 = DDR3APLLCTL0 & 0xFF7FFFFF; // Set ENSAT = 1 DDR3APLLCTL1 |= 0x00000040; // Put the PLL in PLL Mode DDR3APLLCTL0 |= 0x00800000; // Program the necessary multipliers/dividers and BW adjustments // Set the divider values DDR3APLLCTL0 &= ~(0x0000003F); DDR3APLLCTL0 |= (divider & 0x0000003F); // Program OD[3:0] in the SECCTL register DDR3APLLCTL0 &= OUTPUT_DIVIDE_MASK; // clear the OD bit field DDR3APLLCTL0 |= ~OUTPUT_DIVIDE_MASK & (OD_val - 1) << OUTPUT_DIVIDE_OFFSET; // set the OD[3:0] bit field of PLLD to OD_val // Set the Multipler values DDR3APLLCTL0 &= ~(0x0007FFC0); DDR3APLLCTL0 |= ((multiplier << 6) & 0x0007FFC0 ); temp = ((multiplier + 1) >> 1) - 1; DDR3APLLCTL0 &= ~(0xFF000000); DDR3APLLCTL0 |= ((temp << 24) & 0xFF000000); DDR3APLLCTL1 &= ~(0x0000000F); DDR3APLLCTL1 |= ((temp >> 8) & 0x0000000F); // In PLL Controller, reset the PLL (bit 13 in DDR3APLLCTL1 register) DDR3APLLCTL1 |= 0x00004000; for(i=0;is. DDR3A_SDCFG = 0x62008C62; //Single-Rank 9A62//0x62008C62 ;//0x6600CE62=single rank,0x6600CE6A=dual rank //DDR3A_SDCFG = 0x62008C6A; //Dual-Rank DDR3A_SDTIM1 = 0x125C8044;//0x125C8046;//0x125C8044; DDR3A_SDTIM2 = 0x00001D29;//0x00001D08; //29 DDR3A_SDTIM3 = 0x32CDFF43;//0x31C5FF43;//0x32CDFF43; DDR3A_SDTIM4 = 0x543F0ADF;//0x543F06AF;//0x543F0ADF; DDR3A_ZQCFG = 0x70073200; //Single-Rank //DDR3A_ZQCFG = 0xF0073200; //Dual-Rank //8.b. Program reg_initref_dis=0 in the SDRAM Refresh Control Register (address offset 0x10). DDR3A_SDRFC = 0x00001457; GEL_TextOut("DDR3A initialization complete \n"); /* End DDR3A EMIF Configuration */ }