aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/lx/generic_sdram.c
blob: 21239c6c1739c439c77d57bd2088ed2691debd36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <console/console.h>
#include <northbridge/amd/lx/raminit.h>

/* Setup SDRAM */
void sdram_initialize(int controllers, const struct mem_controller *ctrl)
{
	int i;
	/* Set the registers we can set once to reasonable values */
	for (i = 0; i < controllers; i++) {
		printk(BIOS_DEBUG, "Ram1.%02x\n", i);
		sdram_set_registers(ctrl + i);
	}

	/* Now setup those things we can auto detect */
	for (i = 0; i < controllers; i++) {
		printk(BIOS_DEBUG, "Ram2.%02x\n", i);
		sdram_set_spd_registers(ctrl + i);
	}

	/* Now that everything is setup enable the SDRAM.
	 * Some chipsets do the work for us while on others
	 * we need to it by hand.
	 */
	printk(BIOS_DEBUG, "Ram3\n");

	sdram_enable(controllers, ctrl);

	printk(BIOS_DEBUG, "Ram4\n");
}