1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

binman: Support updating all device tree files

Binman currently supports updating the main device tree with things like
the position of each entry. Extend this support to SPL and TPL as well,
since they may need (a subset of) this information.

Also adjust DTB output files to have a .out extension since this seems
clearer than having a .dtb extension with 'out' in the name somwhere.

Also add a few missing comments and update the DT setup code to use
ReadFile and WriteFile().

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2018-09-14 04:57:24 -06:00
parent 93d174135a
commit 6ed45ba0a8
13 changed files with 235 additions and 21 deletions

View File

@@ -59,6 +59,29 @@ def GetFdtPath(fname):
"""
return fdt_files[fname]._fname
def GetFdtContents(fname):
"""Looks up the FDT pathname and contents
This is used to obtain the Fdt pathname and contents when needed by an
entry. It supports a 'fake' dtb, allowing tests to substitute test data for
the real dtb.
Args:
fname: Filename to look up (e.g. 'u-boot.dtb').
Returns:
tuple:
pathname to Fdt
Fdt data (as bytes)
"""
if fname in fdt_files and not use_fake_dtb:
pathname = GetFdtPath(fname)
data = GetFdt(fname).GetContents()
else:
pathname = tools.GetInputFilename(fname)
data = tools.ReadFile(pathname)
return pathname, data
def SetEntryArgs(args):
"""Set the value of the entry args
@@ -133,6 +156,8 @@ def GetFdts():
Device trees being used (U-Boot proper, SPL, TPL)
"""
yield main_dtb
for other_fname in fdt_subset:
yield fdt_files[other_fname]
def GetUpdateNodes(node):
"""Yield all the nodes that need to be updated in all device trees
@@ -149,6 +174,11 @@ def GetUpdateNodes(node):
is node, SPL and TPL)
"""
yield node
for dtb in fdt_files.values():
if dtb != node.GetFdt():
other_node = dtb.GetNode(node.path)
if other_node:
yield other_node
def AddZeroProp(node, prop):
"""Add a new property to affected device trees with an integer value of 0.