svn commit: r202222 - in stable/7/sys/sparc64: pci sparc64

Marius Strobl marius at FreeBSD.org
Wed Jan 13 19:56:03 UTC 2010


Author: marius
Date: Wed Jan 13 19:56:02 2010
New Revision: 202222
URL: http://svn.freebsd.org/changeset/base/202222

Log:
  MFC: 197164
  
  Factor out the duplicated macro for the device type used in the
  OFW device tree for PCI bridges and add a new one for PCI Express.
  While at it, take advantage of the former for the rman(9) work-
  around in jbusppm(4).

Modified:
  stable/7/sys/sparc64/pci/ofw_pci.h
  stable/7/sys/sparc64/pci/psycho.c
  stable/7/sys/sparc64/pci/schizo.c
  stable/7/sys/sparc64/sparc64/jbusppm.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/pci/ofw_pci.h
==============================================================================
--- stable/7/sys/sparc64/pci/ofw_pci.h	Wed Jan 13 19:55:51 2010	(r202221)
+++ stable/7/sys/sparc64/pci/ofw_pci.h	Wed Jan 13 19:56:02 2010	(r202222)
@@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t;
 #define	OFW_PCI_CS_MEM32	0x02
 #define	OFW_PCI_CS_MEM64	0x03
 
+/* OFW device types */
+#define	OFW_TYPE_PCI		"pci"
+#define	OFW_TYPE_PCIE		"pciex"
+
 struct ofw_pci_ranges {
 	uint32_t	cspace;
 	uint32_t	child_hi;

Modified: stable/7/sys/sparc64/pci/psycho.c
==============================================================================
--- stable/7/sys/sparc64/pci/psycho.c	Wed Jan 13 19:55:51 2010	(r202221)
+++ stable/7/sys/sparc64/pci/psycho.c	Wed Jan 13 19:56:02 2010	(r202222)
@@ -225,8 +225,6 @@ struct psycho_dma_sync {
  * providing two PCI buses.
  */
 
-#define	OFW_PCI_TYPE		"pci"
-
 struct psycho_desc {
 	const char	*pd_string;
 	int		pd_mode;
@@ -276,7 +274,7 @@ psycho_probe(device_t dev)
 	const char *dtype;
 
 	dtype = ofw_bus_get_type(dev);
-	if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 &&
+	if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 &&
 	    psycho_get_desc(dev) != NULL) {
 		device_set_desc(dev, "U2P UPA-PCI bridge");
 		return (0);

Modified: stable/7/sys/sparc64/pci/schizo.c
==============================================================================
--- stable/7/sys/sparc64/pci/schizo.c	Wed Jan 13 19:55:51 2010	(r202221)
+++ stable/7/sys/sparc64/pci/schizo.c	Wed Jan 13 19:56:02 2010	(r202222)
@@ -210,8 +210,6 @@ struct schizo_dma_sync {
 #define	SCHIZO_ICON_WRITE_8(sc, offs, v) \
 	SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v))
 
-#define	OFW_PCI_TYPE		"pci"
-
 struct schizo_desc {
 	const char	*sd_string;
 	int		sd_mode;
@@ -245,7 +243,7 @@ schizo_probe(device_t dev)
 	const char *dtype;
 
 	dtype = ofw_bus_get_type(dev);
-	if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 &&
+	if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 &&
 	    schizo_get_desc(dev) != NULL) {
 		device_set_desc(dev, "Sun Host-PCI bridge");
 		return (0);

Modified: stable/7/sys/sparc64/sparc64/jbusppm.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/jbusppm.c	Wed Jan 13 19:55:51 2010	(r202221)
+++ stable/7/sys/sparc64/sparc64/jbusppm.c	Wed Jan 13 19:56:02 2010	(r202222)
@@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$");
 #include <machine/bus.h>
 #include <machine/resource.h>
 
+#if 1
+#include <sparc64/pci/ofw_pci.h>
+#endif
+
 #define	JBUSPPM_NREG	2
 
 #define	JBUSPPM_DEVID	0
@@ -150,7 +154,7 @@ jbusppm_attach(device_t dev)
 			for (j = 0; j < nchildren; j++) {
 				if (ofw_bus_get_type(children[j]) != NULL &&
 				    strcmp(ofw_bus_get_type(children[j]),
-				    "pci") == 0 &&
+				    OFW_TYPE_PCI) == 0 &&
 				    ofw_bus_get_compat(children[j]) != NULL &&
 				    strcmp(ofw_bus_get_compat(children[j]),
 				    "pci108e,a801") == 0 &&


More information about the svn-src-stable mailing list