summaryrefslogtreecommitdiffstats
path: root/boot/arm-trusted-firmware/arm-trusted-firmware.mk
diff options
context:
space:
mode:
Diffstat (limited to 'boot/arm-trusted-firmware/arm-trusted-firmware.mk')
-rw-r--r--boot/arm-trusted-firmware/arm-trusted-firmware.mk21
1 files changed, 21 insertions, 0 deletions
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 212bb5049f..054a000a1d 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -75,15 +75,36 @@ ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31),y)
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += bl31
endif
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT),y)
+define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_BUILD
+# Get the entry point address from the elf.
+ BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \
+ sed -r '/^ Entry point address:\s*(.*)/!d; s//\1/') && \
+ $(HOST_DIR)/bin/mkimage \
+ -A arm64 -O arm-trusted-firmware -C none \
+ -a $${BASE_ADDR} -e $${BASE_ADDR} \
+ -d $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31.bin \
+ $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub
+endef
+define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL
+ $(INSTALL) -m 0644 $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub \
+ $(BINARIES_DIR)/atf-uboot.ub
+endef
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools
+endif
+
define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
$(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL)
$(TARGET_CONFIGURE_OPTS) \
$(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
$(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)
+ $(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_BUILD)
endef
define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/
+ $(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL)
endef
# Configuration check
OpenPOWER on IntegriCloud