summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-31 14:43:04 -0400
committerTom Rini <trini@konsulko.com>2022-10-31 14:43:04 -0400
commita90afc6730e6c67ad37f4c98a02891a93b4ff971 (patch)
tree724c085433631e142a56c052d667139cba29b4a6 /tools/binman/entry.py
parent6f38d91158e7e4199753b79e0a25c1a65175aba4 (diff)
parent77bec9e3d8bd2dc307447b92a3d5cefd693a62ad (diff)
Merge branch '2022-10-31-vbe-implement-the-full-firmware-flow'
To quote Simon: This series provides an implementation of VBE from TPL through to U-Boot proper, using VBE to load the relevant firmware stages. It buils a single image.bin file containing all the phases: TPL - initial phase, loads VPL using binman symbols VPL - main firmware phase, loads SPL using VBE parameters SPL - loads U-Boot proper using VBE parameters U-Boot - final firmware phase, where OS booting is processed This series does not include the OS-booting phase. That will be the subject of a future series. The implementation is entirely handled by sandbox. It should be possible to enable this on a real board without much effort, but that is also the subject of a future series.
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 63ec5cea3b2..1be31a05e00 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -12,6 +12,7 @@ import sys
import time
from binman import bintool
+from binman import elf
from dtoc import fdt_util
from patman import tools
from patman.tools import to_hex, to_hex_size
@@ -86,10 +87,15 @@ class Entry(object):
fake_fname: Fake filename, if one was created, else None
required_props (dict of str): Properties which must be present. This can
be added to by subclasses
+ elf_fname (str): Filename of the ELF file, if this entry holds an ELF
+ file, or is a binary file produced from an ELF file
+ auto_write_symbols (bool): True to write ELF symbols into this entry's
+ contents
"""
fake_dir = None
- def __init__(self, section, etype, node, name_prefix=''):
+ def __init__(self, section, etype, node, name_prefix='',
+ auto_write_symbols=False):
# Put this here to allow entry-docs and help to work without libfdt
global state
from binman import state
@@ -125,6 +131,8 @@ class Entry(object):
self.fake_fname = None
self.required_props = []
self.comp_bintool = None
+ self.elf_fname = None
+ self.auto_write_symbols = auto_write_symbols
@staticmethod
def FindEntryClass(etype, expanded):
@@ -647,7 +655,11 @@ class Entry(object):
Args:
section: Section containing the entry
"""
- pass
+ if self.auto_write_symbols:
+ # Check if we are writing symbols into an ELF file
+ is_elf = self.GetDefaultFilename() == self.elf_fname
+ elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage(),
+ is_elf)
def CheckEntries(self):
"""Check that the entry offsets are correct