Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jan 2016 19:28:36 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293057 - in head/sys: arm64/include dev/ofw sparc64/include
Message-ID:  <201601021928.u02JSa2a081443@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat Jan  2 19:28:35 2016
New Revision: 293057
URL: https://svnweb.freebsd.org/changeset/base/293057

Log:
  Make using the #address-cells property on the interrupt parent in device
  tree parsing opt-out rather than opt-in. All FDT-based systems as well as
  PowerPC systems with real Open Firmware use the CHRP-derived binding that
  includes it, which makes SPARC the odd man out here. Making it opt-out
  avoids astonishment on new platform bring up.

Modified:
  head/sys/arm64/include/ofw_machdep.h
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/sparc64/include/ofw_machdep.h

Modified: head/sys/arm64/include/ofw_machdep.h
==============================================================================
--- head/sys/arm64/include/ofw_machdep.h	Sat Jan  2 19:14:19 2016	(r293056)
+++ head/sys/arm64/include/ofw_machdep.h	Sat Jan  2 19:28:35 2016	(r293057)
@@ -41,7 +41,4 @@ struct mem_region {
 	vm_size_t	mr_size;
 };
 
-/* FDT follows ePAPR */
-#define	OFW_EPAPR
-
 #endif /* _MACHINE_OFW_MACHDEP_H_ */

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c	Sat Jan  2 19:14:19 2016	(r293056)
+++ head/sys/dev/ofw/ofw_bus_subr.c	Sat Jan  2 19:28:35 2016	(r293057)
@@ -361,10 +361,11 @@ ofw_bus_search_intrmap(void *intr, int i
 	paddrsz = 0;
 	while (i > 0) {
 		bcopy(mptr + physsz + intrsz, &parent, sizeof(parent));
-#ifdef OFW_EPAPR
+#ifndef OFW_IMAP_NO_IPARENT_ADDR_CELLS
 		/*
-		 * Find if we need to read the parent address data. Sparc64
-		 * uses a different encoding that doesn't include this data.
+		 * Find if we need to read the parent address data.
+		 * CHRP-derived OF bindings, including ePAPR-compliant FDTs,
+		 * use this as an optional part of the specifier.
 		 */
 		if (OF_getencprop(OF_node_from_xref(parent),
 		    "#address-cells", &paddrsz, sizeof(paddrsz)) == -1)

Modified: head/sys/sparc64/include/ofw_machdep.h
==============================================================================
--- head/sys/sparc64/include/ofw_machdep.h	Sat Jan  2 19:14:19 2016	(r293056)
+++ head/sys/sparc64/include/ofw_machdep.h	Sat Jan  2 19:28:35 2016	(r293057)
@@ -34,6 +34,9 @@
 
 typedef uint64_t cell_t;
 
+/* sparc64 doesn't use the interrupt parent #address-cells in interrupt maps */
+#define OFW_IMAP_NO_IPARENT_ADDR_CELLS
+
 int  OF_decode_addr(phandle_t, int, int *, bus_addr_t *);
 void OF_getetheraddr(device_t, u_char *);
 u_int OF_getscsinitid(device_t);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601021928.u02JSa2a081443>