From owner-svn-src-all@FreeBSD.ORG Fri Feb 27 02:21:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5386647D; Fri, 27 Feb 2015 02:21:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24152D79; Fri, 27 Feb 2015 02:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1R2LsBi070759; Fri, 27 Feb 2015 02:21:54 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1R2LrpH070757; Fri, 27 Feb 2015 02:21:53 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201502270221.t1R2LrpH070757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Fri, 27 Feb 2015 02:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279345 - in head/sys: boot/fdt/dts/mips mips/nlm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2015 02:21:54 -0000 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@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 #include +#include +#include + #include #include #include @@ -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);