diff options
Diffstat (limited to 'arch/arm/mach-imx/spl_imx_romapi.c')
-rw-r--r-- | arch/arm/mach-imx/spl_imx_romapi.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c index ff4a87132b..c0e8bed958 100644 --- a/arch/arm/mach-imx/spl_imx_romapi.c +++ b/arch/arm/mach-imx/spl_imx_romapi.c @@ -263,7 +263,7 @@ static u32 img_header_size(void) static int img_info_size(void *img_hdr) { #ifdef CONFIG_SPL_LOAD_FIT - return fit_get_size(img_hdr); + return board_spl_fit_size_align(fit_get_size(img_hdr)); #elif defined CONFIG_SPL_LOAD_IMX_CONTAINER struct container_hdr *container = img_hdr; @@ -408,10 +408,12 @@ int board_return_to_bootrom(struct spl_image_info *spl_image, { volatile gd_t *pgd = gd; int ret; - u32 boot; + u32 boot, bstage; ret = g_rom_api->query_boot_infor(QUERY_BT_DEV, &boot, ((uintptr_t)&boot) ^ QUERY_BT_DEV); + ret |= g_rom_api->query_boot_infor(QUERY_BT_STAGE, &bstage, + ((uintptr_t)&bstage) ^ QUERY_BT_STAGE); set_gd(pgd); if (ret != ROM_API_OKAY) { @@ -419,6 +421,25 @@ int board_return_to_bootrom(struct spl_image_info *spl_image, return -1; } + printf("Boot Stage: "); + + switch (bstage) { + case BT_STAGE_PRIMARY: + printf("Primary boot\n"); + break; + case BT_STAGE_SECONDARY: + printf("Secondary boot\n"); + break; + case BT_STAGE_RECOVERY: + printf("Recovery boot\n"); + break; + case BT_STAGE_USB: + printf("USB boot\n"); + break; + default: + printf("Unknow (0x%x)\n", bstage); + } + if (is_boot_from_stream_device(boot)) return spl_romapi_load_image_stream(spl_image, bootdev); |