- First stab at running linuxbios without the old static device tree.
[coreboot.git] / src / mainboard / emulation / qemu-i386 / mainboard.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
6
7 #include <arch/io.h>
8 #include "chip.h"
9
10 void cpufixup(unsigned long mem)
11 {
12         printk_spew("Welcome to LinuxBIOS CPU fixup. done.\n");
13 }
14
15 static int mainboard_scan_bus(device_t root, int maxbus) 
16 {
17         int retval;
18         printk_spew("%s: root %p maxbus %d\n", __FUNCTION__, root, maxbus);
19         retval = pci_scan_bus(root->bus, 0, 0xff, maxbus);
20         printk_spew("DONE %s: return %d\n", __FUNCTION__, maxbus);
21         return maxbus;
22 }
23
24 static struct device_operations mainboard_operations = {
25         .read_resources   = root_dev_read_resources,
26         .set_resources    = root_dev_set_resources,
27         .enable_resources = enable_childrens_resources,
28         .init             = 0,
29         .scan_bus         = mainboard_scan_bus,
30         .enable           = 0,
31 };
32
33 static void enumerate(struct chip *chip)
34 {
35         struct chip *child;
36         dev_root.ops = &mainboard_operations;
37         chip->dev = &dev_root;
38         chip->bus = 0;
39         for(child = chip->children; child; child = child->next) {
40                 child->bus = &dev_root.link[0];
41         }
42 }
43
44 struct chip_control mainboard_emulation_qemu_i386_control = {
45         .enumerate = enumerate, 
46         .name      = "qemu mainboard ",
47 };
48