From patchwork Fri Apr 6 16:34:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895755 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lucaceresoli.net Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40HlfJ699Pz9s1R for ; Sat, 7 Apr 2018 02:34:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 856B48A133; Fri, 6 Apr 2018 16:34:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FCKxdSNw4DTF; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 975838A497; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5398C1CF122 for ; Fri, 6 Apr 2018 16:34:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 505C988283 for ; Fri, 6 Apr 2018 16:34:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pkz81tqmoAtu for ; Fri, 6 Apr 2018 16:34:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from srv-hp10-72.netsons.net (srv-hp10-72.netsons.net [94.141.22.72]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0A3FE87AFE for ; Fri, 6 Apr 2018 16:34:39 +0000 (UTC) Received: from [109.168.11.45] (port=35942 helo=pc-ceresoli.dev.aim) by srv-hp10.netsons.net with esmtpa (Exim 4.89_1) (envelope-from ) id 1f4UJv-000zs7-Jk; Fri, 06 Apr 2018 18:34:35 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:17 +0200 Message-Id: <1523032461-3295-3-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523032461-3295-1-git-send-email-luca@lucaceresoli.net> References: <1523032461-3295-1-git-send-email-luca@lucaceresoli.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - buildroot.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: srv-hp10.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Subject: [Buildroot] [PATCH v2-RESEND 2/6] arm-trusted-firmware: generate atf-uboot.ub for ZynqMP booting X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luca Ceresoli MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" U-Boot SPL for the Xilinx ZynqMP SoCs needs ATF in this format to load it. Signed-off-by: Luca Ceresoli Changes v1 -> v2: none. --- boot/arm-trusted-firmware/Config.in | 9 +++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index 7aef87cb746c..dca9958423b9 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -71,6 +71,15 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31 typically used on platforms where another bootloader (e.g U-Boot) encapsulates ATF BL31. +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE + bool "Generate a U-Boot image (for Xilinx ZynqMP U-Boot)" + depends on BR2_cortex_a53 + select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31 + help + Uses mkimage from uboot-tools to encapsulate bl31.bin into + a U-Boot image named atf-uboot.ub. This is needed by the + Xilinx version of U-Boot SPL to load ATF on the ZynqMP SoC. + config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 bool "Use U-Boot as BL33" depends on BR2_TARGET_UBOOT diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 212bb5049f2b..69aac4ee3eb4 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -86,6 +86,27 @@ define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/ endef +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE),y) +define ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE +# Get the entry point address from the elf. + BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \ + grep -E -m 1 -i "entry point.*?0x" | \ + sed -r 's/.*?(0x.*?)/\1/g') && \ + $(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_ZYNQMP_UB_INSTALL + install $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub $(BINARIES_DIR) +endef +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1 +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools +ARM_TRUSTED_FIRMWARE_POST_BUILD_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE +ARM_TRUSTED_FIRMWARE_POST_INSTALL_IMAGES_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_INSTALL +endif + # Configuration check ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE)$(BR_BUILDING),yy)