Ever wondered where those "setting incorrect section attributes for
[coreboot.git] / src / southbridge / via / vt8231 / vt8231_acpi.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ops.h>
5 #include <device/pci_ids.h>
6 #include "vt8231.h"
7
8 static void acpi_init(struct device *dev)
9 {
10         printk_debug("Configuring VIA ACPI\n");
11
12         // Set ACPI base address to IO 0x4000
13         pci_write_config32(dev, 0x48, 0x4001);
14         
15         // Enable ACPI access (and setup like award)
16         pci_write_config8(dev, 0x41, 0x84);
17         
18         // Set hardware monitor base address to IO 0x6000
19         pci_write_config32(dev, 0x70, 0x6001);
20         
21         // Enable hardware monitor (and setup like award)
22         pci_write_config8(dev, 0x74, 0x01);
23         
24         // set IO base address to 0x5000
25         pci_write_config32(dev, 0x90, 0x5001);
26         
27         // Enable SMBus 
28         pci_write_config8(dev, 0xd2, 0x01);
29 }
30
31 static struct device_operations acpi_ops = {
32         .read_resources   = pci_dev_read_resources,
33         .set_resources    = pci_dev_set_resources,
34         .enable_resources = pci_dev_enable_resources,
35         .init             = acpi_init,
36         .enable           = 0,
37         .ops_pci          = 0,
38 };
39
40 static const struct pci_driver northbridge_driver __pci_driver = {
41         .ops    = &acpi_ops,
42         .vendor = PCI_VENDOR_ID_VIA,
43         .device = PCI_DEVICE_ID_VIA_8231_4,
44 };