Skip to content

of_property: resolve phandles against the booted device tree

Primoz Fiser barebox 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1commands: of_property: resolve phandles of fixups in the booted treecommands/of_property.c+51 -241 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] of_property: resolve phandles against the booted device tree

Hi,

I ran into this on a phyBOARD-Mira (i.MX6) secure boot setup. Two board expansions configure a UART pin group via a fixup along these lines:

  of_property -s -f -e $global.bootm.oftree /soc/.../serial@21ec000 \
      pinctrl-0 </soc/.../pinctrl@20e0000/uart3grp>

The node path is resolved to a phandle immediately, against the external dtb named by -e. With secure boot the kernel device tree is part of the FIT image, so that file never exists on disk: of_property fails, the fixup is never registered, and the UART keeps its default pin group, which conflicts with other pins on the board (user LEDs, in this case).

The patch defers phandle resolution to the point the fixup is applied, against the tree that is actually being booted, so -e is no longer needed for this and is now ignored (rather than required) when combined with -f. Existing scripts that still pass -e keep working.

With this applied, setups like the one above can drop the -e $global.bootm.oftree workaround entirely.

Primoz Fiser (1):
commands: of_property: resolve phandles of fixups in the booted tree

 commands/of_property.c | 75 ++++++++++++++++++++++++++++--------------
 1 file changed, 51 insertions(+), 24 deletions(-)
Signature · 1 line
2.34.1