diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-01 20:46:16 +0100 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-16 19:49:07 +0100 |
| commit | 2df6b1fc43ab3cc7b07688a7c8d18f377a754c82 (patch) | |
| tree | 385ecac7957387e3fdedb50f1faf62b841631ec3 /utils/imxtools/sbtools/sb.h | |
| parent | 4f7fea2addf4a5bc7c301e78f53d9080eaf43fb6 (diff) | |
| download | rockbox-2df6b1fc43ab3cc7b07688a7c8d18f377a754c82.zip rockbox-2df6b1fc43ab3cc7b07688a7c8d18f377a754c82.tar.gz rockbox-2df6b1fc43ab3cc7b07688a7c8d18f377a754c82.tar.bz2 rockbox-2df6b1fc43ab3cc7b07688a7c8d18f377a754c82.tar.xz | |
imxtools: rework sb file production
The old code had some annoying way of dealing with padding by adding explicit
instructions to the stream, which is 1) ugly 2) not in par with freescale
tools. The trick, which this new version implements, is to put the useful length
of the section in the section header, and the actual (with padding) length in
the boot tag. This way the tools can just ignore padding instruction by
reading the section header, and the bootloader can still load the image because
it uses the boot tags.
Also correctly handle the case where the first section does not start right
after the header (there is a bug in freescale tools for this case by the way).
There is an ambiguity in the way the padding instructions should be encrypted:
the bootloader should logically treat them as regular instruction of the section
stream, but it appears the freescale tools do not generate them as part of the
stream and instead encrypt them like boot tags, which is stupid because there
is no way the bootloader could decrypt them, and anyway we don't care because
the bootloader doesn't decrypt them at all.
Change-Id: Iabdc1d1f9f82d374779bf03efb75c2c3998f5b5d
Diffstat (limited to 'utils/imxtools/sbtools/sb.h')
| -rw-r--r-- | utils/imxtools/sbtools/sb.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/imxtools/sbtools/sb.h b/utils/imxtools/sbtools/sb.h index cf82636..9ab7fe7 100644 --- a/utils/imxtools/sbtools/sb.h +++ b/utils/imxtools/sbtools/sb.h @@ -195,7 +195,8 @@ struct sb_section_t struct sb_inst_t *insts; /* for production use */ uint32_t file_offset; /* in blocks */ - uint32_t sec_size; /* in blocks */ + uint32_t sec_size; /* in blocks, without padding */ + uint32_t pad_size; /* padding size after the section until next section */ }; struct sb_file_t @@ -217,6 +218,7 @@ struct sb_file_t struct sb_version_t product_ver; struct sb_version_t component_ver; /* for production use */ + int first_boot_sec; /* index in sections[] */ uint32_t image_size; /* in blocks */ }; |