From owner-svn-src-all@freebsd.org Sat Feb 20 12:28:23 2016 Return-Path: Delivered-To: svn-src-all@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 4C31DAAD9A1; Sat, 20 Feb 2016 12:28:23 +0000 (UTC) (envelope-from zbb@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 09ED51DE9; Sat, 20 Feb 2016 12:28:22 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KCSLpq005526; Sat, 20 Feb 2016 12:28:21 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KCSL46005517; Sat, 20 Feb 2016 12:28:21 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602201228.u1KCSL46005517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sat, 20 Feb 2016 12:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295837 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries 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.20 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: Sat, 20 Feb 2016 12:28:23 -0000 Author: zbb Date: Sat Feb 20 12:28:20 2016 New Revision: 295837 URL: https://svnweb.freebsd.org/changeset/base/295837 Log: Revert r295756: Extract common code from PowerPC's ofw_pci Import portions of the PowerPC OF PCI implementation into new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofw_pci.h. This creates a new ofw_pci_write_ivar() function and modifies ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures. Submitted by: Marcin Mazurek Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879 This needs to return to the drawing board as it breaks both PowerPC and Sparc64 build. Pointed out by: jhibbits Deleted: head/sys/dev/ofw/ofw_pci.c Modified: head/sys/conf/files head/sys/dev/ofw/ofw_pci.h head/sys/dev/ofw/ofw_subr.c head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h head/sys/powerpc/pseries/rtas_pci.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/conf/files Sat Feb 20 12:28:20 2016 (r295837) @@ -2108,7 +2108,6 @@ dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt -dev/ofw/ofw_pci.c optional fdt pci dev/ow/ow.c optional ow \ dependency "owll_if.h" \ dependency "own_if.h" Modified: head/sys/dev/ofw/ofw_pci.h ============================================================================== --- head/sys/dev/ofw/ofw_pci.h Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/dev/ofw/ofw_pci.h Sat Feb 20 12:28:20 2016 (r295837) @@ -82,19 +82,14 @@ #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 -#define OFW_PCI_PHYS_HI_BUS(hi) \ +#define OFW_PCI_PHYS_HI_BUS(hi) \ (((hi) & OFW_PCI_PHYS_HI_BUSMASK) >> OFW_PCI_PHYS_HI_BUSSHIFT) -#define OFW_PCI_PHYS_HI_DEVICE(hi) \ +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT) -#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) /* - * Export class definition for inheritance purposes - */ -DECLARE_CLASS(ofw_pci_driver); - -/* * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size. */ struct ofw_pci_register { @@ -105,50 +100,4 @@ struct ofw_pci_register { u_int32_t size_lo; }; -struct ofw_pci_cell_info { - pcell_t host_address_cells; - pcell_t pci_address_cell; - pcell_t size_cells; - }; - -struct ofw_pci_range { - uint32_t pci_hi; - uint64_t pci; - uint64_t host; - uint64_t size; -}; - -/* - * Quirks for some adapters - */ -enum { - OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, -}; - -struct ofw_pci_softc { - device_t sc_dev; - phandle_t sc_node; - int sc_bus; - int sc_initialized; - int sc_quirks; - - struct ofw_pci_range *sc_range; - int sc_nrange; - struct ofw_pci_cell_info *sc_cell_info; - - struct rman sc_io_rman; - struct rman sc_mem_rman; - bus_space_tag_t sc_memt; - bus_dma_tag_t sc_dmat; - - struct ofw_bus_iinfo sc_pci_iinfo; -}; - -int ofw_pci_init(device_t); -int ofw_pci_attach(device_t); -int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); -int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); -int ofw_pci_route_interrupt(device_t, device_t, int); -int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); - #endif /* _DEV_OFW_OFW_PCI_H_ */ Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/dev/ofw/ofw_subr.c Sat Feb 20 12:28:20 2016 (r295837) @@ -39,9 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include static void get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip) Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat Feb 20 12:28:20 2016 (r295837) @@ -55,13 +55,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include #include +#include + #include "ofw_bus_if.h" #include "pcib_if.h" Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/cpcht.c Sat Feb 20 12:28:20 2016 (r295837) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -50,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/grackle.c Sat Feb 20 12:28:20 2016 (r295837) @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/uninorthpci.c Sat Feb 20 12:28:20 2016 (r295837) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/uninorthvar.h Sat Feb 20 12:28:20 2016 (r295837) @@ -30,6 +30,7 @@ #include #include +#include struct uninorth_softc { struct ofw_pci_softc pci_sc; Modified: head/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- head/sys/powerpc/pseries/rtas_pci.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/pseries/rtas_pci.c Sat Feb 20 12:28:20 2016 (r295837) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "pcib_if.h"