Commit 1e0c5442 authored by David Vincze's avatar David Vincze Committed by David Brown
Browse files

imgtool: Set RAM_LOAD flag in header when needed

Set the RAM_LOAD flag in the image header when a load address was passed
to the imgtool script, indicating that the image should be loaded into
RAM and run from there.

Change-Id: Id9d2c179d7fa1ff7d15cf671c09c61b5b78c88a8
Signed-off-by: default avatarDavid Vincze <david.vincze@linaro.org>
parent 7973f573
Loading
Loading
Loading
Loading
+5 −0
Changes for scripts/imgtool/image.py: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ MAX_SW_TYPE_LENGTH = 12 # Bytes
IMAGE_F = {
        'PIC':                   0x0000001,
        'NON_BOOTABLE':          0x0000010,
        'RAM_LOAD':              0x0000020,
        'ENCRYPTED':             0x0000004,
}

@@ -432,6 +433,10 @@ class Image():
        flags = 0
        if enckey is not None:
            flags |= IMAGE_F['ENCRYPTED']
        if self.load_addr != 0:
            # Indicates that this image should be loaded into RAM
            # instead of run directly from flash.
            flags |= IMAGE_F['RAM_LOAD']

        e = STRUCT_ENDIAN_DICT[self.endian]
        fmt = (e +
+1 −1
Changes for scripts/imgtool/main.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ class BasedIntParamType(click.ParamType):
@click.option('-x', '--hex-addr', type=BasedIntParamType(), required=False,
              help='Adjust address in hex output file.')
@click.option('-L', '--load-addr', type=BasedIntParamType(), required=False,
              help='Load address for image when it is in its primary slot.')
              help='Load address for image when it should run from RAM.')
@click.option('--save-enctlv', default=False, is_flag=True,
              help='When upgrading, save encrypted key TLVs instead of plain '
                   'keys. Enable when BOOT_SWAP_SAVE_ENCTLV config option '