[LinuxBIOS] r339 - LinuxBIOSv3/lib

svn at openbios.org svn at openbios.org
Fri Jun 1 06:41:42 CEST 2007

Author: rminnich
Date: 2007-06-01 06:41:42 +0200 (Fri, 01 Jun 2007)
New Revision: 339

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 <rminnich at gmail.com>
Acked-by: Stefan Reinauer <stepan at coresystems.de>

Modified: LinuxBIOSv3/lib/ram.c
--- LinuxBIOSv3/lib/ram.c	2007-05-28 14:34:05 UTC (rev 338)
+++ LinuxBIOSv3/lib/ram.c	2007-06-01 04:41:42 UTC (rev 339)
@@ -40,12 +40,12 @@
  * 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 @@
 	for (i = 0; i < controllers; i++) {
 		       "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++) {
 		  "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");

More information about the coreboot mailing list