Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / src / mainboard / emulation / qemu-x86 / 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 #include <pc80/keyboard.h>
7 #include <arch/io.h>
8 #include "chip.h"
9
10 /* not sure how these are routed in qemu */
11 static const unsigned char enetIrqs[4] = { 11, 0, 0, 0 };
12
13 static void qemu_init(device_t dev)
14 {
15         /* The VGA OPROM already lives at 0xc0000,
16          * force coreboot to use it.
17          */
18         dev->on_mainboard = 1;
19
20         /* Now do the usual initialization */
21         pci_dev_init(dev);
22
23         /* This sneaked in here, because Qemu does not
24          * emulate a SuperIO chip
25          */
26         pc_keyboard_init(0);
27
28         /* The PIRQ table is not working well for interrupt routing purposes.
29          * so we'll just set the IRQ directly.
30         */
31         printk(BIOS_INFO, "setting ethernet\n");
32         pci_assign_irqs(0, 3, enetIrqs);
33 }
34
35 static struct device_operations vga_operations = {
36         .read_resources   = pci_dev_read_resources,
37         .set_resources    = pci_dev_set_resources,
38         .enable_resources = pci_dev_enable_resources,
39         .init             = qemu_init,
40         .ops_pci          = 0,
41 };
42
43 static const struct pci_driver vga_driver __pci_driver = {
44         .ops = &vga_operations,
45         .vendor = 0x1013,
46         .device = 0x00b8,
47 };
48
49 struct chip_operations mainboard_ops = {
50         CHIP_NAME("QEMU Mainboard")
51 };
52