tools/litex_json2dts_linux: add compatible, model
Fixes these dt-schema validation errors: /: 'compatible' is a required property from schema $id: http://devicetree.org/schemas/root-node.yaml# /: 'model' is a required property from schema $id: http://devicetree.org/schemas/root-node.yaml#
This commit is contained in:
parent
ddc521b033
commit
5e0c3f0a04
|
@ -944,6 +944,7 @@ class SoC(LiteXModule, SoCCoreCompat):
|
||||||
self.sys_clk_freq = int(sys_clk_freq) # Do conversion to int here to allow passing float to SoC.
|
self.sys_clk_freq = int(sys_clk_freq) # Do conversion to int here to allow passing float to SoC.
|
||||||
self.constants = {}
|
self.constants = {}
|
||||||
self.csr_regions = {}
|
self.csr_regions = {}
|
||||||
|
self.add_constant("platform", platform.name)
|
||||||
|
|
||||||
# Set Top-Level to LiteXContext.
|
# Set Top-Level to LiteXContext.
|
||||||
LiteXContext.top = self
|
LiteXContext.top = self
|
||||||
|
|
|
@ -247,6 +247,7 @@ class SoCCore(LiteXSoC):
|
||||||
# Add Identifier.
|
# Add Identifier.
|
||||||
if ident != "":
|
if ident != "":
|
||||||
self.add_identifier("identifier", identifier=ident, with_build_time=ident_version)
|
self.add_identifier("identifier", identifier=ident, with_build_time=ident_version)
|
||||||
|
self.add_constant("identifier", ident)
|
||||||
|
|
||||||
# Add UARTBone.
|
# Add UARTBone.
|
||||||
if with_uartbone:
|
if with_uartbone:
|
||||||
|
|
|
@ -55,14 +55,20 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
|
||||||
cpu_mmu = d["constants"].get("config_cpu_mmu", None)
|
cpu_mmu = d["constants"].get("config_cpu_mmu", None)
|
||||||
|
|
||||||
# Header ---------------------------------------------------------------------------------------
|
# Header ---------------------------------------------------------------------------------------
|
||||||
|
platform = d["constants"]["platform"]
|
||||||
dts = """
|
dts = """
|
||||||
/dts-v1/;
|
/dts-v1/;
|
||||||
|
|
||||||
/ {
|
/ {{
|
||||||
|
compatible = "litex,{platform}", "litex,soc";
|
||||||
|
model = "{identifier}";
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
|
|
||||||
"""
|
""".format(
|
||||||
|
platform=platform,
|
||||||
|
identifier=d["constants"].get("identifier", platform),
|
||||||
|
)
|
||||||
|
|
||||||
# Boot Arguments -------------------------------------------------------------------------------
|
# Boot Arguments -------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue