Date: Wed, 13 Jan 2010 19:55:51 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r202221 - in stable/8/sys/sparc64: pci sparc64 Message-ID: <201001131955.o0DJtpF5007130@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Wed Jan 13 19:55:51 2010 New Revision: 202221 URL: http://svn.freebsd.org/changeset/base/202221 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/8/sys/sparc64/pci/ofw_pci.h stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/schizo.c stable/8/sys/sparc64/sparc64/jbusppm.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:55:51 2010 (r202221) @@ -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/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/pci/psycho.c Wed Jan 13 19:55:51 2010 (r202221) @@ -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: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/pci/schizo.c Wed Jan 13 19:55:51 2010 (r202221) @@ -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: stable/8/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- stable/8/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:55:51 2010 (r202221) @@ -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 &&
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001131955.o0DJtpF5007130>