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"