1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright 2021 Google LLC
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for expanded U-Boot TPL binary
8 from patman import tout
10 from binman import state
11 from binman.etype.blob_phase import Entry_blob_phase
13 class Entry_u_boot_tpl_expanded(Entry_blob_phase):
14 """U-Boot TPL flat binary broken out into its component parts
16 Properties / Entry arguments:
17 - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
20 This is a section containing the U-Boot binary, BSS padding if needed and a
21 devicetree. Using this entry type automatically creates this section, with
22 the following entries in it:
28 Having the devicetree separate allows binman to update it in the final
29 image, so that the entries positions are provided to the running U-Boot.
31 This entry is selected based on the value of the 'tpl-dtb' entryarg. If
32 this is non-empty (and not 'n' or '0') then this expanded entry is selected.
34 def __init__(self, section, etype, node):
35 bss_pad = state.GetEntryArgBool('tpl-bss-pad')
36 super().__init__(section, etype, node, 'u-boot-tpl', 'u-boot-tpl-dtb',
40 def UseExpanded(cls, node, etype, new_etype):
41 val = state.GetEntryArgBool('tpl-dtb')
42 tout.DoOutput(tout.INFO if val else tout.DETAIL,
43 "Node '%s': etype '%s': %s %sselected" %
44 (node.path, etype, new_etype, '' if val else 'not '))