blob: 28fcda8b0c9c57afd2f81026e1c40d117fdfb5bf [file] [log] [blame]
Andre Przywara6d471e12019-07-09 11:25:57 +01001#
2# Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7include lib/libfdt/libfdt.mk
8include lib/xlat_tables_v2/xlat_tables.mk
9
10PLAT_INCLUDES := -Iplat/rpi/common/include \
11 -Iplat/rpi/rpi4/include
12
13PLAT_BL_COMMON_SOURCES := drivers/ti/uart/aarch64/16550_console.S \
Andre Przywara9ba6bb02020-03-10 12:34:56 +000014 drivers/arm/pl011/aarch64/pl011_console.S \
Andre Przywara6d471e12019-07-09 11:25:57 +010015 plat/rpi/common/rpi3_common.c \
16 ${XLAT_TABLES_LIB_SRCS}
17
18BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
19 plat/rpi/rpi4/aarch64/plat_helpers.S \
Andre Przywara2d8e99a2019-07-10 18:09:18 +010020 plat/rpi/rpi4/aarch64/armstub8_header.S \
Andre Przywara6d471e12019-07-09 11:25:57 +010021 drivers/arm/gic/common/gic_common.c \
22 drivers/arm/gic/v2/gicv2_helpers.c \
23 drivers/arm/gic/v2/gicv2_main.c \
24 plat/common/plat_gicv2.c \
25 plat/rpi/rpi4/rpi4_bl31_setup.c \
26 plat/rpi/common/rpi3_pm.c \
27 plat/common/plat_psci_common.c \
28 plat/rpi/common/rpi3_topology.c \
Andre Przywara88c9e1d2019-07-11 01:45:39 +010029 common/fdt_fixup.c \
Andre Przywara6d471e12019-07-09 11:25:57 +010030 ${LIBFDT_SRCS}
31
32# For now we only support BL31, using the kernel loaded by the GPU firmware.
33RESET_TO_BL31 := 1
34
35# All CPUs enter armstub8.bin.
36COLD_BOOT_SINGLE_CPU := 0
37
38# Tune compiler for Cortex-A72
39ifeq ($(notdir $(CC)),armclang)
40 TF_CFLAGS_aarch64 += -mcpu=cortex-a72
41else ifneq ($(findstring clang,$(notdir $(CC))),)
42 TF_CFLAGS_aarch64 += -mcpu=cortex-a72
43else
44 TF_CFLAGS_aarch64 += -mtune=cortex-a72
45endif
46
Andre Przywara2d8e99a2019-07-10 18:09:18 +010047# Add support for platform supplied linker script for BL31 build
48$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
Andre Przywara6d471e12019-07-09 11:25:57 +010049
50# Enable all errata workarounds for Cortex-A72
51ERRATA_A72_859971 := 1
52
53WORKAROUND_CVE_2017_5715 := 1
54
55# Add new default target when compiling this platform
56all: bl31
57
58# Build config flags
59# ------------------
60
61# Disable stack protector by default
62ENABLE_STACK_PROTECTOR := 0
63
64# Have different sections for code and rodata
65SEPARATE_CODE_AND_RODATA := 1
66
67# Use Coherent memory
68USE_COHERENT_MEM := 1
69
70# Platform build flags
71# --------------------
72
Andre Przywaraaa89ae42019-07-11 01:42:12 +010073# There is not much else than a Linux kernel to load at the moment.
74RPI3_DIRECT_LINUX_BOOT := 1
Andre Przywara6d471e12019-07-09 11:25:57 +010075
76# BL33 images are in AArch64 by default
77RPI3_BL33_IN_AARCH32 := 0
78
79# UART to use at runtime. -1 means the runtime UART is disabled.
80# Any other value means the default UART will be used.
81RPI3_RUNTIME_UART := 0
82
83# Use normal memory mapping for ROM, FIP, SRAM and DRAM
84RPI3_USE_UEFI_MAP := 0
85
86# Process platform flags
87# ----------------------
88
89$(eval $(call add_define,RPI3_BL33_IN_AARCH32))
90$(eval $(call add_define,RPI3_DIRECT_LINUX_BOOT))
91ifdef RPI3_PRELOADED_DTB_BASE
92$(eval $(call add_define,RPI3_PRELOADED_DTB_BASE))
93endif
94$(eval $(call add_define,RPI3_RUNTIME_UART))
95$(eval $(call add_define,RPI3_USE_UEFI_MAP))
96
Andre Przywara6d471e12019-07-09 11:25:57 +010097ifeq (${ARCH},aarch32)
98 $(error Error: AArch32 not supported on rpi4)
99endif
100
101ifneq ($(ENABLE_STACK_PROTECTOR), 0)
102PLAT_BL_COMMON_SOURCES += drivers/rpi3/rng/rpi3_rng.c \
103 plat/rpi/common/rpi3_stack_protector.c
104endif