From 07fca7ace2860b6521b1e1630e296361b2532156 Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sun, 18 Feb 2018 00:02:09 +0000 Subject: [PATCH] Fix fallout from the import of fresh dts source files from linux 4.15. It appears that node names no longer include leading zeroes in the @address qualifiers, so we have to search for the nodes involved in interrupt fixup using both flavors of name to be compatible with old and new .dtb files. (You know you're in a bad place when you're applying a workaround to code that exists only as a workaround for another problem.) --- sys/arm/freescale/imx/imx6_machdep.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/arm/freescale/imx/imx6_machdep.c b/sys/arm/freescale/imx/imx6_machdep.c index 77ad63c73d2f..57cd27b35ead 100644 --- a/sys/arm/freescale/imx/imx6_machdep.c +++ b/sys/arm/freescale/imx/imx6_machdep.c @@ -88,6 +88,12 @@ static platform_cpu_reset_t imx6_cpu_reset; * per-soc logic. We handle this at platform attach time rather than via the * fdt_fixup_table, because the latter requires matching on the FDT "model" * property, and this applies to all boards including those not yet invented. + * + * This just in: as of the import of dts files from linux 4.15 on 2018-02-10, + * they appear to have applied a new style rule to the dts which forbids leading + * zeroes in the @address qualifiers on node names. Since we have to find those + * nodes by string matching we now have to search for both flavors of each node + * name involved. */ static void fix_fdt_interrupt_data(void) @@ -107,8 +113,12 @@ fix_fdt_interrupt_data(void) /* GIC node may be child of soc node, or appear directly at root. */ gicnode = OF_finddevice("/soc/interrupt-controller@00a01000"); + if (gicnode == -1) + gicnode = OF_finddevice("/soc/interrupt-controller@a01000"); if (gicnode == -1) { gicnode = OF_finddevice("/interrupt-controller@00a01000"); + if (gicnode == -1) + gicnode = OF_finddevice("/interrupt-controller@a01000"); if (gicnode == -1) return; } @@ -121,6 +131,8 @@ fix_fdt_interrupt_data(void) gicipar = gicxref; gpcnode = OF_finddevice("/soc/aips-bus@02000000/gpc@020dc000"); + if (gpcnode == -1) + gpcnode = OF_finddevice("/soc/aips-bus@2000000/gpc@20dc000"); if (gpcnode == -1) return; result = OF_getencprop(gpcnode, "interrupt-parent", &gpcipar,