u_boot_spl_nodtb.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # SPDX-License-Identifier: GPL-2.0+
  2. # Copyright (c) 2016 Google, Inc
  3. # Written by Simon Glass <sjg@chromium.org>
  4. #
  5. # Entry-type module for 'u-boot-spl-nodtb.bin'
  6. #
  7. from binman import elf
  8. from binman.entry import Entry
  9. from binman.etype.blob import Entry_blob
  10. class Entry_u_boot_spl_nodtb(Entry_blob):
  11. """SPL binary without device tree appended
  12. Properties / Entry arguments:
  13. - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
  14. This is the U-Boot SPL binary, It does not include a device tree blob at
  15. the end of it so may not be able to work without it, assuming SPL needs
  16. a device tree to operate on your platform. You can add a u-boot-spl-dtb
  17. entry after this one, or use a u-boot-spl entry instead' which normally
  18. expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
  19. u-boot-spl-dtb
  20. SPL can access binman symbols at runtime. See:
  21. 'Access to binman entry offsets at run time (symbols)'
  22. in the binman README for more information.
  23. The ELF file 'spl/u-boot-spl' must also be available for this to work, since
  24. binman uses that to look up symbols to write into the SPL binary.
  25. """
  26. def __init__(self, section, etype, node):
  27. super().__init__(section, etype, node)
  28. self.elf_fname = 'spl/u-boot-spl'
  29. def GetDefaultFilename(self):
  30. return 'spl/u-boot-spl-nodtb.bin'
  31. def WriteSymbols(self, section):
  32. elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage())