Skip to content

Commit

Permalink
lopper: assists: zephyr: Updates for mbv zephyr
Browse files Browse the repository at this point in the history
--> Add support for zephyr,shell-uart property generation.
--> Remove unused properties from cpu node.

Signed-off-by: Appana Durga Kedareswara rao <[email protected]>
  • Loading branch information
Appana Durga Kedareswara rao authored and zeddii committed Mar 5, 2025
1 parent f6f9b90 commit 4403fb5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions lopper/assists/gen_domain_dts.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,13 @@ def xlnx_generate_domain_dts(tgt_node, sdt, options):

if zephyr_dt:
xlnx_generate_zephyr_domain_dts(tgt_node, sdt, options)
zephyr_supported_schema_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "zephyr_supported_comp.yaml")
if utils.is_file(zephyr_supported_schema_file):
match_cpunode = get_cpu_node(sdt, options)
schema = utils.load_yaml(zephyr_supported_schema_file)
proplist = schema["amd,mbv32"]["required"]
delete_unused_props( match_cpunode, proplist, False)
match_cpunode.parent.name = "cpus"
return True

def xlnx_generate_zephyr_domain_dts(tgt_node, sdt, options):
Expand Down Expand Up @@ -489,7 +496,6 @@ def xlnx_generate_zephyr_domain_dts(tgt_node, sdt, options):

match_cpunode = get_cpu_node(sdt, options)
match_cpunode.parent.delete("address-map")
match_cpunode.parent.name = match_cpunode.parent.name.split('@')[0]
for node in root_sub_nodes:

soc_kconfig_file = os.path.join(sdt.outdir, "Kconfig")
Expand All @@ -503,6 +509,7 @@ def xlnx_generate_zephyr_domain_dts(tgt_node, sdt, options):
dev_node = var.split(':')[0]

sdt.tree[node]['zephyr,console'] = dev_node
sdt.tree[node]['zephyr,shell-uart'] = dev_node

if node.name == "amba_pl":
sdt.tree.delete(node)
Expand Down Expand Up @@ -599,7 +606,7 @@ def xlnx_generate_zephyr_domain_dts(tgt_node, sdt, options):

val = node.propval('clock-frequency', list)[0]
defconfig_kconfig.write("\nconfig SYS_CLOCK_HW_CYCLES_PER_SEC\n")
defconfig_kconfig.write(" default %s\n" % str(val))
defconfig_kconfig.write(" default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)")

defconfig_kconfig.close()

Expand Down
2 changes: 0 additions & 2 deletions lopper/assists/zephyr_supported_comp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ amd,mbv32:
- reg
- device_type
- riscv,isa
- i-cache-size
- d-cache-size
- clock-frequency

xlnx,xps-intc-1.00.a:
Expand Down
2 changes: 1 addition & 1 deletion lopper/lops/lop-mbv-zephyr-intc.dts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
lop_3 {
compatible = "system-device-tree-v1,lop,select-v1";
select_1;
select_2 = "/cpus_.*:compatible:cpus,cluster";
select_2 = "/cpus*:compatible:cpus,cluster";
lop_3_1 {
compatible = "system-device-tree-v1,lop,modify";
modify = ":compatible:";
Expand Down

0 comments on commit 4403fb5

Please sign in to comment.