diff options
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/embeddedsw')
-rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb | 83 | ||||
-rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb | 93 | ||||
-rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb | 91 | ||||
-rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb | 94 |
4 files changed, 361 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb new file mode 100644 index 00000000..a704d3b5 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb @@ -0,0 +1,83 @@ +DESCRIPTION = "Xilinx First Stage Boot Loader" + +LICENSE = "CLOSED" + +PROVIDES = "virtual/fsbl" + +INHERIT_DEFAULT_DEPENDS = "1" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:zynq = "zynq" +COMPATIBLE_MACHINE:zynqmp = "zynqmp" + +# Since we're just copying, we can run any config +COMPATIBLE_HOST = ".*" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# Default expects the user to provide the fsbl in the deploy +# directory, named "fsbl.elf" +# A machine, multiconfig, or local.conf should override this +FSBL_DEPENDS ??= "" +FSBL_MCDEPENDS ??= "" +FSBL_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" +FSBL_DEPLOY_DIR[vardepsexclude] += "TOPDIR" +FSBL_IMAGE_NAME ??= "fsbl-${MACHINE}" + +# Default is for the multilib case (without the extension .elf) +FSBL_FILE ??= "${FSBL_DEPLOY_DIR}/${FSBL_IMAGE_NAME}" +FSBL_FILE[vardepsexclude] = "FSBL_DEPLOY_DIR" + +do_fetch[depends] += "${FSBL_DEPENDS}" +do_fetch[mcdepends] += "${FSBL_MCDEPENDS}" + +inherit deploy + +do_install() { + if [ ! -e ${FSBL_FILE}.elf ]; then + echo "Unable to find FSBL_FILE (${FSBL_FILE}.elf)" + exit 1 + fi + + install -Dm 0644 ${FSBL_FILE}.elf ${D}/boot/${PN}.elf +} + +# If the item is already in OUR deploy_image_dir, nothing to deploy! +SHOULD_DEPLOY = "${@'false' if (d.getVar('FSBL_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" +do_deploy() { + # If the item is already in OUR deploy_image_dir, nothing to deploy! + if ${SHOULD_DEPLOY}; then + install -Dm 0644 ${FSBL_FILE}.elf ${DEPLOYDIR}/${FSBL_IMAGE_NAME}.elf + fi +} + +addtask deploy before do_build after do_install + +INSANE_SKIP:${PN} = "arch" +INSANE_SKIP:${PN}-dbg = "arch" + +# Disable buildpaths QA check warnings. +INSANE_SKIP:${PN} += "buildpaths" + +SYSROOT_DIRS += "/boot" +FILES:${PN} = "/boot/${PN}.elf" + +def check_fsbl_variables(d): + # If both are blank, the user MUST pass in the path to the firmware! + if not d.getVar('FSBL_DEPENDS') and not d.getVar('FSBL_MCDEPENDS'): + # Don't cache this, as the items on disk can change! + d.setVar('BB_DONT_CACHE', '1') + + if not os.path.exists(d.getVar('FSBL_FILE') + ".elf"): + if not d.getVar('WITHIN_EXT_SDK'): + raise bb.parse.SkipRecipe("The expected file %s.elf is not available.\nSet FSBL_FILE to the path with a precompiled FSBL binary. See the meta-xilinx-core README for more information." % d.getVar('FSBL_FILE')) + else: + # We found the file, so be sure to track it + d.setVar('SRC_URI', 'file://${FSBL_FILE}.elf') + d.setVarFlag('do_install', 'file-checksums', '${FSBL_FILE}.elf:True') + d.setVarFlag('do_deploy', 'file-checksums', '${FSBL_FILE}.elf:True') + +python() { + # Need to allow bbappends to change the check + check_fsbl_variables(d) +} diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb new file mode 100644 index 00000000..d398ca88 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb @@ -0,0 +1,93 @@ +DESCRIPTION = "Platform Loader and Manager" +SUMMARY = "Platform Loader and Manager for Versal devices" + +LICENSE = "CLOSED" + +PROVIDES = "virtual/plm" + +INHERIT_DEFAULT_DEPENDS = "1" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:versal = ".*" + +# Since we're just copying, we can run any config +COMPATIBLE_HOST = ".*" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# Default expects the user to provide the plm-firmware in the deploy +# directory, named "plm-${MACHINE}.elf" and "plm-${MACHINE}.bin" +# A machine, multiconfig, or local.conf should override this +PLM_DEPENDS ??= "" +PLM_MCDEPENDS ??= "" +PLM_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" +PLM_DEPLOY_DIR[vardepsexclude] += "TOPDIR" +PLM_IMAGE_NAME ??= "plm-${MACHINE}" + +# Default is for the multilib case (without the extension .elf/.bin) +PLM_FILE ??= "${PLM_DEPLOY_DIR}/${PLM_IMAGE_NAME}" +PLM_FILE[vardepsexclude] = "PLM_DEPLOY_DIR" + +do_fetch[depends] += "${PLM_DEPENDS}" +do_fetch[mcdepends] += "${PLM_MCDEPENDS}" + +inherit deploy + +do_install() { + if [ ! -e ${PLM_FILE}.elf ]; then + echo "Unable to find PLM_FILE (${PLM_FILE}.elf)" + exit 1 + fi + + install -Dm 0644 ${PLM_FILE}.elf ${D}/boot/${PN}.elf +} + +# If the item is already in OUR deploy_image_dir, nothing to deploy! +SHOULD_DEPLOY = "${@'false' if (d.getVar('PLM_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" +do_deploy() { + # If the item is already in OUR deploy_image_dir, nothing to deploy! + if ${SHOULD_DEPLOY}; then + install -Dm 0644 ${PLM_FILE}.elf ${DEPLOYDIR}/${PLM_IMAGE_NAME}.elf + install -Dm 0644 ${PLM_FILE}.bin ${DEPLOYDIR}/${PLM_IMAGE_NAME}.bin + fi +} + +addtask deploy before do_build after do_install + +INSANE_SKIP:${PN} = "arch" +INSANE_SKIP:${PN}-dbg = "arch" + +# Disable buildpaths QA check warnings. +INSANE_SKIP:${PN} += "buildpaths" + +SYSROOT_DIRS += "/boot" +FILES:${PN} = "/boot/${PN}.elf" + +def check_plm_vars(d): + # If both are blank, the user MUST pass in the path to the firmware! + if not d.getVar('PLM_DEPENDS') and not d.getVar('PLM_MCDEPENDS'): + # Don't cache this, as the items on disk can change! + d.setVar('BB_DONT_CACHE', '1') + + msg = "" + fail = False + if not os.path.exists(d.getVar('PLM_FILE') + ".elf"): + msg = msg + "The expected file %s.elf is not available. " % d.getVar('PLM_FILE') + fail = True + if not os.path.exists(d.getVar('PLM_FILE') + ".bin"): + msg = msg + "The expected file %s.bin is not available. " % d.getVar('PLM_FILE') + fail = True + if fail: + if not d.getVar('WITHIN_EXT_SDK'): + raise bb.parse.SkipRecipe("%s\nSee the meta-xilinx-core README." % msg) + else: + # We found the file, so be sure to track it + d.setVar('SRC_URI', 'file://${PLM_FILE}.elf file://${PLM_FILE}.bin') + d.setVarFlag('do_install', 'file-checksums', '${PLM_FILE}.elf:True') + d.setVarFlag('do_deploy', 'file-checksums', '${PLM_FILE}.elf:True ${PLM_FILE}.bin:True') + +python() { + # Need to allow bbappends to change the check + check_plm_vars(d) +} + diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb new file mode 100644 index 00000000..913e9088 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb @@ -0,0 +1,91 @@ +DESCRIPTION = "PMU Firmware" + +LICENSE = "CLOSED" + +PROVIDES = "virtual/pmu-firmware" + +INHERIT_DEFAULT_DEPENDS = "1" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:zynqmp = ".*" + +# Since we're just copying, we can run any config +COMPATIBLE_HOST = ".*" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# Default expects the user to provide the pmu-firmware in the deploy +# directory, named "pmu-firmware-${MACHINE}.elf" and "pmu-firmware-${MACHINE}.bin" +# A machine, multiconfig, or local.conf should override this +PMU_DEPENDS ??= "" +PMU_MCDEPENDS ??= "" +PMU_FIRMWARE_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" +PMU_FIRMWARE_DEPLOY_DIR[vardepsexclude] += "TOPDIR" +PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-${MACHINE}" + +# Default is for the multilib case (without the extension .elf/.bin) +PMU_FILE ??= "${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}" +PMU_FILE[vardepsexclude] = "PMU_FIRMWARE_DEPLOY_DIR" + +do_fetch[depends] += "${PMU_DEPENDS}" +do_fetch[mcdepends] += "${PMU_MCDEPENDS}" + +inherit deploy + +do_install() { + if [ ! -e ${PMU_FILE}.elf ]; then + echo "Unable to find PMU_FILE (${PMU_FILE}.elf)" + exit 1 + fi + + install -Dm 0644 ${PMU_FILE}.elf ${D}/boot/${PN}.elf +} + +# 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 + +INSANE_SKIP:${PN} = "arch" +INSANE_SKIP:${PN}-dbg = "arch" + +# Disable buildpaths QA check warnings. +INSANE_SKIP:${PN} += "buildpaths" + +SYSROOT_DIRS += "/boot" +FILES:${PN} = "/boot/${PN}.elf" + +def check_pmu_vars(d): + # If both are blank, the user MUST pass in the path to the firmware! + if not d.getVar('PMU_DEPENDS') and not d.getVar('PMU_MCDEPENDS'): + # Don't cache this, as the items on disk can change! + d.setVar('BB_DONT_CACHE', '1') + + msg = "" + fail = False + if not os.path.exists(d.getVar('PMU_FILE') + ".elf"): + msg = msg + "The expected file %s.elf is not available. " % d.getVar('PMU_FILE') + fail = True + if not os.path.exists(d.getVar('PMU_FILE') + ".bin"): + msg = msg + "The expected file %s.bin is not available. " % d.getVar('PMU_FILE') + fail = True + if fail: + if not d.getVar('WITHIN_EXT_SDK'): + raise bb.parse.SkipRecipe("%s See the meta-xilinx-core README." % msg) + else: + # We found the file, so be sure to track it + d.setVar('SRC_URI', 'file://${PMU_FILE}.elf file://${PMU_FILE}.bin') + d.setVarFlag('do_install', 'file-checksums', '${PMU_FILE}.elf:True') + d.setVarFlag('do_deploy', 'file-checksums', '${PMU_FILE}.elf:True ${PMU_FILE}.bin:True') + + +python() { + # Need to allow bbappends to change the check + check_pmu_vars(d) +} diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb new file mode 100644 index 00000000..27f921b9 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb @@ -0,0 +1,94 @@ +DESCRIPTION = "PSM Firmware" +SUMMARY = "PSM firmware for versal devices" + +LICENSE = "CLOSED" + +PROVIDES = "virtual/psm-firmware" + +INHERIT_DEFAULT_DEPENDS = "1" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:versal = ".*" + +# Since we're just copying, we can run any config +COMPATIBLE_HOST = ".*" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# Default expects the user to provide the psm-firmware in the deploy +# directory, named "psm-firmware-${MACHINE}.elf" and "psm-firmware-${MACHINE}.bin" +# A machine, multiconfig, or local.conf should override this +PSM_DEPENDS ??= "" +PSM_MCDEPENDS ??= "" +PSM_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" +PSM_FIRMWARE_DEPLOY_DIR[vardepsexclude] += "TOPDIR" +PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-${MACHINE}" + +# Default is for the multilib case (without the extension .elf/.bin) +PSM_FILE ??= "${PSM_FIRMWARE_DEPLOY_DIR}/${PSM_FIRMWARE_IMAGE_NAME}" +PSM_FILE[vardepsexclude] = "PSM_FIRMWARE_DEPLOY_DIR" + +do_fetch[depends] += "${PSM_DEPENDS}" +do_fetch[mcdepends] += "${PSM_MCDEPENDS}" + +inherit deploy + +do_install() { + if [ ! -e ${PSM_FILE}.elf ]; then + echo "Unable to find PSM_FILE (${PSM_FILE}.elf)" + exit 1 + fi + + install -Dm 0644 ${PSM_FILE}.elf ${D}/boot/${PN}.elf +} + +# If the item is already in OUR deploy_image_dir, nothing to deploy! +SHOULD_DEPLOY = "${@'false' if (d.getVar('PSM_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" +do_deploy() { + # If the item is already in OUR deploy_image_dir, nothing to deploy! + if ${SHOULD_DEPLOY}; 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 +} + +addtask deploy before do_build after do_install + +INSANE_SKIP:${PN} = "arch" +INSANE_SKIP:${PN}-dbg = "arch" + +# Disable buildpaths QA check warnings. +INSANE_SKIP:${PN} += "buildpaths" + +SYSROOT_DIRS += "/boot" +FILES:${PN} = "/boot/${PN}.elf" + +def check_psm_vars(d): + # If both are blank, the user MUST pass in the path to the firmware! + if not d.getVar('PSM_DEPENDS') and not d.getVar('PSM_MCDEPENDS'): + # Don't cache this, as the items on disk can change! + d.setVar('BB_DONT_CACHE', '1') + + msg = "" + fail = False + if not os.path.exists(d.getVar('PSM_FILE') + ".elf"): + msg = msg + "The expected file %s.elf is not available. " % d.getVar('PSM_FILE') + fail = True + if not os.path.exists(d.getVar('PSM_FILE') + ".bin"): + msg = msg + "The expected file %s.bin is not available. " % d.getVar('PSM_FILE') + fail = True + + if fail: + if not d.getVar('WITHIN_EXT_SDK'): + raise bb.parse.SkipRecipe("%s\nSee the meta-xilinx-core README." % msg) + else: + # We found the file, so be sure to track it + d.setVar('SRC_URI', 'file://${PSM_FILE}.elf file://${PSM_FILE}.bin') + d.setVarFlag('do_install', 'file-checksums', '${PSM_FILE}.elf:True') + d.setVarFlag('do_deploy', 'file-checksums', '${PSM_FILE}.elf:True ${PSM_FILE}.bin:True') + +python() { + # Need to allow bbappends to change the check + check_psm_vars(d) +} + |