mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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@freimann.org> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@500 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
d3f1396e9b
commit
d2d637c4ac
2 changed files with 31 additions and 1 deletions
|
@ -385,6 +385,25 @@ static struct lb_memory *build_lb_mem(struct lb_header *head)
|
|||
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 @@ unsigned long write_linuxbios_table(
|
|||
* 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);
|
||||
|
||||
|
|
|
@ -167,6 +167,14 @@ struct lb_string {
|
|||
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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue