blob: ea4aead72e6fc9ea590977da9badc3f5ad04616c [file] [log] [blame]
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +00001#
2# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7include lib/xlat_tables_v2/xlat_tables.mk
8
Remi Pommarel21d2e3e2019-03-30 15:58:45 +01009DOIMAGEPATH ?= tools/meson
10DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
11
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000012PLAT_INCLUDES := -Iinclude/drivers/meson/ \
Remi Pommarel199d6e32019-03-28 23:34:18 +010013 -Iinclude/drivers/meson/gxl \
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000014 -Iplat/meson/gxl/include
15
16GXBB_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
17 drivers/arm/gic/v2/gicv2_main.c \
18 drivers/arm/gic/v2/gicv2_helpers.c \
19 plat/common/plat_gicv2.c
20
21PLAT_BL_COMMON_SOURCES := drivers/meson/console/aarch64/meson_console.S \
22 plat/meson/gxl/gxl_common.c \
23 plat/meson/gxl/gxl_topology.c \
24 ${XLAT_TABLES_LIB_SRCS}
25
26BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
27 plat/common/plat_psci_common.c \
28 plat/meson/gxl/aarch64/gxl_helpers.S \
Remi Pommarel199d6e32019-03-28 23:34:18 +010029 plat/meson/gxl/gxl_bl31_setup.c \
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000030 plat/meson/gxl/gxl_efuse.c \
31 plat/meson/gxl/gxl_mhu.c \
Remi Pommarel199d6e32019-03-28 23:34:18 +010032 plat/meson/gxl/gxl_pm.c \
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000033 plat/meson/gxl/gxl_scpi.c \
34 plat/meson/gxl/gxl_sip_svc.c \
35 plat/meson/gxl/gxl_thermal.c \
Remi Pommarel199d6e32019-03-28 23:34:18 +010036 drivers/meson/gxl/crypto/sha_dma.c \
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000037 ${GXBB_GIC_SOURCES}
38
39# Tune compiler for Cortex-A53
40ifeq ($(notdir $(CC)),armclang)
41 TF_CFLAGS_aarch64 += -mcpu=cortex-a53
42else ifneq ($(findstring clang,$(notdir $(CC))),)
43 TF_CFLAGS_aarch64 += -mcpu=cortex-a53
44else
45 TF_CFLAGS_aarch64 += -mtune=cortex-a53
46endif
47
48# Build config flags
49# ------------------
50
51# Enable all errata workarounds for Cortex-A53
52ERRATA_A53_855873 := 1
53ERRATA_A53_819472 := 1
54ERRATA_A53_824069 := 1
55ERRATA_A53_827319 := 1
56
57WORKAROUND_CVE_2017_5715 := 0
58
59# Have different sections for code and rodata
60SEPARATE_CODE_AND_RODATA := 1
61
62# Use Coherent memory
63USE_COHERENT_MEM := 1
64
65# Use multi console API
66MULTI_CONSOLE_API := 1
67
68# Verify build config
69# -------------------
70
71ifneq (${MULTI_CONSOLE_API}, 1)
72 $(error Error: gxl needs MULTI_CONSOLE_API=1)
73endif
74
75ifneq (${RESET_TO_BL31}, 0)
76 $(error Error: gxl needs RESET_TO_BL31=0)
77endif
78
79ifeq (${ARCH},aarch32)
80 $(error Error: AArch32 not supported on gxl)
81endif
Remi Pommarel21d2e3e2019-03-30 15:58:45 +010082
83all: ${BUILD_PLAT}/bl31.img
84distclean realclean clean: cleanimage
85
86cleanimage:
87 ${Q}${MAKE} -C ${DOIMAGEPATH} clean
88
89${DOIMAGETOOL}:
90 ${Q}${MAKE} -C ${DOIMAGEPATH}
91
92${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL}
93 ${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img
94