init.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/pci.h>
  3. #include <linux/init.h>
  4. #include <asm/pci_x86.h>
  5. #include <asm/x86_init.h>
  6. /* arch_initcall has too random ordering, so call the initializers
  7. in the right sequence from here. */
  8. static __init int pci_arch_init(void)
  9. {
  10. #ifdef CONFIG_PCI_DIRECT
  11. int type = 0;
  12. type = pci_direct_probe();
  13. #endif
  14. if (!(pci_probe & PCI_PROBE_NOEARLY))
  15. pci_mmcfg_early_init();
  16. if (x86_init.pci.arch_init && !x86_init.pci.arch_init())
  17. return 0;
  18. #ifdef CONFIG_PCI_BIOS
  19. pci_pcbios_init();
  20. #endif
  21. /*
  22. * don't check for raw_pci_ops here because we want pcbios as last
  23. * fallback, yet it's needed to run first to set pcibios_last_bus
  24. * in case legacy PCI probing is used. otherwise detecting peer busses
  25. * fails.
  26. */
  27. #ifdef CONFIG_PCI_DIRECT
  28. pci_direct_init(type);
  29. #endif
  30. if (!raw_pci_ops && !raw_pci_ext_ops)
  31. printk(KERN_ERR
  32. "PCI: Fatal: No config space access function found\n");
  33. dmi_check_pciprobe();
  34. dmi_check_skip_isa_align();
  35. return 0;
  36. }
  37. arch_initcall(pci_arch_init);