1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2016 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for tpl/u-boot-tpl.bin
10 from entry import Entry
11 from blob import Entry_blob
13 class Entry_u_boot_tpl(Entry_blob):
16 Properties / Entry arguments:
17 - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin')
19 This is the U-Boot TPL (Tertiary Program Loader) binary. This is a small
20 binary which loads before SPL, typically into on-chip SRAM. It is
21 responsible for locating, loading and jumping to SPL, the next-stage
22 loader. Note that SPL is not relocatable so must be loaded to the correct
23 address in SRAM, or written to run from the correct address if direct
24 flash execution is possible (e.g. on x86 devices).
26 SPL can access binman symbols at runtime. See:
28 'Access to binman entry offsets at run time (symbols)'
30 in the binman README for more information.
32 The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
33 binman uses that to look up symbols to write into the TPL binary.
35 def __init__(self, section, etype, node):
36 Entry_blob.__init__(self, section, etype, node)
37 self.elf_fname = 'tpl/u-boot-tpl'
39 def GetDefaultFilename(self):
40 return 'tpl/u-boot-tpl.bin'
42 def WriteSymbols(self, section):
43 elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage())