blob: 5ee62e9df7b95f2b4db9068493e2038df2a61b92 [file] [log] [blame]
Stefan Reinauerd56981f2007-10-22 10:07:46 +00001#include <console/console.h>
Stefan Reinauer4a3bb762004-06-28 11:57:31 +00002#include <device/device.h>
Stefan Reinauerd56981f2007-10-22 10:07:46 +00003#include <device/pci.h>
4#include <device/pci_ids.h>
5#include <device/pci_ops.h>
Stefan Reinauer65e9bc12009-03-13 17:00:46 +00006#include <pc80/keyboard.h>
Stefan Reinauerd56981f2007-10-22 10:07:46 +00007#include <arch/io.h>
Stefan Reinauer4a3bb762004-06-28 11:57:31 +00008#include "chip.h"
9
Ronald G. Minnich rminnich4a8523a2009-04-07 02:18:13 +000010/* not sure how these are routed in qemu */
11static const unsigned char enetIrqs[4] = { 11, 0, 0, 0 };
12
13static void qemu_init(device_t dev)
Stefan Reinauerd56981f2007-10-22 10:07:46 +000014{
Stefan Reinauer65e9bc12009-03-13 17:00:46 +000015 /* The VGA OPROM already lives at 0xc0000,
16 * force coreboot to use it.
17 */
18 dev->on_mainboard = 1;
19 dev->rom_address = 0xc0000;
Stefan Reinauerd56981f2007-10-22 10:07:46 +000020
Stefan Reinauer65e9bc12009-03-13 17:00:46 +000021 /* Now do the usual initialization */
22 pci_dev_init(dev);
Aaron Lwe2342f8b2008-05-06 15:02:22 +000023
Stefan Reinauer65e9bc12009-03-13 17:00:46 +000024 /* This sneaked in here, because Qemu does not
25 * emulate a SuperIO chip
26 */
Aaron Lwe2342f8b2008-05-06 15:02:22 +000027 init_pc_keyboard(0x60, 0x64, 0);
Ronald G. Minnich rminnich4a8523a2009-04-07 02:18:13 +000028
29 /* The PIRQ table is not working well for interrupt routing purposes.
30 * so we'll just set the IRQ directly.
31 */
32 printk_info("setting ethernet\n");
33 pci_assign_irqs(0, 3, enetIrqs);
Stefan Reinauerd56981f2007-10-22 10:07:46 +000034}
35
36static struct device_operations vga_operations = {
37 .read_resources = pci_dev_read_resources,
38 .set_resources = pci_dev_set_resources,
39 .enable_resources = pci_dev_enable_resources,
Ronald G. Minnich rminnich4a8523a2009-04-07 02:18:13 +000040 .init = qemu_init,
Stefan Reinauerd56981f2007-10-22 10:07:46 +000041 .ops_pci = 0,
42};
43
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000044static const struct pci_driver vga_driver __pci_driver = {
Stefan Reinauerd56981f2007-10-22 10:07:46 +000045 .ops = &vga_operations,
46 .vendor = 0x1013,
47 .device = 0x00b8,
48};
49
Carl-Daniel Hailfinger7ad11e82009-02-18 20:41:57 +000050struct chip_operations mainboard_ops = {
Uwe Hermanna7aa29b2006-11-05 18:50:49 +000051 CHIP_NAME("QEMU Mainboard")
Stefan Reinauer4a3bb762004-06-28 11:57:31 +000052};
53