1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
7 void i82801dbm_enable(device_t dev)
9 unsigned int index = 0;
10 uint8_t bHasDisableBit = 0;
11 uint16_t cur_disable_mask, new_disable_mask;
13 // all 82801dbm devices are in bus 0
14 unsigned int devfn = PCI_DEVFN(0x1f, 0); // lpc
15 device_t lpc_dev = dev_find_slot(0, devfn); // 0
19 // Calculate disable bit position for specified device:function
20 // NOTE: For ICH-4, only the following devices can be disabled:
21 // D31: F0, F1, F3, F5, F6,
22 // D29: F0, F1, F2, F7
24 if (PCI_SLOT(dev->path.pci.devfn) == 31) {
25 index = PCI_FUNC(dev->path.pci.devfn);
41 index = 14; // D31:F0 bit is an exception
43 } else if (PCI_SLOT(dev->path.pci.devfn) == 29) {
44 index = 8 + PCI_FUNC(dev->path.pci.devfn);
46 if ((PCI_FUNC(dev->path.pci.devfn) < 3) || (PCI_FUNC(dev->path.pci.devfn) == 7))
51 cur_disable_mask = pci_read_config16(lpc_dev, FUNC_DIS);
52 new_disable_mask = cur_disable_mask & ~(1<<index); // enable it
54 new_disable_mask |= (1<<index); // disable it
56 if (new_disable_mask != cur_disable_mask) {
57 pci_write_config16(lpc_dev, FUNC_DIS, new_disable_mask);
62 struct chip_operations southbridge_intel_i82801dbm_ops = {
63 CHIP_NAME("Intel 82801DBM Southbridge")
64 .enable_dev = i82801dbm_enable,