提交 f72250e7 编写于 作者: T tomas.melin@vaisala.com 提交者: Tom Rini

spl: add check for FIT-header when loading image

Add check for FDT_MAGIC, otherwise also legacy images will be loaded as
a FIT. With this check in place, the loader works correct both
with legacy and FIT images.
Signed-off-by: NTomas Melin <tomas.melin@vaisala.com>
Acked-by: NLokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 1deeecb6
......@@ -99,7 +99,8 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
if (err)
return err;
if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
image_get_magic(header) == FDT_MAGIC) {
struct spl_load_info load;
debug("Found FIT\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册