Stefan Reinauer | d56981f | 2007-10-22 10:07:46 +0000 | [diff] [blame] | 1 | #include <console/console.h> |
Stefan Reinauer | 4a3bb76 | 2004-06-28 11:57:31 +0000 | [diff] [blame] | 2 | #include <device/device.h> |
Stefan Reinauer | d56981f | 2007-10-22 10:07:46 +0000 | [diff] [blame] | 3 | #include <device/pci.h> |
| 4 | #include <device/pci_ids.h> |
| 5 | #include <device/pci_ops.h> |
| 6 | #include <arch/io.h> |
Stefan Reinauer | 4a3bb76 | 2004-06-28 11:57:31 +0000 | [diff] [blame] | 7 | #include "chip.h" |
| 8 | |
Stefan Reinauer | d56981f | 2007-10-22 10:07:46 +0000 | [diff] [blame] | 9 | void vga_enable_console(); |
| 10 | |
| 11 | static void vga_init(device_t dev) |
| 12 | { |
Stefan Reinauer | f8ee180 | 2008-01-18 15:08:58 +0000 | [diff] [blame] | 13 | /* code to make vga init run in real mode - does work but against the current coreboot philosophy */ |
Stefan Reinauer | d56981f | 2007-10-22 10:07:46 +0000 | [diff] [blame] | 14 | printk_debug("INSTALL REAL-MODE IDT\n"); |
| 15 | setup_realmode_idt(); |
| 16 | printk_debug("DO THE VGA BIOS\n"); |
| 17 | do_vgabios(); |
| 18 | |
| 19 | vga_enable_console(); |
Aaron Lwe | 2342f8b | 2008-05-06 15:02:22 +0000 | [diff] [blame] | 20 | |
| 21 | init_pc_keyboard(0x60, 0x64, 0); |
Stefan Reinauer | d56981f | 2007-10-22 10:07:46 +0000 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | static struct device_operations vga_operations = { |
| 25 | .read_resources = pci_dev_read_resources, |
| 26 | .set_resources = pci_dev_set_resources, |
| 27 | .enable_resources = pci_dev_enable_resources, |
| 28 | .init = vga_init, |
| 29 | .ops_pci = 0, |
| 30 | }; |
| 31 | |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 32 | static const struct pci_driver vga_driver __pci_driver = { |
Stefan Reinauer | d56981f | 2007-10-22 10:07:46 +0000 | [diff] [blame] | 33 | .ops = &vga_operations, |
| 34 | .vendor = 0x1013, |
| 35 | .device = 0x00b8, |
| 36 | }; |
| 37 | |
Carl-Daniel Hailfinger | 7ad11e8 | 2009-02-18 20:41:57 +0000 | [diff] [blame] | 38 | struct chip_operations mainboard_ops = { |
Uwe Hermann | a7aa29b | 2006-11-05 18:50:49 +0000 | [diff] [blame] | 39 | CHIP_NAME("QEMU Mainboard") |
Stefan Reinauer | 4a3bb76 | 2004-06-28 11:57:31 +0000 | [diff] [blame] | 40 | }; |
| 41 | |