summaryrefslogtreecommitdiff
path: root/common/bootm.c
diff options
context:
space:
mode:
authorBryan Wu <cooloney@gmail.com>2014-08-15 16:51:38 -0700
committerTom Rini <trini@ti.com>2014-08-21 12:01:29 -0400
commit6c454fedf5195e4160bd7aa398f7a4bb17d7157c (patch)
tree6fb190e57815b3afa3883245bf076008be07f577 /common/bootm.c
parentf28c9708e35d8cc9c5a116dbe13ee9281affb097 (diff)
downloadu-boot-imx-6c454fedf5195e4160bd7aa398f7a4bb17d7157c.zip
u-boot-imx-6c454fedf5195e4160bd7aa398f7a4bb17d7157c.tar.gz
u-boot-imx-6c454fedf5195e4160bd7aa398f7a4bb17d7157c.tar.bz2
image: fix bootm failure for FIT image
Commit b3dd64f5d537 "bootm: use genimg_get_kernel_addr()" introduced a bug for booting FIT image. It's because calling fit_parse_config() twice will give us wrong value in img_addr. Add a new function genimg_get_kernel_addr_fit() whichl will always return fit_uname_config and fit_uname_kernel for CONFIG_FIT. genimg_get_kernel_addr() will ignore those to parameters. Reported-by: York Sun <yorksun@freescale.com> Signed-off-by: Bryan Wu <pengw@nvidia.com>
Diffstat (limited to 'common/bootm.c')
-rw-r--r--common/bootm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/common/bootm.c b/common/bootm.c
index 76d811c..245c82a 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -725,13 +725,14 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
#endif
ulong img_addr;
const void *buf;
-#if defined(CONFIG_FIT)
const char *fit_uname_config = NULL;
const char *fit_uname_kernel = NULL;
+#if defined(CONFIG_FIT)
int os_noffset;
#endif
- img_addr = genimg_get_kernel_addr(argv[0]);
+ img_addr = genimg_get_kernel_addr_fit(argv[0], &fit_uname_config,
+ &fit_uname_kernel);
bootstage_mark(BOOTSTAGE_ID_CHECK_MAGIC);
@@ -788,10 +789,6 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
#endif
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- if (!fit_parse_conf(argv[0], load_addr, &img_addr,
- &fit_uname_config))
- fit_parse_subimage(argv[0], load_addr, &img_addr,
- &fit_uname_kernel);
os_noffset = fit_image_load(images, img_addr,
&fit_uname_kernel, &fit_uname_config,
IH_ARCH_DEFAULT, IH_TYPE_KERNEL,