From patchwork Fri Jan 26 21:30:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 866611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zSsXk3ZYFz9sNr for ; Sat, 27 Jan 2018 08:31:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DC4E730A11; Fri, 26 Jan 2018 21:31:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 60yRoEmi1lmB; Fri, 26 Jan 2018 21:31:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1EB4A30A0F; Fri, 26 Jan 2018 21:31:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7A0F61C3F88 for ; Fri, 26 Jan 2018 21:31:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 76E7089A43 for ; Fri, 26 Jan 2018 21:31:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l8XEeaFgmm-H for ; Fri, 26 Jan 2018 21:30:58 +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 whitealder.osuosl.org (Postfix) with ESMTPS id EE56B89A42 for ; Fri, 26 Jan 2018 21:30:57 +0000 (UTC) Received: from [78.134.113.233] (port=34446 helo=yard.fritz.box) by srv-hp10.netsons.net with esmtpa (Exim 4.89_1) (envelope-from ) id 1efBaH-001GgU-5v; Fri, 26 Jan 2018 22:30:53 +0100 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 26 Jan 2018 22:30:30 +0100 Message-Id: <1517002234-17608-2-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517002234-17608-1-git-send-email-luca@lucaceresoli.net> References: <1517002234-17608-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 1/5] arm-trusted-firmware: simplify release dir path 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" The path to the binary images is very long. Since we are about to make a larger use of it, let's use a variable to make it somewhat shorter. Signed-off-by: Luca Ceresoli --- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 4bac916e3108..212bb5049f2b 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -25,6 +25,7 @@ endif ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ @@ -82,7 +83,7 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS - cp -dpf $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/ + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/ endef # Configuration check From patchwork Fri Jan 26 21:30:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 866608 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zSsXX5q0Vz9sNr for ; Sat, 27 Jan 2018 08:31:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B18C389A55; Fri, 26 Jan 2018 21:31:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JqirO6H3vApp; Fri, 26 Jan 2018 21:31:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2D80089A43; Fri, 26 Jan 2018 21:31:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 5F5861C3F88 for ; Fri, 26 Jan 2018 21:31:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5C29C2F514 for ; Fri, 26 Jan 2018 21:31:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iv4DgTb4ZvdY for ; Fri, 26 Jan 2018 21:30:58 +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 silver.osuosl.org (Postfix) with ESMTPS id 57B292F485 for ; Fri, 26 Jan 2018 21:30:58 +0000 (UTC) Received: from [78.134.113.233] (port=34446 helo=yard.fritz.box) by srv-hp10.netsons.net with esmtpa (Exim 4.89_1) (envelope-from ) id 1efBaH-001GgU-K9; Fri, 26 Jan 2018 22:30:53 +0100 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 26 Jan 2018 22:30:31 +0100 Message-Id: <1517002234-17608-3-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517002234-17608-1-git-send-email-luca@lucaceresoli.net> References: <1517002234-17608-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 2/5] 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 --- boot/arm-trusted-firmware/Config.in | 9 +++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 20 ++++++++++++++++++++ 2 files changed, 29 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..b2c2a67fb661 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -86,6 +86,26 @@ 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 linux -T kernel -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) From patchwork Fri Jan 26 21:30:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 866609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zSsXd049mz9sNr for ; Sat, 27 Jan 2018 08:31:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 60EAA30A12; Fri, 26 Jan 2018 21:31:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8PCihpcYrLhy; Fri, 26 Jan 2018 21:31:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DDC562F514; Fri, 26 Jan 2018 21:31:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 152101C3F88 for ; Fri, 26 Jan 2018 21:30:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 11C6A89A45 for ; Fri, 26 Jan 2018 21:30:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E6MTZEheAuS8 for ; Fri, 26 Jan 2018 21:30:58 +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 whitealder.osuosl.org (Postfix) with ESMTPS id 3431089A43 for ; Fri, 26 Jan 2018 21:30:58 +0000 (UTC) Received: from [78.134.113.233] (port=34446 helo=yard.fritz.box) by srv-hp10.netsons.net with esmtpa (Exim 4.89_1) (envelope-from ) id 1efBaH-001GgU-SR; Fri, 26 Jan 2018 22:30:54 +0100 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 26 Jan 2018 22:30:32 +0100 Message-Id: <1517002234-17608-4-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517002234-17608-1-git-send-email-luca@lucaceresoli.net> References: <1517002234-17608-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 3/5] zynqmp-pmufw-binaries: new package 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" Downloads pre-built binary firmwares for the Xilinx ZynqMP SoCs PMU. Signed-off-by: Luca Ceresoli --- DEVELOPERS | 1 + boot/Config.in | 1 + boot/zynqmp-pmufw-binaries/Config.in | 19 +++++++++++++++++ .../zynqmp-pmufw-binaries.hash | 3 +++ .../zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk | 24 ++++++++++++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 boot/zynqmp-pmufw-binaries/Config.in create mode 100644 boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash create mode 100644 boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk diff --git a/DEVELOPERS b/DEVELOPERS index 73c0231bc0dd..e4db352d3e10 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1013,6 +1013,7 @@ F: package/ti-sgx-um/ N: Luca Ceresoli F: board/olimex/a20_olinuxino/ +F: boot/zynqmp-pmufw-binaries/ F: configs/olimex_a20_olinuxino_* F: package/agentpp/ F: package/exim/ diff --git a/boot/Config.in b/boot/Config.in index 3687c41a2c00..a23886997c9f 100644 --- a/boot/Config.in +++ b/boot/Config.in @@ -19,5 +19,6 @@ source "boot/ts4800-mbrboot/Config.in" source "boot/uboot/Config.in" source "boot/vexpress-firmware/Config.in" source "boot/xloader/Config.in" +source "boot/zynqmp-pmufw-binaries/Config.in" endmenu diff --git a/boot/zynqmp-pmufw-binaries/Config.in b/boot/zynqmp-pmufw-binaries/Config.in new file mode 100644 index 000000000000..e39561cbf91e --- /dev/null +++ b/boot/zynqmp-pmufw-binaries/Config.in @@ -0,0 +1,19 @@ +config BR2_TARGET_ZYNQMP_PMUFW_BINARIES + bool "Zynqmp PMU firmware" + depends on BR2_aarch64 + help + This package provides precompiled firmwares for the Platform + Management Unit (PMU) of the Xilinx ZynqMP family of SoCs. + + https://github.com/lucaceresoli/zynqmp-pmufw-binaries + +if BR2_TARGET_ZYNQMP_PMUFW_BINARIES + +config BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE + string "PMU firmware image file" + help + Enter the path to the PMU firmware file for your board and + configuration, relative to the repository top directory. + Example: "zcu106-default/pmufw.bin". + +endif diff --git a/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash b/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash new file mode 100644 index 000000000000..a60566445290 --- /dev/null +++ b/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 b74808c93522a39bedecd64bd5a75fd766f267e1d540f45dbfe868694f49b1d7 zynqmp-pmufw-binaries-ec64e06b836a0841f40bd52434f6919c5dafb133.tar.gz +sha256 235b467980655706d5fded5baf3d8b52ddb102a9e0c26804a67c0ec719042d38 license.txt diff --git a/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk b/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk new file mode 100644 index 000000000000..2562818f2fb3 --- /dev/null +++ b/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk @@ -0,0 +1,24 @@ +################################################################################ +# +# zynqmp-pmufw-binaries +# +################################################################################ + +ZYNQMP_PMUFW_BINARIES_VERSION = ec64e06b836a0841f40bd52434f6919c5dafb133 +ZYNQMP_PMUFW_BINARIES_SITE = $(call github,lucaceresoli,zynqmp-pmufw-binaries,$(ZYNQMP_PMUFW_BINARIES_VERSION)) + +ZYNQMP_PMUFW_BINARIES_LICENSE = X11 with Xilinx exception +ZYNQMP_PMUFW_BINARIES_LICENSE_FILES = license.txt + +ZYNQMP_PMUFW_BINARIES_IMAGE = $(call qstrip,$(BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE)) +ZYNQMP_PMUFW_BINARIES_INSTALL_IMAGES = YES + +define ZYNQMP_PMUFW_BINARIES_INSTALL_IMAGES_CMDS + $(INSTALL) -D -m 0644 $(@D)/$(ZYNQMP_PMUFW_BINARIES_IMAGE) $(BINARIES_DIR)/pmufw.bin +endef + +ifeq ($(ZYNQMP_PMUFW_BINARIES_IMAGE),) +$(error No PMU firmware image file name set. Check your BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE setting) +endif + +$(eval $(generic-package)) From patchwork Fri Jan 26 21:30:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 866610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zSsXf1N1tz9sNr for ; Sat, 27 Jan 2018 08:31:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BF01630A4B; Fri, 26 Jan 2018 21:31:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YL2CVaSSsGgw; Fri, 26 Jan 2018 21:31:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CE2063098F; Fri, 26 Jan 2018 21:31:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 666A81C3F88 for ; Fri, 26 Jan 2018 21:30:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6347E2F53E for ; Fri, 26 Jan 2018 21:30:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZvZkFP9vp09M for ; Fri, 26 Jan 2018 21:30:58 +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 silver.osuosl.org (Postfix) with ESMTPS id 758642F514 for ; Fri, 26 Jan 2018 21:30:58 +0000 (UTC) Received: from [78.134.113.233] (port=34446 helo=yard.fritz.box) by srv-hp10.netsons.net with esmtpa (Exim 4.89_1) (envelope-from ) id 1efBaI-001GgU-4u; Fri, 26 Jan 2018 22:30:54 +0100 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 26 Jan 2018 22:30:33 +0100 Message-Id: <1517002234-17608-5-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517002234-17608-1-git-send-email-luca@lucaceresoli.net> References: <1517002234-17608-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 4/5] u-boot: add customizations to boot on ZynqMP 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" The Xilinx ZynqMP SoCs require some special handling to boot U-Boot with U-Boot SPL: - In order to work, U-Boot requires a recent PMU firmware loaded, so let's instruct U-Boot to put it in the boot.bin file together with the SPL. - U-Boot must then enable devices, configure pinumxes etc using a file generated by the Xilinx development tools. Add an option to pass these files from the outside (e.g. in the board files). Signed-off-by: Luca Ceresoli --- boot/uboot/Config.in | 32 ++++++++++++++++++++++++++++++++ boot/uboot/uboot.mk | 25 +++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 264f34376749..dd805443726a 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -367,6 +367,38 @@ config BR2_TARGET_UBOOT_ZYNQ_IMAGE for u-boot-dtb.img file so this U-Boot format is required to be set. +config BR2_TARGET_UBOOT_ZYNQMP + bool "Boot on the Xilinx ZynqMP SoCs" + depends on BR2_aarch64 + select BR2_TARGET_ZYNQMP_PMUFW_BINARIES + help + Instruct the U-Boot build process to generate a file named + boot.bin, which is the file loaded by the ZynqMP boot ROM. + boot.bin contains both the U-Boot SPL and the PMU firmware + (downloaded by the zynqmp-pmufw-binaries package) formatted + with the Xilinx-specific format. + +if BR2_TARGET_UBOOT_ZYNQMP +config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR + string "Custom psu_init_gpl files" + help + On ZynqMP the booloader is responsible for some basic + initializations, such as enabling peripherals and + configuring pinmuxes. The psu_init_gpl.[ch], generated by + the Xilinx development tools, contain the code for such + initializations. + + Although U-Boot contains these files for some boards, these + describe only one specific configuration. Users of a + different board, or needing a different configuration, can + provide different files here, and U-Boot will build and link + these files instead of the built-in ones. + + Set to the path where the psu_init_gpl.[ch] files are + located. Leave empty to use the files provided by U-Boot. + +endif + config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC bool "CRC image for Altera SoC FPGA (mkpimage)" depends on BR2_arm diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index d2f241cd8bc5..62cab6a8ccdd 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -273,6 +273,31 @@ define UBOOT_INSTALL_IMAGES_CMDS $(BINARIES_DIR)/boot.scr) endef +ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) + +UBOOT_DEPENDENCIES += zynqmp-pmufw-binaries +define UBOOT_KCONFIG_FIXUP_CMDS + $(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config) +endef +define UBOOT_ZYNQMP_COPY_PMUFW + cp ${BINARIES_DIR}/pmufw.bin $(@D)/board/xilinx/zynqmp/ +endef +UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PMUFW + +ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),) +define UBOOT_ZYNQMP_COPY_PSU_INIT +# In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c +# has precedence over ours if placed in a subdir whose name matches +# CONFIG_DEFAULT_DEVICE_TREE. Delete them all to be sure we use ours. + rm -f $(@D)/board/xilinx/zynqmp/*/psu_init*.[ch] + cp $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR))/psu_init_gpl.[ch] \ + $(@D)/board/xilinx/zynqmp/ +endef +UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PSU_INIT +endif # BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR + +endif # BR2_TARGET_UBOOT_ZYNQMP + define UBOOT_INSTALL_OMAP_IFT_IMAGE cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/ endef