Move PCI bus below simplebus for Broadcom XLP
This will enable us to do common allocation code for memory and interrupts for SoC devices as well as PCI devices.
This commit is contained in:
parent
7c498a0950
commit
020a664210
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279345
@ -65,6 +65,10 @@
|
||||
interrupts = <17>;
|
||||
};
|
||||
|
||||
pci0: pci@18000000 {
|
||||
compatible = "netlogic,xlp-pci", "pci";
|
||||
reg = <0xd0000000 0x10000000>;
|
||||
};
|
||||
};
|
||||
|
||||
chosen {
|
||||
|
@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include <dev/uart/uart_bus.h>
|
||||
#include <dev/uart/uart_cpu.h>
|
||||
|
||||
#include <dev/ofw/ofw_bus.h>
|
||||
#include <dev/ofw/ofw_bus_subr.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/intr_machdep.h>
|
||||
@ -281,7 +284,6 @@ DEFINE_CLASS_1(pci, xlp_pci_driver, xlp_pci_methods, sizeof(struct pci_softc),
|
||||
pci_driver);
|
||||
DRIVER_MODULE(xlp_pci, pcib, xlp_pci_driver, pci_devclass, 0, 0);
|
||||
|
||||
static devclass_t pcib_devclass;
|
||||
static struct rman irq_rman, port_rman, mem_rman, emul_rman;
|
||||
|
||||
static void
|
||||
@ -328,8 +330,11 @@ static int
|
||||
xlp_pcib_probe(device_t dev)
|
||||
{
|
||||
|
||||
device_set_desc(dev, "XLP PCI bus");
|
||||
return (BUS_PROBE_NOWILDCARD);
|
||||
if (ofw_bus_is_compatible(dev, "netlogic,xlp-pci")) {
|
||||
device_set_desc(dev, "XLP PCI bus");
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
}
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -481,13 +486,6 @@ xlp_pcib_attach(device_t dev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
xlp_pcib_identify(driver_t * driver, device_t parent)
|
||||
{
|
||||
|
||||
BUS_ADD_CHILD(parent, 0, "pcib", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* XLS PCIe can have upto 4 links, and each link has its on IRQ
|
||||
* Find the link on which the device is on
|
||||
@ -780,7 +778,6 @@ mips_pcib_route_interrupt(device_t bus, device_t dev, int pin)
|
||||
|
||||
static device_method_t xlp_pcib_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_identify, xlp_pcib_identify),
|
||||
DEVMETHOD(device_probe, xlp_pcib_probe),
|
||||
DEVMETHOD(device_attach, xlp_pcib_attach),
|
||||
|
||||
@ -813,4 +810,5 @@ static driver_t xlp_pcib_driver = {
|
||||
1, /* no softc */
|
||||
};
|
||||
|
||||
DRIVER_MODULE(pcib, nexus, xlp_pcib_driver, pcib_devclass, 0, 0);
|
||||
static devclass_t pcib_devclass;
|
||||
DRIVER_MODULE(xlp_pcib, simplebus, xlp_pcib_driver, pcib_devclass, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user