blob: e201ceed0343d00fe728eb28c6ce2d7233b46509 [file] [log] [blame]
Antonio Nino Diazae6779e2017-11-06 14:49:04 +00001#
2# Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7PLAT_INCLUDES := -Iinclude/common/tbbr \
8 -Iinclude/plat/arm/common/ \
9 -Iinclude/plat/arm/common/aarch64/ \
10 -Iplat/rpi3/include
11
12PLAT_BL_COMMON_SOURCES := drivers/console/aarch64/console.S \
13 drivers/ti/uart/aarch64/16550_console.S \
14 plat/rpi3/rpi3_common.c
15
16BL1_SOURCES += drivers/io/io_fip.c \
17 drivers/io/io_memmap.c \
18 drivers/io/io_storage.c \
19 lib/cpus/aarch64/cortex_a53.S \
20 plat/common/aarch64/platform_mp_stack.S \
21 plat/rpi3/aarch64/plat_helpers.S \
22 plat/rpi3/rpi3_bl1_setup.c \
23 plat/rpi3/rpi3_io_storage.c
24
25BL2_SOURCES += common/desc_image_load.c \
26 drivers/io/io_fip.c \
27 drivers/io/io_memmap.c \
28 drivers/io/io_storage.c \
29 plat/common/aarch64/platform_mp_stack.S \
30 plat/rpi3/aarch64/plat_helpers.S \
31 plat/rpi3/aarch64/rpi3_bl2_mem_params_desc.c \
32 plat/rpi3/rpi3_bl2_setup.c \
33 plat/rpi3/rpi3_image_load.c \
34 plat/rpi3/rpi3_io_storage.c
35
36BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
37 plat/common/aarch64/plat_psci_common.c \
38 plat/rpi3/aarch64/plat_helpers.S \
39 plat/rpi3/rpi3_bl31_setup.c \
40 plat/rpi3/rpi3_pm.c \
41 plat/rpi3/rpi3_topology.c
42
43# Translation tables library
44include lib/xlat_tables_v2/xlat_tables.mk
45
46PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS}
47
48# Tune compiler for Cortex-A53
49ifeq ($(notdir $(CC)),armclang)
50 TF_CFLAGS_aarch64 += -mcpu=cortex-a53
51else ifneq ($(findstring clang,$(notdir $(CC))),)
52 TF_CFLAGS_aarch64 += -mcpu=cortex-a53
53else
54 TF_CFLAGS_aarch64 += -mtune=cortex-a53
55endif
56
57# Build config flags
58# ------------------
59
60# Enable all errata workarounds for Cortex-A53
61ERRATA_A53_826319 := 1
62ERRATA_A53_835769 := 1
63ERRATA_A53_836870 := 1
64ERRATA_A53_843419 := 1
65ERRATA_A53_855873 := 1
66
Dimitris Papastamos8e5bd5e2018-01-24 16:41:14 +000067WORKAROUND_CVE_2017_5715 := 0
68
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000069# Disable the PSCI platform compatibility layer by default
70ENABLE_PLAT_COMPAT := 0
71
72# Enable reset to BL31 by default
73RESET_TO_BL31 := 1
74
75# Have different sections for code and rodata
76SEPARATE_CODE_AND_RODATA := 1
77
78# Use Coherent memory
79USE_COHERENT_MEM := 1
80
81# Enable new version of image loading
82LOAD_IMAGE_V2 := 1
83
84# Platform build flags
85# --------------------
86
87# BL33 images are in AArch64 by default
88RPI3_BL33_IN_AARCH32 := 0
89
90# BL32 location
91RPI3_BL32_RAM_LOCATION := tdram
92ifeq (${RPI3_BL32_RAM_LOCATION}, tsram)
93 RPI3_BL32_RAM_LOCATION_ID = SEC_SRAM_ID
94else ifeq (${RPI3_BL32_RAM_LOCATION}, tdram)
95 RPI3_BL32_RAM_LOCATION_ID = SEC_DRAM_ID
96else
97 $(error "Unsupported RPI3_BL32_RAM_LOCATION value")
98endif
99
100# Process platform flags
101# ----------------------
102
103$(eval $(call add_define,RPI3_BL32_RAM_LOCATION_ID))
104$(eval $(call add_define,RPI3_BL33_IN_AARCH32))
105
106# Verify build config
107# -------------------
108
109ifneq (${LOAD_IMAGE_V2}, 1)
110 $(error Error: rpi3 needs LOAD_IMAGE_V2=1)
111endif
112
113ifeq (${ARCH},aarch32)
114 $(error Error: AArch32 not supported on rpi3)
115endif