u_boot_spl_expanded.py 1.6 KB

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