summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-bsp/embeddedsw
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2022-01-21 12:53:12 -0800
committerMark Hatle <mark.hatle@xilinx.com>2022-01-23 12:17:00 -0800
commit84db3b3d44099132f6aa0e6049d5727e4a0b0fbc (patch)
tree08cc4eb9ed182815cdc69b53775f33522cdfb5be /meta-xilinx-core/recipes-bsp/embeddedsw
parent2c4e691200c816037a5760fe9749b28cca06c023 (diff)
downloadmeta-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.bb41
-rw-r--r--meta-xilinx-core/recipes-bsp/embeddedsw/plmfw.bb50
-rw-r--r--meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb50
-rw-r--r--meta-xilinx-core/recipes-bsp/embeddedsw/psmfw.bb51
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 @@
1DESCRIPTION = "Xilinx First Stage Boot Loader" 1DESCRIPTION = "Xilinx First Stage Boot Loader"
2 2
3LICENSE = "MIT" 3LICENSE = "CLOSED"
4 4
5PROVIDES = "virtual/fsbl" 5PROVIDES = "virtual/fsbl"
6 6
@@ -10,19 +10,21 @@ COMPATIBLE_MACHINE = "^$"
10COMPATIBLE_MACHINE:zynq = "zynq" 10COMPATIBLE_MACHINE:zynq = "zynq"
11COMPATIBLE_MACHINE:zynqmp = "zynqmp" 11COMPATIBLE_MACHINE:zynqmp = "zynqmp"
12 12
13# Since we're just copying, we can run any config
14COMPATIBLE_HOST = ".*"
15
13PACKAGE_ARCH = "${MACHINE_ARCH}" 16PACKAGE_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
17FSBL_DEPENDS ??= "" 21FSBL_DEPENDS ??= ""
18FSBL_MCDEPENDS ??= "mc::fsbl-fw:fsbl-firmware:do_deploy" 22FSBL_MCDEPENDS ??= ""
19 23FSBL_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}"
20# This must be defined to the file output by whatever is providing the fsbl-firmware 24FSBL_DEPLOY_DIR[vardepsexclude] += "TOPDIR"
21# The following sets the default, but the BSP may select a different name 25FSBL_IMAGE_NAME ??= "fsbl-${MACHINE}"
22FSBL_IMAGE_NAME ??= "fsbl"
23FSBL_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)
26FSBL_FILE ??= "${FSBL_DEPLOY_DIR}/${FSBL_IMAGE_NAME}" 28FSBL_FILE ??= "${FSBL_DEPLOY_DIR}/${FSBL_IMAGE_NAME}"
27FSBL_FILE[vardepsexclude] = "FSBL_DEPLOY_DIR" 29FSBL_FILE[vardepsexclude] = "FSBL_DEPLOY_DIR"
28 30
@@ -56,3 +58,22 @@ INSANE_SKIP:${PN}-dbg = "arch"
56 58
57SYSROOT_DIRS += "/boot" 59SYSROOT_DIRS += "/boot"
58FILES:${PN} = "/boot/${PN}.elf" 60FILES:${PN} = "/boot/${PN}.elf"
61
62def 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
76python() {
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 @@
1DESCRIPTION = "Platform Loader and Manager" 1DESCRIPTION = "Platform Loader and Manager"
2SUMMARY = "Platform Loader and Manager for Versal devices" 2SUMMARY = "Platform Loader and Manager for Versal devices"
3 3
4LICENSE = "MIT" 4LICENSE = "CLOSED"
5 5
6PROVIDES = "virtual/plm" 6PROVIDES = "virtual/plm"
7 7
8INHERIT_DEFAULT_DEPENDS = "1" 8INHERIT_DEFAULT_DEPENDS = "1"
9 9
10COMPATIBLE_MACHINE = "^$" 10COMPATIBLE_MACHINE = "^$"
11COMPATIBLE_MACHINE:versal = "versal" 11COMPATIBLE_MACHINE:versal = ".*"
12
13# Since we're just copying, we can run any config
14COMPATIBLE_HOST = ".*"
12 15
13PACKAGE_ARCH = "${MACHINE_ARCH}" 16PACKAGE_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
17PLM_DEPENDS ??= "" 21PLM_DEPENDS ??= ""
18PLM_MCDEPENDS ??= "mc::versal-fw:plm-firmware:do_deploy" 22PLM_MCDEPENDS ??= ""
19 23PLM_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}"
20# This must be defined to the file output by whatever is providing the plm-firmware 24PLM_DEPLOY_DIR[vardepsexclude] += "TOPDIR"
21# The following sets the default, but the BSP may select a different name 25PLM_IMAGE_NAME ??= "plm-${MACHINE}"
22PLM_IMAGE_NAME ??= "plm-versal-mb"
23PLM_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)
26PLM_FILE ??= "${PLM_DEPLOY_DIR}/${PLM_IMAGE_NAME}" 28PLM_FILE ??= "${PLM_DEPLOY_DIR}/${PLM_IMAGE_NAME}"
@@ -57,3 +59,31 @@ INSANE_SKIP:${PN}-dbg = "arch"
57 59
58SYSROOT_DIRS += "/boot" 60SYSROOT_DIRS += "/boot"
59FILES:${PN} = "/boot/${PN}.elf" 61FILES:${PN} = "/boot/${PN}.elf"
62
63def 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
85python() {
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 @@
1DESCRIPTION = "PMU Firmware" 1DESCRIPTION = "PMU Firmware"
2 2
3LICENSE = "MIT" 3LICENSE = "CLOSED"
4 4
5PROVIDES = "virtual/pmu-firmware" 5PROVIDES = "virtual/pmu-firmware"
6 6
7INHERIT_DEFAULT_DEPENDS = "1" 7INHERIT_DEFAULT_DEPENDS = "1"
8 8
9COMPATIBLE_MACHINE = "^$" 9COMPATIBLE_MACHINE = "^$"
10COMPATIBLE_MACHINE:zynqmp = "zynqmp" 10COMPATIBLE_MACHINE:zynqmp = ".*"
11
12# Since we're just copying, we can run any config
13COMPATIBLE_HOST = ".*"
11 14
12PACKAGE_ARCH = "${MACHINE_ARCH}" 15PACKAGE_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
16PMU_DEPENDS ??= "" 20PMU_DEPENDS ??= ""
17PMU_MCDEPENDS ??= "mc::zynqmp-pmufw:pmu-firmware:do_deploy" 21PMU_MCDEPENDS ??= ""
18 22PMU_FIRMWARE_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}"
19# This must be defined to the file output by whatever is providing the pmu-firmware 23PMU_FIRMWARE_DEPLOY_DIR[vardepsexclude] += "TOPDIR"
20# The following sets the default, but the BSP may select a different name 24PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-${MACHINE}"
21PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-zynqmp-pmu"
22PMU_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)
25PMU_FILE ??= "${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}" 27PMU_FILE ??= "${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}"
@@ -55,3 +57,31 @@ INSANE_SKIP:${PN}-dbg = "arch"
55 57
56SYSROOT_DIRS += "/boot" 58SYSROOT_DIRS += "/boot"
57FILES:${PN} = "/boot/${PN}.elf" 59FILES:${PN} = "/boot/${PN}.elf"
60
61def 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
84python() {
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 @@
1DESCRIPTION = "PSM Firmware" 1DESCRIPTION = "PSM Firmware"
2SUMMARY = "PSM firmware for versal devices" 2SUMMARY = "PSM firmware for versal devices"
3 3
4LICENSE = "MIT" 4LICENSE = "CLOSED"
5 5
6PROVIDES = "virtual/psm-firmware" 6PROVIDES = "virtual/psm-firmware"
7 7
8INHERIT_DEFAULT_DEPENDS = "1" 8INHERIT_DEFAULT_DEPENDS = "1"
9 9
10COMPATIBLE_MACHINE = "^$" 10COMPATIBLE_MACHINE = "^$"
11COMPATIBLE_MACHINE:versal = "versal" 11COMPATIBLE_MACHINE:versal = ".*"
12
13# Since we're just copying, we can run any config
14COMPATIBLE_HOST = ".*"
12 15
13PACKAGE_ARCH = "${MACHINE_ARCH}" 16PACKAGE_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
17PSM_DEPENDS ??= "" 21PSM_DEPENDS ??= ""
18PSM_MCDEPENDS ??= "mc::versal-fw:psm-firmware:do_deploy" 22PSM_MCDEPENDS ??= ""
19 23PSM_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}"
20# This must be defined to the file output by whatever is providing the psm-firmware 24PSM_FIRMWARE_DEPLOY_DIR[vardepsexclude] += "TOPDIR"
21# The following sets the default, but the BSP may select a different name 25PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-${MACHINE}"
22PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-versal-mb"
23PSM_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)
26PSM_FILE ??= "${PSM_FIRMWARE_DEPLOY_DIR}/${PSM_FIRMWARE_IMAGE_NAME}" 28PSM_FILE ??= "${PSM_FIRMWARE_DEPLOY_DIR}/${PSM_FIRMWARE_IMAGE_NAME}"
@@ -57,3 +59,32 @@ INSANE_SKIP:${PN}-dbg = "arch"
57 59
58SYSROOT_DIRS += "/boot" 60SYSROOT_DIRS += "/boot"
59FILES:${PN} = "/boot/${PN}.elf" 61FILES:${PN} = "/boot/${PN}.elf"
62
63def 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
86python() {
87 # Need to allow bbappends to change the check
88 check_psm_vars(d)
89}
90