Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <linux/pci.h>
0003 #include <linux/init.h>
0004 #include <asm/pci_x86.h>
0005 #include <asm/x86_init.h>
0006 #include <asm/irqdomain.h>
0007 
0008 /* arch_initcall has too random ordering, so call the initializers
0009    in the right sequence from here. */
0010 static __init int pci_arch_init(void)
0011 {
0012     int type, pcbios = 1;
0013 
0014     type = pci_direct_probe();
0015 
0016     if (!(pci_probe & PCI_PROBE_NOEARLY))
0017         pci_mmcfg_early_init();
0018 
0019     if (x86_init.pci.arch_init)
0020         pcbios = x86_init.pci.arch_init();
0021 
0022     /*
0023      * Must happen after x86_init.pci.arch_init(). Xen sets up the
0024      * x86_init.irqs.create_pci_msi_domain there.
0025      */
0026     x86_create_pci_msi_domain();
0027 
0028     if (!pcbios)
0029         return 0;
0030 
0031     pci_pcbios_init();
0032 
0033     /*
0034      * don't check for raw_pci_ops here because we want pcbios as last
0035      * fallback, yet it's needed to run first to set pcibios_last_bus
0036      * in case legacy PCI probing is used. otherwise detecting peer busses
0037      * fails.
0038      */
0039     pci_direct_init(type);
0040 
0041     if (!raw_pci_ops && !raw_pci_ext_ops)
0042         printk(KERN_ERR
0043         "PCI: Fatal: No config space access function found\n");
0044 
0045     dmi_check_pciprobe();
0046 
0047     dmi_check_skip_isa_align();
0048 
0049     return 0;
0050 }
0051 arch_initcall(pci_arch_init);