rimage: xcc module offset option

This argument is needed in case of platforms that have different
modules padding in xcc binaries.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2019-08-23 11:48:20 +02:00
parent df9897997a
commit 2db4679820
4 changed files with 10 additions and 3 deletions

View File

@ -240,7 +240,7 @@ static int man_get_module_manifest(struct image *image, struct module *module,
/* module built using xcc has preceding bytes */
if (section->size > sizeof(sof_mod))
ret = fseek(module->fd,
section->off + XCC_MOD_OFFSET, SEEK_SET);
section->off + image->xcc_mod_offset, SEEK_SET);
else
ret = fseek(module->fd, section->off, SEEK_SET);

View File

@ -15,7 +15,7 @@
#define MAN_PAGE_SIZE 4096
/* start offset for modules built using xcc */
#define XCC_MOD_OFFSET 0x8
#define DEFAULT_XCC_MOD_OFFSET 0x8
/* start offset for base FW module */
#define FILE_TEXT_OFFSET_V1_8 0x8000

View File

@ -36,6 +36,7 @@ static void usage(char *name)
fprintf(stdout, "\t -s MEU signing offset\n");
fprintf(stdout, "\t -p log dictionary outfile\n");
fprintf(stdout, "\t -i set IMR type\n");
fprintf(stdout, "\t -x set xcc module offset\n");
exit(0);
}
@ -48,7 +49,9 @@ int main(int argc, char *argv[])
memset(&image, 0, sizeof(image));
while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:")) != -1) {
image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET;
while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:x:")) != -1) {
switch (opt) {
case 'o':
image.out_file = optarg;
@ -77,6 +80,9 @@ int main(int argc, char *argv[])
case 'i':
imr_type = atoi(optarg);
break;
case 'x':
image.xcc_mod_offset = atoi(optarg);
break;
case 'h':
usage(argv[0]);
break;

View File

@ -104,6 +104,7 @@ struct image {
struct module module[MAX_MODULES];
uint32_t image_end;/* module end, equal to output image size */
int meu_offset;
int xcc_mod_offset;
/* SHA 256 */
const char *key_name;