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 'u-boot-tpl-nodtb.bin' 6# 7 8from binman import elf 9from binman.entry import Entry 10from binman.etype.blob import Entry_blob 11 12class Entry_u_boot_tpl_nodtb(Entry_blob): 13 """TPL binary without device tree appended 14 15 Properties / Entry arguments: 16 - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin') 17 18 This is the U-Boot TPL binary, It does not include a device tree blob at 19 the end of it so may not be able to work without it, assuming TPL needs 20 a device tree to operate on your platform. You can add a u-boot-tpl-dtb 21 entry after this one, or use a u-boot-tpl entry instead, which normally 22 expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and 23 u-boot-tpl-dtb 24 25 TPL can access binman symbols at runtime. See: 26 27 'Access to binman entry offsets at run time (symbols)' 28 29 in the binman README for more information. 30 31 The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since 32 binman uses that to look up symbols to write into the TPL binary. 33 """ 34 def __init__(self, section, etype, node): 35 super().__init__(section, etype, node) 36 self.elf_fname = 'tpl/u-boot-tpl' 37 38 def GetDefaultFilename(self): 39 return 'tpl/u-boot-tpl-nodtb.bin' 40 41 def WriteSymbols(self, section): 42 elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage()) 43