From patchwork Fri Apr 6 16:34:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895754 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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40HlfD3C60z9s0x for ; Sat, 7 Apr 2018 02:34:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 865F887AFE; Fri, 6 Apr 2018 16:34:42 +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 5PFkySffdUgG; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id DC8CB88283; Fri, 6 Apr 2018 16:34:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 491A61C0539 for ; Fri, 6 Apr 2018 16:34:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 465368A4F2 for ; Fri, 6 Apr 2018 16:34:41 +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 c3MzOFlod+BL 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 hemlock.osuosl.org (Postfix) with ESMTPS id D42CA8A497 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-EZ; Fri, 06 Apr 2018 18:34:35 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:16 +0200 Message-Id: <1523032461-3295-2-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 1/6] 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 --- Changes v1 -> v2: none. --- 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 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) From patchwork Fri Apr 6 16:34:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895757 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 40HlfM3rC1z9s1R for ; Sat, 7 Apr 2018 02:34:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D53CA8A4F2; Fri, 6 Apr 2018 16:34:49 +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 6wjW0XqSts7z; Fri, 6 Apr 2018 16:34:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 29A838A550; Fri, 6 Apr 2018 16:34:49 +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 676201C0539 for ; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 63D9421F75 for ; Fri, 6 Apr 2018 16:34:42 +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 X3oEiZbufFCU 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 silver.osuosl.org (Postfix) with ESMTPS id F055822064 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-O5; Fri, 06 Apr 2018 18:34:35 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:18 +0200 Message-Id: <1523032461-3295-4-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 3/6] 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 --- Changes v1 -> v2: none. --- 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 | 26 ++++++++++++++++++++++ 5 files changed, 50 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 9d23fa51b876..eb4781c1e3cd 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1070,6 +1070,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..91aec04f907a --- /dev/null +++ b/boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk @@ -0,0 +1,26 @@ +################################################################################ +# +# 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),y) +ifeq ($(ZYNQMP_PMUFW_BINARIES_IMAGE),) +$(error No PMU firmware image file name set. Check your BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE setting) +endif +endif + +$(eval $(generic-package)) From patchwork Fri Apr 6 16:34:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895756 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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40HlfK0DSMz9s21 for ; Sat, 7 Apr 2018 02:34:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D1C6A88564; Fri, 6 Apr 2018 16:34:44 +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 U2j-al7U61lY; Fri, 6 Apr 2018 16:34:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4D787884BC; Fri, 6 Apr 2018 16:34:43 +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 7315F1C0539 for ; Fri, 6 Apr 2018 16:34:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6EE652209C for ; Fri, 6 Apr 2018 16:34:41 +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 myWndOCf2rsf 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 silver.osuosl.org (Postfix) with ESMTPS id F048321F75 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-SY; Fri, 06 Apr 2018 18:34:35 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:19 +0200 Message-Id: <1523032461-3295-5-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 4/6] uboot: zynqmp: generate SPL image with PMUFW binary 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" In order to boot on the Xilinx ZynqMP SoCs, U-Boot SPL requires a recent PMU firmware loaded. Instruct U-Boot to add pmufw.bin to the boot.bin file together with U-Boot SPL, to the boot ROM will load both. Signed-off-by: Luca Ceresoli --- Changes v1 -> v2: - split from a larger patch doing 2 things. --- boot/uboot/Config.in | 11 +++++++++++ boot/uboot/uboot.mk | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index cef8ccd3cd0d..68c0be05d95a 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -368,6 +368,17 @@ 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. + 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 24d3e4ef5485..e81a9fd41dab 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -278,6 +278,19 @@ 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 + +endif # BR2_TARGET_UBOOT_ZYNQMP + define UBOOT_INSTALL_OMAP_IFT_IMAGE cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/ endef From patchwork Fri Apr 6 16:34:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895759 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.138; helo=whitealder.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 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 40HlfT2gwPz9s0x for ; Sat, 7 Apr 2018 02:34:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7BFE88903B; Fri, 6 Apr 2018 16:34:52 +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 omfJdQ2pZG05; Fri, 6 Apr 2018 16:34:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D9B6988DDA; Fri, 6 Apr 2018 16:34:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6E12A1CF122 for ; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6B87C8A497 for ; Fri, 6 Apr 2018 16:34:42 +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 VFQ1QP9IUDR8 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 hemlock.osuosl.org (Postfix) with ESMTPS id D34A18A133 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 1f4UJw-000zs7-0V; Fri, 06 Apr 2018 18:34:36 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:20 +0200 Message-Id: <1523032461-3295-6-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 5/6] uboot: zynqmp: allow to use custom psu_init files 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 configures pinmuxes, clocks and other low-level devices. On the Xilinx ZynqMP SoCs the code to do this resides in a file called psu_init_gpl.c which is initially 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 --- Changes v1 -> v2: - split from a larger patch doing 2 things - document the option of having psu_init_gpl.c without .h --- boot/uboot/Config.in | 22 ++++++++++++++++++++++ boot/uboot/uboot.mk | 12 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 68c0be05d95a..55a99aea23d8 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -379,6 +379,28 @@ config BR2_TARGET_UBOOT_ZYNQMP (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.c file (and, optionally, + psu_init_gpl.h), generated by the Xilinx development tools, + contains the code for such initializations. + + Although U-Boot contains psu_init_gpl.c files for some boards, + each of them describes only one specific configuration. Users of + a different board, or needing a different configuration, can + provide a different file here, and U-Boot will build and link + the user-provided file instead of the built-in one. + + Set this variable to the path where the psu_init_gpl.c file (and + psu_init_gpl.h if needed) is 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 e81a9fd41dab..38d3c4019ee9 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -289,6 +289,18 @@ define UBOOT_ZYNQMP_COPY_PMUFW 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 From patchwork Fri Apr 6 16:34:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895758 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.136; helo=silver.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 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 40HlfN4jX1z9s21 for ; Sat, 7 Apr 2018 02:34:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 69CEE21F75; Fri, 6 Apr 2018 16:34:50 +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 lmOoH0sRLJS6; Fri, 6 Apr 2018 16:34:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 72F9322064; Fri, 6 Apr 2018 16:34:48 +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 27CC11C0539 for ; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 24E6988304 for ; Fri, 6 Apr 2018 16:34:42 +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 bY-8-CLB8TAo 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 0CF3888268 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 1f4UJw-000zs7-4g; Fri, 06 Apr 2018 18:34:36 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:21 +0200 Message-Id: <1523032461-3295-7-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 6/6] configs: add Xilinx ZCU106 board (ZynqMP SoC) 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" This adds support the Xilinx ZCU106 development board. Mainline U-Boot does not have a zcu106 defconfig, so iet's use U-Boot from the Xilinx master branch, which has one. But since that defconfig does not boot from SD card, add two patches to fix that. [Tested on the ES2 (Engineering Sample 2) version of the board] Signed-off-by: Luca Ceresoli --- Changes v1 -> v2: - don't provide psu_init files: the xilinx master branch has a defconfig that works (with 2 patches) --- DEVELOPERS | 2 + board/zynqmp/genimage.cfg | 28 +++++++++++ ...1-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch | 56 ++++++++++++++++++++++ ...arm64-zynqmp-zcu106-enable-booting-to-ATF.patch | 39 +++++++++++++++ board/zynqmp/post-image.sh | 13 +++++ board/zynqmp/readme.txt | 52 ++++++++++++++++++++ configs/zynqmp_zcu106_defconfig | 31 ++++++++++++ 7 files changed, 221 insertions(+) create mode 100644 board/zynqmp/genimage.cfg create mode 100644 board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch create mode 100644 board/zynqmp/patches/uboot/0002-arm64-zynqmp-zcu106-enable-booting-to-ATF.patch create mode 100755 board/zynqmp/post-image.sh create mode 100644 board/zynqmp/readme.txt create mode 100644 configs/zynqmp_zcu106_defconfig diff --git a/DEVELOPERS b/DEVELOPERS index eb4781c1e3cd..228a731a9de6 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1070,8 +1070,10 @@ F: package/ti-sgx-um/ N: Luca Ceresoli F: board/olimex/a20_olinuxino/ +F: board/zynqmp/ F: boot/zynqmp-pmufw-binaries/ F: configs/olimex_a20_olinuxino_* +F: configs/zynqmp_zcu106_defconfig F: package/agentpp/ F: package/exim/ F: package/libpjsip/ diff --git a/board/zynqmp/genimage.cfg b/board/zynqmp/genimage.cfg new file mode 100644 index 000000000000..30be086d7d42 --- /dev/null +++ b/board/zynqmp/genimage.cfg @@ -0,0 +1,28 @@ +image boot.vfat { + vfat { + files = { + "boot.bin", + "u-boot.bin", + "atf-uboot.ub", + "system.dtb", + "Image" + } + } + size = 32M +} + +image sdcard.img { + hdimage { + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +} diff --git a/board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch b/board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch new file mode 100644 index 000000000000..a3c7b6265616 --- /dev/null +++ b/board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch @@ -0,0 +1,56 @@ +From e5d72ed8339eb05285448aad3c89d21e4d18fd29 Mon Sep 17 00:00:00 2001 +From: Luca Ceresoli +Date: Mon, 26 Feb 2018 09:40:34 +0100 +Subject: [PATCH 1/2] arm64: zynqmp: zcu106: fix SPL MMC booting + +The U-Boot SPL generated with the current zcu106 defconfig cannot boot +from MMC: + + [...] + U-Boot SPL 2018.01 (Feb 21 2018 - 17:47:14) + EL Level: EL3 + Trying to boot from MMC1 + sdhci_transfer_data: Error detected in status(0x408020)! + spl_load_image_fat_os: error reading image u-boot.bin, err - -2 + spl_load_image_fat: error reading image u-boot.img, err - -6 + SPL: failed to boot from all boot devices + ### ERROR ### Please RESET the board ### + +Fix by lowering the rpll value. The new value for the RPLL_CTRL +register comes from the current psu_init_gpl.c from the HDF file at +https://github.com/xilinx/hdf-examples/tree/01ad8ea5fd1989abf4ea5a072d019a16cb2bc546/zcu106-zynqmp +(generated by Vivado v2017.4). + +RPLL and sdio1_ref clocks before and after this change: + + - Old values: RPLL 1.36 GHz, sdio1_ref 272 MHz + - New values: RPLL 1.16 GHz, sdio1_ref 233 MHz + +Patch submitted upstream. + +Signed-off-by: Luca Ceresoli +Cc: Michal Simek + +--- +Changes v1 -> v2: + - add old/new clocks to commit message (Michal). +--- + board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c b/board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c +index 4d18abe000ca..e6fa477e53e7 100644 +--- a/board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c ++++ b/board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c +@@ -10,7 +10,7 @@ + static unsigned long psu_pll_init_data(void) + { + psu_mask_write(0xFF5E0034, 0xFE7FEDEFU, 0x7E4E2C62U); +- psu_mask_write(0xFF5E0030, 0x00717F00U, 0x00013C00U); ++ psu_mask_write(0xFF5E0030, 0x00717F00U, 0x00014600U); + psu_mask_write(0xFF5E0030, 0x00000008U, 0x00000008U); + psu_mask_write(0xFF5E0030, 0x00000001U, 0x00000001U); + psu_mask_write(0xFF5E0030, 0x00000001U, 0x00000000U); +-- +2.7.4 + diff --git a/board/zynqmp/patches/uboot/0002-arm64-zynqmp-zcu106-enable-booting-to-ATF.patch b/board/zynqmp/patches/uboot/0002-arm64-zynqmp-zcu106-enable-booting-to-ATF.patch new file mode 100644 index 000000000000..df6a57eb1667 --- /dev/null +++ b/board/zynqmp/patches/uboot/0002-arm64-zynqmp-zcu106-enable-booting-to-ATF.patch @@ -0,0 +1,39 @@ +From 2e3b94597550501a58488504ad506ba50074aecd Mon Sep 17 00:00:00 2001 +From: Luca Ceresoli +Date: Wed, 7 Mar 2018 18:29:26 +0100 +Subject: [PATCH 2/2] arm64: zynqmp: zcu106: enable booting to ATF + +U-Boot is now able to boot to ARM Trusted Firmware (ATF). The boot +flow is SPL(EL3) loads ATF and full u-boot and jump to ATF(EL3) which +pass control to full u-boot(EL2). This has been tested on zcu106, so +enable it in this defconfig. + +To generate an image that triggers this booting flow, you need to pass +'-O arm-trusted-firmware' to mkimage. + +Patch submitted upstream. + +Signed-off-by: Luca Ceresoli +Cc: Michal Simek + +--- +Changes v1 -> v2: none. +--- + configs/xilinx_zynqmp_zcu106_revA_defconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configs/xilinx_zynqmp_zcu106_revA_defconfig b/configs/xilinx_zynqmp_zcu106_revA_defconfig +index 71da160cd78b..0575ee00fd8b 100644 +--- a/configs/xilinx_zynqmp_zcu106_revA_defconfig ++++ b/configs/xilinx_zynqmp_zcu106_revA_defconfig +@@ -27,6 +27,7 @@ CONFIG_SPL=y + CONFIG_SPL_OS_BOOT=y + CONFIG_SPL_RAM_SUPPORT=y + CONFIG_SPL_RAM_DEVICE=y ++CONFIG_SPL_ATF=y + CONFIG_SYS_PROMPT="ZynqMP> " + CONFIG_FASTBOOT=y + CONFIG_FASTBOOT_FLASH=y +-- +2.7.4 + diff --git a/board/zynqmp/post-image.sh b/board/zynqmp/post-image.sh new file mode 100755 index 000000000000..2e7bcbaab60f --- /dev/null +++ b/board/zynqmp/post-image.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# By default U-Boot loads DTB from a file named "system.dtb", so +# let's use a symlink with that name that points to the *first* +# devicetree listed in the config. + +FIRST_DT=$(sed -nr \ + -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]]*).*"$|\1|p' \ + ${BR2_CONFIG}) + +[ -z "${FIRST_DT}" ] || ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/system.dtb + +support/scripts/genimage.sh -c board/zynqmp/genimage.cfg diff --git a/board/zynqmp/readme.txt b/board/zynqmp/readme.txt new file mode 100644 index 000000000000..18d0491add21 --- /dev/null +++ b/board/zynqmp/readme.txt @@ -0,0 +1,52 @@ +******************************** +Xilinx ZCU106 board - ZynqMP SoC +******************************** + +This document describes the Buildroot support for the ZCU106 board by +Xilinx, based on the Zynq UltraScale+ MPSoC (aka ZynqMP). It has been +tested with the EK-U1-ZCU106-ES2 pre-production board. + +How to build it +=============== + +Configure Buildroot: + + $ make zynqmp_zcu106_defconfig + +Compile everything and build the rootfs image: + + $ make + +Result of the build +------------------- + +After building, you should get a tree like this: + + output/images/ + +-- atf-uboot.ub + +-- bl31.bin + +-- boot.bin + +-- boot.vfat + +-- Image + +-- pmufw.bin + +-- rootfs.ext2 + +-- rootfs.ext4 -> rootfs.ext2 + +-- sdcard.img + +-- system.dtb -> zynqmp-zcu106-revA.dtb + +-- u-boot.bin + `-- zynqmp-zcu106-revA.dtb + +How to write the SD card +======================== + +WARNING! This will destroy all the card content. Use with care! + +The sdcard.img file is a complete bootable image ready to be written +on the boot medium. To install it, simply copy the image to an SD +card: + + # dd if=output/images/sdcard.img of=/dev/sdX + +Where 'sdX' is the device node of the SD. + +Eject the SD card, insert it in the board, and power it up. diff --git a/configs/zynqmp_zcu106_defconfig b/configs/zynqmp_zcu106_defconfig new file mode 100644 index 000000000000..cf8f2b14a971 --- /dev/null +++ b/configs/zynqmp_zcu106_defconfig @@ -0,0 +1,31 @@ +BR2_aarch64=y +BR2_GLOBAL_PATCH_DIR="board/zynqmp/patches/" +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynqmp/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/Xilinx/linux-xlnx.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.4" +BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynqmp" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/zynqmp-zcu106-revA" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://github.com/xilinx/u-boot-xlnx.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="228801a215909365ae1dcdd799034195ad7264f7" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="xilinx_zynqmp_zcu106_revA" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin" +BR2_TARGET_UBOOT_ZYNQMP=y +BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE="zcu106-default/pmufw.bin" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y