"no warnings day"
[coreboot.git] / src / mainboard / via / epia-m / 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 <arch/io.h>
7 #include "chip.h"
8 #include "vgachip.h"
9
10 static void vga_fixup(void) {
11         // we do this right here because:
12         // - all the hardware is working, and some VGA bioses seem to need
13         //   that
14         // - we need page 0 below for coreboot tables.
15
16         printk(BIOS_DEBUG, "INSTALL REAL-MODE IDT\n");
17         setup_realmode_idt();
18         printk(BIOS_DEBUG, "DO THE VGA BIOS\n");
19         do_vgabios();
20         post_code(0x93);
21         vga_enable_console();
22 }
23  
24 void write_protect_vgabios(void)
25 {
26         device_t dev;
27  
28         printk(BIOS_INFO, "write_protect_vgabios\n");
29         /* there are two possible devices. Just do both. */
30         dev = dev_find_device(PCI_VENDOR_ID_VIA, 0x3122, 0);
31         if(dev)
32                 pci_write_config8(dev, 0x61, 0xaa);
33
34         dev = dev_find_device(PCI_VENDOR_ID_VIA, 0x3123, 0);
35         if(dev)
36                 pci_write_config8(dev, 0x61, 0xaa);
37 }
38
39 struct chip_operations mainboard_ops = {
40         CHIP_NAME("VIA EPIA-M Mainboard")
41 };
42