Skip to content

Commit 008897f

Browse files
arthokalzeddii
authored andcommitted
lopper: assists: xlnx_overlay_pl_dt: exclude address-map property from overlay
address-map is an SDT-specific property that is not consumed by the Linux kernel at runtime. Automatically exclude it from the generated pl.dtsi and clean up any empty overlay fragments left behind. Signed-off-by: Aravind Thokala <aravind.thokala@amd.com>
1 parent 9fc81f9 commit 008897f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lopper/assists/xlnx_overlay_pl_dt.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ def write_output_files(overlay_tree, sdt, pl_file, dtso_file):
734734
# Replace interrupt-parent references from imux to gic
735735
content = content.replace('interrupt-parent = <&imux>;', 'interrupt-parent = <&gic>;')
736736

737+
# Remove empty overlay fragments left after property exclusion
738+
content = re.sub(r'\n&\w+ \{\n\};\n', '', content)
739+
737740
with open(pl_file, "w") as f:
738741
f.write(content)
739742

@@ -767,6 +770,12 @@ def xlnx_generate_overlay_dt(tgt_node, sdt, options):
767770
# Parse and validate options
768771
platform, config, zynq_platforms, versal_platforms, firmware_override, node_specs, exclude_props, exclude_nodes = validate_and_parse_options(options, sdt)
769772

773+
# Remove SDT-specific properties from overlay automatically
774+
if exclude_props is None:
775+
exclude_props = ['address-map']
776+
elif 'address-map' not in exclude_props:
777+
exclude_props.append('address-map')
778+
770779
overlay_tree = LopperTree()
771780

772781
print("Starting overlay generation...")

0 commit comments

Comments
 (0)