1 #include <lib.h> /* Prototypes */
3 #ifndef RAMINIT_SYSINFO
4 #define RAMINIT_SYSINFO 0
7 static inline void print_debug_sdram_8(const char *strval, uint32_t val)
10 printk(BIOS_DEBUG, "%s%02x\r\n", strval, val);
12 print_debug(strval); print_debug_hex8(val); print_debug("\r\n");
17 #if RAMINIT_SYSINFO == 1
18 void sdram_initialize(int controllers, const struct mem_controller *ctrl, void *sysinfo)
20 void sdram_initialize(int controllers, const struct mem_controller *ctrl)
24 /* Set the registers we can set once to reasonable values */
25 for(i = 0; i < controllers; i++) {
26 print_debug_sdram_8("Ram1.",i);
28 #if RAMINIT_SYSINFO == 1
29 sdram_set_registers(ctrl + i , sysinfo);
31 sdram_set_registers(ctrl + i);
35 /* Now setup those things we can auto detect */
36 for(i = 0; i < controllers; i++) {
37 print_debug_sdram_8("Ram2.",i);
39 #if RAMINIT_SYSINFO == 1
40 sdram_set_spd_registers(ctrl + i , sysinfo);
42 sdram_set_spd_registers(ctrl + i);
47 /* Now that everything is setup enable the SDRAM.
48 * Some chipsets do the work for us while on others
49 * we need to it by hand.
51 print_debug("Ram3\r\n");
53 #if RAMINIT_SYSINFO == 1
54 sdram_enable(controllers, ctrl, sysinfo);
56 sdram_enable(controllers, ctrl);
59 print_debug("Ram4\r\n");