summaryrefslogtreecommitdiff
path: root/utils/imxtools/sbtools/sb.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-01 20:46:16 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-01-16 19:49:07 +0100
commit2df6b1fc43ab3cc7b07688a7c8d18f377a754c82 (patch)
tree385ecac7957387e3fdedb50f1faf62b841631ec3 /utils/imxtools/sbtools/sb.h
parent4f7fea2addf4a5bc7c301e78f53d9080eaf43fb6 (diff)
downloadrockbox-2df6b1fc43ab3cc7b07688a7c8d18f377a754c82.tar.gz
rockbox-2df6b1fc43ab3cc7b07688a7c8d18f377a754c82.zip
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.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/imxtools/sbtools/sb.h b/utils/imxtools/sbtools/sb.h
index cf826362de..9ab7fe7aba 100644
--- a/utils/imxtools/sbtools/sb.h
+++ b/utils/imxtools/sbtools/sb.h
@@ -195,7 +195,8 @@ struct sb_section_t
195 struct sb_inst_t *insts; 195 struct sb_inst_t *insts;
196 /* for production use */ 196 /* for production use */
197 uint32_t file_offset; /* in blocks */ 197 uint32_t file_offset; /* in blocks */
198 uint32_t sec_size; /* in blocks */ 198 uint32_t sec_size; /* in blocks, without padding */
199 uint32_t pad_size; /* padding size after the section until next section */
199}; 200};
200 201
201struct sb_file_t 202struct sb_file_t
@@ -217,6 +218,7 @@ struct sb_file_t
217 struct sb_version_t product_ver; 218 struct sb_version_t product_ver;
218 struct sb_version_t component_ver; 219 struct sb_version_t component_ver;
219 /* for production use */ 220 /* for production use */
221 int first_boot_sec; /* index in sections[] */
220 uint32_t image_size; /* in blocks */ 222 uint32_t image_size; /* in blocks */
221}; 223};
222 224