linux dts: rework "rocket" in cpu_name into cpu_name == "rocket"
This commit is contained in:
parent
87ae5db16b
commit
8c80a6c19c
|
@ -50,7 +50,7 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
if "d" in cpu_isa[5:]:
|
if "d" 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)
|
||||||
|
@ -171,7 +171,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>;
|
||||||
|
@ -343,7 +343,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>;
|
||||||
|
@ -377,7 +377,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";
|
||||||
|
@ -404,7 +404,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";
|
||||||
|
@ -421,7 +421,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