From owner-svn-src-head@freebsd.org Mon Jan 18 17:27:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 420F3A8623E; Mon, 18 Jan 2016 17:27:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 003421CAA; Mon, 18 Jan 2016 17:27:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IHRGQY037820; Mon, 18 Jan 2016 17:27:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IHRGTl037817; Mon, 18 Jan 2016 17:27:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201601181727.u0IHRGTl037817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 18 Jan 2016 17:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294281 - in head/sys/powerpc: ofw pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 17:27:18 -0000 Author: nwhitehorn Date: Mon Jan 18 17:27:16 2016 New Revision: 294281 URL: https://svnweb.freebsd.org/changeset/base/294281 Log: Move RTAS PCI-specific interpretation of the "reg" property of the PCI host device to the RTAS driver, where it belongs. Modified: head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/ofw/ofw_pci.h head/sys/powerpc/pseries/rtas_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Mon Jan 18 17:03:12 2016 (r294280) +++ head/sys/powerpc/ofw/ofw_pci.c Mon Jan 18 17:27:16 2016 (r294281) @@ -136,10 +136,6 @@ ofw_pci_init(device_t dev) sc = device_get_softc(dev); sc->sc_initialized = 1; - if (OF_getencprop(node, "reg", (pcell_t *)&sc->sc_pcir, - sizeof(sc->sc_pcir)) == -1) - return (ENXIO); - if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != 8) busrange[0] = 0; Modified: head/sys/powerpc/ofw/ofw_pci.h ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.h Mon Jan 18 17:03:12 2016 (r294280) +++ head/sys/powerpc/ofw/ofw_pci.h Mon Jan 18 17:27:16 2016 (r294281) @@ -56,8 +56,6 @@ struct ofw_pci_softc { int sc_quirks; - struct ofw_pci_register sc_pcir; - struct ofw_pci_range *sc_range; int sc_nrange; Modified: head/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- head/sys/powerpc/pseries/rtas_pci.c Mon Jan 18 17:03:12 2016 (r294280) +++ head/sys/powerpc/pseries/rtas_pci.c Mon Jan 18 17:27:16 2016 (r294281) @@ -91,6 +91,8 @@ static device_method_t rtaspci_methods[] struct rtaspci_softc { struct ofw_pci_softc pci_sc; + struct ofw_pci_register sc_pcir; + cell_t read_pci_config, write_pci_config; cell_t ex_read_pci_config, ex_write_pci_config; int sc_extended_config; @@ -127,6 +129,10 @@ rtaspci_attach(device_t dev) sc = device_get_softc(dev); + if (OF_getencprop(ofw_bus_get_node(dev), "reg", (pcell_t *)&sc->sc_pcir, + sizeof(sc->sc_pcir)) == -1) + return (ENXIO); + sc->read_pci_config = rtas_token_lookup("read-pci-config"); sc->write_pci_config = rtas_token_lookup("write-pci-config"); sc->ex_read_pci_config = rtas_token_lookup("ibm,read-pci-config"); @@ -157,8 +163,8 @@ rtaspci_read_config(device_t dev, u_int if (sc->ex_read_pci_config != -1) error = rtas_call_method(sc->ex_read_pci_config, 4, 2, - config_addr, sc->pci_sc.sc_pcir.phys_hi, - sc->pci_sc.sc_pcir.phys_mid, width, &pcierror, &retval); + config_addr, sc->sc_pcir.phys_hi, + sc->sc_pcir.phys_mid, width, &pcierror, &retval); else error = rtas_call_method(sc->read_pci_config, 2, 2, config_addr, width, &pcierror, &retval); @@ -196,7 +202,7 @@ rtaspci_write_config(device_t dev, u_int if (sc->ex_write_pci_config != -1) rtas_call_method(sc->ex_write_pci_config, 5, 1, config_addr, - sc->pci_sc.sc_pcir.phys_hi, sc->pci_sc.sc_pcir.phys_mid, + sc->sc_pcir.phys_hi, sc->sc_pcir.phys_mid, width, val, &pcierror); else rtas_call_method(sc->write_pci_config, 3, 1, config_addr,