2016-10-15 10:03:42 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# arm-trusted-firmware
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
ARM_TRUSTED_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_VERSION))
|
2017-03-30 15:43:38 +02:00
|
|
|
ARM_TRUSTED_FIRMWARE_LICENSE = BSD-3-Clause
|
2017-10-12 21:54:16 +02:00
|
|
|
ARM_TRUSTED_FIRMWARE_LICENSE_FILES = license.rst
|
2016-10-15 10:03:42 +02:00
|
|
|
|
|
|
|
ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
|
|
|
|
# Handle custom ATF tarballs as specified by the configuration
|
|
|
|
ARM_TRUSTED_FIRMWARE_TARBALL = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))
|
|
|
|
ARM_TRUSTED_FIRMWARE_SITE = $(patsubst %/,%,$(dir $(ARM_TRUSTED_FIRMWARE_TARBALL)))
|
|
|
|
ARM_TRUSTED_FIRMWARE_SOURCE = $(notdir $(ARM_TRUSTED_FIRMWARE_TARBALL))
|
|
|
|
BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
|
|
|
|
else ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_SITE = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL))
|
|
|
|
ARM_TRUSTED_FIRMWARE_SITE_METHOD = git
|
2017-03-21 01:07:11 +01:00
|
|
|
BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
|
2016-10-15 10:03:42 +02:00
|
|
|
else
|
|
|
|
ARM_TRUSTED_FIRMWARE_SITE = $(call github,ARM-software,arm-trusted-firmware,$(ARM_TRUSTED_FIRMWARE_VERSION))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES
|
|
|
|
|
|
|
|
ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM))
|
|
|
|
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
|
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
|
2017-06-14 13:22:27 +02:00
|
|
|
PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM)
|
2016-10-15 10:03:42 +02:00
|
|
|
|
2017-12-03 22:48:05 +01:00
|
|
|
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin
|
|
|
|
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
|
|
|
|
endif
|
|
|
|
|
2016-10-15 10:03:42 +02:00
|
|
|
ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
|
|
|
|
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
|
|
|
|
endif
|
|
|
|
|
2017-12-03 22:48:10 +01:00
|
|
|
ifeq ($(BR2_TARGET_BINARIES_MARVELL),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
|
|
|
|
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += binaries-marvell
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_MV_DDR_MARVELL),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
|
|
|
|
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
|
|
|
|
endif
|
|
|
|
|
2017-12-03 22:48:04 +01:00
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
|
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += fip
|
2017-12-17 09:55:53 +01:00
|
|
|
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-openssl
|
|
|
|
# fiptool only exists in newer (>= 1.3) versions of ATF, so we build
|
|
|
|
# it conditionally. We need to explicitly build it as it requires
|
|
|
|
# OpenSSL, and therefore needs to be passed proper variables to find
|
|
|
|
# the host OpenSSL.
|
|
|
|
define ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL
|
|
|
|
if test -d $(@D)/tools/fiptool; then \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/fiptool \
|
|
|
|
$(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
|
|
|
|
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
|
|
|
LDLIBS="$(HOST_LDFLAGS) -lcrypto" ; \
|
|
|
|
fi
|
|
|
|
endef
|
2017-12-03 22:48:04 +01:00
|
|
|
endif
|
|
|
|
|
2017-12-03 22:48:06 +01:00
|
|
|
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31),y)
|
|
|
|
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += bl31
|
|
|
|
endif
|
|
|
|
|
2016-10-15 10:03:42 +02:00
|
|
|
define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
|
2017-12-17 09:55:53 +01:00
|
|
|
$(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL)
|
2016-10-15 10:03:42 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
|
2017-12-03 22:48:04 +01:00
|
|
|
$(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)
|
2016-10-15 10:03:42 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
|
|
|
|
cp -dpf $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/
|
|
|
|
endef
|
|
|
|
|
2017-10-12 21:54:15 +02:00
|
|
|
# Configuration check
|
2016-10-15 10:03:42 +02:00
|
|
|
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE)$(BR_BUILDING),yy)
|
|
|
|
|
|
|
|
ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
|
|
|
|
ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))),)
|
|
|
|
$(error No tarball location specified. Please check BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT),y)
|
|
|
|
ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL)),)
|
|
|
|
$(error No repository specified. Please check BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|