From: Jan Kiszka <[email protected]>

This is still a nasty mixture, primary due to the larger number of
dependencies, partly binaries and non-OSS. Therefore, this pulls
pre-built PMU firmware, first-stage bootloader and the FPGA bitstream
from Alex Graf's OpenSUSE packages. We will look into a cleaner build
process later.

The good news it: U-Boot and ATF are both from upstream.

Signed-off-by: Jan Kiszka <[email protected]>
---
 .../files/0001-zynqmp-Downgrade-to-PMUFW-0.3.patch | 32 +++++++++++++++
 recipes-bsp/u-boot/files/ultra96-rules             | 41 +++++++++++++++++++
 recipes-bsp/u-boot/files/ultra96.bif               | 18 +++++++++
 .../u-boot/u-boot-ultra96_2019.01-rc2-atf1.6.bb    | 46 ++++++++++++++++++++++
 4 files changed, 137 insertions(+)
 create mode 100644 
recipes-bsp/u-boot/files/0001-zynqmp-Downgrade-to-PMUFW-0.3.patch
 create mode 100644 recipes-bsp/u-boot/files/ultra96-rules
 create mode 100644 recipes-bsp/u-boot/files/ultra96.bif
 create mode 100644 recipes-bsp/u-boot/u-boot-ultra96_2019.01-rc2-atf1.6.bb

diff --git a/recipes-bsp/u-boot/files/0001-zynqmp-Downgrade-to-PMUFW-0.3.patch 
b/recipes-bsp/u-boot/files/0001-zynqmp-Downgrade-to-PMUFW-0.3.patch
new file mode 100644
index 0000000..ce262b6
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0001-zynqmp-Downgrade-to-PMUFW-0.3.patch
@@ -0,0 +1,32 @@
+From 4a8103341c5420a65b80e9bbe0702bb66260b283 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <[email protected]>
+Date: Sat, 5 Jan 2019 22:15:31 +0100
+Subject: [PATCH] zynqmp: Downgrade to PMUFW 0.3
+
+We currently only have 0.3 pre-built at hand.
+
+Not for upstream.
+
+Signed-off-by: Jan Kiszka <[email protected]>
+---
+ arch/arm/include/asm/arch-zynqmp/sys_proto.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/include/asm/arch-zynqmp/sys_proto.h 
b/arch/arm/include/asm/arch-zynqmp/sys_proto.h
+index 385c8825f2..857c512088 100644
+--- a/arch/arm/include/asm/arch-zynqmp/sys_proto.h
++++ b/arch/arm/include/asm/arch-zynqmp/sys_proto.h
+@@ -23,8 +23,8 @@
+ 
+ #define ZYNQMP_SIP_SVC_GET_API_VERSION                0xC2000001
+ 
+-#define ZYNQMP_PM_VERSION_MAJOR               1
+-#define ZYNQMP_PM_VERSION_MINOR               0
++#define ZYNQMP_PM_VERSION_MAJOR               0
++#define ZYNQMP_PM_VERSION_MINOR               3
+ #define ZYNQMP_PM_VERSION_MAJOR_SHIFT 16
+ #define ZYNQMP_PM_VERSION_MINOR_MASK  0xFFFF
+ 
+-- 
+2.16.4
+
diff --git a/recipes-bsp/u-boot/files/ultra96-rules 
b/recipes-bsp/u-boot/files/ultra96-rules
new file mode 100644
index 0000000..c650da9
--- /dev/null
+++ b/recipes-bsp/u-boot/files/ultra96-rules
@@ -0,0 +1,41 @@
+#!/usr/bin/make -f
+#
+# Jailhouse, a Linux-based partitioning hypervisor
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+SET_CROSS_BUILD_TOOLS=CROSS_BUILD_TOOLS=y
+endif
+
+PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2)))
+
+override_dh_auto_build:
+       $(MAKE) $(PARALLEL_BUILD) -C ../arm-trusted-firmware-* \
+               PLAT=zynqmp RESET_TO_BL31=1 bl31
+
+       echo "CONFIG_BOOTCOMMAND=\"setenv fdtfile 
xilinx/avnet-ultra96-rev1.dtb; run distro_bootcmd\"" \
+           >> configs/${U_BOOT_CONFIG}
+       echo "CONFIG_WATCHDOG=n" >> configs/${U_BOOT_CONFIG}
+       echo "CONFIG_WDT=n" >> configs/${U_BOOT_CONFIG}
+       $(MAKE) $(PARALLEL_BUILD) $(U_BOOT_CONFIG)
+       $(MAKE) $(PARALLEL_BUILD) ${U_BOOT_BIN} tools
+
+       tools/mkimage -T zynqmpbif -d ../ultra96.bif boot.bin
+
+       $(MAKE) $(PARALLEL_BUILD) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only 
envtools
+
+override_dh_auto_install:
+       mv tools/env/lib.a tools/env/libubootenv.a
+
+override_dh_auto_test:
+
+%:
+       CFLAGS= LDFLAGS= dh $@ --parallel
diff --git a/recipes-bsp/u-boot/files/ultra96.bif 
b/recipes-bsp/u-boot/files/ultra96.bif
new file mode 100644
index 0000000..29add58
--- /dev/null
+++ b/recipes-bsp/u-boot/files/ultra96.bif
@@ -0,0 +1,18 @@
+#
+# Jailhouse, a Linux-based partitioning hypervisor
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+
+image : {
+       [pmufw_image] ../usr/share/zynqmp/pmufw.elf
+       [bootloader, destination_cpu=a5x-0] ../usr/share/zynqmp/fsbl.elf
+       ../design_1_wrapper.bit
+       [destination_cpu=a5x-0, exception_level=el-3,trustzone] 
../arm-trusted-firmware-@ATF_PV@/build/zynqmp/release/bl31/bl31.elf
+       [destination_cpu=a5x-0, exception_level=el-2] u-boot.elf
+}
diff --git a/recipes-bsp/u-boot/u-boot-ultra96_2019.01-rc2-atf1.6.bb 
b/recipes-bsp/u-boot/u-boot-ultra96_2019.01-rc2-atf1.6.bb
new file mode 100644
index 0000000..fce316e
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-ultra96_2019.01-rc2-atf1.6.bb
@@ -0,0 +1,46 @@
+#
+# Jailhouse, a Linux-based partitioning hypervisor
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+
+U_BOOT_PV="${@d.getVar('PV').split('-atf')[0]}"
+ATF_PV="${@d.getVar('PV').split('-atf')[1]}"
+
+require recipes-bsp/u-boot/u-boot-custom.inc
+require recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_${ATF_PV}.inc
+
+SRC_URI += " \
+    ftp://ftp.denx.de/pub/u-boot/u-boot-${U_BOOT_PV}.tar.bz2;name=u-boot \
+    file://0001-zynqmp-Downgrade-to-PMUFW-0.3.patch \
+    
https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/Zynq:/ZCU100/standard/noarch/zynqmp-pmufw-2017.1-7.2.noarch.rpm;name=pmufw
 \
+    
https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/Zynq:/ZCU100/standard/aarch64/zynqmp-fsbl-2017.1-7.2.aarch64.rpm;name=fsbl
 \
+    
https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/Zynq:/ZCU100/standard/noarch/zynqmp-hdf-20180326-4.2.noarch.rpm;name=hdf
 \
+    file://ultra96.bif \
+    file://ultra96-rules \
+    "
+SRC_URI[u-boot.sha256sum] = 
"e82ad58e1f83a39ba361b42203eaa2b70b30a43a64614b2b6853ffd68d0fd1f7"
+SRC_URI[pmufw.sha256sum] = 
"c87fc36d08361399aa98f1c06a20f447c07f0061c781a015c1d7b0b866b135c9"
+SRC_URI[fsbl.sha256sum] = 
"6f420f4cb049eb4ddd981fb9a1c964db9771e359dc51385a886bbcb27a9a616e"
+SRC_URI[hdf.sha256sum] = 
"30e34942e3a33a5d9fdfa395e5a9cd28d21317eb6200353640e973591206ec3d"
+
+U_BOOT_CONFIG="avnet_ultra96_rev1_defconfig"
+U_BOOT_BIN="u-boot.elf"
+
+S = "${WORKDIR}/u-boot-${U_BOOT_PV}"
+
+do_prepare_build_append() {
+    cp ${WORKDIR}/ultra96-rules ${S}/debian/rules
+
+    unzip -u -d ${WORKDIR} ${WORKDIR}/usr/share/zynqmp/system.hdf \
+        design_1_wrapper.bit
+
+    sed -i "s/@ATF_PV@/${ATF_PV}/g" ${WORKDIR}/ultra96.bif
+
+    echo "boot.bin /usr/lib/u-boot/ultra96" > 
${S}/debian/u-boot-ultra96.install
+}
-- 
2.16.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to