1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
7 void amd8111_enable(device_t dev)
12 unsigned reg_old, reg;
14 /* See if we are on the bus behind the amd8111 pci bridge */
15 bus_dev = dev->bus->dev;
16 if ((bus_dev->vendor == PCI_VENDOR_ID_AMD) &&
17 (bus_dev->device == PCI_DEVICE_ID_AMD_8111_PCI))
20 devfn = bus_dev->path.pci.devfn + (1 << 3);
21 lpc_dev = dev_find_slot(bus_dev->bus->secondary, devfn);
22 index = ((dev->path.pci.devfn & ~7) >> 3) + 8;
23 if (dev->path.pci.devfn == 2) { /* EHCI */
28 devfn = (dev->path.pci.devfn) & ~7;
29 lpc_dev = dev_find_slot(dev->bus->secondary, devfn);
30 index = dev->path.pci.devfn & 7;
32 if ((!lpc_dev) || (index >= 17)) {
35 if ((lpc_dev->vendor != PCI_VENDOR_ID_AMD) ||
36 (lpc_dev->device != PCI_DEVICE_ID_AMD_8111_ISA))
39 id = pci_read_config32(lpc_dev, PCI_VENDOR_ID);
40 if (id != (PCI_VENDOR_ID_AMD | (PCI_DEVICE_ID_AMD_8111_ISA << 16))) {
46 reg = reg_old = pci_read_config16(lpc_dev, 0x48);
52 pci_write_config16(lpc_dev, 0x48, reg);
55 else if (index == 16) {
56 reg = reg_old = pci_read_config8(lpc_dev, 0x47);
62 pci_write_config8(lpc_dev, 0x47, reg);
67 struct chip_operations southbridge_amd_amd8111_ops = {
68 CHIP_NAME("AMD-8111 Southbridge")
69 /* This only called when this device is listed in the
72 .enable_dev = amd8111_enable,