svn commit: r279345 - in head/sys: boot/fdt/dts/mips mips/nlm
Jayachandran C.
jchandra at FreeBSD.org
Fri Feb 27 02:21:54 UTC 2015
Author: jchandra
Date: Fri Feb 27 02:21:52 2015
New Revision: 279345
URL: https://svnweb.freebsd.org/changeset/base/279345
Log:
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.
Modified:
head/sys/boot/fdt/dts/mips/xlp-basic.dts
head/sys/mips/nlm/xlp_pci.c
Modified: head/sys/boot/fdt/dts/mips/xlp-basic.dts
==============================================================================
--- head/sys/boot/fdt/dts/mips/xlp-basic.dts Fri Feb 27 01:59:29 2015 (r279344)
+++ head/sys/boot/fdt/dts/mips/xlp-basic.dts Fri Feb 27 02:21:52 2015 (r279345)
@@ -65,6 +65,10 @@
interrupts = <17>;
};
+ pci0: pci at 18000000 {
+ compatible = "netlogic,xlp-pci", "pci";
+ reg = <0xd0000000 0x10000000>;
+ };
};
chosen {
Modified: head/sys/mips/nlm/xlp_pci.c
==============================================================================
--- head/sys/mips/nlm/xlp_pci.c Fri Feb 27 01:59:29 2015 (r279344)
+++ head/sys/mips/nlm/xlp_pci.c Fri Feb 27 02:21:52 2015 (r279345)
@@ -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_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,
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);
More information about the svn-src-all
mailing list