xref: /rk3399_ARM-atf/plat/amlogic/gxbb/platform.mk (revision f29213d9e3c82f8b43e42023d5b39e097d86ff18)
1#
2# Copyright (c) 2018-2019, 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
9AML_PLAT		:=	plat/amlogic
10AML_PLAT_SOC		:=	${AML_PLAT}/${PLAT}
11AML_PLAT_COMMON		:=	${AML_PLAT}/common
12
13PLAT_INCLUDES		:=	-Iinclude/drivers/amlogic/			\
14				-I${AML_PLAT_SOC}/include			\
15				-I${AML_PLAT_COMMON}/include
16
17GIC_SOURCES		:=	drivers/arm/gic/common/gic_common.c		\
18				drivers/arm/gic/v2/gicv2_main.c			\
19				drivers/arm/gic/v2/gicv2_helpers.c		\
20				plat/common/plat_gicv2.c
21
22BL31_SOURCES		+=	lib/cpus/aarch64/cortex_a53.S			\
23				plat/common/plat_psci_common.c			\
24				drivers/amlogic/console/aarch64/meson_console.S	\
25				${AML_PLAT_SOC}/gxbb_bl31_setup.c		\
26				${AML_PLAT_SOC}/gxbb_pm.c			\
27				${AML_PLAT_SOC}/gxbb_common.c			\
28				${AML_PLAT_COMMON}/aarch64/aml_helpers.S	\
29				${AML_PLAT_COMMON}/aml_efuse.c			\
30				${AML_PLAT_COMMON}/aml_mhu.c			\
31				${AML_PLAT_COMMON}/aml_scpi.c			\
32				${AML_PLAT_COMMON}/aml_sip_svc.c		\
33				${AML_PLAT_COMMON}/aml_thermal.c		\
34				${AML_PLAT_COMMON}/aml_topology.c		\
35				${XLAT_TABLES_LIB_SRCS}				\
36				${GIC_SOURCES}
37
38# Tune compiler for Cortex-A53
39ifeq ($(notdir $(CC)),armclang)
40    TF_CFLAGS_aarch64	+=	-mcpu=cortex-a53
41else ifneq ($(findstring clang,$(notdir $(CC))),)
42    TF_CFLAGS_aarch64	+=	-mcpu=cortex-a53
43else
44    TF_CFLAGS_aarch64	+=	-mtune=cortex-a53
45endif
46
47# Build config flags
48# ------------------
49
50# Enable all errata workarounds for Cortex-A53
51ERRATA_A53_826319		:= 1
52ERRATA_A53_835769		:= 1
53ERRATA_A53_836870		:= 1
54ERRATA_A53_843419		:= 1
55ERRATA_A53_855873		:= 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# Verify build config
66# -------------------
67
68ifneq (${RESET_TO_BL31}, 0)
69  $(error Error: ${PLAT} needs RESET_TO_BL31=0)
70endif
71
72ifeq (${ARCH},aarch32)
73  $(error Error: AArch32 not supported on ${PLAT})
74endif
75