diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-03-30 12:39:46 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-01 14:07:47 +0200 |
commit | f546a50feb861c4264892b2089f8e0cff9b6f68e (patch) | |
tree | 25da4219baf2ee34b125c4703df10c1f4d4348fd /arch | |
parent | 218af23c7374df87d7a054a604e11f1d56a4c7f6 (diff) | |
download | barebox-f546a50feb861c4264892b2089f8e0cff9b6f68e.tar.gz barebox-f546a50feb861c4264892b2089f8e0cff9b6f68e.tar.xz |
ARM: i.MX: xload-esdhc: Find entry in image
The binary image generated by barebox contains an instruction at the
very beginning to jump over the header. However, when the image is
written to a SD card and the first 512 bytes are skipped in order to
preserve the partition table then this jump instruction is lost. Instead
of relying on the jump instruction at the image beginning calculate
the image entry from the i.MX header instead of relying on the beginning
of the image being the entry point.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/xload-esdhc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/xload-esdhc.c b/arch/arm/mach-imx/xload-esdhc.c index 0ff58c8870..e774e4e68c 100644 --- a/arch/arm/mach-imx/xload-esdhc.c +++ b/arch/arm/mach-imx/xload-esdhc.c @@ -260,6 +260,7 @@ int imx6_esdhc_start_image(int instance) u32 *ivt = buf + SZ_1K; int ret, len; void __noreturn (*bb)(void); + unsigned int ofs; len = imx_image_size(); len = ALIGN(len, SECTOR_SIZE); @@ -283,7 +284,9 @@ int imx6_esdhc_start_image(int instance) pr_debug("Image loaded successfully\n"); - bb = buf; + ofs = *(ivt + 1) - *(ivt + 8); + + bb = buf + ofs; bb(); } |