Boot: Extend align value and make it configurable by platform
Since stm/b_u585i_iot02a platform needs 16 bytes align value. Align
value is now configurable up to 32 bytes and default value is fixed
to previous hardcoded settings(1 bytes). Move mcuboot for the support
of alignment larger than 8 bytes.
Change-Id: Id3cce340e10fafe74f17e0aad129bb83dbbe6e8f
Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
diff --git a/bl2/ext/mcuboot/scripts/wrapper/wrapper.py b/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
old mode 100755
new mode 100644
index 5cff01b..9b6667c
--- a/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
+++ b/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
@@ -79,7 +79,7 @@
help='Specify the value of encrypt key length. Default 128.')
@click.option('-v', '--version', callback=imgtool.main.validate_version,
required=True)
-@click.option('--align', type=click.Choice(['1', '2', '4', '8']),
+@click.option('--align', type=click.Choice(['1', '2', '4', '8', '16', '32']),
required=True)
@click.option('--public-key-format', type=click.Choice(['hash', 'full']),
default='hash', help='In what format to add the public key to '
@@ -103,6 +103,13 @@
else:
boot_record = "NSPE_SPE"
+ if int(align) <= 8 :
+ #default behaviour for max_align
+ max_align=8
+ else:
+ #max_align must be set to align
+ max_align=align
+
img = imgtool.image.Image(version=imgtool.version.decode_version(version),
header_size=header_size, pad_header=pad_header,
pad=pad, confirm=confirm, align=int(align),
@@ -111,7 +118,8 @@
load_addr=load_addr, rom_fixed=rom_fixed,
erased_val=erased_val,
save_enctlv=save_enctlv,
- security_counter=security_counter)
+ security_counter=security_counter,
+ max_align=max_align)
img.load(infile)
key = imgtool.main.load_key(key) if key else None