From: Jan Kiszka <[email protected]>

This prepares for adding support for the v2 which will be widely
identical, except where not:
 - fsbl
 - bitstream
 - device tree

The PMU firmware will be customized later as the current version works
sufficiently well for both boards.

Signed-off-by: Jan Kiszka <[email protected]>
---
 conf/distro/jailhouse-demo.conf               |   2 +-
 .../ultra96-v1.conf}                          |   6 ++---
 conf/machine/ultra96.conf                     |  23 -----------------
 conf/machine/ultra96.inc                      |  24 ++++++++++++++++++
 ...mo.conf => ultra96-v1-jailhouse-demo.conf} |   2 +-
 images.list                                   |   2 +-
 recipes-bsp/u-boot/files/ultra96-rules        |   2 +-
 ...a96-fsbl.elf.xz => ultra96-v1-fsbl.elf.xz} | Bin
 .../{ultra96.bit.xz => ultra96-v1.bit.xz}     | Bin
 ...lf.LICENSE => ultra96-vX-fsbl.elf.LICENSE} |   0
 ...a96.bit.LICENSE => ultra96-vX.bit.LICENSE} |   0
 recipes-bsp/u-boot/files/ultra96.bif.tmpl     |   4 +--
 ...bb => u-boot-ultra96-v1_2019.10-atf2.2.bb} |  16 ++++++++----
 ...story-ultra96 => .bash_history-ultra96-v1} |   0
 .../{postinst-ultra96 => postinst-ultra96-v1} |   0
 15 files changed, 44 insertions(+), 37 deletions(-)
 copy conf/{multiconfig/ultra96-jailhouse-demo.conf => machine/ultra96-v1.conf} 
(64%)
 delete mode 100644 conf/machine/ultra96.conf
 create mode 100644 conf/machine/ultra96.inc
 rename conf/multiconfig/{ultra96-jailhouse-demo.conf => 
ultra96-v1-jailhouse-demo.conf} (89%)
 rename recipes-bsp/u-boot/files/{ultra96-fsbl.elf.xz => 
ultra96-v1-fsbl.elf.xz} (100%)
 rename recipes-bsp/u-boot/files/{ultra96.bit.xz => ultra96-v1.bit.xz} (100%)
 rename recipes-bsp/u-boot/files/{ultra96-fsbl.elf.LICENSE => 
ultra96-vX-fsbl.elf.LICENSE} (100%)
 rename recipes-bsp/u-boot/files/{ultra96.bit.LICENSE => 
ultra96-vX.bit.LICENSE} (100%)
 rename recipes-bsp/u-boot/{u-boot-ultra96_2019.10-atf2.2.bb => 
u-boot-ultra96-v1_2019.10-atf2.2.bb} (71%)
 rename recipes-core/customizations/files/{.bash_history-ultra96 => 
.bash_history-ultra96-v1} (100%)
 rename recipes-core/customizations/files/{postinst-ultra96 => 
postinst-ultra96-v1} (100%)

diff --git a/conf/distro/jailhouse-demo.conf b/conf/distro/jailhouse-demo.conf
index 887871d..116b253 100644
--- a/conf/distro/jailhouse-demo.conf
+++ b/conf/distro/jailhouse-demo.conf
@@ -13,7 +13,7 @@ require conf/distro/debian-buster.conf
 
 KERNEL_NAME ?= "jailhouse"
 
-WKS_FILE = "${MACHINE}.wks"
+WKS_FILE ?= "${MACHINE}.wks"
 
 PREFERRED_VERSION_jailhouse-${KERNEL_NAME} ?= "0.12"
 
diff --git a/conf/multiconfig/ultra96-jailhouse-demo.conf 
b/conf/machine/ultra96-v1.conf
similarity index 64%
copy from conf/multiconfig/ultra96-jailhouse-demo.conf
copy to conf/machine/ultra96-v1.conf
index eccb51f..086a154 100644
--- a/conf/multiconfig/ultra96-jailhouse-demo.conf
+++ b/conf/machine/ultra96-v1.conf
@@ -1,7 +1,7 @@
 #
 # Jailhouse, a Linux-based partitioning hypervisor
 #
-# Copyright (c) Siemens AG, 2019
+# Copyright (c) Siemens AG, 2019-2020
 #
 # Authors:
 #  Jan Kiszka <[email protected]>
@@ -9,6 +9,6 @@
 # SPDX-License-Identifier: MIT
 #
 
-MACHINE = "ultra96"
+require ultra96.inc
 
-DISTRO = "jailhouse-demo"
+ULTRA96_VERSION = "1"
diff --git a/conf/machine/ultra96.conf b/conf/machine/ultra96.conf
deleted file mode 100644
index 5cdfebc..0000000
--- a/conf/machine/ultra96.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Jailhouse, a Linux-based partitioning hypervisor
-#
-# Copyright (c) Siemens AG, 2019
-#
-# Authors:
-#  Jan Kiszka <[email protected]>
-#
-# SPDX-License-Identifier: MIT
-#
-
-DISTRO_ARCH = "arm64"
-
-IMAGE_TYPE = "wic-img"
-IMAGER_INSTALL += "u-boot-ultra96"
-IMAGER_BUILD_DEPS += "u-boot-ultra96"
-IMAGE_INSTALL_append = " u-boot-script"
-
-IMAGE_BOOT_FILES = "/usr/lib/u-boot/ultra96/boot.bin;boot.bin"
-
-PREFERRED_PROVIDER_u-boot-ultra96 = "u-boot-ultra96"
-
-IMAGE_PREINSTALL_append = " firmware-ti-connectivity"
diff --git a/conf/machine/ultra96.inc b/conf/machine/ultra96.inc
new file mode 100644
index 0000000..37637ad
--- /dev/null
+++ b/conf/machine/ultra96.inc
@@ -0,0 +1,24 @@
+#
+# Jailhouse, a Linux-based partitioning hypervisor
+#
+# Copyright (c) Siemens AG, 2019-2020
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+
+DISTRO_ARCH = "arm64"
+
+IMAGE_TYPE = "wic-img"
+WKS_FILE = "ultra96.wks"
+IMAGER_INSTALL += "u-boot-ultra96-v${ULTRA96_VERSION}"
+IMAGER_BUILD_DEPS += "u-boot-ultra96-v${ULTRA96_VERSION}"
+IMAGE_INSTALL_append = " u-boot-script"
+
+IMAGE_BOOT_FILES = 
"/usr/lib/u-boot/ultra96-v${ULTRA96_VERSION}/boot.bin;boot.bin"
+
+PREFERRED_PROVIDER_u-boot-ultra96-v${ULTRA96_VERSION} = 
"u-boot-ultra96-v${ULTRA96_VERSION}"
+
+IMAGE_PREINSTALL_append = " firmware-ti-connectivity"
diff --git a/conf/multiconfig/ultra96-jailhouse-demo.conf 
b/conf/multiconfig/ultra96-v1-jailhouse-demo.conf
similarity index 89%
rename from conf/multiconfig/ultra96-jailhouse-demo.conf
rename to conf/multiconfig/ultra96-v1-jailhouse-demo.conf
index eccb51f..cb0da85 100644
--- a/conf/multiconfig/ultra96-jailhouse-demo.conf
+++ b/conf/multiconfig/ultra96-v1-jailhouse-demo.conf
@@ -9,6 +9,6 @@
 # SPDX-License-Identifier: MIT
 #
 
-MACHINE = "ultra96"
+MACHINE = "ultra96-v1"
 
 DISTRO = "jailhouse-demo"
diff --git a/images.list b/images.list
index 3d7e12c..4917813 100644
--- a/images.list
+++ b/images.list
@@ -6,6 +6,6 @@ ipc127e         SIMATIC IPC127E (2 cores / 2 GB edition)
 espressobin    Marvell ESPRESSObin (1 GB edition)
 macchiatobin   Marvell MACCHIATObin
 hikey620       LeMaker HiKey (Kirin 620 SoC, 2 GB edition)
-ultra96                Avnet Ultra96
+ultra96-v1     Avnet Ultra96 v1
 rpi4           Raspberry Pi 4 (1-8 GB editions)
 pine64-plus    Pine64+ (Allwinner A64, 2 GB edition)
diff --git a/recipes-bsp/u-boot/files/ultra96-rules 
b/recipes-bsp/u-boot/files/ultra96-rules
index c650da9..a21e468 100644
--- a/recipes-bsp/u-boot/files/ultra96-rules
+++ b/recipes-bsp/u-boot/files/ultra96-rules
@@ -21,7 +21,7 @@ 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\"" \
+       echo "CONFIG_BOOTCOMMAND=\"setenv fdtfile 
xilinx/avnet-ultra96-rev$(ULTRA96_VERSION).dtb; run distro_bootcmd\"" \
            >> configs/${U_BOOT_CONFIG}
        echo "CONFIG_WATCHDOG=n" >> configs/${U_BOOT_CONFIG}
        echo "CONFIG_WDT=n" >> configs/${U_BOOT_CONFIG}
diff --git a/recipes-bsp/u-boot/files/ultra96-fsbl.elf.xz 
b/recipes-bsp/u-boot/files/ultra96-v1-fsbl.elf.xz
similarity index 100%
rename from recipes-bsp/u-boot/files/ultra96-fsbl.elf.xz
rename to recipes-bsp/u-boot/files/ultra96-v1-fsbl.elf.xz
diff --git a/recipes-bsp/u-boot/files/ultra96.bit.xz 
b/recipes-bsp/u-boot/files/ultra96-v1.bit.xz
similarity index 100%
rename from recipes-bsp/u-boot/files/ultra96.bit.xz
rename to recipes-bsp/u-boot/files/ultra96-v1.bit.xz
diff --git a/recipes-bsp/u-boot/files/ultra96-fsbl.elf.LICENSE 
b/recipes-bsp/u-boot/files/ultra96-vX-fsbl.elf.LICENSE
similarity index 100%
rename from recipes-bsp/u-boot/files/ultra96-fsbl.elf.LICENSE
rename to recipes-bsp/u-boot/files/ultra96-vX-fsbl.elf.LICENSE
diff --git a/recipes-bsp/u-boot/files/ultra96.bit.LICENSE 
b/recipes-bsp/u-boot/files/ultra96-vX.bit.LICENSE
similarity index 100%
rename from recipes-bsp/u-boot/files/ultra96.bit.LICENSE
rename to recipes-bsp/u-boot/files/ultra96-vX.bit.LICENSE
diff --git a/recipes-bsp/u-boot/files/ultra96.bif.tmpl 
b/recipes-bsp/u-boot/files/ultra96.bif.tmpl
index 8281fb0..8c5355b 100644
--- a/recipes-bsp/u-boot/files/ultra96.bif.tmpl
+++ b/recipes-bsp/u-boot/files/ultra96.bif.tmpl
@@ -11,8 +11,8 @@
 
 image : {
        [pmufw_image] /usr/share/zynqmp-pmufw/executable.elf
-       [bootloader, destination_cpu=a5x-0] ../ultra96-fsbl.elf
-       ../ultra96.bit
+       [bootloader, destination_cpu=a5x-0] 
../ultra96-v${ULTRA96_VERSION}-fsbl.elf
+       ../ultra96-v${ULTRA96_VERSION}.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.10-atf2.2.bb 
b/recipes-bsp/u-boot/u-boot-ultra96-v1_2019.10-atf2.2.bb
similarity index 71%
rename from recipes-bsp/u-boot/u-boot-ultra96_2019.10-atf2.2.bb
rename to recipes-bsp/u-boot/u-boot-ultra96-v1_2019.10-atf2.2.bb
index 57424e5..fd593f7 100644
--- a/recipes-bsp/u-boot/u-boot-ultra96_2019.10-atf2.2.bb
+++ b/recipes-bsp/u-boot/u-boot-ultra96-v1_2019.10-atf2.2.bb
@@ -1,7 +1,7 @@
 #
 # Jailhouse, a Linux-based partitioning hypervisor
 #
-# Copyright (c) Siemens AG, 2019
+# Copyright (c) Siemens AG, 2019-2020
 #
 # Authors:
 #  Jan Kiszka <[email protected]>
@@ -15,18 +15,20 @@ 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
 
+ULTRA96_VERSION ?= "1"
+
 SRC_URI += " \
     https://ftp.denx.de/pub/u-boot/u-boot-${U_BOOT_PV}.tar.bz2;name=u-boot \
     file://0001-Revert-tools-Makefile-fix-HOSTCFLAGS-with-CROSS_BUIL.patch \
-    file://ultra96.bit.xz \
-    file://ultra96-fsbl.elf.xz \
+    file://ultra96-v${ULTRA96_VERSION}.bit.xz \
+    file://ultra96-v${ULTRA96_VERSION}-fsbl.elf.xz \
     file://ultra96.bif.tmpl \
     file://ultra96-rules \
     "
 SRC_URI[u-boot.sha256sum] = 
"8d6d6070739522dd236cba7055b8736bfe92b4fac0ea18ad809829ca79667014"
 
 TEMPLATE_FILES += "ultra96.bif.tmpl"
-TEMPLATE_VARS += "ATF_PV"
+TEMPLATE_VARS += "ATF_PV ULTRA96_VERSION"
 
 DEPENDS += "zynqmp-pmufw"
 BUILD_DEPENDS += ", zynqmp-pmufw:native"
@@ -39,5 +41,9 @@ S = "${WORKDIR}/u-boot-${U_BOOT_PV}"
 do_prepare_build_append() {
     cp ${WORKDIR}/ultra96-rules ${S}/debian/rules
 
-    echo "boot.bin /usr/lib/u-boot/ultra96" > 
${S}/debian/u-boot-ultra96.install
+    echo "boot.bin /usr/lib/u-boot/ultra96-v${ULTRA96_VERSION}" > 
${S}/debian/u-boot-ultra96-v${ULTRA96_VERSION}.install
+}
+
+dpkg_runbuild_prepend() {
+    export ULTRA96_VERSION=${ULTRA96_VERSION}
 }
diff --git a/recipes-core/customizations/files/.bash_history-ultra96 
b/recipes-core/customizations/files/.bash_history-ultra96-v1
similarity index 100%
rename from recipes-core/customizations/files/.bash_history-ultra96
rename to recipes-core/customizations/files/.bash_history-ultra96-v1
diff --git a/recipes-core/customizations/files/postinst-ultra96 
b/recipes-core/customizations/files/postinst-ultra96-v1
similarity index 100%
rename from recipes-core/customizations/files/postinst-ultra96
rename to recipes-core/customizations/files/postinst-ultra96-v1
-- 
2.26.2

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/a752463dce9fef2247431da23bd6d5dc8e66f406.1601876389.git.jan.kiszka%40siemens.com.

Reply via email to