From 1bd6471e3eb5341cd6822aedf548eb76407abaca Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Fri, 1 Jun 2007 04:41:42 +0000 Subject: [PATCH] This fixes ram.c correctly for cases where we link instead of including .c files. The mem controller is an opaque type. This code is called with a pointer and a count of mem controllers. I have serious doubts about the value of this code. It is so generic, and does so little, that it may be useless. It may be useful for documentation, however, as it shows people the sequence of operations for spd. Signed-off-by: Ronald G. Minnich Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@339 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- lib/ram.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ram.c b/lib/ram.c index c18bf71a60..c9ab679cf8 100644 --- a/lib/ram.c +++ b/lib/ram.c @@ -40,12 +40,12 @@ void ram_failure(const char *why) * of making it an empty function. * * @param controllers How many memory controllers there are. - * @param ctrl Pointer to the mem control structure. - * @param sysinfo Not used on all targets. NULL if not used. This function - * does nothing with sysinfo but pass it on. + * @param ctrl Pointer to the mem control structure. This is a generic pointer, since the + * structure is wholly chip-dependent, and a survey of all the types makes it clear that a common + * struct is not possible. We can not use the device tree here as this code is run before the device tree + * is available. */ -void ram_initialize(int controllers, const struct mem_controller *ctrl, - void *sysinfo) +void ram_initialize(int controllers, void *ctrl) { int i; @@ -53,21 +53,21 @@ void ram_initialize(int controllers, const struct mem_controller *ctrl, for (i = 0; i < controllers; i++) { printk(BIOS_INFO, "Setting registers of RAM controller %d\n", i); - ram_set_registers(ctrl + i, sysinfo); + ram_set_registers(ctrl, i); } /* Now setup those things we can auto detect. */ for (i = 0; i < controllers; i++) { printk(BIOS_INFO, "Setting SPD based registers of RAM controller %d\n", i); - ram_set_spd_registers(ctrl + i, sysinfo); + ram_set_spd_registers(ctrl, i); } /* Now that everything is setup enable the RAM. Some chipsets do * the work for us while on others we need to it by hand. */ printk(BIOS_DEBUG, "Enabling RAM\n"); - ram_enable(controllers, ctrl, sysinfo); + ram_enable(controllers, ctrl); /* RAM initialization is done. */ printk(BIOS_DEBUG, "RAM enabled successfully\n");