- Major update of the dynamic device tree so it can handle
[coreboot.git] / src / southbridge / amd / amd8111 / amd8111_acpi.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
7 static void acpi_init(struct device *dev)
8 {
9         uint8_t byte;
10         uint16_t word;
11
12 #if 0
13         printk_debug("ACPI: disabling NMI watchdog.. ");
14         pci_read_config_byte(dev, 0x49, &byte);
15         pci_write_config_byte(dev, 0x49, byte | (1<<2));
16
17
18         pci_read_config_byte(dev, 0x41, &byte);
19         pci_write_config_byte(dev, 0x41, byte | (1<<6)|(1<<2));
20
21         /* added from sourceforge */
22         pci_read_config_byte(dev, 0x48, &byte);
23         pci_write_config_byte(dev, 0x48, byte | (1<<3));
24
25         printk_debug("done.\n");
26
27
28         printk_debug("ACPI: Routing IRQ 12 to PS2 port.. ");
29         pci_read_config_word(dev, 0x46, &word);
30         pci_write_config_word(dev, 0x46, word | (1<<9));
31         printk_debug("done.\n");
32
33         
34         printk_debug("ACPI: setting PM class code.. ");
35         pci_write_config_dword(dev, 0x60, 0x06800000);
36         printk_debug("done.\n");
37 #endif
38
39 }
40
41 static struct device_operations acpi_ops  = {
42         .read_resources   = pci_dev_read_resources,
43         .set_resources    = pci_dev_set_resources,
44         .enable_resources = pci_dev_enable_resources,
45         .init = acpi_init,
46         .scan_bus = 0,
47 };
48
49 static struct pci_driver acpi_driver __pci_driver = {
50         .ops    = &acpi_ops,
51         .vendor = PCI_VENDOR_ID_AMD,
52         .device = PCI_DEVICE_ID_AMD_8111_ACPI,
53 };
54