diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 48ee6c3c603fc1d67316563857d902b0850186fa..9de9a9acee7c9b428831ccc89fb175bce7e9abde 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -35,7 +35,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o else -obj-$(CONFIG_SPL_FRAMEWORK) += spl.o +obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o endif diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index c74641dcd9b661fa97237d21b62a2b4019214c28..fb6c37cf519494aa55a562354e066dcf434ddce6 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -149,7 +149,7 @@ here: bl c_runtime_cpu_setup /* we still call old routine here */ #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) SPL_CLEAR_BSS diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S index e76b25a03e8c7621717cc9595c7b2fd5be9807e9..04afa518acf011b58ae28664e03480b31d6a00c1 100644 --- a/arch/arm/lib/crt0_64.S +++ b/arch/arm/lib/crt0_64.S @@ -120,6 +120,7 @@ relocation_return: */ bl c_runtime_cpu_setup /* still call old routine */ #endif /* !CONFIG_SPL_BUILD */ +#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK) #if defined(CONFIG_SPL_BUILD) bl spl_relocate_stack_gd /* may return NULL */ /* 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 */ /* NOTREACHED - board_init_r() does not return */ +#endif ENDPROC(_main) diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 8ac49bdd0603860c5719190099a60dd2782f463a..01c9dd51be8c5805af1d4148775fee40eb4ff59d 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -41,5 +41,5 @@ obj-y += time.o endif # not minimal ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_SPL_FRAMEWORK) += spl.o +obj-$(CONFIG_$(SPL_TPL)_FRAMEWORK) += spl.o endif diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 8f0ba8ef831ec98a3d02ed590672aed7962f4ade..1f122833a777ea813ebb8e7a251fb1bc0fef7e37 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1241,6 +1241,14 @@ config TPL_SIZE_LIMIT Specifies the maximum length of the U-Boot TPL image. 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 bool "Pass hand-off information from TPL to SPL and U-Boot proper" depends on HANDOFF && TPL_BLOBLIST diff --git a/common/spl/Makefile b/common/spl/Makefile index 5ce6f4ae480c9882f5d4e1c274831ad08105efd9..eaa57f5ce5e48646b77640ab5197281b3cbbabd9 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -7,7 +7,7 @@ # 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_)LOAD_FIT) += spl_fit.o obj-$(CONFIG_$(SPL_TPL_)NOR_SUPPORT) += spl_nor.o diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index f8ce7da2d281438066a2dd690be8510f9ed32846..314b02ba07dbee88e71aa9eeb352e9f6f5f70e30 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -71,7 +71,11 @@ HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makef libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/) 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/ +endif libs-y += common/init/ # Special handling for a few options which support SPL/TPL