[U-Boot] [PATCH 3/8][RESEND] binman: Add a new "start-pos" property in section class
Jagdish Gediya
jagdish.gediya at nxp.com
Tue Aug 21 18:18:22 UTC 2018
currently binman calculates '_skip_at_start' based on 'end-at-4gb'
property and it is used for x86 images.
for powerpc architecture also, '_skip_at_start' should be set because
memory address 0xeff40000 or 0xfff40000 is the first entry offset.
'end-at-4gb' property is not applicable for 0xeff40000 first entry
offset.
add new property start-pos' in section class so that
'_skip_at_start' can be calculated either based on 'end-at-4gb'
or based on 'start-pos'
Signed-off-by: Jagdish Gediya <jagdish.gediya at nxp.com>
---
tools/binman/bsection.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py
index a0bd1b6..71f276d 100644
--- a/tools/binman/bsection.py
+++ b/tools/binman/bsection.py
@@ -40,6 +40,10 @@ class Section(object):
used for x86 images, which want to use offsets such that a memory
address (like 0xff800000) is the first entry offset. This causes
_skip_at_start to be set to the starting memory address.
+ _start_pos: For powerpc, memory address 0xeff40000 or 0xfff40000 is the
+ first entry offset. _end_4gb is not re-usable if first entry offset
+ is 0xeff40000. _start_pos causes _skip_at_start to be set to the
+ starting memory address.
_name_prefix: Prefix to add to the name of all entries within this
section
_entries: OrderedDict() of entries
@@ -61,6 +65,7 @@ class Section(object):
self._sort = False
self._skip_at_start = 0
self._end_4gb = False
+ self._start_pos = 0
self._name_prefix = ''
self._entries = OrderedDict()
if not test:
@@ -79,10 +84,14 @@ class Section(object):
self._pad_byte = fdt_util.GetInt(self._node, 'pad-byte', 0)
self._sort = fdt_util.GetBool(self._node, 'sort-by-offset')
self._end_4gb = fdt_util.GetBool(self._node, 'end-at-4gb')
- if self._end_4gb and not self._size:
- self._Raise("Section size must be provided when using end-at-4gb")
+ self._start_pos = fdt_util.GetInt(self._node, 'start-pos', 0)
+ if (self._end_4gb or self._start_pos) and not self._size:
+ self._Raise("Section size must be provided when using end-at-4gb or "
+ "start-pos")
if self._end_4gb:
self._skip_at_start = 0x100000000 - self._size
+ if self._start_pos:
+ self._skip_at_start = self._start_pos
self._name_prefix = fdt_util.GetString(self._node, 'name-prefix')
def _ReadEntries(self):
--
2.7.4
More information about the U-Boot
mailing list