From fcb65c6194c56a2556c4c1be0bb5b593b57492ac Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Thu, 12 Mar 2020 19:14:07 +0800 Subject: [PATCH] spl: rkfw: support bring up different next stage Signed-off-by: Jason Zhu Change-Id: Idfca034d4d3eb5a4f757678e62efd7765bf89840 --- common/spl/spl_rkfw.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/common/spl/spl_rkfw.c b/common/spl/spl_rkfw.c index 2cdcf7794f..102e5a1b56 100644 --- a/common/spl/spl_rkfw.c +++ b/common/spl/spl_rkfw.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -362,20 +363,27 @@ int spl_load_rkfw_image(struct spl_image_info *spl_image, printf("Load trust image failed! ret=%d\n", ret); goto out; } - - ret = rkfw_load_uboot(info, uboot_sector, - &spl_image->entry_point_bl33, try_count); - if (ret) - printf("Load uboot image failed! ret=%d\n", ret); - else - goto boot; - - ret = rkfw_load_kernel(info, boot_sector, - &spl_image->entry_point_bl33, try_count); - if (ret) { - printf("Load kernel image failed! ret=%d\n", ret); - goto out; +#ifdef CONFIG_SPL_KERNEL_BOOT + if (spl_image->next_stage == SPL_NEXT_STAGE_UBOOT) { +#endif + ret = rkfw_load_uboot(info, uboot_sector, + &spl_image->entry_point_bl33, try_count); + if (ret) + printf("Load uboot image failed! ret=%d\n", ret); + else + goto boot; +#ifdef CONFIG_SPL_KERNEL_BOOT + } else if (spl_image->next_stage == SPL_NEXT_STAGE_KERNEL) { +#endif + ret = rkfw_load_kernel(info, boot_sector, + &spl_image->entry_point_bl33, try_count); + if (ret) { + printf("Load kernel image failed! ret=%d\n", ret); + goto out; + } +#ifdef CONFIG_SPL_KERNEL_BOOT } +#endif boot: #if CONFIG_IS_ENABLED(LOAD_FIT)