tools/litex_json2dts: Simplify Switches interrupt support (and make it similar to other interrupts).
This commit is contained in:
parent
291374e66f
commit
5205356d24
|
@ -259,7 +259,6 @@ def generate_dts(d, initrd_start=None, initrd_size=None, polling=False):
|
||||||
liteuart0: serial@{uart_csr_base:x} {{
|
liteuart0: serial@{uart_csr_base:x} {{
|
||||||
compatible = "litex,liteuart";
|
compatible = "litex,liteuart";
|
||||||
reg = <0x{uart_csr_base:x} 0x100>;
|
reg = <0x{uart_csr_base:x} 0x100>;
|
||||||
interrupt-parent = <&intc0>;
|
|
||||||
{uart_interrupt}
|
{uart_interrupt}
|
||||||
status = "okay";
|
status = "okay";
|
||||||
}};
|
}};
|
||||||
|
@ -278,7 +277,6 @@ def generate_dts(d, initrd_start=None, initrd_size=None, polling=False):
|
||||||
<0x{ethmac_mem_base:x} 0x{ethmac_mem_size:x}>;
|
<0x{ethmac_mem_base:x} 0x{ethmac_mem_size:x}>;
|
||||||
tx-fifo-depth = <{ethmac_tx_slots}>;
|
tx-fifo-depth = <{ethmac_tx_slots}>;
|
||||||
rx-fifo-depth = <{ethmac_rx_slots}>;
|
rx-fifo-depth = <{ethmac_rx_slots}>;
|
||||||
interrupt-parent = <&intc0>;
|
|
||||||
{ethmac_interrupt}
|
{ethmac_interrupt}
|
||||||
status = "okay";
|
status = "okay";
|
||||||
}};
|
}};
|
||||||
|
@ -405,15 +403,6 @@ def generate_dts(d, initrd_start=None, initrd_size=None, polling=False):
|
||||||
# Switches -------------------------------------------------------------------------------------
|
# Switches -------------------------------------------------------------------------------------
|
||||||
|
|
||||||
if "switches" in d["csr_bases"]:
|
if "switches" in d["csr_bases"]:
|
||||||
interrupt_specification = ""
|
|
||||||
if "switches_interrupt" in d["constants"]:
|
|
||||||
switches_interrupt = d["constants"]["switches_interrupt"]
|
|
||||||
interrupt_specification = """
|
|
||||||
interrupt-controller;
|
|
||||||
#interrupt-cells = <2>;
|
|
||||||
interrupt-parent = <&intc0>;
|
|
||||||
interrupts = <{switches_interrupt}>;""".format(switches_interrupt=switches_interrupt)
|
|
||||||
|
|
||||||
dts += """
|
dts += """
|
||||||
switches: gpio@{switches_csr_base:x} {{
|
switches: gpio@{switches_csr_base:x} {{
|
||||||
compatible = "litex,gpio";
|
compatible = "litex,gpio";
|
||||||
|
@ -421,11 +410,12 @@ def generate_dts(d, initrd_start=None, initrd_size=None, polling=False):
|
||||||
gpio-controller;
|
gpio-controller;
|
||||||
#gpio-cells = <2>;
|
#gpio-cells = <2>;
|
||||||
litex,direction = "in";
|
litex,direction = "in";
|
||||||
gpio-controller;
|
{switches_interrupt}
|
||||||
#gpio-cells = <2>;{interrupt_specification}
|
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
}};
|
}};
|
||||||
""".format(switches_csr_base=d["csr_bases"]["switches"], interrupt_specification=interrupt_specification)
|
""".format(
|
||||||
|
switches_csr_base = d["csr_bases"]["switches"],
|
||||||
|
switches_interrupt = "" if polling else "interrupts = <{}>;".format(d["constants"]["switches_interrupt"]))
|
||||||
|
|
||||||
# SPI ------------------------------------------------------------------------------------------
|
# SPI ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue