blob: 9cdf37ac9b0c79fd9d9d1d158482bfc0b63b95c2 [file] [log] [blame]
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +00001#
Carlo Caione189494a2019-08-23 18:28:36 +01002# Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +00003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7include lib/xlat_tables_v2/xlat_tables.mk
8
Carlo Caione189494a2019-08-23 18:28:36 +01009DOIMAGEPATH ?= tools/amlogic
Remi Pommarel21d2e3e2019-03-30 15:58:45 +010010DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
11
Carlo Caione189494a2019-08-23 18:28:36 +010012PLAT_INCLUDES := -Iinclude/drivers/amlogic/ \
13 -Iinclude/drivers/amlogic/gxl \
14 -Iplat/amlogic/gxl/include
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000015
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
Carlo Caione189494a2019-08-23 18:28:36 +010021PLAT_BL_COMMON_SOURCES := drivers/amlogic/console/aarch64/meson_console.S \
22 plat/amlogic/gxl/gxl_common.c \
23 plat/amlogic/gxl/gxl_topology.c \
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000024 ${XLAT_TABLES_LIB_SRCS}
25
26BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
27 plat/common/plat_psci_common.c \
Carlo Caione189494a2019-08-23 18:28:36 +010028 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 \
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
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000065# Verify build config
66# -------------------
67
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000068ifneq (${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
Remi Pommarel21d2e3e2019-03-30 15:58:45 +010075
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