From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] TPL/SPL: add separate CONFIG_TPL_FRAMEWORK for TPL
Date: Tue, 28 Aug 2018 16:51:26 +0800 [thread overview]
Message-ID: <20180828085126.27562-1-kever.yang@rock-chips.com> (raw)
SPL_FRAMEWORK is a set of framework feature, we may not need the
fromework for both TPL and SPL at the same time, so add a separate
one for TPL.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---
Makefile | 2 +-
arch/arm/lib/Makefile | 4 ++--
arch/arm/lib/crt0.S | 6 +++++-
common/spl/Kconfig | 9 +++++++++
common/spl/Makefile | 2 +-
scripts/Makefile.spl | 4 ++++
6 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 4b3023b259..68b77d1e43 100644
--- a/Makefile
+++ b/Makefile
@@ -822,7 +822,7 @@ endif
endif
ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb
-ifeq ($(CONFIG_SPL_FRAMEWORK),y)
+ifeq ($(CONFIG_TPL_FRAMEWORK),y)
ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
endif
ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 655727f431..19a6775b0d 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -35,8 +35,8 @@ 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_FRAMEWORK) += zimage.o
+obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
+obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += zimage.o
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
endif
obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 538d78c0b8..f1a8a7e7dc 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -120,7 +120,11 @@ 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) || \
+ (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_FRAMEWORK)) || \
+ (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \
+ defined(CONFIG_SPL_FRAMEWORK)) \
+
# ifdef CONFIG_SPL_BUILD
/* Use a DRAM stack for the rest of SPL, if requested */
bl spl_relocate_stack_gd
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index db1915fe5c..1a2e10b892 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -813,6 +813,15 @@ config TPL
help
If you want to build TPL as well as the normal image and SPL, say Y.
+config TPL_FRAMEWORK
+ bool "Support TPL based upon the common TPL framework"
+ depends on TPL
+ default y
+ help
+ Enable the TPL framework under common/spl/. This framework
+ re-use the all the framework feature from SPL but enable separetely.
+ If unsure, say Y.
+
if TPL
config TPL_BOARD_INIT
diff --git a/common/spl/Makefile b/common/spl/Makefile
index a130a5be4b..dd2fc7a5d3 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 252f13826d..43949cdba1 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -64,7 +64,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
--
2.18.0
next reply other threads:[~2018-08-28 8:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 8:51 Kever Yang [this message]
2018-08-28 12:49 ` [U-Boot] [PATCH] TPL/SPL: add separate CONFIG_TPL_FRAMEWORK for TPL Tom Rini
2018-08-28 13:11 ` Kever Yang
2018-08-29 1:55 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180828085126.27562-1-kever.yang@rock-chips.com \
--to=kever.yang@rock-chips.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox