Since some people disapprove of white space cleanups mixed in regular commits
[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
7 static void acpi_init(struct device *dev)
8 {
9         printk(BIOS_DEBUG, "Configuring VIA ACPI\n");
10
11         // Set ACPI base address to IO 0x4000
12         pci_write_config32(dev, 0x48, 0x4001);
13
14         // Enable ACPI access (and setup like award)
15         pci_write_config8(dev, 0x41, 0x84);
16
17         // Set hardware monitor base address to IO 0x6000
18         pci_write_config32(dev, 0x70, 0x6001);
19
20         // Enable hardware monitor (and setup like award)
21         pci_write_config8(dev, 0x74, 0x01);
22
23         // set IO base address to 0x5000
24         pci_write_config32(dev, 0x90, 0x5001);
25
26         // Enable SMBus
27         pci_write_config8(dev, 0xd2, 0x01);
28 }
29
30 static struct device_operations acpi_ops = {
31         .read_resources   = pci_dev_read_resources,
32         .set_resources    = pci_dev_set_resources,
33         .enable_resources = pci_dev_enable_resources,
34         .init             = acpi_init,
35         .enable           = 0,
36         .ops_pci          = 0,
37 };
38
39 static const struct pci_driver northbridge_driver __pci_driver = {
40         .ops    = &acpi_ops,
41         .vendor = PCI_VENDOR_ID_VIA,
42         .device = PCI_DEVICE_ID_VIA_8231_4,
43 };