svn commit: r197164 - in head/sys/sparc64: pci sparc64
Marius Strobl
marius at FreeBSD.org
Sun Sep 13 14:47:32 UTC 2009
Author: marius
Date: Sun Sep 13 14:47:31 2009
New Revision: 197164
URL: http://svn.freebsd.org/changeset/base/197164
Log:
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:
head/sys/sparc64/pci/ofw_pci.h
head/sys/sparc64/pci/psycho.c
head/sys/sparc64/pci/schizo.c
head/sys/sparc64/sparc64/jbusppm.c
Modified: head/sys/sparc64/pci/ofw_pci.h
==============================================================================
--- head/sys/sparc64/pci/ofw_pci.h Sun Sep 13 13:15:36 2009 (r197163)
+++ head/sys/sparc64/pci/ofw_pci.h Sun Sep 13 14:47:31 2009 (r197164)
@@ -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: head/sys/sparc64/pci/psycho.c
==============================================================================
--- head/sys/sparc64/pci/psycho.c Sun Sep 13 13:15:36 2009 (r197163)
+++ head/sys/sparc64/pci/psycho.c Sun Sep 13 14:47:31 2009 (r197164)
@@ -224,8 +224,6 @@ struct psycho_dma_sync {
* providing two PCI buses.
*/
-#define OFW_PCI_TYPE "pci"
-
struct psycho_desc {
const char *pd_string;
int pd_mode;
@@ -275,7 +273,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: head/sys/sparc64/pci/schizo.c
==============================================================================
--- head/sys/sparc64/pci/schizo.c Sun Sep 13 13:15:36 2009 (r197163)
+++ head/sys/sparc64/pci/schizo.c Sun Sep 13 14:47:31 2009 (r197164)
@@ -209,8 +209,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;
@@ -244,7 +242,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: head/sys/sparc64/sparc64/jbusppm.c
==============================================================================
--- head/sys/sparc64/sparc64/jbusppm.c Sun Sep 13 13:15:36 2009 (r197163)
+++ head/sys/sparc64/sparc64/jbusppm.c Sun Sep 13 14:47:31 2009 (r197164)
@@ -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-head
mailing list