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>
7 static void acpi_init(struct device *dev)
9 printk(BIOS_DEBUG, "Configuring VIA ACPI\n");
11 // Set ACPI base address to IO 0x4000
12 pci_write_config32(dev, 0x48, 0x4001);
14 // Enable ACPI access (and setup like award)
15 pci_write_config8(dev, 0x41, 0x84);
17 // Set hardware monitor base address to IO 0x6000
18 pci_write_config32(dev, 0x70, 0x6001);
20 // Enable hardware monitor (and setup like award)
21 pci_write_config8(dev, 0x74, 0x01);
23 // set IO base address to 0x5000
24 pci_write_config32(dev, 0x90, 0x5001);
27 pci_write_config8(dev, 0xd2, 0x01);
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,
39 static const struct pci_driver northbridge_driver __pci_driver = {
41 .vendor = PCI_VENDOR_ID_VIA,
42 .device = PCI_DEVICE_ID_VIA_8231_4,