spl: separate SPL_FRAMEWORK config for spl and tpl

Right now enabling SPL_FRAMEWORK will also enable it for the TPL in all
cases, making the TPL bigger. There may be cases where the TPL is really
size constrained due to its underlying ram size.

Therefore introduce a new TPL_FRAMEWORK option and make the relevant
conditionals check for both. The default is set to "y if SPL_FRAMEWORK"
to mimic the previous behaviour where the TPL would always get the
SPL framework if it was enabled in SPL.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Heiko Stuebner 2019-07-16 10:12:02 +02:00 committed by Kever Yang
parent bcfacab517
commit 22b7b86005
7 changed files with 18 additions and 4 deletions

View file

@ -35,7 +35,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o
obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
else else
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
endif endif

View file

@ -149,7 +149,7 @@ here:
bl c_runtime_cpu_setup /* we still call old routine here */ bl c_runtime_cpu_setup /* we still call old routine here */
#endif #endif
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_FRAMEWORK) #if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
#if !defined(CONFIG_SPL_EARLY_BSS) #if !defined(CONFIG_SPL_EARLY_BSS)
SPL_CLEAR_BSS SPL_CLEAR_BSS

View file

@ -120,6 +120,7 @@ relocation_return:
*/ */
bl c_runtime_cpu_setup /* still call old routine */ bl c_runtime_cpu_setup /* still call old routine */
#endif /* !CONFIG_SPL_BUILD */ #endif /* !CONFIG_SPL_BUILD */
#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
#if defined(CONFIG_SPL_BUILD) #if defined(CONFIG_SPL_BUILD)
bl spl_relocate_stack_gd /* may return NULL */ bl spl_relocate_stack_gd /* may return NULL */
/* set up gd here, outside any C code, if new stack is returned */ /* set up gd here, outside any C code, if new stack is returned */
@ -152,5 +153,6 @@ clear_loop:
b board_init_r /* PC relative jump */ b board_init_r /* PC relative jump */
/* NOTREACHED - board_init_r() does not return */ /* NOTREACHED - board_init_r() does not return */
#endif
ENDPROC(_main) ENDPROC(_main)

View file

@ -41,5 +41,5 @@ obj-y += time.o
endif # not minimal endif # not minimal
ifdef CONFIG_SPL_BUILD ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o obj-$(CONFIG_$(SPL_TPL)_FRAMEWORK) += spl.o
endif endif

View file

@ -1241,6 +1241,14 @@ config TPL_SIZE_LIMIT
Specifies the maximum length of the U-Boot TPL image. Specifies the maximum length of the U-Boot TPL image.
If this value is zero, it is ignored. If this value is zero, it is ignored.
config TPL_FRAMEWORK
bool "Support TPL based upon the common SPL framework"
default y if SPL_FRAMEWORK
help
Enable the SPL framework under common/spl/ for TPL builds.
This framework supports MMC, NAND and YMODEM and other methods
loading of U-Boot's SPL stage. If unsure, say Y.
config TPL_HANDOFF config TPL_HANDOFF
bool "Pass hand-off information from TPL to SPL and U-Boot proper" bool "Pass hand-off information from TPL to SPL and U-Boot proper"
depends on HANDOFF && TPL_BLOBLIST depends on HANDOFF && TPL_BLOBLIST

View file

@ -7,7 +7,7 @@
# #
ifdef CONFIG_SPL_BUILD ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
obj-$(CONFIG_$(SPL_TPL_)BOOTROM_SUPPORT) += spl_bootrom.o obj-$(CONFIG_$(SPL_TPL_)BOOTROM_SUPPORT) += spl_bootrom.o
obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += spl_fit.o obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += spl_fit.o
obj-$(CONFIG_$(SPL_TPL_)NOR_SUPPORT) += spl_nor.o obj-$(CONFIG_$(SPL_TPL_)NOR_SUPPORT) += spl_nor.o

View file

@ -71,7 +71,11 @@ HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makef
libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/) libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
ifeq ($(CONFIG_TPL_BUILD),y)
libs-$(CONFIG_TPL_FRAMEWORK) += common/spl/
else
libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/ libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
endif
libs-y += common/init/ libs-y += common/init/
# Special handling for a few options which support SPL/TPL # Special handling for a few options which support SPL/TPL