All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/12] spl: separate SPL_FRAMEWORK config for spl and tpl
Date: Fri, 25 Oct 2019 09:55:28 +0800	[thread overview]
Message-ID: <9ab20055-343d-1dde-1444-5e3c22b6d757@rock-chips.com> (raw)
In-Reply-To: <20191024232803.10338-2-heiko@sntech.de>

Heiko,


On 2019/10/25 上午7:27, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
>
> 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.


New TPL_FRAMEWORK looks reasonable, after this patch, only the 
board_init_f() is available while

board_init_r() is drop, right?

> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> ---
>   arch/arm/lib/Makefile     | 2 +-
>   arch/arm/lib/crt0.S       | 2 +-
>   arch/arm/lib/crt0_64.S    | 2 ++
>   arch/powerpc/lib/Makefile | 2 +-
>   common/spl/Kconfig        | 8 ++++++++
>   common/spl/Makefile       | 2 +-
>   scripts/Makefile.spl      | 4 ++++
>   7 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
> index 48ee6c3c60..9de9a9acee 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 c74641dcd9..fb6c37cf51 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 e76b25a03e..04afa518ac 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 8ac49bdd06..01c9dd51be 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 f467eca2be..4d5c4ddc46 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -1183,6 +1183,14 @@ config TPL
>   
>   if TPL
>   
> +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
> diff --git a/common/spl/Makefile b/common/spl/Makefile
> index 5ce6f4ae48..eaa57f5ce5 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 7af6b120b6..090c831710 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
Is it able to use code like:

libs-$(CONFIG_$(SPL_TPL_)FRAMEWORK) +=

Thanks,
- Kever

>   libs-y += common/init/
>   
>   # Special handling for a few options which support SPL/TPL

  reply	other threads:[~2019-10-25  1:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 23:27 [U-Boot] [PATCH 00/12] rockchip: add support for px30 Heiko Stuebner
2019-10-24 23:27 ` [U-Boot] [PATCH 01/12] spl: separate SPL_FRAMEWORK config for spl and tpl Heiko Stuebner
2019-10-25  1:55   ` Kever Yang [this message]
2019-10-24 23:27 ` [U-Boot] [PATCH 02/12] rockchip: add core px30 headers Heiko Stuebner
2019-10-25  2:04   ` Kever Yang
2019-10-24 23:27 ` [U-Boot] [PATCH 03/12] pinctrl: rockchip: add px30 pinctrl driver Heiko Stuebner
2019-10-25  2:07   ` Kever Yang
2019-10-24 23:27 ` [U-Boot] [PATCH 04/12] rockchip: clk: add px30 clock driver Heiko Stuebner
2019-10-24 23:27 ` [U-Boot] [PATCH 05/12] net: gmac_rockchip: add support for px30 Heiko Stuebner
2019-10-25  2:09   ` Kever Yang
2019-10-24 23:27 ` [U-Boot] [PATCH 06/12] rockchip: mkimage: " Heiko Stuebner
2019-10-25  2:09   ` Kever Yang
2019-10-24 23:27 ` [U-Boot] [PATCH 07/12] misc: add driver for the Rockchip otp controller Heiko Stuebner
2019-10-25  2:10   ` Kever Yang
2019-10-24 23:27 ` [U-Boot] [PATCH 08/12] rockchip: misc: read cpuid either from efuse or otp Heiko Stuebner
2019-10-25  2:11   ` Kever Yang
2019-10-24 23:28 ` [U-Boot] [PATCH 09/12] rockchip: ram: add dm-based sdram driver Heiko Stuebner
2019-10-24 23:28 ` [U-Boot] [PATCH 10/12] rockchip: add px30 devicetrees Heiko Stuebner
2019-10-25  2:39   ` Kever Yang
2019-10-24 23:28 ` [U-Boot] [PATCH 11/12] rockchip: add px30 architecture core Heiko Stuebner
2019-10-25  2:49   ` Kever Yang
2019-10-25  7:47     ` Heiko Stübner
2019-11-10 14:13       ` Kever Yang
2019-11-10 14:46         ` Heiko Stuebner
2019-10-24 23:28 ` [U-Boot] [PATCH 12/12] rockchip: add px30-evb board Heiko Stuebner
2019-10-25  2:51   ` Kever Yang
2019-10-25  1:44 ` [U-Boot] [PATCH 00/12] rockchip: add support for px30 Kever Yang
2019-11-18  2:57 ` Kever Yang

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=9ab20055-343d-1dde-1444-5e3c22b6d757@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.