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