aboutsummaryrefslogtreecommitdiffstats
path: root/meta-xilinx-bsp/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-bsp/recipes-bsp')
-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
3 files changed, 192 insertions, 0 deletions
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}"