config: Add CONFIG_TINY_TPL to disable SPL framework at TPL

Some devices cann't use SPL framework at TPL stage, but the
CONFIG_SPL_FRAMEWORK is still defined at TPL stage, so need
to separate them with CONFIG_TINY_TPL.

If the SPL framewrok was used both at TPL and SPL stage,
CONFIG_TINY_TPL is not defined.
If the SPL framewrok was used at SPL stage, but not use at
TPL, need to define CONFIG_TINY_TPL.

Change-Id: Iabb7e0377ee00311ca468cb8ff7544c96bd999d6
Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
David Wu 2018-01-30 13:06:24 +08:00 committed by Kever Yang
parent 56af001036
commit 30129f2f83
7 changed files with 36 additions and 4 deletions

View File

@ -7,7 +7,7 @@
#ifndef _ASM_ARCH_SYS_PROTO_H
#define _ASM_ARCH_SYS_PROTO_H
#ifndef CONFIG_SPL_FRAMEWORK
#if !defined(CONFIG_SPL_FRAMEWORK) || defined(CONFIG_TINY_TPL)
void sdram_init(void);
#endif

View File

@ -121,7 +121,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) || (defined(CONFIG_SPL_FRAMEWORK) && !defined(CONFIG_TPL_BUILD))
# ifdef CONFIG_SPL_BUILD
/* Use a DRAM stack for the rest of SPL, if requested */
bl spl_relocate_stack_gd

View File

@ -14,6 +14,7 @@
#include <asm/io.h>
#include <asm/arch/bootrom.h>
#include <asm/arch/uart.h>
#include <asm/arch-rockchip/sys_proto.h>
#ifndef CONFIG_TPL_LIBCOMMON_SUPPORT
#define CONFIG_SYS_NS16550_COM1 CONFIG_DEBUG_UART_BASE
@ -70,8 +71,10 @@ __weak int arch_cpu_init(void)
void board_init_f(ulong dummy)
{
#if defined(CONFIG_SPL_FRAMEWORK) && !defined(CONFIG_TINY_TPL)
struct udevice *dev;
int ret;
#endif
rockchip_stimer_init();
arch_cpu_init();
@ -88,28 +91,35 @@ void board_init_f(ulong dummy)
debug_uart_init();
printascii("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
U_BOOT_TIME ")\n");
#endif
#if defined(CONFIG_SPL_FRAMEWORK) && !defined(CONFIG_TINY_TPL)
ret = spl_early_init();
if (ret) {
debug("spl_early_init() failed: %d\n", ret);
hang();
}
#endif
/* Init ARM arch timer */
timer_init();
#if defined(CONFIG_SPL_FRAMEWORK) && !defined(CONFIG_TINY_TPL)
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret) {
printf("DRAM init failed: %d\n", ret);
return;
}
#else
sdram_init();
#endif
#if defined(CONFIG_TPL_ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_TPL_BOARD_INIT)
back_to_bootrom(BROM_BOOT_NEXTSTAGE);
#endif
}
#ifndef CONFIG_SPL_FRAMEWORK
#if !(defined(CONFIG_SPL_FRAMEWORK) && !defined(CONFIG_TINY_TPL))
/* Place Holders */
void board_init_r(gd_t *id, ulong dest_addr)
{

View File

@ -852,6 +852,11 @@ config TPL_LIBGENERIC_SUPPORT
Enable support for generic U-Boot libraries within TPL. See
SPL_LIBGENERIC_SUPPORT for details.
config TINY_TPL
bool "Support not to use spl framework in TPL"
help
Enable support for not using spl framework in TPL, to reduce the TPL size.
config TPL_MPC8XXX_INIT_DDR_SUPPORT
bool "Support MPC8XXX DDR init"
help

View File

@ -8,8 +8,17 @@
# Based on common/Makefile.
#
ifeq ($(CONFIG_TPL_BUILD), y)
ifndef CONFIG_TINY_TPL
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
endif
else
ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
endif
endif
ifdef CONFIG_SPL_BUILD
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

View File

@ -64,7 +64,14 @@ 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)
ifndef CONFIG_TINY_TPL
libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
endif
else
libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
endif
libs-y += common/init/
# Special handling for a few options which support SPL/TPL

View File

@ -4870,6 +4870,7 @@ CONFIG_TIZEN
CONFIG_TI_KEYSTONE_SERDES
CONFIG_TI_KSNAV
CONFIG_TI_SPI_MMAP
CONFIG_TINY_TPL
CONFIG_TMU_TIMER
CONFIG_TPL_PAD_TO
CONFIG_TPM_TIS_BASE_ADDRESS