2 * (C) 2003 Linux Networx
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <device/pci.h>
7 #include <device/pci_ids.h>
8 #include <device/pci_ops.h>
10 static void pcix_init(device_t dev)
16 /* Enable memory write and invalidate ??? */
17 byte = pci_read_config8(dev, 0x04);
19 pci_write_config8(dev, 0x04, byte);
21 /* Set drive strength */
22 word = pci_read_config16(dev, 0xe0);
24 pci_write_config16(dev, 0xe0, word);
25 word = pci_read_config16(dev, 0xe4);
27 pci_write_config16(dev, 0xe4, word);
30 word = pci_read_config16(dev, 0xe8);
32 pci_write_config16(dev, 0xe8, word);
37 static struct device_operations pcix_ops = {
38 .read_resources = pci_bus_read_resources,
39 .set_resources = pci_dev_set_resources,
41 .scan_bus = pci_scan_bridge,
44 static struct pci_driver pcix_driver __pci_driver = {
46 .vendor = PCI_VENDOR_ID_AMD,
51 static void ioapic_enable(device_t dev)
54 value = pci_read_config32(dev, 0x44);
56 value |= ((1 << 1) | (1 << 0));
58 value &= ~((1 << 1) | (1 << 0));
60 pci_write_config32(dev, 0x44, value);
63 static struct device_operations ioapic_ops = {
64 .read_resources = pci_dev_read_resources,
65 .set_resources = pci_dev_set_resources,
68 .enable = ioapic_enable,
71 static struct pci_driver ioapic_driver __pci_driver = {
73 .vendor = PCI_VENDOR_ID_AMD,