lopper: assists: Split Zephyr DTS generation into zephyr_domain_dts assist#779
lopper: assists: Split Zephyr DTS generation into zephyr_domain_dts assist#779dbingi-amd wants to merge 2 commits into
Conversation
|
Hi @kedareswararao, |
|
@zeddii : Please don't merge this until i approve it may break existing use cases need to cross verify properly before approving |
| @@ -11,7 +11,6 @@ | |||
| import sys | |||
| import os | |||
| import glob | |||
There was a problem hiding this comment.
The removal of import argparse from gen_domain_dts.py is a direct consequence of this split. It was solely used by _extra_zephyr_comp_paths() (for --extra-zephyr-comp parsing), which has been moved to zephyr_domain_dts.py along with import argparse. No remaining code in gen_domain_dts.py uses argparse, so keeping it would be a dead import.
| 6. Keeps the status disabled nodes in the final device-tree. | ||
| 7. Delete the nodes that have an xlnx,ip-name property value mentioned in the linux_ignore_ip_list. | ||
|
|
||
| Zephyr device-tree generation uses assist zephyr_domain_dts (run after domain DTS). |
There was a problem hiding this comment.
no need to mention this here need to update the https://github.com/devicetree-org/lopper/tree/master/docs/amd/zephyr/source as per latest assist since it's taken care in the commit 2 no need to add this line here
There was a problem hiding this comment.
Agreed, the line has been removed from the xlnx_generate_domain_dts docstring
| # Add cpu0_intc (riscv,cpu-intc) as a child of the CPU node, | ||
| # and add the riscv,timer node at root wired to cpu0_intc at IRQ 5. | ||
| # Also wire axi_intc to cpu0_intc at IRQ 9 (IRQ_S_EXT). | ||
| if linux_dt and match_cpunode.propval('xlnx,ip-name', list)[0] == 'microblaze_riscv': |
There was a problem hiding this comment.
The explicit linux_dt and was removed because the block was moved inside the existing else: branch (line 529), which already implies linux_dt = 1. The old standalone if linux_dt and microblaze_riscv: and the new else: → if microblaze_riscv: produce identical behavior across all cases — no corner case is affected
There was a problem hiding this comment.
there should be one change per commit if you are doing cleanup means it should be in a separate commit
| if node.propval('xlnx,ip-name', list) == ['axi_intc']: | ||
| node + LopperProp("interrupts-extended = <&cpu0_intc 9>") | ||
| break | ||
| for node in sdt.tree['/'].subnodes(): |
There was a problem hiding this comment.
same here unrelated change
There was a problem hiding this comment.
This block is inside else: (line 529, = linux_dt) and if microblaze_riscv: — the effective guard is still linux_dt AND microblaze_riscv, same as before
| @@ -0,0 +1,1740 @@ | |||
| #/* | |||
| # * Copyright (C) 2023-2026 Advanced Micro Devices, Inc. All Rights Reserved. | |||
There was a problem hiding this comment.
2026 is sufficient since it's a new file
There was a problem hiding this comment.
Updated the copyright year
| Zephyr domain DT assist. Invoked after pruned domain DT is available. | ||
| Args: options['args'][0] = processor instance (same as gen_domain_dts); | ||
| options['args'][1] = optional Zephyr board overlay .dts path. | ||
| Optional flag --extra-zephyr-comp <path> may be repeated to merge |
There was a problem hiding this comment.
cross check this comment and fix properly
There was a problem hiding this comment.
Updated the doc string
513452a to
e1b60d6
Compare
Zephyr-specific device-tree logic is currently handled inside gen_domain_dts alongside Linux and baremetal domain pruning. Move Zephyr handling into a dedicated assist to improve modularity, readability, and maintainability. - Moved Zephyr device-tree generation from gen_domain_dts into zephyr_domain_dts.py. - Removed zephyr_dt handling from gen_domain_dts while keeping linux_dt, baremetal, and zynqmp_fsbl behaviour unchanged. - Added zephyr_domain_dts assist to accept SDT input, invoke gen_domain_dts in-process and apply Zephyr transforms. - Registered zephyr_domain_dts in lop-load.dts. Signed-off-by: Bingi Dinesh kumar <dineshkumar.bingi@amd.com>
Zephyr device-tree generation now uses the zephyr_domain_dts assist instead of gen_domain_dts with a zephyr_dt option. Update documentation so users follow the new entry point and Lopper command flow. - Updated developer-guide.md to describe zephyr_domain_dts as the Zephyr assist. - Updated Cortex-A78 and Cortex-R52 platform guides with the new Lopper usage. - Updated MicroBlaze RISC-V platform guide with the new Lopper usage. - Updated Linux device-tree generation chapter to note gen_domain_dts remains for Linux domain trees. Signed-off-by: Bingi Dinesh kumar <dineshkumar.bingi@amd.com>
e1b60d6 to
e566888
Compare
|
Hi @kedareswararao, Please review the updated change |
| mapped_children_nodes.append(node) | ||
| continue | ||
| elif xlnx_openamp_keep_node(linux_dt, zephyr_dt, node, sdt.tree): | ||
| elif xlnx_openamp_keep_node(linux_dt, False, node, sdt.tree): |
There was a problem hiding this comment.
@bentheredonethat : will this change effect open amp assists?
@dbingi-amd : Please check with Ben and test the open amp dts generation use case as well so that nothing will broke due to this change
There was a problem hiding this comment.
@dbingi-amd @kedareswararao NAK - keep zephyr_dt flag there.
| intc_node['#interrupt-cells'] = 1 | ||
| intc_node + LopperProp("interrupt-controller") | ||
| match_cpunode.add(intc_node) | ||
| match_cpunode.add(intc_node) |
| timer_node.name = "timer" | ||
| timer_node.label = "int_timer" | ||
| timer_node ["compatible"] = "riscv,timer" | ||
| timer_node["compatible"] = "riscv,timer" |
There was a problem hiding this comment.
same here unrelated change
• Split Zephyr device-tree generation out of gen_domain_dts into a new zephyr_domain_dts assist.
• gen_domain_dts now handles domain pruning and Linux/baremetal output only; Zephyr logic was removed from it.
• Added zephyr_domain_dts.py for Zephyr-specific transforms, board overlay handling, and related cleanup.
• Registered the new assist in lop-load.dts so Lopper loads it automatically.
• Replaced the old gen_domain_dts {proc} zephyr_dt [board.dts] flow with a separate zephyr_domain_dts {proc} [board.dts] step after domain (and imux) generation.
• Moved optional board overlay input to the second argument of zephyr_domain_dts (previously the third argument on gen_domain_dts).
• Preserved --extra-zephyr-comp support in the Zephyr assist (not in gen_domain_dts).
• Updated Zephyr platform docs, Linux domain-tree docs, and the developer guide to describe the new assist and command examples.
• No intended functional change to generated Zephyr DTS — this is primarily a refactor to separate concerns and simplify maintenance.