svn commit: r295837 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries
Zbigniew Bodek
zbb at FreeBSD.org
Sat Feb 20 12:28:23 UTC 2016
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 <mma at semihalf.com>
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 <machine/bus.h>
#include <dev/ofw/openfirm.h>
-#include <dev/ofw/ofw_subr.h>
-#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/ofw_pci.h>
+#include <dev/ofw/ofw_subr.h>
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 <vm/vm.h>
#include <vm/pmap.h>
+#include <dev/ofw/ofw_pci.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#include <dev/ofw/ofw_pci.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcib_private.h>
+#include <powerpc/ofw/ofw_pci.h>
+
#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 <sys/rman.h>
#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_pci.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -50,7 +51,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#include <dev/ofw/ofw_pci.h>
+#include <powerpc/ofw/ofw_pci.h>
#include <vm/vm.h>
#include <vm/pmap.h>
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 <sys/proc.h>
#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_pci.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#include <dev/ofw/ofw_pci.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
+#include <powerpc/ofw/ofw_pci.h>
#include <powerpc/powermac/gracklevar.h>
#include <vm/vm.h>
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 <sys/kernel.h>
#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_pci.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#include <dev/ofw/ofw_pci.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
+#include <powerpc/ofw/ofw_pci.h>
#include <powerpc/powermac/uninorthvar.h>
#include <vm/vm.h>
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 <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/ofw_pci.h>
+#include <powerpc/ofw/ofw_pci.h>
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 <sys/kernel.h>
#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_pci.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#include <dev/ofw/ofw_pci.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/pmap.h>
+#include <powerpc/ofw/ofw_pci.h>
#include <powerpc/pseries/plpar_iommu.h>
#include "pcib_if.h"
More information about the svn-src-head
mailing list