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.)
This commit is contained in:
Ian Lepore 2018-02-18 00:02:09 +00:00
parent 02b84ad865
commit 07fca7ace2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329483

View File

@ -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,