AArch32: Enable build at top level Makefile for FVP

This patch enables the AArch32 build including SP_MIN in the
top level Makefile. The build flag `ARCH` now can specify either
`aarch64`(default) or `aarch32`. Currently only FVP AEM model is
supported for AArch32 build. Another new build flag `AARCH32_SP`
is introduced to specify the AArch32 secure payload to be built.

Change-Id: Ie1198cb9e52d7da1b79b93243338fc3868b08faa
This commit is contained in:
Soby Mathew 2016-05-05 14:33:33 +01:00
parent 181bbd41fb
commit 9d29c227b2
2 changed files with 61 additions and 15 deletions

View File

@ -45,7 +45,7 @@ include ${MAKE_HELPERS_DIRECTORY}build_env.mk
# Default values for build configurations # Default values for build configurations
################################################################################ ################################################################################
# The Target build architecture. # The Target build architecture. Supported values are: aarch64, aarch32.
ARCH := aarch64 ARCH := aarch64
# Build verbosity # Build verbosity
V := 0 V := 0
@ -56,6 +56,8 @@ DEFAULT_PLAT := fvp
PLAT := ${DEFAULT_PLAT} PLAT := ${DEFAULT_PLAT}
# SPD choice # SPD choice
SPD := none SPD := none
# The AArch32 Secure Payload to be built as BL32 image
AARCH32_SP := none
# Base commit to perform code check on # Base commit to perform code check on
BASE_COMMIT := origin/master BASE_COMMIT := origin/master
# NS timer register save and restore # NS timer register save and restore
@ -200,14 +202,20 @@ OD := ${CROSS_COMPILE}objdump
NM := ${CROSS_COMPILE}nm NM := ${CROSS_COMPILE}nm
PP := ${CROSS_COMPILE}gcc -E PP := ${CROSS_COMPILE}gcc -E
ASFLAGS_aarch64 = -mgeneral-regs-only
TF_CFLAGS_aarch64 = -mgeneral-regs-only -mstrict-align
ASFLAGS_aarch32 = -march=armv8-a
TF_CFLAGS_aarch32 = -march=armv8-a
ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \
-Werror -Wmissing-include-dirs \ -Werror -Wmissing-include-dirs \
-mgeneral-regs-only -D__ASSEMBLY__ \ -D__ASSEMBLY__ $(ASFLAGS_$(ARCH)) \
${DEFINES} ${INCLUDES} ${DEFINES} ${INCLUDES}
TF_CFLAGS += -nostdinc -ffreestanding -Wall \ TF_CFLAGS += -nostdinc -ffreestanding -Wall \
-Werror -Wmissing-include-dirs \ -Werror -Wmissing-include-dirs \
-mgeneral-regs-only -mstrict-align \
-std=c99 -c -Os \ -std=c99 -c -Os \
$(TF_CFLAGS_$(ARCH)) \
${DEFINES} ${INCLUDES} ${DEFINES} ${INCLUDES}
TF_CFLAGS += -ffunction-sections -fdata-sections TF_CFLAGS += -ffunction-sections -fdata-sections
@ -222,26 +230,26 @@ include lib/stdlib/stdlib.mk
BL_COMMON_SOURCES += common/bl_common.c \ BL_COMMON_SOURCES += common/bl_common.c \
common/tf_printf.c \ common/tf_printf.c \
common/aarch64/debug.S \ common/${ARCH}/debug.S \
lib/aarch64/cache_helpers.S \ lib/${ARCH}/cache_helpers.S \
lib/aarch64/misc_helpers.S \ lib/${ARCH}/misc_helpers.S \
plat/common/aarch64/platform_helpers.S \ plat/common/${ARCH}/platform_helpers.S \
${STDLIB_SRCS} ${STDLIB_SRCS}
INCLUDES += -Iinclude/bl1 \ INCLUDES += -Iinclude/bl1 \
-Iinclude/bl31 \ -Iinclude/bl31 \
-Iinclude/common \ -Iinclude/common \
-Iinclude/common/aarch64 \ -Iinclude/common/${ARCH} \
-Iinclude/drivers \ -Iinclude/drivers \
-Iinclude/drivers/arm \ -Iinclude/drivers/arm \
-Iinclude/drivers/auth \ -Iinclude/drivers/auth \
-Iinclude/drivers/io \ -Iinclude/drivers/io \
-Iinclude/drivers/ti/uart \ -Iinclude/drivers/ti/uart \
-Iinclude/lib \ -Iinclude/lib \
-Iinclude/lib/aarch64 \ -Iinclude/lib/${ARCH} \
-Iinclude/lib/cpus/aarch64 \ -Iinclude/lib/cpus/${ARCH} \
-Iinclude/lib/el3_runtime \ -Iinclude/lib/el3_runtime \
-Iinclude/lib/el3_runtime/aarch64 \ -Iinclude/lib/el3_runtime/${ARCH} \
-Iinclude/lib/psci \ -Iinclude/lib/psci \
-Iinclude/plat/common \ -Iinclude/plat/common \
-Iinclude/services \ -Iinclude/services \
@ -269,6 +277,9 @@ INCLUDE_TBBR_MK := 1
################################################################################ ################################################################################
ifneq (${SPD},none) ifneq (${SPD},none)
ifeq (${ARCH},aarch32)
$(error "Error: SPD is incompatible with AArch32.")
endif
ifdef EL3_PAYLOAD_BASE ifdef EL3_PAYLOAD_BASE
$(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.") $(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.")
$(warning "The SPD and its BL32 companion will be present but ignored.") $(warning "The SPD and its BL32 companion will be present but ignored.")
@ -301,6 +312,8 @@ endif
include ${PLAT_MAKEFILE_FULL} include ${PLAT_MAKEFILE_FULL}
# Platform compatibility is not supported in AArch32
ifneq (${ARCH},aarch32)
# If the platform has not defined ENABLE_PLAT_COMPAT, then enable it by default # If the platform has not defined ENABLE_PLAT_COMPAT, then enable it by default
ifndef ENABLE_PLAT_COMPAT ifndef ENABLE_PLAT_COMPAT
ENABLE_PLAT_COMPAT := 1 ENABLE_PLAT_COMPAT := 1
@ -310,6 +323,7 @@ endif
ifneq (${ENABLE_PLAT_COMPAT}, 0) ifneq (${ENABLE_PLAT_COMPAT}, 0)
include plat/compat/plat_compat.mk include plat/compat/plat_compat.mk
endif endif
endif
# Include the CPU specific operations makefile, which provides default # Include the CPU specific operations makefile, which provides default
# values for all CPU errata workarounds and CPU specific optimisations. # values for all CPU errata workarounds and CPU specific optimisations.
@ -480,7 +494,8 @@ endif
################################################################################ ################################################################################
# Include BL specific makefiles # Include BL specific makefiles
################################################################################ ################################################################################
# BL31 is not needed and BL1, BL2 & BL2U are not currently supported in AArch32
ifneq (${ARCH},aarch32)
ifdef BL1_SOURCES ifdef BL1_SOURCES
NEED_BL1 := yes NEED_BL1 := yes
include bl1/bl1.mk include bl1/bl1.mk
@ -504,7 +519,27 @@ NEED_BL31 := yes
include bl31/bl31.mk include bl31/bl31.mk
endif endif
endif endif
endif
ifeq (${ARCH},aarch32)
NEED_BL32 := yes
################################################################################
# Build `AARCH32_SP` as BL32 image for AArch32
################################################################################
ifneq (${AARCH32_SP},none)
# We expect to locate an sp.mk under the specified AARCH32_SP directory
AARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk)
ifeq (${AARCH32_SP_MAKE},)
$(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located)
endif
$(info Including ${AARCH32_SP_MAKE})
include ${AARCH32_SP_MAKE}
endif
endif
################################################################################ ################################################################################
# Build targets # Build targets
@ -673,7 +708,8 @@ help:
@echo " bl2 Build the BL2 binary" @echo " bl2 Build the BL2 binary"
@echo " bl2u Build the BL2U binary" @echo " bl2u Build the BL2U binary"
@echo " bl31 Build the BL31 binary" @echo " bl31 Build the BL31 binary"
@echo " bl32 Build the BL32 binary" @echo " bl32 Build the BL32 binary. If ARCH=aarch32, then "
@echo " this builds secure payload specified by AARCH32_SP"
@echo " certificates Build the certificates (requires 'GENERATE_COT=1')" @echo " certificates Build the certificates (requires 'GENERATE_COT=1')"
@echo " fip Build the Firmware Image Package (FIP)" @echo " fip Build the Firmware Image Package (FIP)"
@echo " fwu_fip Build the FWU Firmware Image Package (FIP)" @echo " fwu_fip Build the FWU Firmware Image Package (FIP)"

View File

@ -208,11 +208,21 @@ performed.
platform name must be subdirectory of any depth under `plat/`, and must platform name must be subdirectory of any depth under `plat/`, and must
contain a platform makefile named `platform.mk`. contain a platform makefile named `platform.mk`.
* `ARCH` : Choose the target build architecture for ARM Trusted Firmware.
It can take either `aarch64` or `aarch32` as values. By default, it is
defined to `aarch64`.
* `SPD`: Choose a Secure Payload Dispatcher component to be built into the * `SPD`: Choose a Secure Payload Dispatcher component to be built into the
Trusted Firmware. The value should be the path to the directory containing Trusted Firmware. This build option is only valid if `ARCH=aarch64`. The
the SPD source, relative to `services/spd/`; the directory is expected to value should be the path to the directory containing the SPD source,
relative to `services/spd/`; the directory is expected to
contain a makefile called `<spd-value>.mk`. contain a makefile called `<spd-value>.mk`.
* `AARCH32_SP` : Choose the AArch32 Secure Payload component to be built as
as the BL32 image when `ARCH=aarch32`. The value should be the path to the
directory containing the SP source, relative to the `bl32/`; the directory
is expected to contain a makefile called `<aarch32_sp-value>.mk`.
* `V`: Verbose build. If assigned anything other than 0, the build commands * `V`: Verbose build. If assigned anything other than 0, the build commands
are printed. Default is 0. are printed. Default is 0.