Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jun 2018 18:55:02 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335226 - head/sys/dev/ofw
Message-ID:  <201806151855.w5FIt2Qo090777@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Fri Jun 15 18:55:02 2018
New Revision: 335226
URL: https://svnweb.freebsd.org/changeset/base/335226

Log:
  Check for a 'pci' prefix rather than a full match in get_addr_props
  
  Summary:
  Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for
  device_type, not 'pci'.  Rather than enumerating all possible variants, just
  check for a 'pci' prefix.
  
  Reviewed by:	nwhitehorn, breno.leitao_gmail.com
  Differential Revision: https://reviews.freebsd.org/D15817

Modified:
  head/sys/dev/ofw/ofw_subr.c

Modified: head/sys/dev/ofw/ofw_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_subr.c	Fri Jun 15 18:50:24 2018	(r335225)
+++ head/sys/dev/ofw/ofw_subr.c	Fri Jun 15 18:55:02 2018	(r335226)
@@ -61,7 +61,9 @@ get_addr_props(phandle_t node, uint32_t *addrp, uint32
 		res = OF_getprop(node, "device_type", type, sizeof(type));
 		if (res != -1) {
 			type[sizeof(type) - 1] = '\0';
-			pci = (strcmp(type, "pci") == 0) ? 1 : 0;
+			if (strcmp(type, "pci") == 0 ||
+			    strcmp(type, "pciex")== 0)
+				pci = 1;
 		}
 	}
 	if (addrp != NULL)



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