platform.mk 2.29 KB
Newer Older
1
#
2
# Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
3
4
5
6
7
8
#
# SPDX-License-Identifier: BSD-3-Clause
#

include lib/xlat_tables_v2/xlat_tables.mk

9
10
AML_PLAT		:=	plat/amlogic
AML_PLAT_SOC		:=	${AML_PLAT}/${PLAT}
11
AML_PLAT_COMMON		:=	${AML_PLAT}/common
12

13
DOIMAGEPATH		?=	tools/amlogic
14
15
DOIMAGETOOL		?=	${DOIMAGEPATH}/doimage

16
PLAT_INCLUDES		:=	-Iinclude/drivers/amlogic/		\
17
18
				-I${AML_PLAT_SOC}/include		\
				-I${AML_PLAT_COMMON}/include
19

20
GIC_SOURCES		:=	drivers/arm/gic/common/gic_common.c	\
21
22
23
24
				drivers/arm/gic/v2/gicv2_main.c		\
				drivers/arm/gic/v2/gicv2_helpers.c	\
				plat/common/plat_gicv2.c

25
26
27
PLAT_BL_COMMON_SOURCES	:=	drivers/amlogic/console/aarch64/meson_console.S	\
				${AML_PLAT_SOC}/gxl_common.c		\
				${AML_PLAT_SOC}/gxl_topology.c		\
28
29
30
31
				${XLAT_TABLES_LIB_SRCS}

BL31_SOURCES		+=	lib/cpus/aarch64/cortex_a53.S		\
				plat/common/plat_psci_common.c		\
32
				${AML_PLAT_COMMON}/aarch64/aml_helpers.S	\
33
				${AML_PLAT_SOC}/gxl_bl31_setup.c	\
34
				${AML_PLAT_COMMON}/aml_efuse.c		\
35
				${AML_PLAT_COMMON}/aml_mhu.c		\
36
				${AML_PLAT_SOC}/gxl_pm.c		\
37
				${AML_PLAT_COMMON}/aml_scpi.c		\
38
39
				${AML_PLAT_SOC}/gxl_sip_svc.c		\
				${AML_PLAT_SOC}/gxl_thermal.c		\
40
				drivers/amlogic/crypto/sha_dma.c	\
41
				${GIC_SOURCES}
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

# Tune compiler for Cortex-A53
ifeq ($(notdir $(CC)),armclang)
    TF_CFLAGS_aarch64	+=	-mcpu=cortex-a53
else ifneq ($(findstring clang,$(notdir $(CC))),)
    TF_CFLAGS_aarch64	+=	-mcpu=cortex-a53
else
    TF_CFLAGS_aarch64	+=	-mtune=cortex-a53
endif

# Build config flags
# ------------------

# Enable all errata workarounds for Cortex-A53
ERRATA_A53_855873		:= 1
ERRATA_A53_819472		:= 1
ERRATA_A53_824069		:= 1
ERRATA_A53_827319		:= 1

WORKAROUND_CVE_2017_5715	:= 0

# Have different sections for code and rodata
SEPARATE_CODE_AND_RODATA	:= 1

# Use Coherent memory
USE_COHERENT_MEM		:= 1

# Verify build config
# -------------------

ifneq (${RESET_TO_BL31}, 0)
73
  $(error Error: ${PLAT} needs RESET_TO_BL31=0)
74
75
76
endif

ifeq (${ARCH},aarch32)
77
  $(error Error: AArch32 not supported on ${PLAT})
78
endif
79
80
81
82
83
84
85
86
87
88
89
90
91

all: ${BUILD_PLAT}/bl31.img
distclean realclean clean: cleanimage

cleanimage:
	${Q}${MAKE} -C ${DOIMAGEPATH} clean

${DOIMAGETOOL}:
	${Q}${MAKE} -C ${DOIMAGEPATH}

${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL}
	${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img