From 9156d7902e223364bb05c84587702f63c74fb03a Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Thu, 21 Mar 2024 20:54:08 +0100 Subject: [PATCH] tools/litex_json2dts_linux: increment interrupts value by one for rocket --- litex/tools/litex_json2dts_linux.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litex/tools/litex_json2dts_linux.py b/litex/tools/litex_json2dts_linux.py index 5fca60b81..4620b5ac2 100755 --- a/litex/tools/litex_json2dts_linux.py +++ b/litex/tools/litex_json2dts_linux.py @@ -386,6 +386,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic if "uart" in d["csr_bases"]: aliases["serial0"] = "liteuart0" + it_incr = {True: 1, False: 0}["rocket" in cpu_name] dts += """ liteuart0: serial@{uart_csr_base:x} {{ compatible = "litex,liteuart"; @@ -395,11 +396,12 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic }}; """.format( uart_csr_base = d["csr_bases"]["uart"], - uart_interrupt = "" if polling else "interrupts = <{}>;".format(d["constants"]["uart_interrupt"])) + uart_interrupt = "" if polling else "interrupts = <{}>;".format(int(d["constants"]["uart_interrupt"]) + it_incr)) # Ethernet ------------------------------------------------------------------------------------- if "ethphy" in d["csr_bases"] and "ethmac" in d["csr_bases"]: + it_incr = {True: 1, False: 0}["rocket" in cpu_name] dts += """ mac0: mac@{ethmac_csr_base:x} {{ compatible = "litex,liteeth"; @@ -421,7 +423,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic ethmac_rx_slots = d["constants"]["ethmac_rx_slots"], ethmac_tx_slots = d["constants"]["ethmac_tx_slots"], ethmac_slot_size = d["constants"]["ethmac_slot_size"], - ethmac_interrupt = "" if polling else "interrupts = <{}>;".format(d["constants"]["ethmac_interrupt"])) + ethmac_interrupt = "" if polling else "interrupts = <{}>;".format(int(d["constants"]["ethmac_interrupt"]) + it_incr)) # USB OHCI -------------------------------------------------------------------------------------