blob: 2e47670f019e49de8322ac40de13967c0a07d267 [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 Caione50e8a272019-08-23 19:34:44 +01009AML_PLAT := plat/amlogic
10AML_PLAT_SOC := ${AML_PLAT}/${PLAT}
Carlo Caioned6e5afb2019-08-23 20:02:32 +010011AML_PLAT_COMMON := ${AML_PLAT}/common
Carlo Caione50e8a272019-08-23 19:34:44 +010012
Carlo Caione189494a2019-08-23 18:28:36 +010013DOIMAGEPATH ?= tools/amlogic
Remi Pommarel21d2e3e2019-03-30 15:58:45 +010014DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
15
Carlo Caione7408b0c2019-08-24 18:37:46 +010016PLAT_INCLUDES := -Iinclude/drivers/amlogic/ \
17 -I${AML_PLAT_SOC}/include \
Carlo Caione49488322019-08-24 17:28:23 +010018 -I${AML_PLAT_COMMON}/include
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000019
Carlo Caione7408b0c2019-08-24 18:37:46 +010020GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
21 drivers/arm/gic/v2/gicv2_main.c \
22 drivers/arm/gic/v2/gicv2_helpers.c \
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000023 plat/common/plat_gicv2.c
24
Carlo Caione7408b0c2019-08-24 18:37:46 +010025BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
26 plat/common/plat_psci_common.c \
27 drivers/amlogic/console/aarch64/meson_console.S \
28 ${AML_PLAT_SOC}/gxl_bl31_setup.c \
29 ${AML_PLAT_SOC}/gxl_pm.c \
30 ${AML_PLAT_SOC}/gxl_common.c \
Carlo Caioned6e5afb2019-08-23 20:02:32 +010031 ${AML_PLAT_COMMON}/aarch64/aml_helpers.S \
Carlo Caione7408b0c2019-08-24 18:37:46 +010032 ${AML_PLAT_COMMON}/aml_efuse.c \
33 ${AML_PLAT_COMMON}/aml_mhu.c \
34 ${AML_PLAT_COMMON}/aml_scpi.c \
35 ${AML_PLAT_COMMON}/aml_sip_svc.c \
36 ${AML_PLAT_COMMON}/aml_thermal.c \
37 ${AML_PLAT_COMMON}/aml_topology.c \
Carlo Caione613bdb72019-09-05 12:27:39 +010038 ${AML_PLAT_COMMON}/aml_console.c \
Carlo Caione7408b0c2019-08-24 18:37:46 +010039 drivers/amlogic/crypto/sha_dma.c \
40 ${XLAT_TABLES_LIB_SRCS} \
Carlo Caione50e8a272019-08-23 19:34:44 +010041 ${GIC_SOURCES}
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000042
43# Tune compiler for Cortex-A53
44ifeq ($(notdir $(CC)),armclang)
45 TF_CFLAGS_aarch64 += -mcpu=cortex-a53
46else ifneq ($(findstring clang,$(notdir $(CC))),)
47 TF_CFLAGS_aarch64 += -mcpu=cortex-a53
48else
49 TF_CFLAGS_aarch64 += -mtune=cortex-a53
50endif
51
52# Build config flags
53# ------------------
54
55# Enable all errata workarounds for Cortex-A53
56ERRATA_A53_855873 := 1
57ERRATA_A53_819472 := 1
58ERRATA_A53_824069 := 1
59ERRATA_A53_827319 := 1
60
61WORKAROUND_CVE_2017_5715 := 0
62
63# Have different sections for code and rodata
64SEPARATE_CODE_AND_RODATA := 1
65
66# Use Coherent memory
67USE_COHERENT_MEM := 1
68
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000069# Verify build config
70# -------------------
71
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000072ifneq (${RESET_TO_BL31}, 0)
Carlo Caione50e8a272019-08-23 19:34:44 +010073 $(error Error: ${PLAT} needs RESET_TO_BL31=0)
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000074endif
75
76ifeq (${ARCH},aarch32)
Carlo Caione50e8a272019-08-23 19:34:44 +010077 $(error Error: AArch32 not supported on ${PLAT})
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000078endif
Remi Pommarel21d2e3e2019-03-30 15:58:45 +010079
80all: ${BUILD_PLAT}/bl31.img
81distclean realclean clean: cleanimage
82
83cleanimage:
84 ${Q}${MAKE} -C ${DOIMAGEPATH} clean
85
86${DOIMAGETOOL}:
87 ${Q}${MAKE} -C ${DOIMAGEPATH}
88
89${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL}
90 ${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img
91