spl: Split sprintf, strto* from SPL serial in Kconfig
When SPL serial is disabled, callers who need sprintf or strtoul fail because their inclusion is guarded by CONFIG_SPL_SERIAL_SUPPORT/ CONFIG_TPL_SERIAL_SUPPORT. Split printf, sprintf and strto into their own entries and then select all of them if SERIAL_SUPPORT is enabled to match the current behaviour. Include panic.o unconditionally as it can be called from anywhere which uses BUG_ON(). Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
This commit is contained in:
parent
d4bb3b3762
commit
14ad44ab46
@ -626,6 +626,8 @@ config SPL_SATA_SUPPORT
|
|||||||
|
|
||||||
config SPL_SERIAL_SUPPORT
|
config SPL_SERIAL_SUPPORT
|
||||||
bool "Support serial"
|
bool "Support serial"
|
||||||
|
select SPL_PRINTF
|
||||||
|
select SPL_STRTO
|
||||||
help
|
help
|
||||||
Enable support for serial in SPL. This allows use of a serial UART
|
Enable support for serial in SPL. This allows use of a serial UART
|
||||||
for displaying messages while SPL is running. It also brings in
|
for displaying messages while SPL is running. It also brings in
|
||||||
@ -927,6 +929,8 @@ config TPL_RAM_DEVICE
|
|||||||
|
|
||||||
config TPL_SERIAL_SUPPORT
|
config TPL_SERIAL_SUPPORT
|
||||||
bool "Support serial"
|
bool "Support serial"
|
||||||
|
select TPL_PRINTF
|
||||||
|
select TPL_STRTO
|
||||||
help
|
help
|
||||||
Enable support for serial in TPL. See SPL_SERIAL_SUPPORT for
|
Enable support for serial in TPL. See SPL_SERIAL_SUPPORT for
|
||||||
details.
|
details.
|
||||||
|
34
lib/Kconfig
34
lib/Kconfig
@ -27,6 +27,40 @@ config HAVE_PRIVATE_LIBGCC
|
|||||||
config LIB_UUID
|
config LIB_UUID
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config PRINTF
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
|
config SPL_PRINTF
|
||||||
|
bool
|
||||||
|
select SPL_SPRINTF
|
||||||
|
select SPL_STRTO if !USE_TINY_PRINTF
|
||||||
|
|
||||||
|
config TPL_PRINTF
|
||||||
|
bool
|
||||||
|
select TPL_SPRINTF
|
||||||
|
select TPL_STRTO if !USE_TINY_PRINTF
|
||||||
|
|
||||||
|
config SPRINTF
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
|
config SPL_SPRINTF
|
||||||
|
bool
|
||||||
|
|
||||||
|
config TPL_SPRINTF
|
||||||
|
bool
|
||||||
|
|
||||||
|
config STRTO
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
|
config SPL_STRTO
|
||||||
|
bool
|
||||||
|
|
||||||
|
config TPL_STRTO
|
||||||
|
bool
|
||||||
|
|
||||||
config USE_PRIVATE_LIBGCC
|
config USE_PRIVATE_LIBGCC
|
||||||
bool "Use private libgcc"
|
bool "Use private libgcc"
|
||||||
depends on HAVE_PRIVATE_LIBGCC
|
depends on HAVE_PRIVATE_LIBGCC
|
||||||
|
15
lib/Makefile
15
lib/Makefile
@ -88,22 +88,19 @@ obj-y += time.o
|
|||||||
obj-$(CONFIG_TRACE) += trace.o
|
obj-$(CONFIG_TRACE) += trace.o
|
||||||
obj-$(CONFIG_LIB_UUID) += uuid.o
|
obj-$(CONFIG_LIB_UUID) += uuid.o
|
||||||
obj-$(CONFIG_LIB_RAND) += rand.o
|
obj-$(CONFIG_LIB_RAND) += rand.o
|
||||||
|
obj-y += panic.o
|
||||||
|
|
||||||
ifdef CONFIG_SPL_BUILD
|
ifeq ($(CONFIG_$(SPL_TPL_)BUILD),y)
|
||||||
ifdef CONFIG_TPL_BUILD
|
|
||||||
SERIAL_SUPPORT := $(CONFIG_TPL_SERIAL_SUPPORT)
|
|
||||||
else
|
|
||||||
SERIAL_SUPPORT := $(CONFIG_SPL_SERIAL_SUPPORT)
|
|
||||||
endif
|
|
||||||
# SPL U-Boot may use full-printf, tiny-printf or none at all
|
# SPL U-Boot may use full-printf, tiny-printf or none at all
|
||||||
ifdef CONFIG_USE_TINY_PRINTF
|
ifdef CONFIG_USE_TINY_PRINTF
|
||||||
obj-$(SERIAL_SUPPORT) += tiny-printf.o panic.o strto.o
|
obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += tiny-printf.o
|
||||||
else
|
else
|
||||||
obj-$(SERIAL_SUPPORT) += vsprintf.o panic.o strto.o strmhz.o
|
obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o strmhz.o
|
||||||
endif
|
endif
|
||||||
|
obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o
|
||||||
else
|
else
|
||||||
# Main U-Boot always uses the full printf support
|
# Main U-Boot always uses the full printf support
|
||||||
obj-y += vsprintf.o panic.o strto.o strmhz.o
|
obj-y += vsprintf.o strto.o strmhz.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2
|
subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2
|
||||||
|
Loading…
Reference in New Issue
Block a user