tools/litex_json2dts_linux: don't hardcode phandle for clint's interrupts-extended

This commit is contained in:
Gwenhael Goavec-Merou 2024-03-05 16:10:42 +01:00
parent 044760e06c
commit 1511c8f200
1 changed files with 5 additions and 2 deletions

View File

@ -296,11 +296,14 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
dts += """
lintc0: clint@{clint_base:x} {{
compatible = "riscv,clint0";
interrupts-extended = <&L4 3 &L4 7>;
interrupts-extended = <
{cpu_mapping}>;
reg = <0x{clint_base:x} 0x10000>;
reg-names = "control";
}};
""".format(clint_base=d["memories"]["clint"]["base"])
""".format(
clint_base=d["memories"]["clint"]["base"],
cpu_mapping =("\n" + " "*20).join(["&L{} 3 &L{} 7".format(cpu, cpu) for cpu in range(ncpus)]))
if cpu_arch == "riscv":
dts += """
intc0: interrupt-controller@{plic_base:x} {{