Merge pull request #1983 from Dolu1990/vexiiriscv
linux dts: add vexii clint support
This commit is contained in:
commit
6ed61e11bc
|
@ -50,7 +50,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
if "c" in cpu_isa[5:]:
|
if "c" in cpu_isa[5:]:
|
||||||
cpu_isa_extensions += ", \"c\""
|
cpu_isa_extensions += ", \"c\""
|
||||||
# rocket specific extensions
|
# rocket specific extensions
|
||||||
if "rocket" in cpu_name:
|
if cpu_name == "rocket":
|
||||||
cpu_isa_extensions += ", \"zicsr\", \"zifencei\", \"zihpm\""
|
cpu_isa_extensions += ", \"zicsr\", \"zifencei\", \"zihpm\""
|
||||||
|
|
||||||
cpu_mmu = d["constants"].get("config_cpu_mmu", None)
|
cpu_mmu = d["constants"].get("config_cpu_mmu", None)
|
||||||
|
@ -183,7 +183,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
i_tlb_ways = d["constants"]["config_cpu_itlb_ways"])
|
i_tlb_ways = d["constants"]["config_cpu_itlb_ways"])
|
||||||
|
|
||||||
# Rocket specific attributes
|
# Rocket specific attributes
|
||||||
if ("rocket" in cpu_name):
|
if (cpu_name == "rocket"):
|
||||||
extra_attr = """
|
extra_attr = """
|
||||||
hardware-exec-breakpoint-count = <1>;
|
hardware-exec-breakpoint-count = <1>;
|
||||||
next-level-cache = <&memory>;
|
next-level-cache = <&memory>;
|
||||||
|
@ -339,7 +339,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
|
|
||||||
# Interrupt Controller -------------------------------------------------------------------------
|
# Interrupt Controller -------------------------------------------------------------------------
|
||||||
|
|
||||||
if (cpu_arch == "riscv") and ("rocket" in cpu_name):
|
if (cpu_arch == "riscv") and (cpu_name in ["rocket", "vexiiriscv"]):
|
||||||
# FIXME : L4 definitiion?
|
# FIXME : L4 definitiion?
|
||||||
# CHECKME: interrupts-extended.
|
# CHECKME: interrupts-extended.
|
||||||
dts += """
|
dts += """
|
||||||
|
@ -354,7 +354,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
clint_base=d["memories"]["clint"]["base"],
|
clint_base=d["memories"]["clint"]["base"],
|
||||||
cpu_mapping =("\n" + " "*20).join(["&L{} 3 &L{} 7".format(cpu, cpu) for cpu in range(ncpus)]))
|
cpu_mapping =("\n" + " "*20).join(["&L{} 3 &L{} 7".format(cpu, cpu) for cpu in range(ncpus)]))
|
||||||
if cpu_arch == "riscv":
|
if cpu_arch == "riscv":
|
||||||
if "rocket" in cpu_name:
|
if cpu_name == "rocket":
|
||||||
extra_attr = """
|
extra_attr = """
|
||||||
reg-names = "control";
|
reg-names = "control";
|
||||||
riscv,max-priority = <7>;
|
riscv,max-priority = <7>;
|
||||||
|
@ -388,7 +388,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
"""
|
"""
|
||||||
if (cpu_arch == "riscv") and ("rocket" in cpu_name):
|
if (cpu_arch == "riscv") and (cpu_name == "rocket"):
|
||||||
dts += """
|
dts += """
|
||||||
dbg_ctl: debug-controller@0 {{
|
dbg_ctl: debug-controller@0 {{
|
||||||
compatible = "sifive,debug-013", "riscv,debug-013";
|
compatible = "sifive,debug-013", "riscv,debug-013";
|
||||||
|
@ -415,7 +415,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
|
|
||||||
if "uart" in d["csr_bases"]:
|
if "uart" in d["csr_bases"]:
|
||||||
aliases["serial0"] = "liteuart0"
|
aliases["serial0"] = "liteuart0"
|
||||||
it_incr = {True: 1, False: 0}["rocket" in cpu_name]
|
it_incr = {True: 1, False: 0}[cpu_name == "rocket"]
|
||||||
dts += """
|
dts += """
|
||||||
liteuart0: serial@{uart_csr_base:x} {{
|
liteuart0: serial@{uart_csr_base:x} {{
|
||||||
compatible = "litex,liteuart";
|
compatible = "litex,liteuart";
|
||||||
|
@ -432,7 +432,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
idx = (0 if i == '' else i)
|
idx = (0 if i == '' else i)
|
||||||
ethphy_name = "ethphy" + str(i)
|
ethphy_name = "ethphy" + str(i)
|
||||||
ethmac_name = "ethmac" + str(i)
|
ethmac_name = "ethmac" + str(i)
|
||||||
it_incr = {True: 1, False: 0}["rocket" in cpu_name]
|
it_incr = {True: 1, False: 0}[cpu_name == "rocket"]
|
||||||
if ethphy_name in d["csr_bases"] and ethmac_name in d["csr_bases"]:
|
if ethphy_name in d["csr_bases"] and ethmac_name in d["csr_bases"]:
|
||||||
dts += """
|
dts += """
|
||||||
mac{idx}: mac@{ethmac_csr_base:x} {{
|
mac{idx}: mac@{ethmac_csr_base:x} {{
|
||||||
|
|
Loading…
Reference in New Issue