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)
15 /* Enable memory write and invalidate ??? */
16 byte = pci_read_config8(dev, 0x04);
18 pci_write_config8(dev, 0x04, byte);
20 /* Set drive strength */
21 word = pci_read_config16(dev, 0xe0);
23 pci_write_config16(dev, 0xe0, word);
24 word = pci_read_config16(dev, 0xe4);
26 pci_write_config16(dev, 0xe4, word);
29 word = pci_read_config16(dev, 0xe8);
31 pci_write_config16(dev, 0xe8, word);
33 /* Set discard unrequested prefetch data */
34 word = pci_read_config16(dev, 0x4c);
36 pci_write_config16(dev, 0x4c, word);
38 /* Set split transaction limits */
39 word = pci_read_config16(dev, 0xa8);
40 pci_write_config16(dev, 0xaa, word);
41 word = pci_read_config16(dev, 0xac);
42 pci_write_config16(dev, 0xae, word);
47 static struct device_operations pcix_ops = {
48 .read_resources = pci_bus_read_resources,
49 .set_resources = pci_dev_set_resources,
50 .enable_resources = pci_bus_enable_resources,
52 .scan_bus = pci_scan_bridge,
55 static struct pci_driver pcix_driver __pci_driver = {
57 .vendor = PCI_VENDOR_ID_AMD,
62 static void ioapic_enable(device_t dev)
65 value = pci_read_config32(dev, 0x44);
67 value |= ((1 << 1) | (1 << 0));
69 value &= ~((1 << 1) | (1 << 0));
71 pci_write_config32(dev, 0x44, value);
74 static struct device_operations ioapic_ops = {
75 .read_resources = pci_dev_read_resources,
76 .set_resources = pci_dev_set_resources,
77 .enable_resources = pci_dev_enable_resources,
80 .enable = ioapic_enable,
83 static struct pci_driver ioapic_driver __pci_driver = {
85 .vendor = PCI_VENDOR_ID_AMD,