arm-trusted-firmware/plat/amlogic/axg/platform.mk
Chris Kay 7c4e1eea61 build: unify verbosity handling
This change introduces a few helper variables for dealing with verbose
and silent build modes: `silent`, `verbose`, `q` and `s`.

The `silent` and `verbose` variables are boolean values determining
whether the build system has been configured to run silently or
verbosely respectively (i.e. with `--silent` or `V=1`).

These two modes cannot be used together - if `silent` is truthy then
`verbose` is always falsy. As such:

    make --silent V=1

... results in a silent build.

In addition to these boolean variables, we also introduce two new
variables - `s` and `q` - for use in rule recipes to conditionally
suppress the output of commands.

When building silently, `s` expands to a value which disables the
command that follows, and `q` expands to a value which supppresses
echoing of the command:

    $(s)echo 'This command is neither echoed nor executed'
    $(q)echo 'This command is executed but not echoed'

When building verbosely, `s` expands to a value which disables the
command that follows, and `q` expands to nothing:

    $(s)echo 'This command is neither echoed nor executed'
    $(q)echo 'This command is executed and echoed'

In all other cases, both `s` and `q` expand to a value which suppresses
echoing of the command that follows:

    $(s)echo 'This command is executed but not echoed'
    $(q)echo 'This command is executed but not echoed'

The `s` variable is predominantly useful for `echo` commands, where you
always want to suppress echoing of the command itself, whilst `q` is
more useful for all other commands.

Change-Id: I8d8ff6ed714d3cb401946c52955887ed7dca602b
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-14 15:54:48 +00:00

94 lines
2.4 KiB
Makefile

#
# Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
include lib/xlat_tables_v2/xlat_tables.mk
AML_PLAT := plat/amlogic
AML_PLAT_SOC := ${AML_PLAT}/${PLAT}
AML_PLAT_COMMON := ${AML_PLAT}/common
DOIMAGEPATH ?= tools/amlogic
DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
PLAT_INCLUDES := -Iinclude/drivers/amlogic/ \
-I${AML_PLAT_SOC}/include \
-I${AML_PLAT_COMMON}/include
GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v2/gicv2_main.c \
drivers/arm/gic/v2/gicv2_helpers.c \
plat/common/plat_gicv2.c
BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
plat/common/plat_psci_common.c \
drivers/amlogic/console/aarch64/meson_console.S \
${AML_PLAT_SOC}/${PLAT}_bl31_setup.c \
${AML_PLAT_SOC}/${PLAT}_pm.c \
${AML_PLAT_SOC}/${PLAT}_common.c \
${AML_PLAT_COMMON}/aarch64/aml_helpers.S \
${AML_PLAT_COMMON}/aml_efuse.c \
${AML_PLAT_COMMON}/aml_mhu.c \
${AML_PLAT_COMMON}/aml_scpi.c \
${AML_PLAT_COMMON}/aml_sip_svc.c \
${AML_PLAT_COMMON}/aml_thermal.c \
${AML_PLAT_COMMON}/aml_topology.c \
${AML_PLAT_COMMON}/aml_console.c \
drivers/amlogic/crypto/sha_dma.c \
${XLAT_TABLES_LIB_SRCS} \
${GIC_SOURCES}
# Tune compiler for Cortex-A53
ifeq ($($(ARCH)-cc-id),arm-clang)
TF_CFLAGS_aarch64 += -mcpu=cortex-a53
else ifneq ($(filter %-clang,$($(ARCH)-cc-id)),)
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
AML_USE_ATOS := 0
$(eval $(call assert_boolean,AML_USE_ATOS))
$(eval $(call add_define,AML_USE_ATOS))
# Verify build config
# -------------------
ifneq (${RESET_TO_BL31}, 0)
$(error Error: ${PLAT} needs RESET_TO_BL31=0)
endif
ifeq (${ARCH},aarch32)
$(error Error: AArch32 not supported on ${PLAT})
endif
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