diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2024-03-21 17:49:31 -0600 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2024-03-21 17:49:31 -0600 |
| commit | 013826a649491a3845b3a580d45cfec920040c2b (patch) | |
| tree | 6cfc6fae1f4dc7bde5e3bf234eae40e28e95d672 | |
| parent | f80c3b2c00376588417040c54c46fd630f922961 (diff) | |
| parent | 0879fa02f63a815a38ee404f285e5da3d48fedf2 (diff) | |
| download | meta-xilinx-013826a649491a3845b3a580d45cfec920040c2b.tar.gz | |
Merge remote-tracking branch 'github/rel-v2023.2' into master-next
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
| -rw-r--r-- | meta-xilinx-core/classes/amd_spi_image.bbclass | 142 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-apps/image-update/image-update_1.0.bb | 28 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2023.2.bb | 4 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2023.2.inc | 2 | ||||
| -rw-r--r--[-rwxr-xr-x] | meta-xilinx-core/recipes-multimedia/vdu/vdu-firmware_2023.1.bb | 0 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb | 2 |
6 files changed, 174 insertions, 4 deletions
diff --git a/meta-xilinx-core/classes/amd_spi_image.bbclass b/meta-xilinx-core/classes/amd_spi_image.bbclass new file mode 100644 index 00000000..ed4c1f87 --- /dev/null +++ b/meta-xilinx-core/classes/amd_spi_image.bbclass | |||
| @@ -0,0 +1,142 @@ | |||
| 1 | # | ||
| 2 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. | ||
| 3 | # | ||
| 4 | # SPDX-License-Identifier: MIT | ||
| 5 | # | ||
| 6 | |||
| 7 | QSPI_SIZE ?= "0x2280000" | ||
| 8 | |||
| 9 | # Register values | ||
| 10 | IDN_REG ?= "0x4D554241" | ||
| 11 | VERSION_REG ?= "0x1" | ||
| 12 | LENGTH_REG ?= "0x4" | ||
| 13 | PERSISTENT_REG ?= "0x01010000" | ||
| 14 | |||
| 15 | # QSPI Offsets | ||
| 16 | IMAGE_SELECTOR_OFFSET ?= "0x0" | ||
| 17 | IMAGE_SELECTOR_BACKUP_OFFSET ?= "0x80000" | ||
| 18 | PERSISTENT_REG_OFFSET ?= "0x100000" | ||
| 19 | PERSISTENT_REG_BACKUP_OFFSET ?= "0x120000" | ||
| 20 | IMAGE_A_OFFSET ?= "0x200000" | ||
| 21 | IMAGE_A_IMGSEL_OFFSET ?= "0xF00000" | ||
| 22 | IMAGE_B_OFFSET ?= "0xF80000" | ||
| 23 | IMAGE_B_IMGSEL_OFFSET ?= "0x1C80000" | ||
| 24 | IMAGE_RCVRY_OFFSET ?= "0x1E00000" | ||
| 25 | IMAGE_RCVRY_BACKUP_OFFSET ?= "0x2000000" | ||
| 26 | VERSION_OFFSET ?= "0x2240000" | ||
| 27 | CHECKSUM_OFFSET ?= "0x2250000" | ||
| 28 | |||
| 29 | def generate_spi_image(d): | ||
| 30 | |||
| 31 | import io | ||
| 32 | import hashlib | ||
| 33 | import time | ||
| 34 | |||
| 35 | qspi_size = int(d.getVar("QSPI_SIZE") or '0', 0) | ||
| 36 | int(d.getVar("QSPI_SIZE") or '0', 0) | ||
| 37 | |||
| 38 | # Register values | ||
| 39 | idn_reg = int(d.getVar("IDN_REG") or '0', 0) | ||
| 40 | version_reg = int(d.getVar("VERSION_REG") or '0', 0) | ||
| 41 | length_reg = int(d.getVar("LENGTH_REG") or '0', 0) | ||
| 42 | persistent_reg = int(d.getVar("PERSISTENT_REG") or '0', 0) | ||
| 43 | |||
| 44 | # QSPI Offsets | ||
| 45 | image_selector_offset = int(d.getVar("IMAGE_SELECTOR_OFFSET") or '0', 0) | ||
| 46 | image_selector_backup_offset = int(d.getVar("IMAGE_SELECTOR_BACKUP_OFFSET") or '0', 0) | ||
| 47 | persistent_reg_offset = int(d.getVar("PERSISTENT_REG_OFFSET") or '0', 0) | ||
| 48 | persistent_reg_backup_offset = int(d.getVar("PERSISTENT_REG_BACKUP_OFFSET") or '0', 0) | ||
| 49 | image_a_offset = int(d.getVar("IMAGE_A_OFFSET") or '0', 0) | ||
| 50 | image_a_imgsel_offset = int(d.getVar("IMAGE_A_IMGSEL_OFFSET") or '0', 0) | ||
| 51 | image_b_offset = int(d.getVar("IMAGE_B_OFFSET") or '0', 0) | ||
| 52 | image_b_imgsel_offset = int(d.getVar("IMAGE_B_IMGSEL_OFFSET") or '0', 0) | ||
| 53 | image_rcvry_offset = int(d.getVar("IMAGE_RCVRY_OFFSET") or '0', 0) | ||
| 54 | image_rcvry_backup_offset = int(d.getVar("IMAGE_RCVRY_BACKUP_OFFSET") or '0', 0) | ||
| 55 | version_offset = int(d.getVar("VERSION_OFFSET") or '0', 0) | ||
| 56 | checksum_offset = int(d.getVar("CHECKSUM_OFFSET") or '0', 0) | ||
| 57 | |||
| 58 | # QSPI data | ||
| 59 | qspi_data = io.BytesIO() | ||
| 60 | qspi_data.write(b'\xFF' * qspi_size) | ||
| 61 | |||
| 62 | # Image Selector - Primary, Backup, Image A and Image B | ||
| 63 | imgsel_file = d.getVar("DEPLOY_DIR_IMAGE")+"/imgsel-"+d.getVar("MACHINE")+".bin" | ||
| 64 | try: | ||
| 65 | with open(imgsel_file, "rb") as il: | ||
| 66 | imgsel = il.read(-1) | ||
| 67 | except OSError as err: | ||
| 68 | bb.fatal("Unable to open imgsel file: " + str(err)) | ||
| 69 | |||
| 70 | qspi_data.seek(image_selector_offset) | ||
| 71 | qspi_data.write(imgsel) | ||
| 72 | qspi_data.seek(image_selector_backup_offset) | ||
| 73 | qspi_data.write(imgsel) | ||
| 74 | qspi_data.seek(image_a_imgsel_offset) | ||
| 75 | qspi_data.write(imgsel) | ||
| 76 | qspi_data.seek(image_b_imgsel_offset) | ||
| 77 | qspi_data.write(imgsel) | ||
| 78 | |||
| 79 | # Persistent Registers - Primary and Backup | ||
| 80 | p_reg = [idn_reg, version_reg, length_reg, persistent_reg, \ | ||
| 81 | image_a_offset, image_b_offset, image_rcvry_offset] | ||
| 82 | checksum = 0xffffffff - (0xffffffff & sum(p_reg)) | ||
| 83 | p_reg.insert(3, checksum) | ||
| 84 | |||
| 85 | qspi_data.seek(persistent_reg_offset) | ||
| 86 | for value in p_reg: | ||
| 87 | qspi_data.write(value.to_bytes(4, byteorder="little")) | ||
| 88 | |||
| 89 | qspi_data.seek(persistent_reg_backup_offset) | ||
| 90 | for value in p_reg: | ||
| 91 | qspi_data.write(value.to_bytes(4, byteorder="little")) | ||
| 92 | |||
| 93 | # Image A and B - boot.bin | ||
| 94 | try: | ||
| 95 | with open(d.getVar("DEPLOY_DIR_IMAGE")+"/boot.bin", "rb") as bo: | ||
| 96 | bootbin = bo.read(-1) | ||
| 97 | except OSError as err: | ||
| 98 | bb.fatal("Unable to open boot.bin file: " + str(err)) | ||
| 99 | |||
| 100 | qspi_data.seek(image_a_offset) | ||
| 101 | qspi_data.write(bootbin) | ||
| 102 | qspi_data.seek(image_b_offset) | ||
| 103 | qspi_data.write(bootbin) | ||
| 104 | |||
| 105 | # Recovery Image & Recovery Image Backup | ||
| 106 | imgrcry_file = d.getVar("DEPLOY_DIR_IMAGE")+"/imgrcry-"+d.getVar("MACHINE")+".bin" | ||
| 107 | try: | ||
| 108 | with open(imgrcry_file, "rb") as iy: | ||
| 109 | imgrcry = iy.read(-1) | ||
| 110 | except OSError as err: | ||
| 111 | bb.fatal("Unable to open imgrcry file: " + str(err)) | ||
| 112 | |||
| 113 | qspi_data.seek(image_rcvry_offset) | ||
| 114 | qspi_data.write(imgrcry) | ||
| 115 | qspi_data.seek(image_rcvry_backup_offset) | ||
| 116 | qspi_data.write(imgrcry) | ||
| 117 | |||
| 118 | # Version string and checksum | ||
| 119 | version = d.getVar("QSPI_IMAGE_VERSION") | ||
| 120 | date = time.strftime("%m%d%H%M") | ||
| 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) | ||
| 126 | qspi_data.write(qspi_version.encode()) | ||
| 127 | |||
| 128 | qspi_sha = hashlib.sha256(qspi_data.getbuffer()) | ||
| 129 | qspi_data.seek(checksum_offset) | ||
| 130 | qspi_data.write(qspi_sha.digest()) | ||
| 131 | |||
| 132 | # Write the QSPI data to file | ||
| 133 | with open(d.getVar("B") + "/" + d.getVar("IMAGE_NAME") + ".bin", "wb") as sq: | ||
| 134 | sq.write(qspi_data.getbuffer()) | ||
| 135 | |||
| 136 | do_compile[depends] += "virtual/boot-bin:do_deploy virtual/imgsel:do_deploy virtual/imgrcry:do_deploy" | ||
| 137 | |||
| 138 | python amd_spi_image_do_compile() { | ||
| 139 | generate_spi_image(d) | ||
| 140 | } | ||
| 141 | |||
| 142 | EXPORT_FUNCTIONS do_compile | ||
diff --git a/meta-xilinx-core/recipes-apps/image-update/image-update_1.0.bb b/meta-xilinx-core/recipes-apps/image-update/image-update_1.0.bb new file mode 100644 index 00000000..8a707df4 --- /dev/null +++ b/meta-xilinx-core/recipes-apps/image-update/image-update_1.0.bb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | DESCRIPTION = "Image update is used to update alternate images on compatible firmware." | ||
| 2 | SUMMARY = "Image update is used to update alternate image on compatible firmware. \ | ||
| 3 | If the current image is ImageA, ImageB will get updated and vice versa. \ | ||
| 4 | Usage: image_update <Input Image File>" | ||
| 5 | |||
| 6 | LICENSE = "MIT" | ||
| 7 | LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSES/MIT;md5=2ac09a7a37dd6ee0ba23ce497d57d09b" | ||
| 8 | |||
| 9 | BRANCH = "xlnx_rel_v2023.2" | ||
| 10 | SRC_URI = "git://github.com/Xilinx/linux-image_update.git;branch=${BRANCH};protocol=https" | ||
| 11 | SRCREV = "4f0b7b1b20933ddc454124fc3472f1b8894ddf08" | ||
| 12 | |||
| 13 | RDEPENDS:${PN} += "freeipmi" | ||
| 14 | |||
| 15 | S = "${WORKDIR}/git" | ||
| 16 | |||
| 17 | COMPATIBLE_MACHINE = "^$" | ||
| 18 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
| 19 | |||
| 20 | PACKAGE_ARCH:zynqmp = "${SOC_FAMILY_ARCH}" | ||
| 21 | |||
| 22 | # Force the make system to use the flags we want! | ||
| 23 | EXTRA_OEMAKE = 'CC="${CC} ${TARGET_CFLAGS} ${TARGET_LDFLAGS}" all' | ||
| 24 | |||
| 25 | do_install () { | ||
| 26 | install -d ${D}${bindir} | ||
| 27 | install -m 0755 ${S}/image_update ${D}${bindir}/ | ||
| 28 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2023.2.bb b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2023.2.bb index 0d24c9fc..d09ab51e 100644 --- a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2023.2.bb +++ b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2023.2.bb | |||
| @@ -9,7 +9,7 @@ BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != ' | |||
| 9 | SRC_URI = "${REPO};${BRANCHARG}" | 9 | SRC_URI = "${REPO};${BRANCHARG}" |
| 10 | 10 | ||
| 11 | BRANCH = "xlnx_rel_v2023.2" | 11 | BRANCH = "xlnx_rel_v2023.2" |
| 12 | SRCREV = "4dbd33accb043bd92ecbec2a3507f85a22045c51" | 12 | SRCREV = "898fe38023d15d54402c788bcbca67a29eb2dc3d" |
| 13 | SOMAJOR = "1" | 13 | SOMAJOR = "1" |
| 14 | SOMINOR = "0" | 14 | SOMINOR = "0" |
| 15 | SOVERSION = "${SOMAJOR}.${SOMINOR}" | 15 | SOVERSION = "${SOMAJOR}.${SOMINOR}" |
| @@ -22,7 +22,7 @@ S = "${WORKDIR}/git" | |||
| 22 | 22 | ||
| 23 | inherit cmake update-rc.d systemd | 23 | inherit cmake update-rc.d systemd |
| 24 | 24 | ||
| 25 | DEPENDS += " libwebsockets inotify-tools libdfx zocl libdrm" | 25 | DEPENDS += " libwebsockets inotify-tools libdfx zocl libdrm systemd" |
| 26 | RDEPENDS:${PN} += " freeipmi" | 26 | RDEPENDS:${PN} += " freeipmi" |
| 27 | EXTRA_OECMAKE += " \ | 27 | EXTRA_OECMAKE += " \ |
| 28 | -DCMAKE_SYSROOT:PATH=${RECIPE_SYSROOT} \ | 28 | -DCMAKE_SYSROOT:PATH=${RECIPE_SYSROOT} \ |
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2023.2.inc b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2023.2.inc index 0cfbd846..0a813d69 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2023.2.inc +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2023.2.inc | |||
| @@ -2,7 +2,7 @@ UBOOT_VERSION = "v2023.01" | |||
| 2 | 2 | ||
| 3 | UBRANCH = "xlnx_rebase_v2023.01" | 3 | UBRANCH = "xlnx_rebase_v2023.01" |
| 4 | 4 | ||
| 5 | SRCREV = "0fc19cad5a07a09958443e7a5b6f11e420ef195c" | 5 | SRCREV = "4da834fc7644b4124f7417e0e2789c7afcb40352" |
| 6 | 6 | ||
| 7 | LICENSE = "GPL-2.0-or-later" | 7 | LICENSE = "GPL-2.0-or-later" |
| 8 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=4;md5=744e7e3bb0c94b4b9f6b3db3bf893897" | 8 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=4;md5=744e7e3bb0c94b4b9f6b3db3bf893897" |
diff --git a/meta-xilinx-core/recipes-multimedia/vdu/vdu-firmware_2023.1.bb b/meta-xilinx-core/recipes-multimedia/vdu/vdu-firmware_2023.1.bb index 419dd681..419dd681 100755..100644 --- a/meta-xilinx-core/recipes-multimedia/vdu/vdu-firmware_2023.1.bb +++ b/meta-xilinx-core/recipes-multimedia/vdu/vdu-firmware_2023.1.bb | |||
diff --git a/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb b/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb index a9d60465..db4f25b4 100644 --- a/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb +++ b/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb | |||
| @@ -30,7 +30,7 @@ LIC_FILES_CHKSUM = " \ | |||
| 30 | 30 | ||
| 31 | BRANCH ?= "freeipmi-1-6-0-stable" | 31 | BRANCH ?= "freeipmi-1-6-0-stable" |
| 32 | SRC_URI = " \ | 32 | SRC_URI = " \ |
| 33 | git://git.savannah.gnu.org/freeipmi.git;iprotocol=https;branch=${BRANCH} \ | 33 | git://git.savannah.gnu.org/git/freeipmi.git;protocol=https;branch=${BRANCH} \ |
| 34 | file://0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch \ | 34 | file://0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch \ |
| 35 | file://0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch \ | 35 | file://0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch \ |
| 36 | " | 36 | " |
