diff options
author | Marek Vasut <marex@denx.de> | 2013-04-25 10:16:02 +0000 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2013-04-28 11:18:03 +0200 |
commit | 6cb83829a013ed2631cba5d5c9bf42eaf2380131 (patch) | |
tree | a8b92da2b504a72c7ac7a528602337a831a038e2 /tools | |
parent | 7e2173cf82d0bc235b695460c56d46927febdf36 (diff) | |
download | u-boot-imx-6cb83829a013ed2631cba5d5c9bf42eaf2380131.zip u-boot-imx-6cb83829a013ed2631cba5d5c9bf42eaf2380131.tar.gz u-boot-imx-6cb83829a013ed2631cba5d5c9bf42eaf2380131.tar.bz2 |
tools: arm: imx: Implement BOOT_OFFSET command for imximage
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 <u32 offset>".
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/imximage.c | 6 | ||||
-rw-r--r-- | tools/imximage.h | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/imximage.c b/tools/imximage.c index fa308c9..895c9de 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); diff --git a/tools/imximage.h b/tools/imximage.h index 42b6090..1445c1e 100644 --- a/tools/imximage.h +++ b/tools/imximage.h @@ -31,6 +31,11 @@ #define HEADER_OFFSET 0x400 +/* + * NOTE: This file must be kept in sync with arch/arm/include/asm/\ + * imx-common/imximage.cfg because tools/imximage.c can not + * cross-include headers from arch/arm/ and vice-versa. + */ #define CMD_DATA_STR "DATA" #define FLASH_OFFSET_UNDEFINED 0xFFFFFFFF #define FLASH_OFFSET_STANDARD 0x400 @@ -52,6 +57,7 @@ enum imximage_cmd { CMD_INVALID, CMD_IMAGE_VERSION, CMD_BOOT_FROM, + CMD_BOOT_OFFSET, CMD_DATA }; |