1 #include <lib.h> /* Prototypes */
3 static inline void print_debug_sdram_8(const char *strval
, uint32_t val
)
5 #if CONFIG_CACHE_AS_RAM
6 printk(BIOS_DEBUG
, "%s%02x\n", strval
, val
);
8 print_debug(strval
); print_debug_hex8(val
); print_debug("\n");
13 #if CONFIG_RAMINIT_SYSINFO
14 void sdram_initialize(int controllers
, const struct mem_controller
*ctrl
, void *sysinfo
)
16 void sdram_initialize(int controllers
, const struct mem_controller
*ctrl
)
20 /* Set the registers we can set once to reasonable values */
21 for(i
= 0; i
< controllers
; i
++) {
22 print_debug_sdram_8("Ram1.", i
);
24 #if CONFIG_RAMINIT_SYSINFO
25 sdram_set_registers(ctrl
+ i
, sysinfo
);
27 sdram_set_registers(ctrl
+ i
);
31 /* Now setup those things we can auto detect */
32 for(i
= 0; i
< controllers
; i
++) {
33 print_debug_sdram_8("Ram2.", i
);
35 #if CONFIG_RAMINIT_SYSINFO
36 sdram_set_spd_registers(ctrl
+ i
, sysinfo
);
38 sdram_set_spd_registers(ctrl
+ i
);
43 /* Now that everything is setup enable the SDRAM.
44 * Some chipsets do the work for us while on others
45 * we need to it by hand.
47 print_debug("Ram3\n");
49 #if CONFIG_RAMINIT_SYSINFO
50 sdram_enable(controllers
, ctrl
, sysinfo
);
52 sdram_enable(controllers
, ctrl
);
55 print_debug("Ram4\n");