xref: /rk3399_ARM-atf/plat/amlogic/gxl/platform.mk (revision 4a079c752beef8c2e8072b55a267d4b597b1e05b)
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
9DOIMAGEPATH		?=	tools/amlogic
10DOIMAGETOOL		?=	${DOIMAGEPATH}/doimage
11
12PLAT_INCLUDES		:=	-Iinclude/drivers/amlogic/		\
13				-Iinclude/drivers/amlogic/gxl		\
14				-Iplat/amlogic/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/amlogic/console/aarch64/meson_console.S \
22				plat/amlogic/gxl/gxl_common.c		\
23				plat/amlogic/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/amlogic/gxl/aarch64/gxl_helpers.S	\
29				plat/amlogic/gxl/gxl_bl31_setup.c		\
30				plat/amlogic/gxl/gxl_efuse.c		\
31				plat/amlogic/gxl/gxl_mhu.c		\
32				plat/amlogic/gxl/gxl_pm.c			\
33				plat/amlogic/gxl/gxl_scpi.c		\
34				plat/amlogic/gxl/gxl_sip_svc.c		\
35				plat/amlogic/gxl/gxl_thermal.c		\
36				drivers/amlogic/gxl/crypto/sha_dma.c	\
37				${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# Verify build config
66# -------------------
67
68ifneq (${RESET_TO_BL31}, 0)
69  $(error Error: gxl needs RESET_TO_BL31=0)
70endif
71
72ifeq (${ARCH},aarch32)
73  $(error Error: AArch32 not supported on gxl)
74endif
75
76all: ${BUILD_PLAT}/bl31.img
77distclean realclean clean: cleanimage
78
79cleanimage:
80	${Q}${MAKE} -C ${DOIMAGEPATH} clean
81
82${DOIMAGETOOL}:
83	${Q}${MAKE} -C ${DOIMAGEPATH}
84
85${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL}
86	${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img
87
88