Commit 985ee0b7 authored by Julius Werner's avatar Julius Werner
Browse files

drivers/console: Link console framework code by default



This patch makes the build system link the console framework code by
default, like it already does with other common libraries (e.g. cache
helpers). This should not make a difference in practice since TF is
linked with --gc-sections, so the linker will garbage collect all
functions and data that are not referenced by any other code. Thus, if a
platform doesn't want to include console code for size reasons and
doesn't make any references to console functions, the code will not be
included in the final binary.

To avoid compatibility issues with older platform ports, only make this
change for the MULTI_CONSOLE_API.

Change-Id: I153a9dbe680d57aadb860d1c829759ba701130d3
Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
parent 0f8aee4e
...@@ -214,6 +214,7 @@ include lib/libc/libc.mk ...@@ -214,6 +214,7 @@ include lib/libc/libc.mk
BL_COMMON_SOURCES += common/bl_common.c \ BL_COMMON_SOURCES += common/bl_common.c \
common/tf_log.c \ common/tf_log.c \
common/${ARCH}/debug.S \ common/${ARCH}/debug.S \
drivers/console/${ARCH}/multi_console.S \
lib/${ARCH}/cache_helpers.S \ lib/${ARCH}/cache_helpers.S \
lib/${ARCH}/misc_helpers.S \ lib/${ARCH}/misc_helpers.S \
plat/common/plat_bl_common.c \ plat/common/plat_bl_common.c \
......
...@@ -10,11 +10,13 @@ ...@@ -10,11 +10,13 @@
#include <console_macros.S> #include <console_macros.S>
#include <pl011.h> #include <pl011.h>
#if !MULTI_CONSOLE_API
/* /*
* Pull in generic functions to provide backwards compatibility for * Pull in generic functions to provide backwards compatibility for
* platform makefiles * platform makefiles
*/ */
#include "../../../console/aarch32/console.S" #include "../../../console/aarch32/console.S"
#endif
/* /*
* "core" functions are low-level implementations that don't require * "core" functions are low-level implementations that don't require
......
...@@ -10,11 +10,13 @@ ...@@ -10,11 +10,13 @@
#include <console_macros.S> #include <console_macros.S>
#include <pl011.h> #include <pl011.h>
#if !MULTI_CONSOLE_API
/* /*
* Pull in generic functions to provide backwards compatibility for * Pull in generic functions to provide backwards compatibility for
* platform makefiles * platform makefiles
*/ */
#include "../../../console/aarch64/console.S" #include "../../../console/aarch64/console.S"
#endif
/* /*
* "core" functions are low-level implementations that don't require * "core" functions are low-level implementations that don't require
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
*/ */
#if MULTI_CONSOLE_API #if MULTI_CONSOLE_API
#include "multi_console.S" #if ERROR_DEPRECATED
#error "console.S is deprecated, platforms should no longer link it explicitly"
#endif
#else #else
#include "deprecated_console.S" #include "deprecated_console.S"
#endif #endif
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#if MULTI_CONSOLE_API
#include <asm_macros.S> #include <asm_macros.S>
#include <assert_macros.S> #include <assert_macros.S>
#include <console.h> #include <console.h>
...@@ -316,3 +318,5 @@ flush_done: ...@@ -316,3 +318,5 @@ flush_done:
mov r0, r5 mov r0, r5
pop {r5-r6, pc} pop {r5-r6, pc}
endfunc console_flush endfunc console_flush
#endif /* MULTI_CONSOLE_API */
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
*/ */
#if MULTI_CONSOLE_API #if MULTI_CONSOLE_API
#include "multi_console.S" #if ERROR_DEPRECATED
#error "console.S is deprecated, platforms should no longer link it explicitly"
#endif
#else #else
#include "deprecated_console.S" #include "deprecated_console.S"
#endif #endif
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#if MULTI_CONSOLE_API
#include <asm_macros.S> #include <asm_macros.S>
#include <assert_macros.S> #include <assert_macros.S>
#include <console.h> #include <console.h>
...@@ -323,3 +325,5 @@ flush_done: ...@@ -323,3 +325,5 @@ flush_done:
ldp x30, xzr, [sp], #16 ldp x30, xzr, [sp], #16
ret ret
endfunc console_flush endfunc console_flush
#endif /* MULTI_CONSOLE_API */
...@@ -15,8 +15,7 @@ PLAT_INCLUDES := -Iinclude/plat/arm/common \ ...@@ -15,8 +15,7 @@ PLAT_INCLUDES := -Iinclude/plat/arm/common \
include lib/libfdt/libfdt.mk include lib/libfdt/libfdt.mk
PLAT_BL_COMMON_SOURCES := drivers/console/${ARCH}/console.S \ PLAT_BL_COMMON_SOURCES := drivers/ti/uart/${ARCH}/16550_console.S \
drivers/ti/uart/${ARCH}/16550_console.S \
${XLAT_TABLES_LIB_SRCS} \ ${XLAT_TABLES_LIB_SRCS} \
${AW_PLAT}/common/plat_helpers.S \ ${AW_PLAT}/common/plat_helpers.S \
${AW_PLAT}/common/sunxi_common.c ${AW_PLAT}/common/sunxi_common.c
......
...@@ -26,7 +26,6 @@ BL31_SOURCES += plat/imx/common/lpuart_console.S \ ...@@ -26,7 +26,6 @@ BL31_SOURCES += plat/imx/common/lpuart_console.S \
lib/xlat_tables/xlat_tables_common.c \ lib/xlat_tables/xlat_tables_common.c \
lib/cpus/aarch64/cortex_a53.S \ lib/cpus/aarch64/cortex_a53.S \
lib/cpus/aarch64/cortex_a72.S \ lib/cpus/aarch64/cortex_a72.S \
drivers/console/aarch64/console.S \
drivers/arm/cci/cci.c \ drivers/arm/cci/cci.c \
${IMX_GIC_SOURCES} \ ${IMX_GIC_SOURCES} \
......
...@@ -25,7 +25,6 @@ BL31_SOURCES += plat/imx/common/lpuart_console.S \ ...@@ -25,7 +25,6 @@ BL31_SOURCES += plat/imx/common/lpuart_console.S \
lib/xlat_tables/xlat_tables_common.c \ lib/xlat_tables/xlat_tables_common.c \
lib/xlat_tables/aarch64/xlat_tables.c \ lib/xlat_tables/aarch64/xlat_tables.c \
lib/cpus/aarch64/cortex_a35.S \ lib/cpus/aarch64/cortex_a35.S \
drivers/console/aarch64/console.S \
${IMX_GIC_SOURCES} \ ${IMX_GIC_SOURCES} \
include plat/imx/common/sci/sci_api.mk include plat/imx/common/sci/sci_api.mk
......
...@@ -28,8 +28,7 @@ PLAT_INCLUDES := -Iplat/layerscape/board/ls1043/include \ ...@@ -28,8 +28,7 @@ PLAT_INCLUDES := -Iplat/layerscape/board/ls1043/include \
-Iinclude/drivers/io -Iinclude/drivers/io
PLAT_BL_COMMON_SOURCES := drivers/console/aarch64/console.S \ PLAT_BL_COMMON_SOURCES := plat/layerscape/common/aarch64/ls_console.S
plat/layerscape/common/aarch64/ls_console.S
LS1043_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S LS1043_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S
......
...@@ -96,7 +96,6 @@ PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \ ...@@ -96,7 +96,6 @@ PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
$(ATF_INCLUDES) $(ATF_INCLUDES)
PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a3700_common.c \ PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a3700_common.c \
drivers/console/aarch64/console.S \
$(MARVELL_COMMON_BASE)/marvell_cci.c \ $(MARVELL_COMMON_BASE)/marvell_cci.c \
$(MARVELL_DRV_BASE)/uart/a3700_console.S $(MARVELL_DRV_BASE)/uart/a3700_console.S
......
...@@ -52,7 +52,6 @@ PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \ ...@@ -52,7 +52,6 @@ PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
$(ATF_INCLUDES) $(ATF_INCLUDES)
PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \ PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
drivers/console/aarch64/console.S \
drivers/ti/uart/aarch64/16550_console.S drivers/ti/uart/aarch64/16550_console.S
BLE_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/dram_port.c \ BLE_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/dram_port.c \
......
...@@ -14,8 +14,7 @@ GXBB_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ ...@@ -14,8 +14,7 @@ GXBB_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v2/gicv2_helpers.c \ drivers/arm/gic/v2/gicv2_helpers.c \
plat/common/plat_gicv2.c plat/common/plat_gicv2.c
PLAT_BL_COMMON_SOURCES := drivers/console/aarch64/multi_console.S \ PLAT_BL_COMMON_SOURCES := drivers/meson/console/aarch64/meson_console.S \
drivers/meson/console/aarch64/meson_console.S \
plat/meson/gxbb/gxbb_common.c \ plat/meson/gxbb/gxbb_common.c \
plat/meson/gxbb/gxbb_topology.c \ plat/meson/gxbb/gxbb_topology.c \
${XLAT_TABLES_LIB_SRCS} ${XLAT_TABLES_LIB_SRCS}
......
...@@ -34,7 +34,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/aarch64/xlat_tables.c \ ...@@ -34,7 +34,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/aarch64/xlat_tables.c \
BL31_SOURCES += ${RK_GIC_SOURCES} \ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/arm/cci/cci.c \ drivers/arm/cci/cci.c \
drivers/console/aarch64/console.S \
drivers/ti/uart/aarch64/16550_console.S \ drivers/ti/uart/aarch64/16550_console.S \
drivers/delay_timer/delay_timer.c \ drivers/delay_timer/delay_timer.c \
drivers/delay_timer/generic_delay_timer.c \ drivers/delay_timer/generic_delay_timer.c \
......
...@@ -31,7 +31,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \ ...@@ -31,7 +31,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
BL31_SOURCES += ${RK_GIC_SOURCES} \ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/arm/cci/cci.c \ drivers/arm/cci/cci.c \
drivers/console/aarch64/console.S \
drivers/ti/uart/aarch64/16550_console.S \ drivers/ti/uart/aarch64/16550_console.S \
drivers/delay_timer/delay_timer.c \ drivers/delay_timer/delay_timer.c \
drivers/delay_timer/generic_delay_timer.c \ drivers/delay_timer/generic_delay_timer.c \
......
...@@ -37,7 +37,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \ ...@@ -37,7 +37,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
BL31_SOURCES += ${RK_GIC_SOURCES} \ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/arm/cci/cci.c \ drivers/arm/cci/cci.c \
drivers/console/aarch64/console.S \
drivers/ti/uart/aarch64/16550_console.S \ drivers/ti/uart/aarch64/16550_console.S \
drivers/delay_timer/delay_timer.c \ drivers/delay_timer/delay_timer.c \
drivers/delay_timer/generic_delay_timer.c \ drivers/delay_timer/generic_delay_timer.c \
......
...@@ -10,8 +10,7 @@ include lib/xlat_tables_v2/xlat_tables.mk ...@@ -10,8 +10,7 @@ include lib/xlat_tables_v2/xlat_tables.mk
PLAT_INCLUDES := -Iinclude/common/tbbr \ PLAT_INCLUDES := -Iinclude/common/tbbr \
-Iplat/rpi3/include -Iplat/rpi3/include
PLAT_BL_COMMON_SOURCES := drivers/console/aarch64/console.S \ PLAT_BL_COMMON_SOURCES := drivers/ti/uart/aarch64/16550_console.S \
drivers/ti/uart/aarch64/16550_console.S \
plat/rpi3/rpi3_common.c \ plat/rpi3/rpi3_common.c \
${XLAT_TABLES_LIB_SRCS} ${XLAT_TABLES_LIB_SRCS}
......
...@@ -35,8 +35,7 @@ include lib/libfdt/libfdt.mk ...@@ -35,8 +35,7 @@ include lib/libfdt/libfdt.mk
PLAT_BL_COMMON_SOURCES := plat/st/stm32mp1/stm32mp1_common.c PLAT_BL_COMMON_SOURCES := plat/st/stm32mp1/stm32mp1_common.c
PLAT_BL_COMMON_SOURCES += drivers/console/aarch32/console.S \ PLAT_BL_COMMON_SOURCES += drivers/st/uart/aarch32/stm32_console.S
drivers/st/uart/aarch32/stm32_console.S
ifneq (${ENABLE_STACK_PROTECTOR},0) ifneq (${ENABLE_STACK_PROTECTOR},0)
PLAT_BL_COMMON_SOURCES += plat/st/stm32mp1/stm32mp1_stack_protector.c PLAT_BL_COMMON_SOURCES += plat/st/stm32mp1/stm32mp1_stack_protector.c
......
...@@ -39,7 +39,6 @@ PLAT_INCLUDES += \ ...@@ -39,7 +39,6 @@ PLAT_INCLUDES += \
-I${PLAT_PATH}/common/drivers/ti_sci \ -I${PLAT_PATH}/common/drivers/ti_sci \
K3_CONSOLE_SOURCES += \ K3_CONSOLE_SOURCES += \
drivers/console/aarch64/console.S \
drivers/ti/uart/aarch64/16550_console.S \ drivers/ti/uart/aarch64/16550_console.S \
${PLAT_PATH}/common/k3_console.c \ ${PLAT_PATH}/common/k3_console.c \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment