Skip to content

lopper: assists: xlnx_overlay_pl_dt: Validate PL nodes by reg or compatible#773

Merged
zeddii merged 1 commit into
devicetree-org:masterfrom
arthokal:overlay_strip_amba_pl_no_pl
Jun 19, 2026
Merged

lopper: assists: xlnx_overlay_pl_dt: Validate PL nodes by reg or compatible#773
zeddii merged 1 commit into
devicetree-org:masterfrom
arthokal:overlay_strip_amba_pl_no_pl

Conversation

@arthokal

Copy link
Copy Markdown
Contributor

Root Cause:
xlnx_overlay_pl_dt's validate_amba_pl_node() only considered a /amba_pl
child to be a valid PL node if it had a reg property. On designs where
/amba_pl contains only non-address-mapped nodes — e.g. the zocl node
zyxclmm_drm, which has a compatible but no reg — validation failed. As a
result the assist aborted early: it generated no pl.dtsi and, crucially,
did not remove /amba_pl from the base device tree.

Because /amba_pl was left in the base SDT, downstream processing
(gen_domain_dts) carried its nodes into the generated Linux device tree.
The kernel then probed the device even though no PL is present, and the
probe failed at boot.

Fix:
Treat a /amba_pl child as a valid PL node if it has reg or compatible, so
non-address-mapped nodes like zocl are recognized. With validation
passing, the assist now:

  • emits a pl.dtsi overlay containing such nodes, and
  • removes /amba_pl from the base tree as in the normal flow (so the node
    no longer leaks into the Linux DT).

The scan uses children_only=True so the /amba_pl bus node's own compatible
= "simple-bus" is not mistakenly counted (otherwise every /amba_pl,
including an empty one, would pass).

…atible

validate_amba_pl_node() previously required at least one child of /amba_pl
to have a 'reg' property before an overlay was generated. Designs whose
/amba_pl contains only non-address-mapped nodes, for example the zocl
node 'zyxclmm_drm', which has a 'compatible' but no 'reg', failed this
check: the assist aborted early, emitted no pl.dtsi, and left /amba_pl in
the base device tree, so its nodes were carried into the Linux device tree
and the device failed to probe at boot.

Treat a node as a valid PL node if it has a 'reg' or a 'compatible'
property, so such nodes are carried into the overlay (pl.dtsi) and
/amba_pl is removed from the base tree exactly as in the normal flow.
Iterate with children_only=True so the /amba_pl bus node's own
"simple-bus" compatible is not counted.

Signed-off-by: Aravind Thokala <aravind.thokala@amd.com>
@arthokal

Copy link
Copy Markdown
Contributor Author

@onkarharsh , please review.

@onkarharsh

Copy link
Copy Markdown
Contributor

Looks good to me.

@zeddii zeddii merged commit 0d9d6c2 into devicetree-org:master Jun 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants