Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | include lib/xlat_tables_v2/xlat_tables.mk |
| 8 | |
Remi Pommarel | 21d2e3e | 2019-03-30 15:58:45 +0100 | [diff] [blame] | 9 | DOIMAGEPATH ?= tools/meson |
| 10 | DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage |
| 11 | |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 12 | PLAT_INCLUDES := -Iinclude/drivers/meson/ \ |
Remi Pommarel | 199d6e3 | 2019-03-28 23:34:18 +0100 | [diff] [blame] | 13 | -Iinclude/drivers/meson/gxl \ |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 14 | -Iplat/meson/gxl/include |
| 15 | |
| 16 | GXBB_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 | |
| 21 | PLAT_BL_COMMON_SOURCES := drivers/meson/console/aarch64/meson_console.S \ |
| 22 | plat/meson/gxl/gxl_common.c \ |
| 23 | plat/meson/gxl/gxl_topology.c \ |
| 24 | ${XLAT_TABLES_LIB_SRCS} |
| 25 | |
| 26 | BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \ |
| 27 | plat/common/plat_psci_common.c \ |
| 28 | plat/meson/gxl/aarch64/gxl_helpers.S \ |
Remi Pommarel | 199d6e3 | 2019-03-28 23:34:18 +0100 | [diff] [blame] | 29 | plat/meson/gxl/gxl_bl31_setup.c \ |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 30 | plat/meson/gxl/gxl_efuse.c \ |
| 31 | plat/meson/gxl/gxl_mhu.c \ |
Remi Pommarel | 199d6e3 | 2019-03-28 23:34:18 +0100 | [diff] [blame] | 32 | plat/meson/gxl/gxl_pm.c \ |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 33 | plat/meson/gxl/gxl_scpi.c \ |
| 34 | plat/meson/gxl/gxl_sip_svc.c \ |
| 35 | plat/meson/gxl/gxl_thermal.c \ |
Remi Pommarel | 199d6e3 | 2019-03-28 23:34:18 +0100 | [diff] [blame] | 36 | drivers/meson/gxl/crypto/sha_dma.c \ |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 37 | ${GXBB_GIC_SOURCES} |
| 38 | |
| 39 | # Tune compiler for Cortex-A53 |
| 40 | ifeq ($(notdir $(CC)),armclang) |
| 41 | TF_CFLAGS_aarch64 += -mcpu=cortex-a53 |
| 42 | else ifneq ($(findstring clang,$(notdir $(CC))),) |
| 43 | TF_CFLAGS_aarch64 += -mcpu=cortex-a53 |
| 44 | else |
| 45 | TF_CFLAGS_aarch64 += -mtune=cortex-a53 |
| 46 | endif |
| 47 | |
| 48 | # Build config flags |
| 49 | # ------------------ |
| 50 | |
| 51 | # Enable all errata workarounds for Cortex-A53 |
| 52 | ERRATA_A53_855873 := 1 |
| 53 | ERRATA_A53_819472 := 1 |
| 54 | ERRATA_A53_824069 := 1 |
| 55 | ERRATA_A53_827319 := 1 |
| 56 | |
| 57 | WORKAROUND_CVE_2017_5715 := 0 |
| 58 | |
| 59 | # Have different sections for code and rodata |
| 60 | SEPARATE_CODE_AND_RODATA := 1 |
| 61 | |
| 62 | # Use Coherent memory |
| 63 | USE_COHERENT_MEM := 1 |
| 64 | |
| 65 | # Use multi console API |
| 66 | MULTI_CONSOLE_API := 1 |
| 67 | |
| 68 | # Verify build config |
| 69 | # ------------------- |
| 70 | |
| 71 | ifneq (${MULTI_CONSOLE_API}, 1) |
| 72 | $(error Error: gxl needs MULTI_CONSOLE_API=1) |
| 73 | endif |
| 74 | |
| 75 | ifneq (${RESET_TO_BL31}, 0) |
| 76 | $(error Error: gxl needs RESET_TO_BL31=0) |
| 77 | endif |
| 78 | |
| 79 | ifeq (${ARCH},aarch32) |
| 80 | $(error Error: AArch32 not supported on gxl) |
| 81 | endif |
Remi Pommarel | 21d2e3e | 2019-03-30 15:58:45 +0100 | [diff] [blame] | 82 | |
| 83 | all: ${BUILD_PLAT}/bl31.img |
| 84 | distclean realclean clean: cleanimage |
| 85 | |
| 86 | cleanimage: |
| 87 | ${Q}${MAKE} -C ${DOIMAGEPATH} clean |
| 88 | |
| 89 | ${DOIMAGETOOL}: |
| 90 | ${Q}${MAKE} -C ${DOIMAGEPATH} |
| 91 | |
| 92 | ${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL} |
| 93 | ${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img |
| 94 | |