aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/pci
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2009-09-13 14:47:31 +0000
committerMarius Strobl <marius@FreeBSD.org>2009-09-13 14:47:31 +0000
commit7b8253c3ebec15d1c4a6b051bad2f6a9ea3debc7 (patch)
tree08243e40a1986975e281b9074cabf77b8322b66e /sys/sparc64/pci
parente89666a9ed4609cacf75ef6eea63dcf6b8368edf (diff)
downloadsrc-7b8253c3ebec15d1c4a6b051bad2f6a9ea3debc7.tar.gz
src-7b8253c3ebec15d1c4a6b051bad2f6a9ea3debc7.zip
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).
Notes
Notes: svn path=/head/; revision=197164
Diffstat (limited to 'sys/sparc64/pci')
-rw-r--r--sys/sparc64/pci/ofw_pci.h4
-rw-r--r--sys/sparc64/pci/psycho.c4
-rw-r--r--sys/sparc64/pci/schizo.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/sparc64/pci/ofw_pci.h b/sys/sparc64/pci/ofw_pci.h
index 19c2fbed5dbe..3b5059858c1a 100644
--- a/sys/sparc64/pci/ofw_pci.h
+++ b/sys/sparc64/pci/ofw_pci.h
@@ -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;
diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c
index c8caec2c4ef8..8034612fd4cf 100644
--- a/sys/sparc64/pci/psycho.c
+++ b/sys/sparc64/pci/psycho.c
@@ -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);
diff --git a/sys/sparc64/pci/schizo.c b/sys/sparc64/pci/schizo.c
index 70851718863c..4685a611315c 100644
--- a/sys/sparc64/pci/schizo.c
+++ b/sys/sparc64/pci/schizo.c
@@ -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);