Stefan Reinauer | 4a3bb76 | 2004-06-28 11:57:31 +0000 | [diff] [blame^] | 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 <device/chip.h> |
| 9 | #include "chip.h" |
| 10 | |
| 11 | void cpufixup(unsigned long mem) |
| 12 | { |
| 13 | printk_spew("Welcome to LinuxBIOS CPU fixup. done.\n"); |
| 14 | } |
| 15 | |
| 16 | static int mainboard_scan_bus(device_t root, int maxbus) |
| 17 | { |
| 18 | int retval; |
| 19 | printk_spew("%s: root %p maxbus %d\n", __FUNCTION__, root, maxbus); |
| 20 | retval = pci_scan_bus(root->bus, 0, 0xff, maxbus); |
| 21 | printk_spew("DONE %s: return %d\n", __FUNCTION__, maxbus); |
| 22 | return maxbus; |
| 23 | } |
| 24 | |
| 25 | static struct device_operations mainboard_operations = { |
| 26 | .read_resources = root_dev_read_resources, |
| 27 | .set_resources = root_dev_set_resources, |
| 28 | .enable_resources = enable_childrens_resources, |
| 29 | .init = 0, |
| 30 | .scan_bus = mainboard_scan_bus, |
| 31 | .enable = 0, |
| 32 | }; |
| 33 | |
| 34 | static void enumerate(struct chip *chip) |
| 35 | { |
| 36 | struct chip *child; |
| 37 | dev_root.ops = &mainboard_operations; |
| 38 | chip->dev = &dev_root; |
| 39 | chip->bus = 0; |
| 40 | for(child = chip->children; child; child = child->next) { |
| 41 | child->bus = &dev_root.link[0]; |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | struct chip_control mainboard_emulation_qemu_i386_control = { |
| 46 | .enumerate = enumerate, |
| 47 | .name = "qemu mainboard ", |
| 48 | }; |
| 49 | |