diff --git a/sys/arm64/include/ofw_machdep.h b/sys/arm64/include/ofw_machdep.h index e9c65ef02801..511fc8d71c19 100644 --- a/sys/arm64/include/ofw_machdep.h +++ b/sys/arm64/include/ofw_machdep.h @@ -41,7 +41,4 @@ struct mem_region { vm_size_t mr_size; }; -/* FDT follows ePAPR */ -#define OFW_EPAPR - #endif /* _MACHINE_OFW_MACHDEP_H_ */ diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index c286373940d4..60a341c538ee 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -361,10 +361,11 @@ ofw_bus_search_intrmap(void *intr, int intrsz, void *regs, int physsz, 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) diff --git a/sys/sparc64/include/ofw_machdep.h b/sys/sparc64/include/ofw_machdep.h index bc69b3b3773c..fcacc10d446d 100644 --- a/sys/sparc64/include/ofw_machdep.h +++ b/sys/sparc64/include/ofw_machdep.h @@ -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);