Commit 5f5ec1e9 authored by Marek Vasut's avatar Marek Vasut

mxssb: Properly implement BOOTABLE section flag

The BOOTABLE flag was set by default during development. This is
not correct, implement a proper BOOTABLE flag for each section and
make this configurable from the command file.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent 7422640a
SECTION 0x0 SECTION 0x0 BOOTABLE
TAG LAST TAG LAST
LOAD 0x0 spl/u-boot-spl.bin LOAD 0x0 spl/u-boot-spl.bin
CALL 0x14 0x0 CALL 0x14 0x0
......
SECTION 0x0 SECTION 0x0 BOOTABLE
TAG LAST TAG LAST
LOAD 0x0 spl/u-boot-spl.bin LOAD 0x0 spl/u-boot-spl.bin
LOAD IVT 0x8000 0x14 LOAD IVT 0x8000 0x14
......
...@@ -685,6 +685,7 @@ static int sb_parse_sections(struct sb_image_ctx *ictx) ...@@ -685,6 +685,7 @@ static int sb_parse_sections(struct sb_image_ctx *ictx)
struct sb_section_ctx *sctx, *head = NULL, *prev = NULL; struct sb_section_ctx *sctx, *head = NULL, *prev = NULL;
struct sb_sections_header *shdr; struct sb_sections_header *shdr;
int ret; int ret;
uint32_t bootable = 0;
long id; long id;
char *tok, *line; char *tok, *line;
...@@ -709,6 +710,11 @@ static int sb_parse_sections(struct sb_image_ctx *ictx) ...@@ -709,6 +710,11 @@ static int sb_parse_sections(struct sb_image_ctx *ictx)
if (id < 0) if (id < 0)
goto fail; goto fail;
bootable = 0;
tok = strtok(NULL, " ");
if (tok && (strlen(tok) == 8) && !strncmp(tok, "BOOTABLE", 8))
bootable = SB_SECTION_FLAG_BOOTABLE;
sctx = calloc(1, sizeof(*sctx)); sctx = calloc(1, sizeof(*sctx));
if (!sctx) if (!sctx)
goto fail; goto fail;
...@@ -727,12 +733,11 @@ static int sb_parse_sections(struct sb_image_ctx *ictx) ...@@ -727,12 +733,11 @@ static int sb_parse_sections(struct sb_image_ctx *ictx)
goto fail; goto fail;
shdr = &sctx->payload; shdr = &sctx->payload;
/* FIXME -- bootable by default. */
sctx->boot = 1;
sctx->boot = bootable;
shdr->section_number = id; shdr->section_number = id;
shdr->section_size = sctx->size / SB_BLOCK_SIZE; shdr->section_size = sctx->size / SB_BLOCK_SIZE;
shdr->section_flags = sctx->boot ? SB_SECTION_FLAG_BOOTABLE : 0; shdr->section_flags = bootable;
ictx->section_count++; ictx->section_count++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment