diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2021-03-09 19:32:45 -0800 |
---|---|---|
committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2021-07-14 14:49:19 -0700 |
commit | 453ba3b622e0dce7834209b453c01412028799fa (patch) | |
tree | 39414dc5b55c42739b48608a83fc4959467d20fe /meta-xilinx-standalone/recipes-bsp | |
parent | 7a5a5b46899fc3630749ee32d48f29b49c6ae322 (diff) | |
download | meta-xilinx-453ba3b622e0dce7834209b453c01412028799fa.tar.gz |
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>
Diffstat (limited to 'meta-xilinx-standalone/recipes-bsp')
5 files changed, 46 insertions, 19 deletions
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 @@ | |||
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 | PROVIDES = "virtual/plm" | ||
5 | |||
6 | inherit xlnx-embeddedsw deploy | 4 | inherit xlnx-embeddedsw deploy |
7 | 5 | ||
8 | COMPATIBLE_HOST = "microblaze.*-elf" | 6 | COMPATIBLE_HOST = "microblaze.*-elf" |
@@ -50,20 +48,28 @@ do_compile() { | |||
50 | oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" | 48 | oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" |
51 | } | 49 | } |
52 | 50 | ||
51 | # All do_compiles need this, even if the base is overriden | ||
52 | do_compile_append() { | ||
53 | ${OBJCOPY} -O binary ${B}/plm.elf ${B}/plm.bin | ||
54 | } | ||
55 | |||
53 | do_install() { | 56 | do_install() { |
54 | : | 57 | : |
55 | } | 58 | } |
56 | 59 | ||
57 | PLM_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | 60 | PACKAGES = "" |
61 | |||
62 | # This is the default in most BSPs. A MACHINE.conf can override this! | ||
63 | PLM_IMAGE_NAME ??= "plm-versal-mb" | ||
64 | |||
65 | PLM_BASE_NAME ?= "${PLM_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
58 | PLM_BASE_NAME[vardepsexclude] = "DATETIME" | 66 | PLM_BASE_NAME[vardepsexclude] = "DATETIME" |
59 | 67 | ||
60 | do_deploy() { | 68 | do_deploy() { |
61 | install -Dm 0644 ${B}/plm.elf ${DEPLOYDIR}/${PLM_BASE_NAME}.elf | 69 | install -Dm 0644 ${B}/plm.elf ${DEPLOYDIR}/${PLM_BASE_NAME}.elf |
62 | ln -sf ${PLM_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf | 70 | ln -sf ${PLM_BASE_NAME}.elf ${DEPLOYDIR}/${PLM_IMAGE_NAME}.elf |
63 | ${OBJCOPY} -O binary ${B}/plm.elf ${B}/plm.bin | ||
64 | install -m 0644 ${B}/plm.bin ${DEPLOYDIR}/${PLM_BASE_NAME}.bin | 71 | install -m 0644 ${B}/plm.bin ${DEPLOYDIR}/${PLM_BASE_NAME}.bin |
65 | ln -sf ${PLM_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin | 72 | ln -sf ${PLM_BASE_NAME}.bin ${DEPLOYDIR}/${PLM_IMAGE_NAME}.bin |
66 | } | 73 | } |
67 | 74 | ||
68 | addtask deploy before do_build after do_install | 75 | addtask deploy before do_build after do_install |
69 | |||
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 @@ | |||
1 | DESCRIPTION = "PMU Firmware" | 1 | DESCRIPTION = "PMU Firmware" |
2 | 2 | ||
3 | PROVIDES = "virtual/pmu-firmware" | ||
4 | |||
5 | inherit xlnx-embeddedsw deploy | 3 | inherit xlnx-embeddedsw deploy |
6 | 4 | ||
7 | COMPATIBLE_HOST = "microblaze.*-elf" | 5 | COMPATIBLE_HOST = "microblaze.*-elf" |
@@ -20,6 +18,12 @@ do_configure() { | |||
20 | ${B}/../misc/copy_bsp.sh | 18 | ${B}/../misc/copy_bsp.sh |
21 | } | 19 | } |
22 | 20 | ||
21 | # All do_compiles need this, even if it's overriden | ||
22 | MB_OBJCOPY ??= "${OBJCOPY}" | ||
23 | |||
24 | # Only add a dependency if we need to use OUR binutils | ||
25 | DEPENDS .= "${@' virtual/${TARGET_PREFIX}binutils' if d.getVar('MB_OBJCOPY') == d.getVar('OBJCOPY') else ''}" | ||
26 | |||
23 | COMPILER = "${CC}" | 27 | COMPILER = "${CC}" |
24 | COMPILER_FLAGS = "-O2 -c" | 28 | COMPILER_FLAGS = "-O2 -c" |
25 | EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects" | 29 | EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects" |
@@ -47,21 +51,27 @@ do_compile() { | |||
47 | # --build-id=none is required due to linker script not defining a location for it. | 51 | # --build-id=none is required due to linker script not defining a location for it. |
48 | # Again, recipe-systoot include is necessary | 52 | # Again, recipe-systoot include is necessary |
49 | oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" | 53 | oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" |
54 | |||
55 | ${MB_OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin | ||
50 | } | 56 | } |
51 | 57 | ||
52 | do_install() { | 58 | do_install() { |
53 | : | 59 | : |
54 | } | 60 | } |
55 | 61 | ||
56 | PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}" | 62 | PACKAGES = "" |
63 | |||
64 | # This is the default in most BSPs. A MACHINE.conf can override this! | ||
65 | PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-zynqmp-pmu" | ||
66 | |||
67 | PMU_FIRMWARE_BASE_NAME ?= "${PMU_FIRMWARE_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}" | ||
57 | PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME" | 68 | PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME" |
58 | 69 | ||
59 | do_deploy() { | 70 | do_deploy() { |
60 | install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf | 71 | install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf |
61 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf | 72 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf |
62 | ${OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin | ||
63 | install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin | 73 | install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin |
64 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin | 74 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${PMU_FIRMWARE_IMAGE_NAME}.bin |
65 | } | 75 | } |
66 | 76 | ||
67 | addtask deploy before do_build after do_install | 77 | 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() { | |||
45 | # Again, recipe-systoot include is necessary | 45 | # Again, recipe-systoot include is necessary |
46 | echo Construct: executable | 46 | echo Construct: executable |
47 | oe_runmake executable.elf CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" | 47 | oe_runmake executable.elf CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" |
48 | |||
49 | ${MB_OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin | ||
48 | } | 50 | } |
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() { | |||
48 | # Again, recipe-systoot include is necessary | 48 | # Again, recipe-systoot include is necessary |
49 | echo Construct: executable | 49 | echo Construct: executable |
50 | oe_runmake executable.elf CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" | 50 | oe_runmake executable.elf CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" |
51 | |||
52 | ${MB_OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin | ||
51 | } | 53 | } |
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 @@ | |||
1 | ESCRIPTION = "PSM Firmware" | 1 | ESCRIPTION = "PSM Firmware" |
2 | SUMMARY = "PSM firmware for versal devices" | 2 | SUMMARY = "PSM firmware for versal devices" |
3 | 3 | ||
4 | PROVIDES = "virtual/psm-firmware" | ||
5 | |||
6 | inherit xlnx-embeddedsw deploy | 4 | inherit xlnx-embeddedsw deploy |
7 | 5 | ||
8 | COMPATIBLE_HOST = "microblaze.*-elf" | 6 | COMPATIBLE_HOST = "microblaze.*-elf" |
@@ -50,19 +48,28 @@ do_compile() { | |||
50 | oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" | 48 | oe_runmake CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include" |
51 | } | 49 | } |
52 | 50 | ||
51 | # All do compiles need this, even if the base is overriden | ||
52 | do_compile_append() { | ||
53 | ${OBJCOPY} -O binary ${B}/psmfw.elf ${B}/psmfw.bin | ||
54 | } | ||
55 | |||
53 | do_install() { | 56 | do_install() { |
54 | : | 57 | : |
55 | } | 58 | } |
56 | 59 | ||
57 | PSM_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | 60 | PACKAGES = "" |
61 | |||
62 | # This is the default in most BSPs. A MACHINE.conf can override this! | ||
63 | PSM_FIRMWARE_IMAGE_NAME ??= "psm-firmware-versal-mb" | ||
64 | |||
65 | PSM_FIRMWARE_BASE_NAME ?= "${PSM_FIRMWARE_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
58 | PSM_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME" | 66 | PSM_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME" |
59 | 67 | ||
60 | do_deploy() { | 68 | do_deploy() { |
61 | install -Dm 0644 ${B}/psmfw.elf ${DEPLOYDIR}/${PSM_FIRMWARE_BASE_NAME}.elf | 69 | install -Dm 0644 ${B}/psmfw.elf ${DEPLOYDIR}/${PSM_FIRMWARE_BASE_NAME}.elf |
62 | ln -sf ${PSM_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf | 70 | ln -sf ${PSM_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${PSM_FIRMWARE_IMAGE_NAME}.elf |
63 | ${OBJCOPY} -O binary ${B}/psmfw.elf ${B}/psmfw.bin | ||
64 | install -m 0644 ${B}/psmfw.bin ${DEPLOYDIR}/${PSM_FIRMWARE_BASE_NAME}.bin | 71 | install -m 0644 ${B}/psmfw.bin ${DEPLOYDIR}/${PSM_FIRMWARE_BASE_NAME}.bin |
65 | ln -sf ${PSM_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin | 72 | ln -sf ${PSM_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${PSM_FIRMWARE_IMAGE_NAME}.bin |
66 | } | 73 | } |
67 | 74 | ||
68 | addtask deploy before do_build after do_install | 75 | addtask deploy before do_build after do_install |