xref: /rk3399_ARM-atf/plat/nvidia/tegra/platform.mk (revision e87c823102f5d439be896d4238dd92807c9d5825)
1#
2# Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
3# Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8SOC_DIR			:=	plat/nvidia/tegra/soc/${TARGET_SOC}
9
10# dump the state on crash console
11CRASH_REPORTING		:=	1
12$(eval $(call add_define,CRASH_REPORTING))
13
14# enable assert() for release/debug builds
15ENABLE_ASSERTIONS	:=	1
16PLAT_LOG_LEVEL_ASSERT	:=	50
17$(eval $(call add_define,PLAT_LOG_LEVEL_ASSERT))
18
19# enable dynamic memory mapping
20PLAT_XLAT_TABLES_DYNAMIC :=	1
21$(eval $(call add_define,PLAT_XLAT_TABLES_DYNAMIC))
22
23# Enable exception handling at EL3
24EL3_EXCEPTION_HANDLING	:=	1
25GICV2_G0_FOR_EL3	:=	1
26
27# Enable PSCI v1.0 extended state ID format
28PSCI_EXTENDED_STATE_ID	:=	1
29
30# code and read-only data should be put on separate memory pages
31SEPARATE_CODE_AND_RODATA :=	1
32
33# do not use coherent memory
34USE_COHERENT_MEM	:=	0
35
36# do not enable SVE
37ENABLE_SVE_FOR_NS	:=	0
38
39# enable D-cache early during CPU warmboot
40WARMBOOT_ENABLE_DCACHE_EARLY := 1
41
42# remove the standard libc
43OVERRIDE_LIBC		:=	1
44
45# Flag to enable WDT FIQ interrupt handling for Tegra SoCs
46# prior to Tegra186
47ENABLE_TEGRA_WDT_LEGACY_FIQ_HANDLING	?= 0
48
49# Flag to allow relocation of BL32 image to TZDRAM during boot
50RELOCATE_BL32_IMAGE		?= 0
51
52# Enable stack protection
53ENABLE_STACK_PROTECTOR		:=	strong
54
55# Enable SDEI
56SDEI_SUPPORT			:= 1
57
58# modify BUILD_PLAT to point to SoC specific build directory
59BUILD_PLAT	:=	${BUILD_BASE}/${PLAT}/${TARGET_SOC}/${BUILD_TYPE}
60
61include plat/nvidia/tegra/common/tegra_common.mk
62include ${SOC_DIR}/platform_${TARGET_SOC}.mk
63
64$(eval $(call add_define,ENABLE_TEGRA_WDT_LEGACY_FIQ_HANDLING))
65$(eval $(call add_define,RELOCATE_BL32_IMAGE))
66
67# platform cflags (enable signed comparisons, disable stdlib)
68TF_CFLAGS	+= -nostdlib
69
70# override with necessary libc files for the Tegra platform
71override LIBC_SRCS :=	$(addprefix lib/libc/,		\
72			aarch64/setjmp.S		\
73			assert.c			\
74			memchr.c			\
75			memcmp.c			\
76			memcpy.c			\
77			memmove.c			\
78			memset.c			\
79			printf.c			\
80			putchar.c			\
81			strrchr.c			\
82			strlen.c			\
83			snprintf.c)
84
85INCLUDES	+=	-Iinclude/lib/libc		\
86			-Iinclude/lib/libc/$(ARCH)	\
87
88ifneq ($(findstring armlink,$(notdir $(LD))),)
89# o suppress warnings for section mismatches, undefined symbols
90# o use only those libraries that are specified in the input file
91#   list to resolve references
92# o create a static callgraph of functions
93# o resolve undefined symbols to el3_panic
94# o include only required sections
95TF_LDFLAGS	+= --diag_suppress=L6314,L6332 --no_scanlib --callgraph
96TF_LDFLAGS	+= --keep="*(__pubsub*)" --keep="*(rt_svc_descs*)" --keep="*(*cpu_ops)"
97ifeq (${ENABLE_PMF},1)
98TF_LDFLAGS	+= --keep="*(*pmf_svc_descs*)"
99endif
100endif
101