1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/chip.h>
8 void amd8111_enable(device_t dev)
13 uint16_t reg_old, reg;
15 /* See if we are on the behind the amd8111 pci bridge */
16 bus_dev = dev->bus->dev;
17 if ((bus_dev->vendor == PCI_VENDOR_ID_AMD) &&
18 (bus_dev->device == PCI_DEVICE_ID_AMD_8111_PCI)) {
20 devfn = bus_dev->path.u.pci.devfn + (1 << 3);
21 lpc_dev = dev_find_slot(bus_dev->bus->secondary, devfn);
22 index = ((dev->path.u.pci.devfn & ~7) >> 3) + 8;
25 devfn = (dev->path.u.pci.devfn) & ~7;
26 lpc_dev = dev_find_slot(dev->bus->secondary, devfn);
27 index = dev->path.u.pci.devfn & 7;
30 if ((!lpc_dev) || (index >= 16)) {
33 if ((lpc_dev->vendor != PCI_VENDOR_ID_AMD) ||
34 (lpc_dev->device != PCI_DEVICE_ID_AMD_8111_ISA)) {
36 id = pci_read_config32(lpc_dev, PCI_VENDOR_ID);
37 if (id != (PCI_VENDOR_ID_AMD | (PCI_DEVICE_ID_AMD_8111_ISA << 16))) {
41 reg = reg_old = pci_read_config16(lpc_dev, 0x48);
47 pci_write_config16(lpc_dev, 0x48, reg);
51 struct chip_control southbridge_amd_amd8111_control = {
52 .name = "AMD 8111 Southbridge",
53 .enable_dev = amd8111_enable,