Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 1 | # |
Carlo Caione | 189494a | 2019-08-23 18:28:36 +0100 | [diff] [blame] | 2 | # Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | include lib/xlat_tables_v2/xlat_tables.mk |
| 8 | |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 9 | AML_PLAT := plat/amlogic |
| 10 | AML_PLAT_SOC := ${AML_PLAT}/${PLAT} |
Carlo Caione | d6e5afb | 2019-08-23 20:02:32 +0100 | [diff] [blame] | 11 | AML_PLAT_COMMON := ${AML_PLAT}/common |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 12 | |
Carlo Caione | 189494a | 2019-08-23 18:28:36 +0100 | [diff] [blame] | 13 | DOIMAGEPATH ?= tools/amlogic |
Remi Pommarel | 21d2e3e | 2019-03-30 15:58:45 +0100 | [diff] [blame] | 14 | DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage |
| 15 | |
Carlo Caione | 189494a | 2019-08-23 18:28:36 +0100 | [diff] [blame] | 16 | PLAT_INCLUDES := -Iinclude/drivers/amlogic/ \ |
Carlo Caione | 4948832 | 2019-08-24 17:28:23 +0100 | [diff] [blame] | 17 | -I${AML_PLAT_SOC}/include \ |
| 18 | -I${AML_PLAT_COMMON}/include |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 19 | |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 20 | GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 21 | drivers/arm/gic/v2/gicv2_main.c \ |
| 22 | drivers/arm/gic/v2/gicv2_helpers.c \ |
| 23 | plat/common/plat_gicv2.c |
| 24 | |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 25 | PLAT_BL_COMMON_SOURCES := drivers/amlogic/console/aarch64/meson_console.S \ |
| 26 | ${AML_PLAT_SOC}/gxl_common.c \ |
Carlo Caione | 6415f6e | 2019-08-24 17:50:16 +0100 | [diff] [blame^] | 27 | ${AML_PLAT_COMMON}/aml_topology.c \ |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 28 | ${XLAT_TABLES_LIB_SRCS} |
| 29 | |
| 30 | BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \ |
| 31 | plat/common/plat_psci_common.c \ |
Carlo Caione | d6e5afb | 2019-08-23 20:02:32 +0100 | [diff] [blame] | 32 | ${AML_PLAT_COMMON}/aarch64/aml_helpers.S \ |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 33 | ${AML_PLAT_SOC}/gxl_bl31_setup.c \ |
Carlo Caione | 0030679 | 2019-08-24 17:43:33 +0100 | [diff] [blame] | 34 | ${AML_PLAT_COMMON}/aml_efuse.c \ |
Carlo Caione | e6ae8e7 | 2019-08-24 17:46:04 +0100 | [diff] [blame] | 35 | ${AML_PLAT_COMMON}/aml_mhu.c \ |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 36 | ${AML_PLAT_SOC}/gxl_pm.c \ |
Carlo Caione | 4948832 | 2019-08-24 17:28:23 +0100 | [diff] [blame] | 37 | ${AML_PLAT_COMMON}/aml_scpi.c \ |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 38 | ${AML_PLAT_SOC}/gxl_sip_svc.c \ |
Carlo Caione | 52d4dc2 | 2019-08-24 17:48:11 +0100 | [diff] [blame] | 39 | ${AML_PLAT_COMMON}/aml_thermal.c \ |
Carlo Caione | 23a9ad2 | 2019-08-24 17:17:30 +0100 | [diff] [blame] | 40 | drivers/amlogic/crypto/sha_dma.c \ |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 41 | ${GIC_SOURCES} |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 42 | |
| 43 | # Tune compiler for Cortex-A53 |
| 44 | ifeq ($(notdir $(CC)),armclang) |
| 45 | TF_CFLAGS_aarch64 += -mcpu=cortex-a53 |
| 46 | else ifneq ($(findstring clang,$(notdir $(CC))),) |
| 47 | TF_CFLAGS_aarch64 += -mcpu=cortex-a53 |
| 48 | else |
| 49 | TF_CFLAGS_aarch64 += -mtune=cortex-a53 |
| 50 | endif |
| 51 | |
| 52 | # Build config flags |
| 53 | # ------------------ |
| 54 | |
| 55 | # Enable all errata workarounds for Cortex-A53 |
| 56 | ERRATA_A53_855873 := 1 |
| 57 | ERRATA_A53_819472 := 1 |
| 58 | ERRATA_A53_824069 := 1 |
| 59 | ERRATA_A53_827319 := 1 |
| 60 | |
| 61 | WORKAROUND_CVE_2017_5715 := 0 |
| 62 | |
| 63 | # Have different sections for code and rodata |
| 64 | SEPARATE_CODE_AND_RODATA := 1 |
| 65 | |
| 66 | # Use Coherent memory |
| 67 | USE_COHERENT_MEM := 1 |
| 68 | |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 69 | # Verify build config |
| 70 | # ------------------- |
| 71 | |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 72 | ifneq (${RESET_TO_BL31}, 0) |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 73 | $(error Error: ${PLAT} needs RESET_TO_BL31=0) |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 74 | endif |
| 75 | |
| 76 | ifeq (${ARCH},aarch32) |
Carlo Caione | 50e8a27 | 2019-08-23 19:34:44 +0100 | [diff] [blame] | 77 | $(error Error: AArch32 not supported on ${PLAT}) |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 78 | endif |
Remi Pommarel | 21d2e3e | 2019-03-30 15:58:45 +0100 | [diff] [blame] | 79 | |
| 80 | all: ${BUILD_PLAT}/bl31.img |
| 81 | distclean realclean clean: cleanimage |
| 82 | |
| 83 | cleanimage: |
| 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 | |