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>
10 void vga_enable_console();
14 mainboard_scan_bus(device_t root, int maxbus)
17 printk_spew("%s: root %p maxbus %d\n", __FUNCTION__, root, maxbus);
18 retval = pci_scan_bus(root->bus, 0, 0xff, maxbus);
19 printk_spew("DONE %s: return %d\n", __FUNCTION__, maxbus);
23 void vga_fixup(void) {
24 // we do this right here because:
25 // - all the hardware is working, and some VGA bioses seem to need
27 // - we need page 0 below for linuxbios tables.
29 printk_debug("INSTALL REAL-MODE IDT\n");
31 printk_debug("DO THE VGA BIOS\n");
39 void write_protect_vgabios(void)
43 printk_info("write_protect_vgabios\n");
44 dev = dev_find_device(PCI_VENDOR_ID_VIA, 0x3123, 0);
46 pci_write_config8(dev, 0x61, 0xaa);
51 enable(struct chip *chip, enum chip_pass pass)
54 struct mainboard_tyan_s4882_config *conf =
55 (struct mainboard_tyan_s4882_config *)chip->chip_info;
59 // case CONF_PASS_PRE_CONSOLE:
60 // case CONF_PASS_PRE_PCI:
61 case CONF_PASS_POST_PCI:
62 // case CONF_PASS_PRE_BOOT:
63 // if (conf->fixup_scsi)
64 // onboard_scsi_fixup();
65 // if (conf->fixup_vga)
67 printk_debug("mainboard fixup pass %d done\r\n",
73 static struct device_operations mainboard_operations = {
74 .read_resources = root_dev_read_resources,
75 .set_resources = root_dev_set_resources,
76 .enable_resources = enable_childrens_resources,
78 .scan_bus = mainboard_scan_bus,
82 static void enumerate(struct chip *chip)
85 dev_root.ops = &mainboard_operations;
86 chip->dev = &dev_root;
88 for(child = chip->children; child; child = child->next) {
89 child->bus = &dev_root.link[0];
92 struct chip_control mainboard_via_epia_m_control = {
93 .enumerate = enumerate,
94 .name = "VIA EPIA-M mainboard ",