Lines Matching +full:bus +full:- +full:num

1 // SPDX-License-Identifier: GPL-2.0
22 #include <asm/pci-direct.h>
32 static void __init fix_hypertransport_config(int num, int slot, int func) in fix_hypertransport_config() argument
36 * we found a hypertransport bus in fix_hypertransport_config()
38 * interrupts to all cpus on the ht bus in fix_hypertransport_config()
41 htcfg = read_pci_config(num, slot, func, 0x68); in fix_hypertransport_config()
44 "on hypertransport bus\n"); in fix_hypertransport_config()
51 write_pci_config(num, slot, func, 0x68, htcfg); in fix_hypertransport_config()
58 static void __init via_bugs(int num, int slot, int func) in via_bugs() argument
81 static void __init nvidia_bugs(int num, int slot, int func) in nvidia_bugs() argument
86 * Only applies to Nvidia root ports (bus 0) and not to in nvidia_bugs()
89 if (num) in nvidia_bugs()
112 /* RED-PEN skip them on mptables too? */ in nvidia_bugs()
117 static u32 __init ati_ixp4x0_rev(int num, int slot, int func) in ati_ixp4x0_rev() argument
122 b = read_pci_config_byte(num, slot, func, 0xac); in ati_ixp4x0_rev()
124 write_pci_config_byte(num, slot, func, 0xac, b); in ati_ixp4x0_rev()
126 d = read_pci_config(num, slot, func, 0x70); in ati_ixp4x0_rev()
128 write_pci_config(num, slot, func, 0x70, d); in ati_ixp4x0_rev()
130 d = read_pci_config(num, slot, func, 0x8); in ati_ixp4x0_rev()
135 static void __init ati_bugs(int num, int slot, int func) in ati_bugs() argument
143 d = ati_ixp4x0_rev(num, slot, func); in ati_bugs()
161 static u32 __init ati_sbx00_rev(int num, int slot, int func) in ati_sbx00_rev() argument
165 d = read_pci_config(num, slot, func, 0x8); in ati_sbx00_rev()
171 static void __init ati_bugs_contd(int num, int slot, int func) in ati_bugs_contd() argument
175 rev = ati_sbx00_rev(num, slot, func); in ati_bugs_contd()
191 d = read_pci_config(num, slot, func, 0x64); in ati_bugs_contd()
203 static void __init ati_bugs(int num, int slot, int func) in ati_bugs() argument
207 static void __init ati_bugs_contd(int num, int slot, int func) in ati_bugs_contd() argument
212 static void __init intel_remapping_check(int num, int slot, int func) in intel_remapping_check() argument
217 device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); in intel_remapping_check()
218 revision = read_pci_config_byte(num, slot, func, PCI_REVISION_ID); in intel_remapping_check()
297 * register. We need to calculate it as TOM-TSEG_SIZE-stolen_size.
299 static resource_size_t __init i830_stolen_base(int num, int slot, int func, in i830_stolen_base() argument
302 return i830_mem_size() - i830_tseg_size() - stolen_size; in i830_stolen_base()
305 static resource_size_t __init i845_stolen_base(int num, int slot, int func, in i845_stolen_base() argument
308 return i830_mem_size() - i845_tseg_size() - stolen_size; in i845_stolen_base()
311 static resource_size_t __init i85x_stolen_base(int num, int slot, int func, in i85x_stolen_base() argument
314 return i85x_mem_size() - i85x_tseg_size() - stolen_size; in i85x_stolen_base()
317 static resource_size_t __init i865_stolen_base(int num, int slot, int func, in i865_stolen_base() argument
327 static resource_size_t __init gen3_stolen_base(int num, int slot, int func, in gen3_stolen_base() argument
337 bsm = read_pci_config(num, slot, func, INTEL_BSM); in gen3_stolen_base()
342 static resource_size_t __init gen11_stolen_base(int num, int slot, int func, in gen11_stolen_base() argument
347 bsm = read_pci_config(num, slot, func, INTEL_GEN11_BSM_DW0); in gen11_stolen_base()
349 bsm |= (u64)read_pci_config(num, slot, func, INTEL_GEN11_BSM_DW1) << 32; in gen11_stolen_base()
354 static resource_size_t __init i830_stolen_size(int num, int slot, int func) in i830_stolen_size() argument
375 static resource_size_t __init gen3_stolen_size(int num, int slot, int func) in gen3_stolen_size() argument
404 static resource_size_t __init gen6_stolen_size(int num, int slot, int func) in gen6_stolen_size() argument
409 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); in gen6_stolen_size()
415 static resource_size_t __init gen8_stolen_size(int num, int slot, int func) in gen8_stolen_size() argument
420 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); in gen8_stolen_size()
426 static resource_size_t __init chv_stolen_size(int num, int slot, int func) in chv_stolen_size() argument
431 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); in chv_stolen_size()
442 return (gms - 0x11) * MB(4) + MB(8); in chv_stolen_size()
444 return (gms - 0x17) * MB(4) + MB(36); in chv_stolen_size()
447 static resource_size_t __init gen9_stolen_size(int num, int slot, int func) in gen9_stolen_size() argument
452 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); in gen9_stolen_size()
460 return (gms - 0xf0) * MB(4) + MB(4); in gen9_stolen_size()
464 resource_size_t (*stolen_size)(int num, int slot, int func);
465 resource_size_t (*stolen_base)(int num, int slot, int func,
567 intel_graphics_stolen(int num, int slot, int func, in intel_graphics_stolen() argument
573 size = early_ops->stolen_size(num, slot, func); in intel_graphics_stolen()
574 base = early_ops->stolen_base(num, slot, func, size); in intel_graphics_stolen()
579 end = base + size - 1; in intel_graphics_stolen()
592 static void __init intel_graphics_quirks(int num, int slot, int func) in intel_graphics_quirks() argument
605 device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); in intel_graphics_quirks()
615 intel_graphics_stolen(num, slot, func, early_ops); in intel_graphics_quirks()
621 static void __init force_disable_hpet(int num, int slot, int func) in force_disable_hpet() argument
634 static void __init apple_airport_reset(int bus, int slot, int func) in apple_airport_reset() argument
645 pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL); in apple_airport_reset()
649 write_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL, pmcsr); in apple_airport_reset()
652 pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL); in apple_airport_reset()
655 bus, slot, func); in apple_airport_reset()
660 addr = read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_0); in apple_airport_reset()
661 addr |= (u64)read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_1) << 32; in apple_airport_reset()
667 bus, slot, func); in apple_airport_reset()
696 void (*f)(int num, int slot, int func);
720 * problems: it will halt in deep idle state - so we disable it.
724 …tp://www.intel.com/content/dam/www/public/us/en/documents/datasheets/atom-z8000-datasheet-vol-1.pdf
733 static void __init early_pci_scan_bus(int bus);
736 * check_dev_quirk - apply early quirks to a given PCI device
737 * @num: bus number
746 static int __init check_dev_quirk(int num, int slot, int func) in check_dev_quirk() argument
755 class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE); in check_dev_quirk()
758 return -1; /* no class, treat as single function */ in check_dev_quirk()
760 vendor = read_pci_config_16(num, slot, func, PCI_VENDOR_ID); in check_dev_quirk()
762 device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); in check_dev_quirk()
773 early_qrk[i].f(num, slot, func); in check_dev_quirk()
778 type = read_pci_config_byte(num, slot, func, in check_dev_quirk()
782 sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS); in check_dev_quirk()
783 if (sec > num) in check_dev_quirk()
788 return -1; in check_dev_quirk()
793 static void __init early_pci_scan_bus(int bus) in early_pci_scan_bus() argument
801 if (check_dev_quirk(bus, slot, func)) in early_pci_scan_bus()