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 <chenjh@rock-chips.com>
Change-Id: Id4625a783747ce2e4ebaf69a5fa3812077a79639
This commit is contained in:
Joseph Chen 2020-08-12 11:03:19 +08:00 committed by Jianhong Chen
parent 45d851f407
commit a00b516f44
4 changed files with 25 additions and 19 deletions

10
Kconfig
View File

@ -362,16 +362,6 @@ config SPL_SYS_DCACHE_OFF
Disable SPL dcache. Please make sure CONFIG_SPL_SYS_MALLOC_F_LEN 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. 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 # SPL
endif # FIT endif # FIT

View File

@ -209,7 +209,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE
config SPL_MISC_SECTOR config SPL_MISC_SECTOR
hex "Sector address to load misc in SPL" 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 default 0x8000
config SPL_CRC32_SUPPORT config SPL_CRC32_SUPPORT
@ -855,7 +855,12 @@ config SPL_KERNEL_BOOT
help help
Enable boot kernel in SPL. 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 config SPL_KERNEL_ADDR
hex "Kernel load address in spl" hex "Kernel load address in spl"
depends on SPL depends on SPL

View File

@ -412,7 +412,7 @@ static void *spl_fit_load_blob(struct spl_load_info *info,
return fit; return fit;
} }
#ifdef CONFIG_SPL_FIT_LOAD_KERNEL #ifdef CONFIG_SPL_KERNEL_BOOT
#ifdef CONFIG_SPL_LIBDISK_SUPPORT #ifdef CONFIG_SPL_LIBDISK_SUPPORT
__weak const char *spl_kernel_partition(struct spl_image_info *spl, __weak const char *spl_kernel_partition(struct spl_image_info *spl,
struct spl_load_info *info) 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; sector = part_info.start;
#else #else
sector = CONFIG_SPL_FIT_LOAD_KERNEL_SECTOR; sector = CONFIG_SPL_KERNEL_BOOT_SECTOR;
#endif #endif
if (info->read(info, sector, 1, &fit_header) != 1) { if (info->read(info, sector, 1, &fit_header) != 1) {
debug("%s: no memory\n", __func__); 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)) if (!strcmp(images[i], FIT_FDT_PROP))
spl_image->fdt_addr = (void *)image_info.load_addr; spl_image->fdt_addr = (void *)image_info.load_addr;
else if (!strcmp(images[i], FIT_KERNEL_PROP)) else if (!strcmp(images[i], FIT_KERNEL_PROP))
#if CONFIG_IS_ENABLED(OPTEE)
spl_image->entry_point_os = image_info.load_addr; 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", debug("fdt_addr=0x%08lx, entry_point=0x%08lx, entry_point_os=0x%08lx\n",
spl_image->entry_point, spl_image->entry_point_os, (ulong)spl_image->fdt_addr,
(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; 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, ret = spl_internal_load_simple_fit(spl_image, info,
sector_offs, fit); sector_offs, fit);
if (!ret) { if (!ret) {
#ifdef CONFIG_SPL_FIT_LOAD_KERNEL #ifdef CONFIG_SPL_KERNEL_BOOT
ret = spl_load_kernel_fit(spl_image, info); ret = spl_load_kernel_fit(spl_image, info);
#endif #endif
return ret; return ret;

View File

@ -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 * 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, const char *spl_kernel_partition(struct spl_image_info *spl,
struct spl_load_info *info); struct spl_load_info *info);
#endif #endif