From 6cb83829a013ed2631cba5d5c9bf42eaf2380131 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 25 Apr 2013 10:16:02 +0000 Subject: tools: arm: imx: Implement BOOT_OFFSET command for imximage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants. The syntax of BOOT_OFFSET command is "BOOT_OFFSET ". Signed-off-by: Marek Vasut Cc: Albert ARIBAUD Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Scott Wood Cc: Stefano Babic Cc: Tom Rini Acked-by: Stefano Babic Acked-by: Stefan Roese --- tools/imximage.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/imximage.c') diff --git a/tools/imximage.c b/tools/imximage.c index fa308c94b0..895c9de7b1 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -37,6 +37,7 @@ */ static table_entry_t imximage_cmds[] = { {CMD_BOOT_FROM, "BOOT_FROM", "boot command", }, + {CMD_BOOT_OFFSET, "BOOT_OFFSET", "Boot offset", }, {CMD_DATA, "DATA", "Reg Write Data", }, {CMD_IMAGE_VERSION, "IMAGE_VERSION", "image version", }, {-1, "", "", }, @@ -352,6 +353,11 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, int32_t cmd, char *token, if (unlikely(cmd_ver_first != 1)) cmd_ver_first = 0; break; + case CMD_BOOT_OFFSET: + imxhdr->flash_offset = get_cfg_value(token, name, lineno); + if (unlikely(cmd_ver_first != 1)) + cmd_ver_first = 0; + break; case CMD_DATA: value = get_cfg_value(token, name, lineno); (*set_dcd_val)(imxhdr, name, lineno, fld, value, dcd_len); -- cgit v1.2.1