From 1511c8f200e59150fe56dfd3009da0dec6086de7 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Tue, 5 Mar 2024 16:10:42 +0100 Subject: [PATCH] tools/litex_json2dts_linux: don't hardcode phandle for clint's interrupts-extended --- litex/tools/litex_json2dts_linux.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/litex/tools/litex_json2dts_linux.py b/litex/tools/litex_json2dts_linux.py index b277c7fbd..588a098fd 100755 --- a/litex/tools/litex_json2dts_linux.py +++ b/litex/tools/litex_json2dts_linux.py @@ -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} {{