- First stab at running linuxbios without the old static device tree.
[coreboot.git] / src / mainboard / technologic / ts5300 / 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 static int
11 mainboard_scan_bus(device_t root, int maxbus) 
12 {
13         int retval;
14         printk_spew("%s: root %p maxbus %d\n", __FUNCTION__, root, maxbus);
15         retval = pci_scan_bus(root->bus, 0, 0xff, maxbus);
16         printk_spew("DONE %s: return %d\n", __FUNCTION__, maxbus);
17         return maxbus;
18 }
19
20 static struct device_operations mainboard_operations = {
21         .read_resources   = root_dev_read_resources,
22         .set_resources    = root_dev_set_resources,
23         .enable_resources = enable_childrens_resources,
24         .init             = 0,
25         .scan_bus         = mainboard_scan_bus,
26         .enable           = 0,
27 };
28
29 static void enumerate(struct chip *chip)
30 {
31         struct chip *child;
32         dev_root.ops = &mainboard_operations;
33         chip->dev = &dev_root;
34         chip->bus = 0;
35         for(child = chip->children; child; child = child->next) {
36                 child->bus = &dev_root.link[0];
37         }
38 }
39 struct chip_control mainboard_technologic_ts5300_control = {
40         .enumerate = enumerate, 
41         .name      = "Technologic Systems TS5300 mainboard ",
42 };
43