diff options
author | John Toomey <john.toomey@amd.com> | 2024-06-13 15:59:13 +0100 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2024-11-21 10:43:44 -0600 |
commit | 7d2a5743a087705d41c41e333b13b40e6de60c45 (patch) | |
tree | 7bd4f6124f555cbf4cd3221831bedefbc6673663 | |
parent | aa6b784139502478a9a5f458c8b7f6e2d7a8318c (diff) | |
download | meta-xilinx-7d2a5743a087705d41c41e333b13b40e6de60c45.tar.gz |
Tweaks to enable version string format change
Minor updates to the amd_spi_image bbclass and bootbin version files to
support updated version strin format for Kria, SC and emb-plus
Also fix an issue with IMAGE_NAME_SUFFIX being set to ".rootfs" by
default
Signed-off-by: John Toomey <john.toomey@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
3 files changed, 18 insertions, 12 deletions
diff --git a/meta-xilinx-core/classes-recipe/amd_spi_image.bbclass b/meta-xilinx-core/classes-recipe/amd_spi_image.bbclass index ed4c1f87..6dd18d76 100644 --- a/meta-xilinx-core/classes-recipe/amd_spi_image.bbclass +++ b/meta-xilinx-core/classes-recipe/amd_spi_image.bbclass | |||
@@ -5,6 +5,8 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | QSPI_SIZE ?= "0x2280000" | 7 | QSPI_SIZE ?= "0x2280000" |
8 | QSPI_VERSION ?= "" | ||
9 | QSPI_IMAGE_VERSION ?= "" | ||
8 | 10 | ||
9 | # Register values | 11 | # Register values |
10 | IDN_REG ?= "0x4D554241" | 12 | IDN_REG ?= "0x4D554241" |
@@ -116,12 +118,8 @@ def generate_spi_image(d): | |||
116 | qspi_data.write(imgrcry) | 118 | qspi_data.write(imgrcry) |
117 | 119 | ||
118 | # Version string and checksum | 120 | # Version string and checksum |
119 | version = d.getVar("QSPI_IMAGE_VERSION") | 121 | version = d.getVar('QSPI_IMAGE_VERSION') |
120 | date = time.strftime("%m%d%H%M") | 122 | qspi_version = f"{version}\x00" |
121 | machine = d.getVar("MACHINE")[:3] | ||
122 | image_name = d.getVar("QSPI_IMAGE_NAME") | ||
123 | |||
124 | qspi_version = f"{image_name}-{machine}-v{version}-{date}\x00" | ||
125 | qspi_data.seek(version_offset) | 123 | qspi_data.seek(version_offset) |
126 | qspi_data.write(qspi_version.encode()) | 124 | qspi_data.write(qspi_version.encode()) |
127 | 125 | ||
diff --git a/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb index 98eebc3e..f4a96f41 100644 --- a/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb +++ b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb | |||
@@ -9,7 +9,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" | |||
9 | 9 | ||
10 | BOOTBIN_VER_MAIN ?= "" | 10 | BOOTBIN_VER_MAIN ?= "" |
11 | 11 | ||
12 | BOOTBIN_VER_SUFFIX ?= "${@(d.getVar('XILINX_VER_BUILD') or '')[:8] if d.getVar('XILINX_VER_UPDATE') != 'release' and not d.getVar('XILINX_VER_UPDATE').startswith('update') else ''}" | ||
13 | BOOTBIN_VER_FILE = "bootbin-version-header.txt" | 12 | BOOTBIN_VER_FILE = "bootbin-version-header.txt" |
14 | BOOTBIN_VER_MAX_LEN = "36" | 13 | BOOTBIN_VER_MAX_LEN = "36" |
15 | 14 | ||
@@ -17,12 +16,16 @@ BOOTBIN_MANIFEST_FILE ?= "bootbin-version-header.manifest" | |||
17 | 16 | ||
18 | inherit deploy image-artifact-names | 17 | inherit deploy image-artifact-names |
19 | 18 | ||
19 | IMAGE_NAME_SUFFIX = "" | ||
20 | |||
20 | python do_configure() { | 21 | python do_configure() { |
21 | if d.getVar("BOOTBIN_VER_SUFFIX"): | 22 | |
22 | version = version + "-" + d.getVar("BOOTBIN_VER_SUFFIX") | 23 | if not 'version' in locals(): |
24 | version = d.getVar("MACHINE") + "-v" + d.getVar("BOOTBIN_VER_MAIN") | ||
25 | version += d.getVar("IMAGE_VERSION_SUFFIX") | ||
23 | 26 | ||
24 | if len(version) > int(d.getVar("BOOTBIN_VER_MAX_LEN")): | 27 | if len(version) > int(d.getVar("BOOTBIN_VER_MAX_LEN")): |
25 | bb.error("version string too long") | 28 | bb.fatal("version string too long") |
26 | 29 | ||
27 | with open(d.expand("${B}/${BOOTBIN_VER_FILE}"), "w") as f: | 30 | with open(d.expand("${B}/${BOOTBIN_VER_FILE}"), "w") as f: |
28 | f.write(version.encode("utf-8").hex()) | 31 | f.write(version.encode("utf-8").hex()) |
diff --git a/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb index af30a17d..765d35e8 100644 --- a/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb +++ b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb | |||
@@ -15,9 +15,14 @@ BOOTBIN_VER_FILE = "bootbin-version-string.txt" | |||
15 | 15 | ||
16 | inherit deploy image-artifact-names | 16 | inherit deploy image-artifact-names |
17 | 17 | ||
18 | IMAGE_NAME_SUFFIX = "" | ||
19 | |||
18 | python do_configure() { | 20 | python do_configure() { |
19 | if d.getVar("BOOTBIN_VER_SUFFIX"): | 21 | |
20 | version = version + "-" + d.getVar("BOOTBIN_VER_SUFFIX") | 22 | if not 'version' in locals(): |
23 | version = d.getVar("MACHINE") + "-v" + d.getVar("BOOTBIN_VER_MAIN") | ||
24 | version += d.getVar("IMAGE_VERSION_SUFFIX") | ||
25 | |||
21 | with open(d.expand("${B}/${BOOTBIN_VER_FILE}"), "w") as f: | 26 | with open(d.expand("${B}/${BOOTBIN_VER_FILE}"), "w") as f: |
22 | f.write(version) | 27 | f.write(version) |
23 | } | 28 | } |