early-quirks.c (4f2c0a4acffbec01079c28f839422e64ddeff004) early-quirks.c (197e0da1f1a3445b9b266f83d5d037b4709dae2e)
1// SPDX-License-Identifier: GPL-2.0
2/* Various workarounds for chipset bugs.
3 This code runs very early and can't use the regular PCI subsystem
4 The entries are keyed to PCI bridges which usually identify chipsets
5 uniquely.
6 This is only for whole classes of chipsets with specific problems which
7 need early invasive action (e.g. before the timers are initialized).
8 Most PCI device specific workarounds can be done later and should be

--- 765 unchanged lines hidden (view full) ---

774 early_qrk[i].f(num, slot, func);
775 early_qrk[i].flags |= QFLAG_APPLIED;
776 }
777 }
778
779 type = read_pci_config_byte(num, slot, func,
780 PCI_HEADER_TYPE);
781
1// SPDX-License-Identifier: GPL-2.0
2/* Various workarounds for chipset bugs.
3 This code runs very early and can't use the regular PCI subsystem
4 The entries are keyed to PCI bridges which usually identify chipsets
5 uniquely.
6 This is only for whole classes of chipsets with specific problems which
7 need early invasive action (e.g. before the timers are initialized).
8 Most PCI device specific workarounds can be done later and should be

--- 765 unchanged lines hidden (view full) ---

774 early_qrk[i].f(num, slot, func);
775 early_qrk[i].flags |= QFLAG_APPLIED;
776 }
777 }
778
779 type = read_pci_config_byte(num, slot, func,
780 PCI_HEADER_TYPE);
781
782 if ((type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) {
782 if ((type & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE) {
783 sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS);
784 if (sec > num)
785 early_pci_scan_bus(sec);
786 }
787
783 sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS);
784 if (sec > num)
785 early_pci_scan_bus(sec);
786 }
787
788 if (!(type & 0x80))
788 if (!(type & PCI_HEADER_TYPE_MFD))
789 return -1;
790
791 return 0;
792}
793
794static void __init early_pci_scan_bus(int bus)
795{
796 int slot, func;

--- 17 unchanged lines hidden ---
789 return -1;
790
791 return 0;
792}
793
794static void __init early_pci_scan_bus(int bus)
795{
796 int slot, func;

--- 17 unchanged lines hidden ---