From 0b329c3dcef89043d6e4cb47d54973b19039bcbe Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 1 Jun 2021 10:41:35 +0200 Subject: [PATCH] tools/litex_json2dts: Add initial USB OHCI support. --- litex/tools/litex_json2dts.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/litex/tools/litex_json2dts.py b/litex/tools/litex_json2dts.py index e5e9d0b40..32b4a2064 100755 --- a/litex/tools/litex_json2dts.py +++ b/litex/tools/litex_json2dts.py @@ -229,7 +229,21 @@ def generate_dts(d, initrd_start=None, initrd_size=None, polling=False): ethmac_rx_slots = d["constants"]["ethmac_rx_slots"], ethmac_interrupt = "" if polling else "interrupts = <{}>;".format(d["constants"]["ethmac_interrupt"])) - # SPI Flash ------------------------------------------------------------------------------------- + # USB OHCI ------------------------------------------------------------------------------------- + + if "usb_ohci_ctrl" in d["memories"]: + dts += """ + usb0: mac@{usb_ohci_mem_base:x} {{ + compatible = "generic-ohci"; + reg = <0x{usb_ohci_mem_base:x} 0x1000>; + {usb_ohci_interrupt} + status = "okay"; + }}; +""".format( + usb_ohci_mem_base = d["memories"]["usb_ohci_ctrl"]["base"], + usb_ohci_interrupt = "" if polling else "interrupts = <{}>;".format(16)) # FIXME + + # SPI Flash ------------------------------------------------------------------------------------ if "spiflash" in d["csr_bases"]: aliases["spiflash"] = "litespiflash"