[LinuxBIOS] r500 - in LinuxBIOSv3: arch/x86 include

svn at openbios.org svn at openbios.org
Tue Sep 25 02:22:18 CEST 2007


Author: uwe
Date: 2007-09-25 02:22:18 +0200 (Tue, 25 Sep 2007)
New Revision: 500

Modified:
   LinuxBIOSv3/arch/x86/linuxbios_table.c
   LinuxBIOSv3/include/tables.h
Log:
Add a pointer to the root device to the LinuxBIOS table. Used for
example to access the device list from Open Firmware.

Signed-off-by: Jens Freimann <jens at freimann.org>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>



Modified: LinuxBIOSv3/arch/x86/linuxbios_table.c
===================================================================
--- LinuxBIOSv3/arch/x86/linuxbios_table.c	2007-09-25 00:16:31 UTC (rev 499)
+++ LinuxBIOSv3/arch/x86/linuxbios_table.c	2007-09-25 00:22:18 UTC (rev 500)
@@ -385,6 +385,25 @@
 	return mem;
 }
 
+/**
+ * Add pointer to device tree to LinuxBIOS table.
+ *
+ * @param head Pointer to lbtable header.
+ * @return TODO
+ */
+struct lb_devtree *lb_devtree(struct lb_header *head)
+{
+	struct lb_devtree *lbdev = NULL;
+	struct device *dev = NULL;
+
+	lbdev = (struct lb_devtree *)lb_new_record(head);
+	lbdev->tag = LB_TAG_DEVTREE_PTR;
+	lbdev->size = sizeof(*lbdev);
+	lbdev->dev_root_ptr = &dev_root;
+
+	return lbdev;
+}
+
 unsigned long write_linuxbios_table( 
 	unsigned long low_table_start, unsigned long low_table_end, 
 	unsigned long rom_table_start, unsigned long rom_table_end)
@@ -431,12 +450,15 @@
 	 * size of the linuxbios table.
 	 */
 
-	/* Record our motheboard */
+	/* Record our motherboard */
 	lb_mainboard(head);
 
 	/* Record our various random string information */
 	lb_strings(head);
 
+	/* Record a pointer to the LinuxBIOS device tree */
+	lb_devtree(head);
+
 	/* Remember where my valid memory ranges are */
 	return lb_table_fini(head);
 	

Modified: LinuxBIOSv3/include/tables.h
===================================================================
--- LinuxBIOSv3/include/tables.h	2007-09-25 00:16:31 UTC (rev 499)
+++ LinuxBIOSv3/include/tables.h	2007-09-25 00:22:18 UTC (rev 500)
@@ -167,6 +167,14 @@
 	u8  string[0];
 };
 
+#define LB_TAG_DEVTREE_PTR	0x000e
+
+struct lb_devtree {
+	u32 tag;
+	u32 size;
+	u32 dev_root_ptr; /* Pointer to the root device */
+};
+
 /* The following structures are for the cmos definitions table */
 #define LB_TAG_CMOS_OPTION_TABLE 200
 /* cmos header record */





More information about the coreboot mailing list