2bdd1b031b
Previously, one would have to specifically choose CONFIG_OLPC and CONFIG_PCI_GOOLPC in order to enable PCI_OLPC. That doesn't really work for distro kernels, so this patch allows one to choose CONFIG_OLPC and CONFIG_PCI_GOANY in order to build in OLPC support in a generic kernel (as requested by Robert Millan). This also moves GOOLPC before GOANY in the menuconfig list. Finally, make pci_access_init return early if we detect OLPC hardware. There's no need to continue probing stuff, and pci_pcbios_init specifically trashes our settings (we didn't run into that before because PCI_GOANY wasn't supported). Signed-off-by: Andres Salomon <dilinger@debian.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
43 lines
972 B
C
43 lines
972 B
C
#include <linux/pci.h>
|
|
#include <linux/init.h>
|
|
#include "pci.h"
|
|
|
|
/* arch_initcall has too random ordering, so call the initializers
|
|
in the right sequence from here. */
|
|
static __init int pci_access_init(void)
|
|
{
|
|
#ifdef CONFIG_PCI_DIRECT
|
|
int type = 0;
|
|
|
|
type = pci_direct_probe();
|
|
#endif
|
|
|
|
pci_mmcfg_early_init();
|
|
|
|
#ifdef CONFIG_PCI_OLPC
|
|
if (!pci_olpc_init())
|
|
return 0; /* skip additional checks if it's an XO */
|
|
#endif
|
|
#ifdef CONFIG_PCI_BIOS
|
|
pci_pcbios_init();
|
|
#endif
|
|
/*
|
|
* don't check for raw_pci_ops here because we want pcbios as last
|
|
* fallback, yet it's needed to run first to set pcibios_last_bus
|
|
* in case legacy PCI probing is used. otherwise detecting peer busses
|
|
* fails.
|
|
*/
|
|
#ifdef CONFIG_PCI_DIRECT
|
|
pci_direct_init(type);
|
|
#endif
|
|
if (!raw_pci_ops && !raw_pci_ext_ops)
|
|
printk(KERN_ERR
|
|
"PCI: Fatal: No config space access function found\n");
|
|
|
|
dmi_check_pciprobe();
|
|
|
|
dmi_check_skip_isa_align();
|
|
|
|
return 0;
|
|
}
|
|
arch_initcall(pci_access_init);
|