From a00b516f4424a0e9d45ac0a26e70fc175e6aa995 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 12 Aug 2020 11:03:19 +0800 Subject: [PATCH] spl: fit: use CONFIG_SPL_KERNEL_BOOT for thunder-boot This option was added by RKFW boot flow, let's reuse it. Signed-off-by: Joseph Chen Change-Id: Id4625a783747ce2e4ebaf69a5fa3812077a79639 --- Kconfig | 10 ---------- common/spl/Kconfig | 9 +++++++-- common/spl/spl_fit.c | 23 +++++++++++++++++------ include/spl.h | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Kconfig b/Kconfig index bb9459593e..1345a0671c 100644 --- a/Kconfig +++ b/Kconfig @@ -362,16 +362,6 @@ config SPL_SYS_DCACHE_OFF Disable SPL dcache. Please make sure CONFIG_SPL_SYS_MALLOC_F_LEN is large enough to malloc TLB and bd_t buffer while enabling dcache. -config SPL_FIT_LOAD_KERNEL - bool "Support load kernel FIT in SPL" - help - Support load kernel FIT in SPL accordding to platform selection. - -config SPL_FIT_LOAD_KERNEL_SECTOR - hex "Sector address to load kernel in SPL" - depends on !SPL_LIBDISK_SUPPORT && SPL_FIT_LOAD_KERNEL - default 0xa000 - endif # SPL endif # FIT diff --git a/common/spl/Kconfig b/common/spl/Kconfig index dc04e528e6..8f2ff1a0d9 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -209,7 +209,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE config SPL_MISC_SECTOR hex "Sector address to load misc in SPL" - depends on !SPL_LIBDISK_SUPPORT && SPL_FIT_LOAD_KERNEL + depends on !SPL_LIBDISK_SUPPORT && SPL_KERNEL_BOOT default 0x8000 config SPL_CRC32_SUPPORT @@ -855,7 +855,12 @@ config SPL_KERNEL_BOOT help Enable boot kernel in SPL. -if SPL_KERNEL_BOOT +config SPL_KERNEL_BOOT_SECTOR + hex "Sector address to load kernel in SPL" + depends on SPL_KERNEL_BOOT + default 0xa000 + +if SPL_LOAD_RKFW config SPL_KERNEL_ADDR hex "Kernel load address in spl" depends on SPL diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 866f4b7c7d..70e76d1edf 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -412,7 +412,7 @@ static void *spl_fit_load_blob(struct spl_load_info *info, return fit; } -#ifdef CONFIG_SPL_FIT_LOAD_KERNEL +#ifdef CONFIG_SPL_KERNEL_BOOT #ifdef CONFIG_SPL_LIBDISK_SUPPORT __weak const char *spl_kernel_partition(struct spl_image_info *spl, struct spl_load_info *info) @@ -456,7 +456,7 @@ static int spl_load_kernel_fit(struct spl_image_info *spl_image, } sector = part_info.start; #else - sector = CONFIG_SPL_FIT_LOAD_KERNEL_SECTOR; + sector = CONFIG_SPL_KERNEL_BOOT_SECTOR; #endif if (info->read(info, sector, 1, &fit_header) != 1) { debug("%s: no memory\n", __func__); @@ -515,12 +515,23 @@ static int spl_load_kernel_fit(struct spl_image_info *spl_image, if (!strcmp(images[i], FIT_FDT_PROP)) spl_image->fdt_addr = (void *)image_info.load_addr; else if (!strcmp(images[i], FIT_KERNEL_PROP)) +#if CONFIG_IS_ENABLED(OPTEE) spl_image->entry_point_os = image_info.load_addr; +#endif +#if CONFIG_IS_ENABLED(ATF) + spl_image->entry_point_bl33 = image_info.load_addr; +#endif } - debug("entry_point=0x%08lx, entry_point_os=0x%08lx, fdt_addr=0x%08lx\n", - spl_image->entry_point, spl_image->entry_point_os, - (ulong)spl_image->fdt_addr); + debug("fdt_addr=0x%08lx, entry_point=0x%08lx, entry_point_os=0x%08lx\n", + (ulong)spl_image->fdt_addr, + spl_image->entry_point, +#if CONFIG_IS_ENABLED(OPTEE) + spl_image->entry_point_os); +#endif +#if CONFIG_IS_ENABLED(ATF) + spl_image->entry_point_bl33); +#endif return 0; } @@ -752,7 +763,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, ret = spl_internal_load_simple_fit(spl_image, info, sector_offs, fit); if (!ret) { -#ifdef CONFIG_SPL_FIT_LOAD_KERNEL +#ifdef CONFIG_SPL_KERNEL_BOOT ret = spl_load_kernel_fit(spl_image, info); #endif return ret; diff --git a/include/spl.h b/include/spl.h index 9a6a7537cc..4238d8da27 100644 --- a/include/spl.h +++ b/include/spl.h @@ -338,7 +338,7 @@ int spl_board_prepare_for_jump(struct spl_image_info *spl_image); /** * spl_kernel_partition() - arch/board-specific callback to get kernel partition */ -#ifdef CONFIG_SPL_FIT_LOAD_KERNEL +#ifdef CONFIG_SPL_KERNEL_BOOT const char *spl_kernel_partition(struct spl_image_info *spl, struct spl_load_info *info); #endif