aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2021-03-09 19:32:45 -0800
committerMark Hatle <mark.hatle@xilinx.com>2021-03-09 19:43:34 -0800
commit48c196dc2c0173f8f0a319d1ad027d2aa04b99bd (patch)
tree6da866840bb3dc9226d3afa2cea429874c672c1d
parent7532ee1ea27dbf913a884c8b3a1ee3ff7795a27c (diff)
downloadmeta-xilinx-48c196dc2c0173f8f0a319d1ad027d2aa04b99bd.tar.gz
meta-xilinx-48c196dc2c0173f8f0a319d1ad027d2aa04b99bd.tar.bz2
meta-xilinx-48c196dc2c0173f8f0a319d1ad027d2aa04b99bd.zip
embeddedsw: Rework plm/pmu/psm firmware and Linux packaging
In order to allow standalone (meta-xilinx-standalone), XSCT (meta-xilinx-tools), and future items to work in the same way the recipes have been restructured. A *-firmware recipe will generate the firmware and stage it to do_deploy. A *fw recipe will take the deployed version and package it for the Linux side of things. This allows the firmware generation to be easily extended without requiring packaging knowledge. Similarly packaging can be extended for alternative boot/upgrade mechanisms as required. In all cases, the MACHINE configuration will specify the default way the components are to be built, along with the names of the item in the deploy directory. The PLM/PSM/PMU_IMAGE_NAME is the name for the generated firmware. PLM/PSM/PMU_DEPLOY_DIR is the path to the constructed firmware. This along with the IMAGE_NAME above can be used to specify the location of an externally generated set of firmware. Addtionally the dependencies for building the plmfw/psmfw/pmufw can be changed easily using PLM/PSM/PMU_DEPENDS and PLM/PSM/PMU_MCDEPENDS. The former specifies dependencies in the same multiconfig, while the later allows the component to require another multiconfig to have finihed. The system has a referenced default, if multiconfig is enabled it will automatically use it, otherwise it will try to use the recipe in the main configuration. (This will fail unless meta-xilinx-tools is available.) Also two multiconfigs hve been implemented: versal-fw and zynqmp-pmufw They can be enabled using BBMULITCONFIG += "zynqmp-pmufw" or versal-fw. Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
-rw-r--r--meta-xilinx-bsp/conf/machine/include/soc-versal.inc12
-rw-r--r--meta-xilinx-bsp/conf/machine/include/soc-zynqmp.inc11
-rw-r--r--meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/vck-sc-zynqmp.conf4
-rw-r--r--meta-xilinx-bsp/conf/machine/vck190-versal.conf5
-rw-r--r--meta-xilinx-bsp/conf/machine/versal-generic.conf4
-rw-r--r--meta-xilinx-bsp/conf/machine/zc1254-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf5
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu111-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu1275-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu1285-zynqmp.conf3
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu208-zynqmp.conf4
-rw-r--r--meta-xilinx-bsp/conf/machine/zcu216-zynqmp.conf4
-rw-r--r--meta-xilinx-bsp/conf/machine/zynqmp-generic.conf5
-rw-r--r--meta-xilinx-bsp/recipes-bsp/embeddedsw/plmfw.bb64
-rw-r--r--meta-xilinx-bsp/recipes-bsp/embeddedsw/pmufw.bb65
-rw-r--r--meta-xilinx-bsp/recipes-bsp/embeddedsw/psmfw.bb63
-rw-r--r--meta-xilinx-standalone/conf/multiconfig/versal-fw.conf9
-rw-r--r--meta-xilinx-standalone/conf/multiconfig/zynqmp-pmufw.conf9
-rw-r--r--meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware.inc20
-rw-r--r--meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware.inc22
-rw-r--r--meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.2.bb2
-rw-r--r--meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_git.bb2
-rw-r--r--meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware.inc19
26 files changed, 279 insertions, 71 deletions
diff --git a/meta-xilinx-bsp/conf/machine/include/soc-versal.inc b/meta-xilinx-bsp/conf/machine/include/soc-versal.inc
index a9a94848..abf5f08e 100644
--- a/meta-xilinx-bsp/conf/machine/include/soc-versal.inc
+++ b/meta-xilinx-bsp/conf/machine/include/soc-versal.inc
@@ -17,3 +17,15 @@ KERNEL_IMAGETYPE ?= "Image"
WIC_DEPENDS ?= "virtual/kernel virtual/bootloader virtual/boot-bin virtual/arm-trusted-firmware"
UBOOT_ELF ?= "u-boot.elf"
+
+# Default, if multiconfig is off, call plm/psm-firmware directly, otherwise call the versal-fw multiconfig version
+# The Linux compatible plm/psm-firmware though requires meta-xilinx-tools
+PLM_DEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', '', 'plm-firmware:do_deploy', d)}"
+PLM_MCDEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', 'mc::versal-fw:plm-firmware:do_deploy', '', d)}"
+PLM_DEPLOY_DIR ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', '${TOPDIR}/tmp-microblaze-versal-fw/deploy/images/${MACHINE}', '${DEPLOY_DIR_IMAGE}', d)}"
+PLM_IMAGE_NAME ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', 'plm-versal-mb', 'plm-${MACHINE}', d)}"
+
+PSM_DEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', '', 'psm-firmware:do_deploy', d)}"
+PSM_MCDEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', 'mc::versal-fw:psm-firmware:do_deploy', '', d)}"
+PSM_FIRMWARE_DEPLOY_DIR ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', '${TOPDIR}/tmp-microblaze-versal-fw/deploy/images/${MACHINE}', '${DEPLOY_DIR_IMAGE}', d)}"
+PSM_FIRMWARE_IMAGE_NAME ?= "${@bb.utils.contains('BBMULTICONFIG', 'versal-fw', 'psm-firmware-versal-mb', 'psm-${MACHINE}', d)}"
diff --git a/meta-xilinx-bsp/conf/machine/include/soc-zynqmp.inc b/meta-xilinx-bsp/conf/machine/include/soc-zynqmp.inc
index fb45b73f..9849efd2 100644
--- a/meta-xilinx-bsp/conf/machine/include/soc-zynqmp.inc
+++ b/meta-xilinx-bsp/conf/machine/include/soc-zynqmp.inc
@@ -26,3 +26,14 @@ WIC_DEPENDS ?= "virtual/kernel virtual/bootloader virtual/boot-bin virtual/arm-t
UBOOT_SUFFIX ?= "bin"
XSERVER_EXT_zynqmp ?= "xf86-video-armsoc"
+
+# Default PMU ROM
+PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
+
+# Default, if multiconfig is off, call pmu-firmware directly, otherwise call the zynqmp-pmufw multiconfig version
+# The Linux compatible pmu-firmware though requires meta-xilinx-tools
+PMU_DEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'zynqmp-pmufw', '', 'pmu-firmware:do_deploy', d)}"
+PMU_MCDEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'zynqmp-pmufw', 'mc::zynqmp-pmufw:pmu-firmware:do_deploy', '', d)}"
+PMU_FIRMWARE_DEPLOY_DIR ?= "${@bb.utils.contains('BBMULTICONFIG', 'zynqmp-pmufw', '${TOPDIR}/tmp-microblaze-zynqmp-pmufw/deploy/images/${MACHINE}', '${DEPLOY_DIR_IMAGE}', d)}"
+PMU_FIRMWARE_IMAGE_NAME ?= "${@bb.utils.contains('BBMULTICONFIG', 'zynqmp-pmufw', 'pmu-firmware-zynqmp-pmu', 'pmu-${MACHINE}', d)}"
+
diff --git a/meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf b/meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf
index f31c10cf..ad65087c 100644
--- a/meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf
@@ -19,9 +19,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zcu100-revC.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/vck-sc-zynqmp.conf b/meta-xilinx-bsp/conf/machine/vck-sc-zynqmp.conf
index 6a453a2c..6e4f2872 100644
--- a/meta-xilinx-bsp/conf/machine/vck-sc-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/vck-sc-zynqmp.conf
@@ -13,10 +13,6 @@ SPL_BINARY ?= "spl/boot.bin"
SERIAL_CONSOLES ?= "115200;ttyPS0"
-# PMU instance args
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/vck190-versal.conf b/meta-xilinx-bsp/conf/machine/vck190-versal.conf
index 647a6b5b..28a07eb4 100644
--- a/meta-xilinx-bsp/conf/machine/vck190-versal.conf
+++ b/meta-xilinx-bsp/conf/machine/vck190-versal.conf
@@ -36,11 +36,6 @@ IMAGE_BOOT_FILES += " \
Image \
boot.scr \
"
-PLM_DEPLOY_DIR ?= "{TOPDIR}/versalmbtmp/deploy/images/versal-mb"
-PLM_IMAGE_NAME ?= "plm-versal-mb"
-PSM_FIRMWARE_DEPLOY_DIR ?= "{TOPDIR}/versalmbtmp/deploy/images/versal-mb"
-PSM_FIRMWARE_IMAGE_NAME ?= "psm-firmware-versal-mb"
-
# This machine has a QEMU model, runqemu setup:
QB_MEM = "-m 8G"
diff --git a/meta-xilinx-bsp/conf/machine/versal-generic.conf b/meta-xilinx-bsp/conf/machine/versal-generic.conf
index dd6966a0..2816a9b1 100644
--- a/meta-xilinx-bsp/conf/machine/versal-generic.conf
+++ b/meta-xilinx-bsp/conf/machine/versal-generic.conf
@@ -39,10 +39,6 @@ IMAGE_BOOT_FILES += " \
Image \
boot.scr \
"
-PLM_DEPLOY_DIR ?= "{TOPDIR}/versalmbtmp/deploy/images/versal-mb"
-PLM_IMAGE_NAME ?= "plm-versal-mb"
-PSM_FIRMWARE_DEPLOY_DIR ?= "{TOPDIR}/versalmbtmp/deploy/images/versal-mb"
-PSM_FIRMWARE_IMAGE_NAME ?= "psm-firmware-versal-mb"
# We use the vc-p-a2197-00-versal DTB from the external-hdf.
HDF_MACHINE = "vc-p-a2197-00-versal"
diff --git a/meta-xilinx-bsp/conf/machine/zc1254-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zc1254-zynqmp.conf
index 3bdb215d..0d45a7b3 100644
--- a/meta-xilinx-bsp/conf/machine/zc1254-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zc1254-zynqmp.conf
@@ -18,9 +18,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zc1254-revA.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf
index 2c890cfb..0add656f 100644
--- a/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf
@@ -55,11 +55,6 @@ QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5"
QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
-# PMU instance args
-PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/microblaze-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}"
-PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-microblaze-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-zcu102-zynqmp'}"
-
QB_PMU_OPT = " \
-M microblaze-fdt \
-display none \
diff --git a/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf
index 17a677fe..f97ffa37 100644
--- a/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf
@@ -18,9 +18,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zcu104-revC.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf
index 27ab2a98..045d6f6c 100644
--- a/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf
@@ -16,9 +16,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zcu106-revA.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu111-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu111-zynqmp.conf
index 24e96ad6..813f7453 100644
--- a/meta-xilinx-bsp/conf/machine/zcu111-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu111-zynqmp.conf
@@ -18,9 +18,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zcu111-revA.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu1275-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu1275-zynqmp.conf
index 2ac4004f..91d2761c 100644
--- a/meta-xilinx-bsp/conf/machine/zcu1275-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu1275-zynqmp.conf
@@ -18,9 +18,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zcu1275-revB.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu1285-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu1285-zynqmp.conf
index d7d41d4d..254974e8 100644
--- a/meta-xilinx-bsp/conf/machine/zcu1285-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu1285-zynqmp.conf
@@ -18,9 +18,6 @@ SERIAL_CONSOLES ?= "115200;ttyPS0"
KERNEL_DEVICETREE = "xilinx/zynqmp-zcu1285-revA.dtb"
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu208-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu208-zynqmp.conf
index c69b5f35..673ab9e4 100644
--- a/meta-xilinx-bsp/conf/machine/zcu208-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu208-zynqmp.conf
@@ -15,10 +15,6 @@ SPL_BINARY ?= "spl/boot.bin"
SERIAL_CONSOLES ?= "115200;ttyPS0"
-
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zcu216-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu216-zynqmp.conf
index 4f07e0ea..53cb31ae 100644
--- a/meta-xilinx-bsp/conf/machine/zcu216-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu216-zynqmp.conf
@@ -15,10 +15,6 @@ SPL_BINARY ?= "spl/boot.bin"
SERIAL_CONSOLES ?= "115200;ttyPS0"
-
-PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
-
EXTRA_IMAGEDEPENDS += " \
u-boot-zynq-uenv \
arm-trusted-firmware \
diff --git a/meta-xilinx-bsp/conf/machine/zynqmp-generic.conf b/meta-xilinx-bsp/conf/machine/zynqmp-generic.conf
index 9c7dbe83..b2860b0c 100644
--- a/meta-xilinx-bsp/conf/machine/zynqmp-generic.conf
+++ b/meta-xilinx-bsp/conf/machine/zynqmp-generic.conf
@@ -65,11 +65,6 @@ QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5"
QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
-# PMU instance args
-PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
-PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu' if d.getVar('BMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}"
-PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-zynqmp-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-${MACHINE}'}"
-
QB_PMU_OPT = " \
-M microblaze-fdt \
-display none \
diff --git a/meta-xilinx-bsp/recipes-bsp/embeddedsw/plmfw.bb b/meta-xilinx-bsp/recipes-bsp/embeddedsw/plmfw.bb
new file mode 100644
index 00000000..33c50953
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-bsp/embeddedsw/plmfw.bb
@@ -0,0 +1,64 @@
+DESCRIPTION = "Platform Loader and Manager"
+SUMMARY = "Platform Loader and Manager for Versal devices"
+
+LICENSE = "MIT"
+
+PROVIDES = "virtual/plm"
+
+INHERIT_DEFAULT_DEPENDS = "1"
+
+COMPATIBLE_MACHINE = "^$"
+COMPATIBLE_MACHINE_versal = "versal"
+
+# This is really BOARD specific, but we'll set it MACHINE for now.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Default would be a multiconfig (versal) build
+# For this to work, BBMULTICONFIG += "versal-fw" must be in the user's local.conf!
+PLM_DEPENDS ??= ""
+PLM_MCDEPENDS ??= "mc::versal-fw:plm-firmware:do_deploy"
+
+# This must be defined to the file output by whatever is providing the plm-firmware
+# The following sets the default, but the BSP may select a different name
+PLM_IMAGE_NAME ??= "plm-versal-mb"
+PLM_DEPLOY_DIR ??= "${TOPDIR}/tmp-microblaze-versal-fw/deploy/images/${MACHINE}"
+
+# Default is for the multilib case (without the extension .elf/.bin)
+PLM_FILE ??= "${PLM_DEPLOY_DIR/${PLM_IMAGE_NAME}"
+
+do_fetch[depends] += "${PLM_DEPENDS}"
+do_fetch[mcdepends] += "${PLM_MCDEPENDS}"
+
+inherit update-alternatives deploy
+
+BINARY_NAME = "${PN}"
+BINARY_EXT = ".elf"
+BINARY_ID = "${@d.getVar('SRCPV') if d.getVar('SRCPV') else d.getVar('PR') }"
+
+do_install() {
+ if [ ! -e ${PLM_FILE}${BINARY_EXT} ]; then
+ echo "Unable to find PLM_FILE (${PLM_FILE}${BINARY_EXT})"
+ exit 1
+ fi
+
+ install -Dm 0644 ${PLM_FILE}${BINARY_EXT} ${D}/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}
+}
+
+do_deploy() {
+ # If the item is already in OUR deploy_image_dir, nothing to deploy!
+ if [ "x${@'' if d.getVar('PLM_FILE').startswith(d.getVar('DEPLOY_IMAGE_DIR')) else 'copy'}" != "x" ]; then
+ install -Dm 0644 ${PLM_FILE}.elf ${DEPLOYDIR}/${PLM_IMAGE_NAME}.elf
+ install -Dm 0644 ${PLM_FILE}.bin ${DEPLOYDIR}/${PLM_IMAGE_NAME}.bin
+ fi
+}
+
+
+ALTERNATIVE_${PN} = "plmfw"
+ALTERNATIVE_TARGET[plmfw] = "/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}"
+ALTERNATIVE_LINK_NAME[plmfw] = "/boot/${BINARY_NAME}${BINARY_EXT}"
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
+
+SYSROOT_DIRS += "/boot"
+FILES_${PN} = "/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}"
diff --git a/meta-xilinx-bsp/recipes-bsp/embeddedsw/pmufw.bb b/meta-xilinx-bsp/recipes-bsp/embeddedsw/pmufw.bb
new file mode 100644
index 00000000..3af12cfe
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-bsp/embeddedsw/pmufw.bb
@@ -0,0 +1,65 @@
+DESCRIPTION = "PMU Firmware"
+
+LICENSE = "MIT"
+
+PROVIDES = "virtual/pmu-firmware"
+
+INHERIT_DEFAULT_DEPENDS = "1"
+
+COMPATIBLE_MACHINE = "^$"
+COMPATIBLE_MACHINE_zynqmp = "zynqmp"
+
+# This is really BOARD specific, but we'll set it MACHINE for now.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Default would be a multiconfig (zynqmp-pmufw) build
+# For this to work, BBMULTICONFIG += "zynqmp-pmufw" must be in the user's local.conf!
+PMU_DEPENDS ??= ""
+PMU_MCDEPENDS ??= "mc::zynqmp-pmufw:pmu-firmware:do_deploy"
+
+# This must be defined to the file output by whatever is providing the pmu-firmware
+# The following sets the default, but the BSP may select a different name
+PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-zynqmp-pmu"
+PMU_FIRMWARE_DEPLOY_DIR ??= "${TOPDIR}/tmp-microblaze-zynqmp-pmufw/deploy/images/${MACHINE}"
+
+# Default is for the multilib case (without the extension .elf/.bin)
+PMU_FILE ??= "${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}"
+
+do_fetch[depends] += "${PMU_DEPENDS}"
+do_fetch[mcdepends] += "${PMU_MCDEPENDS}"
+
+inherit deploy update-alternatives
+
+BINARY_NAME = "${PN}"
+BINARY_EXT = ".elf"
+BINARY_ID = "${@d.getVar('SRCPV') if d.getVar('SRCPV') else d.getVar('PR') }"
+
+do_install() {
+ if [ ! -e ${PMU_FILE}${BINARY_EXT} ]; then
+ echo "Unable to find PMU_FILE (${PMU_FILE}${BINARY_EXT})"
+ exit 1
+ fi
+
+ install -Dm 0644 ${PMU_FILE}${BINARY_EXT} ${D}/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}
+}
+
+# If the item is already in OUR deploy_image_dir, nothing to deploy!
+SHOULD_DEPLOY = "${@'false' if (d.getVar('PMU_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}"
+do_deploy() {
+ if ${SHOULD_DEPLOY}; then
+ install -Dm 0644 ${PMU_FILE}.elf ${DEPLOYDIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf
+ install -Dm 0644 ${PMU_FILE}.bin ${DEPLOYDIR}/${PMU_FIRMWARE_IMAGE_NAME}.bin
+ fi
+}
+
+addtask deploy before do_build after do_install
+
+ALTERNATIVE_${PN} = "pmufw"
+ALTERNATIVE_TARGET[pmufw] = "/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}"
+ALTERNATIVE_LINK_NAME[pmufw] = "/boot/${BINARY_NAME}${BINARY_EXT}"
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
+
+SYSROOT_DIRS += "/boot"
+FILES_${PN} = "/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}"
diff --git a/meta-xilinx-bsp/recipes-bsp/embeddedsw/psmfw.bb b/meta-xilinx-bsp/recipes-bsp/embeddedsw/psmfw.bb
new file mode 100644
index 00000000..24044f77
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-bsp/embeddedsw/psmfw.bb
@@ -0,0 +1,63 @@
+DESCRIPTION = "PSM Firmware"
+SUMMARY = "PSM firmware for versal devices"
+
+LICENSE = "MIT"
+
+PROVIDES = "virtual/psm-firmware"
+
+INHERIT_DEFAULT_DEPENDS = "1"
+
+COMPATIBLE_MACHINE = "^$"
+COMPATIBLE_MACHINE_versal = "versal"
+
+# This is really BOARD specific, but we'll set it MACHINE for now.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Default would be a multiconfig (versal) build
+# For this to work, BBMULTICONFIG += "versal-fw" must be in the user's local.conf!
+PSM_DEPENDS ??= ""
+PSM_MCDEPENDS ??= "mc::versal-fw:psm-firmware:do_deploy"
+
+# This must be defined to the file output by whatever is providing the psm-firmware
+# The following sets the default, but the BSP may select a different name
+PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-versal-mb"
+PSM_FIRMWARE_DEPLOY_DIR ??= "${TOPDIR}/tmp-microblaze-versal-fw/deploy/images/${MACHINE}"
+
+# Default is for the multilib case (without the extension .elf/.bin)
+PSM_FILE ??= "${PSM_FIRMWARE_DEPLOY_DIR}/${PSM_FIRMWARE_IMAGE_NAME}"
+
+do_fetch[depends] += "${PSM_DEPENDS}"
+do_fetch[mcdepends] += "${PSM_MCDEPENDS}"
+
+inherit update-alternatives deploy
+
+BINARY_NAME = "${PN}"
+BINARY_EXT = ".elf"
+BINARY_ID = "${@d.getVar('SRCPV') if d.getVar('SRCPV') else d.getVar('PR') }"
+
+do_install() {
+ if [ ! -e ${PSM_FILE}${BINARY_EXT} ]; then
+ echo "Unable to find PSM_FILE (${PSM_FILE}${BINARY_EXT})"
+ exit 1
+ fi
+
+ install -Dm 0644 ${PSM_FILE}${BINARY_EXT} ${D}/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}
+}
+
+do_deploy() {
+ # If the item is already in OUR deploy_image_dir, nothing to deploy!
+ if [ "x${@'' if d.getVar('PSM_FILE').startswith(d.getVar('DEPLOY_IMAGE_DIR')) else 'copy'}" != "x" ]; then
+ install -Dm 0644 ${PSM_FILE}.elf ${DEPLOYDIR}/${PSM_FIRMWARE_IMAGE_NAME}.elf
+ install -Dm 0644 ${PSM_FILE}.bin ${DEPLOYDIR}/${PSM_FIRMWARE_IMAGE_NAME}.bin
+ fi
+}
+
+ALTERNATIVE_${PN} = "psmfw"
+ALTERNATIVE_TARGET[psmfw] = "/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}"
+ALTERNATIVE_LINK_NAME[psmfw] = "/boot/${BINARY_NAME}${BINARY_EXT}"
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
+
+SYSROOT_DIRS += "/boot"
+FILES_${PN} = "/boot/${BINARY_NAME}-${BINARY_ID}${BINARY_EXT}"
diff --git a/meta-xilinx-standalone/conf/multiconfig/versal-fw.conf b/meta-xilinx-standalone/conf/multiconfig/versal-fw.conf
new file mode 100644
index 00000000..329d7e08
--- /dev/null
+++ b/meta-xilinx-standalone/conf/multiconfig/versal-fw.conf
@@ -0,0 +1,9 @@
+# To be used with a zynqmp machine
+# Re-use the main machine, which SHOULD allow us to override the default tune!
+DEFAULTTUNE = "microblaze"
+TUNE_FEATURES_tune-microblaze = "microblaze v10.0 barrel-shift pattern-compare"
+#LINKER_HASH_STYLE_microblaze = ""
+
+DISTRO = "xilinx-standalone"
+
+TMPDIR = "${TOPDIR}/tmp-microblaze-versal-fw"
diff --git a/meta-xilinx-standalone/conf/multiconfig/zynqmp-pmufw.conf b/meta-xilinx-standalone/conf/multiconfig/zynqmp-pmufw.conf
new file mode 100644
index 00000000..e678e7c2
--- /dev/null
+++ b/meta-xilinx-standalone/conf/multiconfig/zynqmp-pmufw.conf
@@ -0,0 +1,9 @@
+# To be used with a zynqmp machine
+# Re-use the main machine, which SHOULD allow us to override the default tune!
+DEFAULTTUNE = "microblaze"
+TUNE_FEATURES_tune-microblaze = "microblaze v9.2 barrel-shift pattern-compare"
+#LINKER_HASH_STYLE_microblaze = ""
+
+DISTRO = "xilinx-standalone"
+
+TMPDIR = "${TOPDIR}/tmp-microblaze-zynqmp-pmufw"
diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware.inc b/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware.inc
index 57e577ea..e4feba31 100644
--- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware.inc
+++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware.inc
@@ -1,8 +1,6 @@
DESCRIPTION = "Platform Loader and Manager"
SUMMARY = "Platform Loader and Manager for Versal devices"
-PROVIDES = "virtual/plm"
-
inherit xlnx-embeddedsw deploy
COMPATIBLE_HOST = "microblaze.*-elf"
@@ -50,20 +48,28 @@ do_compile() {
oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include"
}
+# All do_compiles need this, even if the base is overriden
+do_compile_append() {
+ ${OBJCOPY} -O binary ${B}/plm.elf ${B}/plm.bin
+}
+
do_install() {
:
}
-PLM_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+PACKAGES = ""
+
+# This is the default in most BSPs. A MACHINE.conf can override this!
+PLM_IMAGE_NAME ??= "plm-versal-mb"
+
+PLM_BASE_NAME ?= "${PLM_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
PLM_BASE_NAME[vardepsexclude] = "DATETIME"
do_deploy() {
install -Dm 0644 ${B}/plm.elf ${DEPLOYDIR}/${PLM_BASE_NAME}.elf
- ln -sf ${PLM_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
- ${OBJCOPY} -O binary ${B}/plm.elf ${B}/plm.bin
+ ln -sf ${PLM_BASE_NAME}.elf ${DEPLOYDIR}/${PLM_IMAGE_NAME}.elf
install -m 0644 ${B}/plm.bin ${DEPLOYDIR}/${PLM_BASE_NAME}.bin
- ln -sf ${PLM_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
+ ln -sf ${PLM_BASE_NAME}.bin ${DEPLOYDIR}/${PLM_IMAGE_NAME}.bin
}
addtask deploy before do_build after do_install
-
diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware.inc b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware.inc
index 01d05a9b..e8674b12 100644
--- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware.inc
+++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware.inc
@@ -1,7 +1,5 @@
DESCRIPTION = "PMU Firmware"
-PROVIDES = "virtual/pmu-firmware"
-
inherit xlnx-embeddedsw deploy
COMPATIBLE_HOST = "microblaze.*-elf"
@@ -20,6 +18,12 @@ do_configure() {
${B}/../misc/copy_bsp.sh
}
+# All do_compiles need this, even if it's overriden
+MB_OBJCOPY ??= "${OBJCOPY}"
+
+# Only add a dependency if we need to use OUR binutils
+DEPENDS .= "${@' virtual/${TARGET_PREFIX}binutils' if d.getVar('MB_OBJCOPY') == d.getVar('OBJCOPY') else ''}"
+
COMPILER = "${CC}"
COMPILER_FLAGS = "-O2 -c"
EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects"
@@ -47,21 +51,27 @@ do_compile() {
# --build-id=none is required due to linker script not defining a location for it.
# Again, recipe-systoot include is necessary
oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include"
+
+ ${MB_OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin
}
do_install() {
:
}
-PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
+PACKAGES = ""
+
+# This is the default in most BSPs. A MACHINE.conf can override this!
+PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-zynqmp-pmu"
+
+PMU_FIRMWARE_BASE_NAME ?= "${PMU_FIRMWARE_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME"
do_deploy() {
install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf
- ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
- ${OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin
+ ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf
install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin
- ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
+ ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${PMU_FIRMWARE_IMAGE_NAME}.bin
}
addtask deploy before do_build after do_install
diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.2.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.2.bb
index 93c8bafc..047f97d9 100644
--- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.2.bb
+++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.2.bb
@@ -45,4 +45,6 @@ do_compile() {
# Again, recipe-systoot include is necessary
echo Construct: executable
oe_runmake executable.elf CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include"
+
+ ${MB_OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin
}
diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_git.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_git.bb
index 2fc69cbe..cdf569c3 100644
--- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_git.bb
+++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_git.bb
@@ -48,4 +48,6 @@ do_compile() {
# Again, recipe-systoot include is necessary
echo Construct: executable
oe_runmake executable.elf CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include"
+
+ ${MB_OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin
}
diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware.inc b/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware.inc
index 05b9a9b5..11e8981b 100644
--- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware.inc
+++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware.inc
@@ -1,8 +1,6 @@
ESCRIPTION = "PSM Firmware"
SUMMARY = "PSM firmware for versal devices"
-PROVIDES = "virtual/psm-firmware"
-
inherit xlnx-embeddedsw deploy
COMPATIBLE_HOST = "microblaze.*-elf"
@@ -50,19 +48,28 @@ do_compile() {
oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include"
}
+# All do compiles need this, even if the base is overriden
+do_compile_append() {
+ ${OBJCOPY} -O binary ${B}/psmfw.elf ${B}/psmfw.bin
+}
+
do_install() {
:
}
-PSM_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+PACKAGES = ""
+
+# This is the default in most BSPs. A MACHINE.conf can override this!
+PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-versal-mb"
+
+PSM_FIRMWARE_BASE_NAME ?= "${PSM_FIRMWARE_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
PSM_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME"
do_deploy() {
install -Dm 0644 ${B}/psmfw.elf ${DEPLOYDIR}/${PSM_FIRMWARE_BASE_NAME}.elf
- ln -sf ${PSM_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
- ${OBJCOPY} -O binary ${B}/psmfw.elf ${B}/psmfw.bin
+ ln -sf ${PSM_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${PSM_FIRMWARE_IMAGE_NAME}.elf
install -m 0644 ${B}/psmfw.bin ${DEPLOYDIR}/${PSM_FIRMWARE_BASE_NAME}.bin
- ln -sf ${PSM_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
+ ln -sf ${PSM_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${PSM_FIRMWARE_IMAGE_NAME}.bin
}
addtask deploy before do_build after do_install