diff options
| author | Mark Hatle <mark.hatle@xilinx.com> | 2022-01-21 12:53:12 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@xilinx.com> | 2022-01-23 12:17:00 -0800 |
| commit | 84db3b3d44099132f6aa0e6049d5727e4a0b0fbc (patch) | |
| tree | 08cc4eb9ed182815cdc69b53775f33522cdfb5be /meta-xilinx-core/recipes-bsp/embeddedsw | |
| parent | 2c4e691200c816037a5760fe9749b28cca06c023 (diff) | |
| download | meta-xilinx-84db3b3d44099132f6aa0e6049d5727e4a0b0fbc.tar.gz | |
embeddedsw: Rework the embeddedsw copy firmware recipes
fsbl, plmfw, pufw, and psmfw are reworked to provide earlier error messages,
and better handle multiconfig builds.
Also adjust MACHINE specific changes to use .* for compatibility based on the
SOC_FAMILY override. The system doesn't always set the SOC_FAMILY as
COMPATIBLE_MACHINE, so this avoids an error of incompatible machine.
Align all of the expected firmware filenames to be <firmware>-${MACHINE}.
The user can override as necessary.
The license moves to CLOSED as we don't know the license of the software being
provided by the user or other dependencies. It'll be up to the user to
reconcile it.
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/embeddedsw')
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb | 41 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb | 50 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb | 50 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb | 51 |
4 files changed, 152 insertions, 40 deletions
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb index ae2123e7..f8679f0e 100644 --- a/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | DESCRIPTION = "Xilinx First Stage Boot Loader" | 1 | DESCRIPTION = "Xilinx First Stage Boot Loader" |
| 2 | 2 | ||
| 3 | LICENSE = "MIT" | 3 | LICENSE = "CLOSED" |
| 4 | 4 | ||
| 5 | PROVIDES = "virtual/fsbl" | 5 | PROVIDES = "virtual/fsbl" |
| 6 | 6 | ||
| @@ -10,19 +10,21 @@ COMPATIBLE_MACHINE = "^$" | |||
| 10 | COMPATIBLE_MACHINE:zynq = "zynq" | 10 | COMPATIBLE_MACHINE:zynq = "zynq" |
| 11 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | 11 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" |
| 12 | 12 | ||
| 13 | # Since we're just copying, we can run any config | ||
| 14 | COMPATIBLE_HOST = ".*" | ||
| 15 | |||
| 13 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 16 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 14 | 17 | ||
| 15 | # Default would be a multiconfig (versal) build | 18 | # Default expects the user to provide the fsbl in the deploy |
| 16 | # For this to work, BBMULTICONFIG += "fsbl-fw" must be in the user's local.conf! | 19 | # directory, named "fsbl.elf" |
| 20 | # A machine, multiconfig, or local.conf should override this | ||
| 17 | FSBL_DEPENDS ??= "" | 21 | FSBL_DEPENDS ??= "" |
| 18 | FSBL_MCDEPENDS ??= "mc::fsbl-fw:fsbl-firmware:do_deploy" | 22 | FSBL_MCDEPENDS ??= "" |
| 19 | 23 | FSBL_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | |
| 20 | # This must be defined to the file output by whatever is providing the fsbl-firmware | 24 | FSBL_DEPLOY_DIR[vardepsexclude] += "TOPDIR" |
| 21 | # The following sets the default, but the BSP may select a different name | 25 | FSBL_IMAGE_NAME ??= "fsbl-${MACHINE}" |
| 22 | FSBL_IMAGE_NAME ??= "fsbl" | ||
| 23 | FSBL_DEPLOY_DIR ??= "${TOPDIR}/tmp-fsbl-fw/deploy/images/${MACHINE}" | ||
| 24 | 26 | ||
| 25 | # Default is for the multilib case (without the extension .elf/.bin) | 27 | # Default is for the multilib case (without the extension .elf) |
| 26 | FSBL_FILE ??= "${FSBL_DEPLOY_DIR}/${FSBL_IMAGE_NAME}" | 28 | FSBL_FILE ??= "${FSBL_DEPLOY_DIR}/${FSBL_IMAGE_NAME}" |
| 27 | FSBL_FILE[vardepsexclude] = "FSBL_DEPLOY_DIR" | 29 | FSBL_FILE[vardepsexclude] = "FSBL_DEPLOY_DIR" |
| 28 | 30 | ||
| @@ -56,3 +58,22 @@ INSANE_SKIP:${PN}-dbg = "arch" | |||
| 56 | 58 | ||
| 57 | SYSROOT_DIRS += "/boot" | 59 | SYSROOT_DIRS += "/boot" |
| 58 | FILES:${PN} = "/boot/${PN}.elf" | 60 | FILES:${PN} = "/boot/${PN}.elf" |
| 61 | |||
| 62 | def check_fsbl_variables(d): | ||
| 63 | # If both are blank, the user MUST pass in the path to the firmware! | ||
| 64 | if not d.getVar('FSBL_DEPENDS') and not d.getVar('FSBL_MCDEPENDS'): | ||
| 65 | # Don't cache this, as the items on disk can change! | ||
| 66 | d.setVar('BB_DONT_CACHE', '1') | ||
| 67 | |||
| 68 | if not os.path.exists(d.getVar('FSBL_FILE') + ".elf"): | ||
| 69 | raise bb.parse.SkipRecipe("The expect 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')) | ||
| 70 | else: | ||
| 71 | # We found the file, so be sure to track it | ||
| 72 | d.setVar('SRC_URI', 'file://${FSBL_FILE}.elf') | ||
| 73 | d.setVarFlag('do_install', 'file-checksums', '${FSBL_FILE}.elf:True') | ||
| 74 | d.setVarFlag('do_deploy', 'file-checksums', '${FSBL_FILE}.elf:True') | ||
| 75 | |||
| 76 | python() { | ||
| 77 | # Need to allow bbappends to change the check | ||
| 78 | check_fsbl_variables(d) | ||
| 79 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb index 6a2a5172..0306ef46 100644 --- a/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb | |||
| @@ -1,26 +1,28 @@ | |||
| 1 | DESCRIPTION = "Platform Loader and Manager" | 1 | DESCRIPTION = "Platform Loader and Manager" |
| 2 | SUMMARY = "Platform Loader and Manager for Versal devices" | 2 | SUMMARY = "Platform Loader and Manager for Versal devices" |
| 3 | 3 | ||
| 4 | LICENSE = "MIT" | 4 | LICENSE = "CLOSED" |
| 5 | 5 | ||
| 6 | PROVIDES = "virtual/plm" | 6 | PROVIDES = "virtual/plm" |
| 7 | 7 | ||
| 8 | INHERIT_DEFAULT_DEPENDS = "1" | 8 | INHERIT_DEFAULT_DEPENDS = "1" |
| 9 | 9 | ||
| 10 | COMPATIBLE_MACHINE = "^$" | 10 | COMPATIBLE_MACHINE = "^$" |
| 11 | COMPATIBLE_MACHINE:versal = "versal" | 11 | COMPATIBLE_MACHINE:versal = ".*" |
| 12 | |||
| 13 | # Since we're just copying, we can run any config | ||
| 14 | COMPATIBLE_HOST = ".*" | ||
| 12 | 15 | ||
| 13 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 16 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 14 | 17 | ||
| 15 | # Default would be a multiconfig (versal) build | 18 | # Default expects the user to provide the plm-firmware in the deploy |
| 16 | # For this to work, BBMULTICONFIG += "versal-fw" must be in the user's local.conf! | 19 | # directory, named "plm-${MACHINE}.elf" and "plm-${MACHINE}.bin" |
| 20 | # A machine, multiconfig, or local.conf should override this | ||
| 17 | PLM_DEPENDS ??= "" | 21 | PLM_DEPENDS ??= "" |
| 18 | PLM_MCDEPENDS ??= "mc::versal-fw:plm-firmware:do_deploy" | 22 | PLM_MCDEPENDS ??= "" |
| 19 | 23 | PLM_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | |
| 20 | # This must be defined to the file output by whatever is providing the plm-firmware | 24 | PLM_DEPLOY_DIR[vardepsexclude] += "TOPDIR" |
| 21 | # The following sets the default, but the BSP may select a different name | 25 | PLM_IMAGE_NAME ??= "plm-${MACHINE}" |
| 22 | PLM_IMAGE_NAME ??= "plm-versal-mb" | ||
| 23 | PLM_DEPLOY_DIR ??= "${TOPDIR}/tmp-microblaze-versal-fw/deploy/images/${MACHINE}" | ||
| 24 | 26 | ||
| 25 | # Default is for the multilib case (without the extension .elf/.bin) | 27 | # Default is for the multilib case (without the extension .elf/.bin) |
| 26 | PLM_FILE ??= "${PLM_DEPLOY_DIR}/${PLM_IMAGE_NAME}" | 28 | PLM_FILE ??= "${PLM_DEPLOY_DIR}/${PLM_IMAGE_NAME}" |
| @@ -57,3 +59,31 @@ INSANE_SKIP:${PN}-dbg = "arch" | |||
| 57 | 59 | ||
| 58 | SYSROOT_DIRS += "/boot" | 60 | SYSROOT_DIRS += "/boot" |
| 59 | FILES:${PN} = "/boot/${PN}.elf" | 61 | FILES:${PN} = "/boot/${PN}.elf" |
| 62 | |||
| 63 | def check_plm_vars(d): | ||
| 64 | # If both are blank, the user MUST pass in the path to the firmware! | ||
| 65 | if not d.getVar('PLM_DEPENDS') and not d.getVar('PLM_MCDEPENDS'): | ||
| 66 | # Don't cache this, as the items on disk can change! | ||
| 67 | d.setVar('BB_DONT_CACHE', '1') | ||
| 68 | |||
| 69 | msg = "" | ||
| 70 | fail = False | ||
| 71 | if not os.path.exists(d.getVar('PLM_FILE') + ".elf"): | ||
| 72 | msg = msg + "The expected file %s.elf is not available. " % d.getVar('PLM_FILE') | ||
| 73 | fail = True | ||
| 74 | if not os.path.exists(d.getVar('PLM_FILE') + ".bin"): | ||
| 75 | msg = msg + "The expected file %s.bin is not available. " % d.getVar('PLM_FILE') | ||
| 76 | fail = True | ||
| 77 | if fail: | ||
| 78 | raise bb.parse.SkipRecipe("%s\nSee the meta-xilinx-core README." % msg) | ||
| 79 | else: | ||
| 80 | # We found the file, so be sure to track it | ||
| 81 | d.setVar('SRC_URI', 'file://${PLM_FILE}.elf file://${PLM_FILE}.bin') | ||
| 82 | d.setVarFlag('do_install', 'file-checksums', '${PLM_FILE}.elf:True') | ||
| 83 | d.setVarFlag('do_deploy', 'file-checksums', '${PLM_FILE}.elf:True ${PLM_FILE}.bin:True') | ||
| 84 | |||
| 85 | python() { | ||
| 86 | # Need to allow bbappends to change the check | ||
| 87 | check_plm_vars(d) | ||
| 88 | } | ||
| 89 | |||
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb index ea0eb5a6..b3f9664e 100644 --- a/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb | |||
| @@ -1,25 +1,27 @@ | |||
| 1 | DESCRIPTION = "PMU Firmware" | 1 | DESCRIPTION = "PMU Firmware" |
| 2 | 2 | ||
| 3 | LICENSE = "MIT" | 3 | LICENSE = "CLOSED" |
| 4 | 4 | ||
| 5 | PROVIDES = "virtual/pmu-firmware" | 5 | PROVIDES = "virtual/pmu-firmware" |
| 6 | 6 | ||
| 7 | INHERIT_DEFAULT_DEPENDS = "1" | 7 | INHERIT_DEFAULT_DEPENDS = "1" |
| 8 | 8 | ||
| 9 | COMPATIBLE_MACHINE = "^$" | 9 | COMPATIBLE_MACHINE = "^$" |
| 10 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | 10 | COMPATIBLE_MACHINE:zynqmp = ".*" |
| 11 | |||
| 12 | # Since we're just copying, we can run any config | ||
| 13 | COMPATIBLE_HOST = ".*" | ||
| 11 | 14 | ||
| 12 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 15 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 13 | 16 | ||
| 14 | # Default would be a multiconfig (zynqmp-pmufw) build | 17 | # Default expects the user to provide the pmu-firmware in the deploy |
| 15 | # For this to work, BBMULTICONFIG += "zynqmp-pmufw" must be in the user's local.conf! | 18 | # directory, named "pmu-firmware-${MACHINE}.elf" and "pmu-firmware-${MACHINE}.bin" |
| 19 | # A machine, multiconfig, or local.conf should override this | ||
| 16 | PMU_DEPENDS ??= "" | 20 | PMU_DEPENDS ??= "" |
| 17 | PMU_MCDEPENDS ??= "mc::zynqmp-pmufw:pmu-firmware:do_deploy" | 21 | PMU_MCDEPENDS ??= "" |
| 18 | 22 | PMU_FIRMWARE_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | |
| 19 | # This must be defined to the file output by whatever is providing the pmu-firmware | 23 | PMU_FIRMWARE_DEPLOY_DIR[vardepsexclude] += "TOPDIR" |
| 20 | # The following sets the default, but the BSP may select a different name | 24 | PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-${MACHINE}" |
| 21 | PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-zynqmp-pmu" | ||
| 22 | PMU_FIRMWARE_DEPLOY_DIR ??= "${TOPDIR}/tmp-microblaze-zynqmp-pmufw/deploy/images/${MACHINE}" | ||
| 23 | 25 | ||
| 24 | # Default is for the multilib case (without the extension .elf/.bin) | 26 | # Default is for the multilib case (without the extension .elf/.bin) |
| 25 | PMU_FILE ??= "${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}" | 27 | PMU_FILE ??= "${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}" |
| @@ -55,3 +57,31 @@ INSANE_SKIP:${PN}-dbg = "arch" | |||
| 55 | 57 | ||
| 56 | SYSROOT_DIRS += "/boot" | 58 | SYSROOT_DIRS += "/boot" |
| 57 | FILES:${PN} = "/boot/${PN}.elf" | 59 | FILES:${PN} = "/boot/${PN}.elf" |
| 60 | |||
| 61 | def check_pmu_vars(d): | ||
| 62 | # If both are blank, the user MUST pass in the path to the firmware! | ||
| 63 | if not d.getVar('PMU_FIRMWARE_DEPENDS') and not d.getVar('PMU_FIRMWARE_MCDEPENDS'): | ||
| 64 | # Don't cache this, as the items on disk can change! | ||
| 65 | d.setVar('BB_DONT_CACHE', '1') | ||
| 66 | |||
| 67 | msg = "" | ||
| 68 | fail = False | ||
| 69 | if not os.path.exists(d.getVar('PMU_FILE') + ".elf"): | ||
| 70 | msg = msg + "The expected file %s.elf is not available. " % d.getVar('PMU_FILE') | ||
| 71 | fail = True | ||
| 72 | if not os.path.exists(d.getVar('PMU_FILE') + ".bin"): | ||
| 73 | msg = msg + "The expected file %s.bin is not available. " % d.getVar('PMU_FILE') | ||
| 74 | fail = True | ||
| 75 | if fail: | ||
| 76 | raise bb.parse.SkipRecipe("%s See the meta-xilinx-core README." % msg) | ||
| 77 | else: | ||
| 78 | # We found the file, so be sure to track it | ||
| 79 | d.setVar('SRC_URI', 'file://${PMU_FILE}.elf file://${PMU_FILE}.bin') | ||
| 80 | d.setVarFlag('do_install', 'file-checksums', '${PMU_FILE}.elf:True') | ||
| 81 | d.setVarFlag('do_deploy', 'file-checksums', '${PMU_FILE}.elf:True ${PMU_FILE}.bin:True') | ||
| 82 | |||
| 83 | |||
| 84 | python() { | ||
| 85 | # Need to allow bbappends to change the check | ||
| 86 | check_pmu_vars(d) | ||
| 87 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb index 89a9e93f..46124591 100644 --- a/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb | |||
| @@ -1,26 +1,28 @@ | |||
| 1 | DESCRIPTION = "PSM Firmware" | 1 | DESCRIPTION = "PSM Firmware" |
| 2 | SUMMARY = "PSM firmware for versal devices" | 2 | SUMMARY = "PSM firmware for versal devices" |
| 3 | 3 | ||
| 4 | LICENSE = "MIT" | 4 | LICENSE = "CLOSED" |
| 5 | 5 | ||
| 6 | PROVIDES = "virtual/psm-firmware" | 6 | PROVIDES = "virtual/psm-firmware" |
| 7 | 7 | ||
| 8 | INHERIT_DEFAULT_DEPENDS = "1" | 8 | INHERIT_DEFAULT_DEPENDS = "1" |
| 9 | 9 | ||
| 10 | COMPATIBLE_MACHINE = "^$" | 10 | COMPATIBLE_MACHINE = "^$" |
| 11 | COMPATIBLE_MACHINE:versal = "versal" | 11 | COMPATIBLE_MACHINE:versal = ".*" |
| 12 | |||
| 13 | # Since we're just copying, we can run any config | ||
| 14 | COMPATIBLE_HOST = ".*" | ||
| 12 | 15 | ||
| 13 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 16 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 14 | 17 | ||
| 15 | # Default would be a multiconfig (versal) build | 18 | # Default expects the user to provide the psm-firmware in the deploy |
| 16 | # For this to work, BBMULTICONFIG += "versal-fw" must be in the user's local.conf! | 19 | # directory, named "psm-firmware-${MACHINE}.elf" and "psm-firmware-${MACHINE}.bin" |
| 20 | # A machine, multiconfig, or local.conf should override this | ||
| 17 | PSM_DEPENDS ??= "" | 21 | PSM_DEPENDS ??= "" |
| 18 | PSM_MCDEPENDS ??= "mc::versal-fw:psm-firmware:do_deploy" | 22 | PSM_MCDEPENDS ??= "" |
| 19 | 23 | PSM_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | |
| 20 | # This must be defined to the file output by whatever is providing the psm-firmware | 24 | PSM_FIRMWARE_DEPLOY_DIR[vardepsexclude] += "TOPDIR" |
| 21 | # The following sets the default, but the BSP may select a different name | 25 | PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-${MACHINE}" |
| 22 | PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-versal-mb" | ||
| 23 | PSM_FIRMWARE_DEPLOY_DIR ??= "${TOPDIR}/tmp-microblaze-versal-fw/deploy/images/${MACHINE}" | ||
| 24 | 26 | ||
| 25 | # Default is for the multilib case (without the extension .elf/.bin) | 27 | # Default is for the multilib case (without the extension .elf/.bin) |
| 26 | PSM_FILE ??= "${PSM_FIRMWARE_DEPLOY_DIR}/${PSM_FIRMWARE_IMAGE_NAME}" | 28 | PSM_FILE ??= "${PSM_FIRMWARE_DEPLOY_DIR}/${PSM_FIRMWARE_IMAGE_NAME}" |
| @@ -57,3 +59,32 @@ INSANE_SKIP:${PN}-dbg = "arch" | |||
| 57 | 59 | ||
| 58 | SYSROOT_DIRS += "/boot" | 60 | SYSROOT_DIRS += "/boot" |
| 59 | FILES:${PN} = "/boot/${PN}.elf" | 61 | FILES:${PN} = "/boot/${PN}.elf" |
| 62 | |||
| 63 | def check_psm_vars(d): | ||
| 64 | # If both are blank, the user MUST pass in the path to the firmware! | ||
| 65 | if not d.getVar('PSM_DEPENDS') and not d.getVar('PSM_MCDEPENDS'): | ||
| 66 | # Don't cache this, as the items on disk can change! | ||
| 67 | d.setVar('BB_DONT_CACHE', '1') | ||
| 68 | |||
| 69 | msg = "" | ||
| 70 | fail = False | ||
| 71 | if not os.path.exists(d.getVar('PSM_FILE') + ".elf"): | ||
| 72 | msg = msg + "The expected file %s.elf is not available. " % d.getVar('PSM_FILE') | ||
| 73 | fail = True | ||
| 74 | if not os.path.exists(d.getVar('PSM_FILE') + ".bin"): | ||
| 75 | msg = msg + "The expected file %s.bin is not available. " % d.getVar('PSM_FILE') | ||
| 76 | fail = True | ||
| 77 | |||
| 78 | if fail: | ||
| 79 | raise bb.parse.SkipRecipe("%s\nSee the meta-xilinx-core README." % msg) | ||
| 80 | else: | ||
| 81 | # We found the file, so be sure to track it | ||
| 82 | d.setVar('SRC_URI', 'file://${PSM_FILE}.elf file://${PSM_FILE}.bin') | ||
| 83 | d.setVarFlag('do_install', 'file-checksums', '${PSM_FILE}.elf:True') | ||
| 84 | d.setVarFlag('do_deploy', 'file-checksums', '${PSM_FILE}.elf:True ${PSM_FILE}.bin:True') | ||
| 85 | |||
| 86 | python() { | ||
| 87 | # Need to allow bbappends to change the check | ||
| 88 | check_psm_vars(d) | ||
| 89 | } | ||
| 90 | |||
