diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-11-11 11:24:08 -0700 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2024-11-11 11:24:08 -0700 |
commit | ee6e2f1f4fc8d438bfde7634e31657b52970fda9 (patch) | |
tree | 38b5366d82e15538ab3c5e4f9a3dd1dcac26ff20 /meta-xilinx-core | |
parent | 03d3b2ce359a1c2959f04588cf2c4a1b0dcb4de8 (diff) | |
parent | 7c79383570dc4182bb21cdee68598ccf47403150 (diff) | |
download | meta-xilinx-ee6e2f1f4fc8d438bfde7634e31657b52970fda9.tar.gz |
Merge remote-tracking branch 'origin/rel-v2024.2' into scarthgap-next
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core')
136 files changed, 6100 insertions, 1454 deletions
diff --git a/meta-xilinx-core/README.md b/meta-xilinx-core/README.md index ec5b663b..945a76a7 100644 --- a/meta-xilinx-core/README.md +++ b/meta-xilinx-core/README.md | |||
@@ -10,11 +10,15 @@ This layer depends on: | |||
10 | 10 | ||
11 | URI: https://git.yoctoproject.org/poky | 11 | URI: https://git.yoctoproject.org/poky |
12 | layers: meta, meta-poky | 12 | layers: meta, meta-poky |
13 | branch: langdale | 13 | branch: scarthgap |
14 | 14 | ||
15 | URI: https://git.openembedded.org/meta-openembedded | 15 | URI: https://git.openembedded.org/meta-openembedded |
16 | layers: meta-oe | 16 | layers: meta-oe |
17 | branch: langdale | 17 | branch: scarthgap |
18 | |||
19 | URI: https://git.yoctoproject.org/meta-arm | ||
20 | layers: meta-arm, meta-arm-toolchain | ||
21 | branch: scarthgap | ||
18 | --- | 22 | --- |
19 | 23 | ||
20 | ## Configuring Machines | 24 | ## Configuring Machines |
@@ -36,13 +40,13 @@ Zynqmp-generic requires pmu-firmware. The firmware can be passed directly | |||
36 | as a path to a binary: PMU_FILE, you may use the generic built version | 40 | as a path to a binary: PMU_FILE, you may use the generic built version |
37 | by including meta-xilinx-standalone, the XSCT version by adding | 41 | by including meta-xilinx-standalone, the XSCT version by adding |
38 | meta-xilinx-tools or the DTB workflow version using | 42 | meta-xilinx-tools or the DTB workflow version using |
39 | meta-xilinx-standalone-experimental. | 43 | meta-xilinx-standalone-sdt. |
40 | 44 | ||
41 | Versal-generic requires both PLM and PSM firmware to be specified. They can | 45 | Versal-generic requires both PLM and PSM firmware to be specified. They can |
42 | be specified as a path to a binary using PLM_FILE and PSM_FILE. Or they can | 46 | be specified as a path to a binary using PLM_FILE and PSM_FILE. Or they can |
43 | be generated by including meta-xilinx-standalone, the XSCT version by adding | 47 | be generated by including meta-xilinx-standalone, the XSCT version by adding |
44 | meta-xilinx-tools or the DTB workflow version using | 48 | meta-xilinx-tools or the DTB workflow version using |
45 | meta-xilinx-standalone-experimental. Additionally some configurations may | 49 | meta-xilinx-standalone-sdt. Additionally some configurations may |
46 | require you to specify the path to a PDI file using PDI_PATH. The XSCT | 50 | require you to specify the path to a PDI file using PDI_PATH. The XSCT |
47 | version will extract the PDI automatically. | 51 | version will extract the PDI automatically. |
48 | --- | 52 | --- |
diff --git a/meta-xilinx-core/classes-recipe/amd_spi_image.bbclass b/meta-xilinx-core/classes-recipe/amd_spi_image.bbclass index ed4c1f87..5020b02b 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" |
@@ -60,7 +62,7 @@ def generate_spi_image(d): | |||
60 | qspi_data.write(b'\xFF' * qspi_size) | 62 | qspi_data.write(b'\xFF' * qspi_size) |
61 | 63 | ||
62 | # Image Selector - Primary, Backup, Image A and Image B | 64 | # Image Selector - Primary, Backup, Image A and Image B |
63 | imgsel_file = d.getVar("DEPLOY_DIR_IMAGE")+"/imgsel-"+d.getVar("MACHINE")+".bin" | 65 | imgsel_file = d.getVar("DEPLOY_DIR_IMAGE")+"/image-selector-"+d.getVar("MACHINE")+".bin" |
64 | try: | 66 | try: |
65 | with open(imgsel_file, "rb") as il: | 67 | with open(imgsel_file, "rb") as il: |
66 | imgsel = il.read(-1) | 68 | imgsel = il.read(-1) |
@@ -103,7 +105,7 @@ def generate_spi_image(d): | |||
103 | qspi_data.write(bootbin) | 105 | qspi_data.write(bootbin) |
104 | 106 | ||
105 | # Recovery Image & Recovery Image Backup | 107 | # Recovery Image & Recovery Image Backup |
106 | imgrcry_file = d.getVar("DEPLOY_DIR_IMAGE")+"/imgrcry-"+d.getVar("MACHINE")+".bin" | 108 | imgrcry_file = d.getVar("DEPLOY_DIR_IMAGE")+"/image-recovery-"+d.getVar("MACHINE")+".bin" |
107 | try: | 109 | try: |
108 | with open(imgrcry_file, "rb") as iy: | 110 | with open(imgrcry_file, "rb") as iy: |
109 | imgrcry = iy.read(-1) | 111 | imgrcry = iy.read(-1) |
@@ -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/classes-recipe/dfx_user_dts.bbclass b/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass index 188d594b..d4a01048 100644 --- a/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass +++ b/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass | |||
@@ -255,8 +255,12 @@ do_install() { | |||
255 | # doesn't have any driver then user can load pdi/bit/bin file. | 255 | # doesn't have any driver then user can load pdi/bit/bin file. |
256 | if [ `ls ${S}/*.dtbo | wc -l` -eq 1 ]; then | 256 | if [ `ls ${S}/*.dtbo | wc -l` -eq 1 ]; then |
257 | install -Dm 0644 ${S}/*.dtbo ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | 257 | install -Dm 0644 ${S}/*.dtbo ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ |
258 | elif [ `ls ${S}/${DTBO_PATH}/*.dtbo | wc -l` -eq 1 ]; then | ||
259 | install -Dm 0644 ${S}/${DTBO_PATH}/*.dtbo ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | ||
258 | elif [ `ls ${S}/*.dtbo | wc -l` -gt 1 ]; then | 260 | elif [ `ls ${S}/*.dtbo | wc -l` -gt 1 ]; then |
259 | bbfatal "Multiple DTBO found, use the right DTBO in SRC_URI from the following:\n$(basename -a ${S}/*.dtbo)" | 261 | bbfatal "Multiple DTBO found, use the right DTBO in SRC_URI from the following:\n$(basename -a ${S}/*.dtbo)" |
262 | elif [ `ls ${S}/${DTBO_PATH}/*.dtbo | wc -l` -gt 1 ]; then | ||
263 | bbfatal "Multiple DTBO found, use the right DTBO in SRC_URI from the following:\n$(basename -a ${S}/${DTBO_PATH}/*.dtbo)" | ||
260 | elif [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then | 264 | elif [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then |
261 | install -Dm 0644 ${B}/${USER_DTS_FILE}.dtbo ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.dtbo | 265 | install -Dm 0644 ${B}/${USER_DTS_FILE}.dtbo ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.dtbo |
262 | else | 266 | else |
@@ -272,12 +276,20 @@ do_install() { | |||
272 | if [ "${SOC_FAMILY}" = "zynq" ] || [ "${SOC_FAMILY}" = "zynqmp" ]; then | 276 | if [ "${SOC_FAMILY}" = "zynq" ] || [ "${SOC_FAMILY}" = "zynqmp" ]; then |
273 | if [ `ls ${S}/*.bit | wc -l` -gt 1 ]; then | 277 | if [ `ls ${S}/*.bit | wc -l` -gt 1 ]; then |
274 | bbfatal "Multiple .bit found, use the right .bit in SRC_URI from the following:\n$(basename -a ${S}/*.bit)" | 278 | bbfatal "Multiple .bit found, use the right .bit in SRC_URI from the following:\n$(basename -a ${S}/*.bit)" |
279 | elif [ `ls ${S}/${BIT_PATH}/*.bit | wc -l` -gt 1 ]; then | ||
280 | bbfatal "Multiple .bit found, use the right .bit in SRC_URI from the following:\n$(basename -a ${S}/${BIT_PATH}/*.bit)" | ||
275 | elif [ `ls ${S}/*.bin | wc -l` -gt 1 ]; then | 281 | elif [ `ls ${S}/*.bin | wc -l` -gt 1 ]; then |
276 | bbfatal "Multiple .bin found, use the right .bin in SRC_URI from the following:\n$(basename -a ${S}/*.bin)" | 282 | bbfatal "Multiple .bin found, use the right .bin in SRC_URI from the following:\n$(basename -a ${S}/*.bin)" |
283 | elif [ `ls ${S}/${BIN_PATH}/*.bin | wc -l` -gt 1 ]; then | ||
284 | bbfatal "Multiple .bin found, use the right .bin in SRC_URI from the following:\n$(basename -a ${S}/${BIN_PATH}/*.bin)" | ||
277 | elif [ `ls ${S}/*.bit | wc -l` -eq 1 ] && [ ! -f ${B}/${USER_DTS_FILE}.dtbo ]; then | 285 | elif [ `ls ${S}/*.bit | wc -l` -eq 1 ] && [ ! -f ${B}/${USER_DTS_FILE}.dtbo ]; then |
278 | install -Dm 0644 ${S}/*.bit ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | 286 | install -Dm 0644 ${S}/*.bit ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ |
287 | elif [ `ls ${S}/${BIT_PATH}/*.bit | wc -l` -eq 1 ] && [ ! -f ${B}/${USER_DTS_FILE}.dtbo ]; then | ||
288 | install -Dm 0644 ${S}/${BIT_PATH}/*.bit ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | ||
279 | elif [ `ls ${S}/*.bin | wc -l` -eq 1 ]; then | 289 | elif [ `ls ${S}/*.bin | wc -l` -eq 1 ]; then |
280 | install -Dm 0644 ${S}/*.bin ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | 290 | install -Dm 0644 ${S}/*.bin ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ |
291 | elif [ `ls ${S}/${BIN_PATH}/*.bin | wc -l` -eq 1 ]; then | ||
292 | install -Dm 0644 ${S}/${BIN_PATH}/*.bin ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | ||
281 | elif [ -f ${B}/${PN}.bin ] && [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then | 293 | elif [ -f ${B}/${PN}.bin ] && [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then |
282 | install -Dm 0644 ${B}/${PN}.bin ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.bin | 294 | install -Dm 0644 ${B}/${PN}.bin ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.bin |
283 | else | 295 | else |
@@ -295,10 +307,16 @@ do_install() { | |||
295 | if [ "${SOC_FAMILY}" != "zynq" ] && [ "${SOC_FAMILY}" != "zynqmp" ]; then | 307 | if [ "${SOC_FAMILY}" != "zynq" ] && [ "${SOC_FAMILY}" != "zynqmp" ]; then |
296 | if [ `ls ${S}/*.pdi | wc -l` -eq 1 ] && [ ! -f ${B}/${USER_DTS_FILE}.dtbo ]; then | 308 | if [ `ls ${S}/*.pdi | wc -l` -eq 1 ] && [ ! -f ${B}/${USER_DTS_FILE}.dtbo ]; then |
297 | install -Dm 0644 ${S}/*.pdi ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | 309 | install -Dm 0644 ${S}/*.pdi ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ |
310 | elif [ `ls ${S}/${PDI_PATH}/*.pdi | wc -l` -eq 1 ] && [ ! -f ${B}/${USER_DTS_FILE}.dtbo ]; then | ||
311 | install -Dm 0644 ${S}/${PDI_PATH}/*.pdi ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/ | ||
298 | elif [ `ls ${S}/*.pdi | wc -l` -gt 1 ]; then | 312 | elif [ `ls ${S}/*.pdi | wc -l` -gt 1 ]; then |
299 | bbfatal "Multiple PDI found, use the right PDI in SRC_URI from the following:\n$(basename -a ${S}/*.pdi)" | 313 | bbfatal "Multiple PDI found, use the right PDI in SRC_URI from the following:\n$(basename -a ${S}/*.pdi)" |
314 | elif [ `ls ${S}/${PDI_PATH}/*.pdi | wc -l` -gt 1 ]; then | ||
315 | bbfatal "Multiple PDI found, use the right PDI in SRC_URI from the following:\n$(basename -a ${S}/${PDI_PATH}/*.pdi)" | ||
300 | elif [ `ls ${S}/*.pdi | wc -l` -eq 1 ] && [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then | 316 | elif [ `ls ${S}/*.pdi | wc -l` -eq 1 ] && [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then |
301 | install -Dm 0644 ${S}/*.pdi ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.pdi | 317 | install -Dm 0644 ${S}/*.pdi ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.pdi |
318 | elif [ `ls ${S}/${PDI_PATH}/*.pdi | wc -l` -eq 1 ] && [ -f ${B}/${USER_DTS_FILE}.dtbo ]; then | ||
319 | install -Dm 0644 ${S}/${PDI_PATH}/*.pdi ${D}/${nonarch_base_libdir}/firmware/xilinx/${PN}/${PN}.pdi | ||
302 | else | 320 | else |
303 | bbwarn "A PDI file with '.pdi' expected but not found" | 321 | bbwarn "A PDI file with '.pdi' expected but not found" |
304 | fi | 322 | fi |
diff --git a/meta-xilinx-core/classes-recipe/qemuboot-xilinx.bbclass b/meta-xilinx-core/classes-recipe/qemuboot-xilinx.bbclass index a0ea1531..df7016d4 100644 --- a/meta-xilinx-core/classes-recipe/qemuboot-xilinx.bbclass +++ b/meta-xilinx-core/classes-recipe/qemuboot-xilinx.bbclass | |||
@@ -23,10 +23,26 @@ QB_DEFAULT_KERNEL:zynq ?= "${@'zImage' if \ | |||
23 | QB_DEFAULT_KERNEL:microblaze ?= "${@'simpleImage.mb' if \ | 23 | QB_DEFAULT_KERNEL:microblaze ?= "${@'simpleImage.mb' if \ |
24 | d.getVar('INITRAMFS_IMAGE_BUNDLE') != '1' else 'simpleImage.mb-initramfs-${MACHINE}.bin'}" | 24 | d.getVar('INITRAMFS_IMAGE_BUNDLE') != '1' else 'simpleImage.mb-initramfs-${MACHINE}.bin'}" |
25 | 25 | ||
26 | # https://docs.amd.com/r/en-US/ug585-zynq-7000-SoC-TRM/Boot-Mode-Pin-Settings | ||
26 | # https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Boot-Modes | 27 | # https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Boot-Modes |
27 | # https://docs.amd.com/r/en-US/ug1304-versal-acap-ssdg/Boot-Device-Modes | 28 | # https://docs.amd.com/r/en-US/ug1304-versal-acap-ssdg/Boot-Device-Modes |
28 | QB_BOOT_MODE ?= "-boot mode=5" | 29 | QB_BOOT_MODE ?= "-boot mode=5" |
29 | 30 | ||
31 | |||
32 | # ZynqMP or Versal SD and eMMC drive index. | ||
33 | # Note: Do not set drive index based on boot mode some boards may have primary | ||
34 | # boot mode as QSPI/OSPI and secondary boot mode as SD/eMMC. | ||
35 | # | ||
36 | # SoC Device Drive Index | ||
37 | # Zynq-7000, ZynqMP, Versal SD0 0 | ||
38 | # ZynqMP, Versal SD1 1 | ||
39 | # ZynqMP, Versal eMMC0(secondary boot only) 2 | ||
40 | # ZynqMP, Versal eMMC1 3 | ||
41 | |||
42 | QB_SD_DRIVE_INDEX ?= "1" | ||
43 | QB_SD_DRIVE_INDEX:zynq ?= "0" | ||
44 | QB_SD_DRIVE_INDEX:versal-net ?= "0" | ||
45 | |||
30 | inherit qemuboot | 46 | inherit qemuboot |
31 | 47 | ||
32 | def qemu_target_binary(data): | 48 | def qemu_target_binary(data): |
@@ -78,6 +94,7 @@ def qemu_rootfs_params(data, param): | |||
78 | bundle_image = data.getVar('INITRAMFS_IMAGE_BUNDLE') or "" | 94 | bundle_image = data.getVar('INITRAMFS_IMAGE_BUNDLE') or "" |
79 | soc_family = data.getVar('SOC_FAMILY') or "" | 95 | soc_family = data.getVar('SOC_FAMILY') or "" |
80 | tune_features = (data.getVar('TUNE_FEATURES') or []).split() | 96 | tune_features = (data.getVar('TUNE_FEATURES') or []).split() |
97 | sd_index = data.getVar('QB_SD_DRIVE_INDEX') or "" | ||
81 | if 'microblaze' in tune_features: | 98 | if 'microblaze' in tune_features: |
82 | soc_family = 'microblaze' | 99 | soc_family = 'microblaze' |
83 | 100 | ||
@@ -101,12 +118,6 @@ def qemu_rootfs_params(data, param): | |||
101 | return fstype_dict[soc_family] | 118 | return fstype_dict[soc_family] |
102 | 119 | ||
103 | elif param == 'rootfs-opt': | 120 | elif param == 'rootfs-opt': |
104 | sd_index = "1" | ||
105 | if soc_family == 'zynq': | ||
106 | sd_index = "0" | ||
107 | if soc_family == 'versal-net': | ||
108 | sd_index = "0" | ||
109 | |||
110 | # Device is using a disk | 121 | # Device is using a disk |
111 | if not initramfs_image: | 122 | if not initramfs_image: |
112 | return ' -drive if=sd,index=%s,file=@ROOTFS@,format=raw' % (sd_index) | 123 | return ' -drive if=sd,index=%s,file=@ROOTFS@,format=raw' % (sd_index) |
diff --git a/meta-xilinx-core/classes/xilinx-deprecated.bbclass b/meta-xilinx-core/classes/xilinx-deprecated.bbclass index 1aee2fe1..c7509feb 100644 --- a/meta-xilinx-core/classes/xilinx-deprecated.bbclass +++ b/meta-xilinx-core/classes/xilinx-deprecated.bbclass | |||
@@ -14,5 +14,6 @@ python xilinx_deprecated_config_eventhandler () { | |||
14 | if msg_source == "doc": | 14 | if msg_source == "doc": |
15 | continue | 15 | continue |
16 | msg = d.getVarFlag('XILINX_DEPRECATED', msg_source) or "" | 16 | msg = d.getVarFlag('XILINX_DEPRECATED', msg_source) or "" |
17 | bb.warn('%s: %s' % (msg_source, msg)) | 17 | if msg: |
18 | bb.warn('%s: %s' % (msg_source, msg)) | ||
18 | } | 19 | } |
diff --git a/meta-xilinx-core/classes/xilinx-vars.bbclass b/meta-xilinx-core/classes/xilinx-vars.bbclass index 51d3cd87..e19918ca 100644 --- a/meta-xilinx-core/classes/xilinx-vars.bbclass +++ b/meta-xilinx-core/classes/xilinx-vars.bbclass | |||
@@ -6,15 +6,6 @@ xilinx_variables_config_eventhandler[eventmask] = "bb.event.ConfigParsed" | |||
6 | # It's up to the base sytem to define the variables being used here, we're | 6 | # It's up to the base sytem to define the variables being used here, we're |
7 | # only going to check them. | 7 | # only going to check them. |
8 | python xilinx_variables_config_eventhandler () { | 8 | python xilinx_variables_config_eventhandler () { |
9 | # Verify HDF_MACHINE | ||
10 | hdf_prior = d.getVar('HDF_MACHINE_PRIOR') | ||
11 | hdf_final = d.getVar('HDF_MACHINE') | ||
12 | |||
13 | if hdf_prior and hdf_prior != hdf_final: | ||
14 | bb.fatal("HDF_MACHINE is set to %s, it appears you intended %s. " \ | ||
15 | "This is usually as a result of specifying it in the local.conf or before the 'require' in the machine .conf file. " \ | ||
16 | "See meta-xilinx-core/conf/machine/README." % (hdf_final, hdf_prior)) | ||
17 | |||
18 | # Verify DEFAULTTUNE | 9 | # Verify DEFAULTTUNE |
19 | tune_prior = d.getVar('DEFAULTTUNE_PRIOR') | 10 | tune_prior = d.getVar('DEFAULTTUNE_PRIOR') |
20 | tune_final = d.getVar('DEFAULTTUNE') | 11 | tune_final = d.getVar('DEFAULTTUNE') |
@@ -26,7 +17,7 @@ python xilinx_variables_config_eventhandler () { | |||
26 | 17 | ||
27 | # Verify 'xilinx' is in LICENSE_FLAGS_ACCEPTED | 18 | # Verify 'xilinx' is in LICENSE_FLAGS_ACCEPTED |
28 | license_flags = d.getVar('LICENSE_FLAGS_ACCEPTED') or "" | 19 | license_flags = d.getVar('LICENSE_FLAGS_ACCEPTED') or "" |
29 | if 'xilinx' not in license_flags.split(): | 20 | if all(license not in license_flags.split() for license in ['xilinx', 'xilinx_pmu-rom-native']) : |
30 | bb.warn("The ZynqMP pmu-rom is not enabled, qemu may not be able to emulate a ZynqMP system without it. " \ | 21 | bb.warn("The ZynqMP pmu-rom is not enabled, qemu may not be able to emulate a ZynqMP system without it. " \ |
31 | "To enable this you must add 'xilinx' to the LICENSE_FLAGS_ACCEPTED to indicate you accept the software license.") | 22 | "To enable this you must add 'xilinx' to the LICENSE_FLAGS_ACCEPTED to indicate you accept the software license.") |
32 | } | 23 | } |
diff --git a/meta-xilinx-core/conf/layer.conf b/meta-xilinx-core/conf/layer.conf index 2aa0a1a1..399011a7 100644 --- a/meta-xilinx-core/conf/layer.conf +++ b/meta-xilinx-core/conf/layer.conf | |||
@@ -22,7 +22,7 @@ xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bb \ | |||
22 | xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bbappend \ | 22 | xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bbappend \ |
23 | " | 23 | " |
24 | 24 | ||
25 | LAYERDEPENDS_xilinx = "core" | 25 | LAYERDEPENDS_xilinx = "core meta-arm" |
26 | LAYERRECOMMENDS_xilinx = "openembedded-layer" | 26 | LAYERRECOMMENDS_xilinx = "openembedded-layer" |
27 | 27 | ||
28 | LAYERSERIES_COMPAT_xilinx = "scarthgap" | 28 | LAYERSERIES_COMPAT_xilinx = "scarthgap" |
@@ -42,7 +42,7 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ | |||
42 | *->xserver-xorg \ | 42 | *->xserver-xorg \ |
43 | " | 43 | " |
44 | 44 | ||
45 | XILINX_RELEASE_VERSION ??= "v2024.1" | 45 | XILINX_RELEASE_VERSION ??= "v2024.2" |
46 | 46 | ||
47 | BUILDCFG_VARS:append = " XILINX_RELEASE_VERSION" | 47 | BUILDCFG_VARS:append = " XILINX_RELEASE_VERSION" |
48 | 48 | ||
@@ -55,13 +55,20 @@ XILINX_ATF_VERSION[v2022.2] = "2.6-xilinx-v2022.2%" | |||
55 | XILINX_ATF_VERSION[v2023.1] = "2.8-xilinx-v2023.1%" | 55 | XILINX_ATF_VERSION[v2023.1] = "2.8-xilinx-v2023.1%" |
56 | XILINX_ATF_VERSION[v2023.2] = "2.8-xilinx-v2023.2%" | 56 | XILINX_ATF_VERSION[v2023.2] = "2.8-xilinx-v2023.2%" |
57 | XILINX_ATF_VERSION[v2024.1] = "2.10-xilinx-v2024.1%" | 57 | XILINX_ATF_VERSION[v2024.1] = "2.10-xilinx-v2024.1%" |
58 | PREFERRED_VERSION_arm-trusted-firmware ?= "${@d.getVarFlag('XILINX_ATF_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 58 | XILINX_ATF_VERSION[v2024.2] = "2.10-xilinx-v2024.2%" |
59 | PREFERRED_VERSION_virtual/arm-trusted-firmware ?= "${@d.getVarFlag('XILINX_ATF_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | ||
60 | |||
61 | # The name of the software has changed to match upstream ARM | ||
62 | XILINX_ATF_PROVIDERS[v2024.2] = "trusted-firmware-a" | ||
63 | PREFERRED_PROVIDER_virtual/arm-trusted-firmware = "${@d.getVarFlag('XILINX_ATF_PROVIDERS', d.getVar('XILINX_RELEASE_VERSION')) or 'arm-trusted-firmware'}" | ||
64 | |||
59 | 65 | ||
60 | XILINX_UBOOT_VERSION[v2022.1] = "1:2021.01-xilinx-v2022.1%" | 66 | XILINX_UBOOT_VERSION[v2022.1] = "1:2021.01-xilinx-v2022.1%" |
61 | XILINX_UBOOT_VERSION[v2022.2] = "1:2022.01-xilinx-v2022.2%" | 67 | XILINX_UBOOT_VERSION[v2022.2] = "1:2022.01-xilinx-v2022.2%" |
62 | XILINX_UBOOT_VERSION[v2023.1] = "1:2023.01-xilinx-v2023.1%" | 68 | XILINX_UBOOT_VERSION[v2023.1] = "1:2023.01-xilinx-v2023.1%" |
63 | XILINX_UBOOT_VERSION[v2023.2] = "1:2023.01-xilinx-v2023.2%" | 69 | XILINX_UBOOT_VERSION[v2023.2] = "1:2023.01-xilinx-v2023.2%" |
64 | XILINX_UBOOT_VERSION[v2024.1] = "1:2024.01-xilinx-v2024.1%" | 70 | XILINX_UBOOT_VERSION[v2024.1] = "1:2024.01-xilinx-v2024.1%" |
71 | XILINX_UBOOT_VERSION[v2024.2] = "1:2024.01-xilinx-v2024.2%" | ||
65 | 72 | ||
66 | PREFERRED_VERSION_u-boot-xlnx ?= "${@d.getVarFlag('XILINX_UBOOT_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 73 | PREFERRED_VERSION_u-boot-xlnx ?= "${@d.getVarFlag('XILINX_UBOOT_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
67 | PREFERRED_VERSION_u-boot-tools-xlnx ?= "${@d.getVarFlag('XILINX_UBOOT_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 74 | PREFERRED_VERSION_u-boot-tools-xlnx ?= "${@d.getVarFlag('XILINX_UBOOT_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
@@ -71,6 +78,7 @@ XILINX_LINUX_VERSION[v2022.2] = "5.15.36%" | |||
71 | XILINX_LINUX_VERSION[v2023.1] = "6.1.30%" | 78 | XILINX_LINUX_VERSION[v2023.1] = "6.1.30%" |
72 | XILINX_LINUX_VERSION[v2023.2] = "6.1.60%" | 79 | XILINX_LINUX_VERSION[v2023.2] = "6.1.60%" |
73 | XILINX_LINUX_VERSION[v2024.1] = "6.6.10%" | 80 | XILINX_LINUX_VERSION[v2024.1] = "6.6.10%" |
81 | XILINX_LINUX_VERSION[v2024.2] = "6.6.40%" | ||
74 | PREFERRED_VERSION_linux-xlnx ?= "${@d.getVarFlag('XILINX_LINUX_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 82 | PREFERRED_VERSION_linux-xlnx ?= "${@d.getVarFlag('XILINX_LINUX_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
75 | 83 | ||
76 | # XRT/ZOCL | 84 | # XRT/ZOCL |
@@ -78,7 +86,8 @@ XRT_ZOCL_VERSION[v2022.1] = "202210.2.13.479" | |||
78 | XRT_ZOCL_VERSION[v2022.2] = "202220.2.14.0" | 86 | XRT_ZOCL_VERSION[v2022.2] = "202220.2.14.0" |
79 | XRT_ZOCL_VERSION[v2023.1] = "202310.2.15.0" | 87 | XRT_ZOCL_VERSION[v2023.1] = "202310.2.15.0" |
80 | XRT_ZOCL_VERSION[v2023.2] = "202320.2.16.0" | 88 | XRT_ZOCL_VERSION[v2023.2] = "202320.2.16.0" |
81 | XRT_ZOCL_VERSION[v2024.1] = "202410.2.17.0" | 89 | XRT_ZOCL_VERSION[v2024.1] = "202410.2.17.319" |
90 | XRT_ZOCL_VERSION[v2024.2] = "202420.2.18.0" | ||
82 | PREFERRED_VERSION_xrt ?= "${@d.getVarFlag('XRT_ZOCL_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 91 | PREFERRED_VERSION_xrt ?= "${@d.getVarFlag('XRT_ZOCL_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
83 | PREFERRED_VERSION_zocl ?= "${@d.getVarFlag('XRT_ZOCL_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 92 | PREFERRED_VERSION_zocl ?= "${@d.getVarFlag('XRT_ZOCL_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
84 | 93 | ||
@@ -88,6 +97,7 @@ AIEFAL_VERSION[v2022.2] = "1.4" | |||
88 | AIEFAL_VERSION[v2023.1] = "1.5" | 97 | AIEFAL_VERSION[v2023.1] = "1.5" |
89 | AIEFAL_VERSION[v2023.2] = "1.5" | 98 | AIEFAL_VERSION[v2023.2] = "1.5" |
90 | AIEFAL_VERSION[v2024.1] = "1.6" | 99 | AIEFAL_VERSION[v2024.1] = "1.6" |
100 | AIEFAL_VERSION[v2024.2] = "1.7" | ||
91 | PREFERRED_VERSION_aiefal ?= "${@d.getVarFlag('AIEFAL_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 101 | PREFERRED_VERSION_aiefal ?= "${@d.getVarFlag('AIEFAL_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
92 | 102 | ||
93 | AI_ENGINE_DRIVER_VERSION[v2022.1] = "3.3" | 103 | AI_ENGINE_DRIVER_VERSION[v2022.1] = "3.3" |
@@ -95,6 +105,7 @@ AI_ENGINE_DRIVER_VERSION[v2022.2] = "3.3" | |||
95 | AI_ENGINE_DRIVER_VERSION[v2023.1] = "3.4" | 105 | AI_ENGINE_DRIVER_VERSION[v2023.1] = "3.4" |
96 | AI_ENGINE_DRIVER_VERSION[v2023.2] = "3.4" | 106 | AI_ENGINE_DRIVER_VERSION[v2023.2] = "3.4" |
97 | AI_ENGINE_DRIVER_VERSION[v2024.1] = "3.5" | 107 | AI_ENGINE_DRIVER_VERSION[v2024.1] = "3.5" |
108 | AI_ENGINE_DRIVER_VERSION[v2024.2] = "3.6" | ||
98 | PREFERRED_VERSION_ai-engine-driver ?= "${@d.getVarFlag('AI_ENGINE_DRIVER_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" | 109 | PREFERRED_VERSION_ai-engine-driver ?= "${@d.getVarFlag('AI_ENGINE_DRIVER_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" |
99 | 110 | ||
100 | # Add support to eSDK for gen-machine-conf if it exists | 111 | # Add support to eSDK for gen-machine-conf if it exists |
diff --git a/meta-xilinx-core/conf/machine/README b/meta-xilinx-core/conf/machine/README index f664a2f0..5db8fa8f 100644 --- a/meta-xilinx-core/conf/machine/README +++ b/meta-xilinx-core/conf/machine/README | |||
@@ -44,7 +44,6 @@ MACHINEOVERRIDES =. "${@['', 'my-example:']['my-example' != '${MACHINE}']}" | |||
44 | 44 | ||
45 | require conf/machine/zynqmp-generic.conf | 45 | require conf/machine/zynqmp-generic.conf |
46 | 46 | ||
47 | HDF_MACHINE = "zcu102-zynqmp" | ||
48 | MACHINE_FEATURES += "pci" | 47 | MACHINE_FEATURES += "pci" |
49 | 48 | ||
50 | #### No additional settings should be after the Postamble | 49 | #### No additional settings should be after the Postamble |
@@ -67,7 +66,6 @@ DEFAULTTUNE ?= "aarch64" | |||
67 | 66 | ||
68 | require conf/machine/zynqmp-generic.conf | 67 | require conf/machine/zynqmp-generic.conf |
69 | 68 | ||
70 | HDF_MACHINE = "zcu102-zynqmp" | ||
71 | MACHINE_FEATURES += "pci" | 69 | MACHINE_FEATURES += "pci" |
72 | 70 | ||
73 | #### No additional settings should be after the Postamble | 71 | #### No additional settings should be after the Postamble |
@@ -88,7 +86,6 @@ TUNE_FEATURES:tune-microblaze ?= "microblaze v8.50 barrel-shift reorder pattern- | |||
88 | 86 | ||
89 | require conf/machine/microblaze-generic.conf | 87 | require conf/machine/microblaze-generic.conf |
90 | 88 | ||
91 | HDF_MACHINE = "ml605" | ||
92 | SERIAL_CONSOLE = "115200,ttyUL0" | 89 | SERIAL_CONSOLE = "115200,ttyUL0" |
93 | 90 | ||
94 | #### No additional settings should be after the Postamble | 91 | #### No additional settings should be after the Postamble |
@@ -149,12 +146,17 @@ local.conf | |||
149 | System wide setting: | 146 | System wide setting: |
150 | TUNE_FEATURES:tune-<tune> - Specific tune features | 147 | TUNE_FEATURES:tune-<tune> - Specific tune features |
151 | 148 | ||
149 | XILINX_WITH_ESW = "xsct" or "sdt" - Specify xsct or sdt workflow | ||
150 | |||
152 | external-hdf recipe from meta-xilinx-tools: | 151 | external-hdf recipe from meta-xilinx-tools: |
153 | HDF_MACHINE - Machine to load from reference defign xsa using hdf-examples recipe | 152 | XILINX_XSCT_VERSION - Version of the XSCT tool and associated ESW software |
154 | HDF_EXT - Only ".xsa" externsion is supported, legacy variable. | 153 | HDF_URI - URL for the .xsa file |
155 | HDF_BASE - Download protocol (file://, git://, http:// or https://) protocol if | 154 | HDF_URI[sha256sum] - sha256sum of the .xsa |
156 | not using the default external-hdf repository. | 155 | |
157 | HDF_PATH - Path to the repository or XSA file | 156 | sdt-artifacts recipe from meta-xilinx-standalone-sdt: |
157 | SDT_URI - URI for the system device tree artifacts (usually a tarball) | ||
158 | SDT_URI[sha256sum] - sha256sum of the SDT artifacts file | ||
159 | SDT_URI[S] - the 'S' (source) directory where the artifacts are extracted | ||
158 | 160 | ||
159 | fs-boot recipe from meta-xilinx-tools: | 161 | fs-boot recipe from meta-xilinx-tools: |
160 | YAML_SERIAL_CONSOLE_STDIN:pn-fs-boot - YAML based uart stdin configuration for | 162 | YAML_SERIAL_CONSOLE_STDIN:pn-fs-boot - YAML based uart stdin configuration for |
@@ -208,15 +210,3 @@ HAS_PLATFORM_INIT - List of defconfig files available for u-boot only for SPL bo | |||
208 | u-boot-xlnx-scr recipe from meta-xilinx-core: | 210 | u-boot-xlnx-scr recipe from meta-xilinx-core: |
209 | DDR_BASEADDR - Base address for DDR used for loading the images from u-boot env. | 211 | DDR_BASEADDR - Base address for DDR used for loading the images from u-boot env. |
210 | SKIP_APPEND_BASEADDR - Skip appending ${DDR_BASEADDR} for image offsets. | 212 | SKIP_APPEND_BASEADDR - Skip appending ${DDR_BASEADDR} for image offsets. |
211 | |||
212 | Varibable set after required inclusion file: | ||
213 | Varibables that does not intend to change must be set before required inclusion | ||
214 | file. | ||
215 | |||
216 | external-hdf recipe from meta-xilinx-tools: | ||
217 | HDF_MACHINE - Used by the recipe to find the correct XSA | ||
218 | HDF_EXT - only xsa is supported, legacy variable | ||
219 | HDF_BASE - protocol if not using the default external-hdf repository | ||
220 | HDF_PATH - path to the repository or XSA file | ||
221 | |||
222 | ...and more... | ||
diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc index 904b4861..cf890a51 100644 --- a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc +++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc | |||
@@ -1,5 +1,3 @@ | |||
1 | # HDF_MACHINE should be set _AFTER_ this has been loaded | ||
2 | HDF_MACHINE_PRIOR := "${HDF_MACHINE}" | ||
3 | INHERIT += "xilinx-vars" | 1 | INHERIT += "xilinx-vars" |
4 | INHERIT += "xilinx-deprecated" | 2 | INHERIT += "xilinx-deprecated" |
5 | 3 | ||
@@ -14,7 +12,7 @@ IMAGE_FSTYPES ?= "tar.gz cpio cpio.gz cpio.gz.u-boot" | |||
14 | PREFERRED_PROVIDER_virtual/kernel ??= "linux-xlnx" | 12 | PREFERRED_PROVIDER_virtual/kernel ??= "linux-xlnx" |
15 | 13 | ||
16 | # Device tree Configuration | 14 | # Device tree Configuration |
17 | PREFERRED_PROVIDER_virtual/dtb ??= "device-tree" | 15 | PREFERRED_PROVIDER_virtual/dtb ??= "${@'device-tree' if d.getVar('XILINX_WITH_ESW') else ''}" |
18 | 16 | ||
19 | # U-Boot Configuration | 17 | # U-Boot Configuration |
20 | PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-xlnx" | 18 | PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-xlnx" |
@@ -27,8 +25,6 @@ PREFERRED_PROVIDER_nativesdk-u-boot-tools ??= "nativesdk-u-boot-tools-xlnx" | |||
27 | PREFERRED_PROVIDER_libmetal ?= "libmetal-xlnx" | 25 | PREFERRED_PROVIDER_libmetal ?= "libmetal-xlnx" |
28 | PREFERRED_PROVIDER_open-amp ?= "open-amp-xlnx" | 26 | PREFERRED_PROVIDER_open-amp ?= "open-amp-xlnx" |
29 | 27 | ||
30 | do_image_wic[depends] += "${@' '.join('%s:do_deploy' % r for r in (d.getVar('WIC_DEPENDS') or "").split())}" | ||
31 | |||
32 | UBOOT_SUFFIX ?= "bin" | 28 | UBOOT_SUFFIX ?= "bin" |
33 | 29 | ||
34 | UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" | 30 | UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" |
@@ -61,12 +57,9 @@ WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'boot.bi | |||
61 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'system.dtb', ' virtual/dtb', '', d)}" | 57 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'system.dtb', ' virtual/dtb', '', d)}" |
62 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'boot.scr', ' u-boot-xlnx-scr', '', d)}" | 58 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'boot.scr', ' u-boot-xlnx-scr', '', d)}" |
63 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uEnv.txt', ' u-boot-xlnx-uenv', '', d)}" | 59 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uEnv.txt', ' u-boot-xlnx-uenv', '', d)}" |
64 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'atf-uboot.ub', ' arm-trusted-firmware', '', d)}" | ||
65 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'Image', ' virtual/kernel', '', d)}" | 60 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'Image', ' virtual/kernel', '', d)}" |
66 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uImage', ' virtual/kernel', '', d)}" | 61 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uImage', ' virtual/kernel', '', d)}" |
67 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'zImage', ' virtual/kernel', '', d)}" | 62 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'zImage', ' virtual/kernel', '', d)}" |
68 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'u-boot.bin', ' virtual/bootloader', '', d)}" | ||
69 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'u-boot.elf', ' virtual/bootloader', '', d)}" | ||
70 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', '${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot', ' ${INITRAMFS_IMAGE}', '', d)}" | 63 | WKS_FILE_DEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', '${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot', ' ${INITRAMFS_IMAGE}', '', d)}" |
71 | 64 | ||
72 | # Automatically add IMAGE_BOOT_FILES to /boot via packages | 65 | # Automatically add IMAGE_BOOT_FILES to /boot via packages |
@@ -74,9 +67,6 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INST | |||
74 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'system.dtb', ' ${PREFERRED_PROVIDER_virtual/dtb}', '', d)}" | 67 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'system.dtb', ' ${PREFERRED_PROVIDER_virtual/dtb}', '', d)}" |
75 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'boot.scr', ' u-boot-xlnx-scr', '', d)}" | 68 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'boot.scr', ' u-boot-xlnx-scr', '', d)}" |
76 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uEnv.txt', ' u-boot-xlnx-uenv', '', d)}" | 69 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uEnv.txt', ' u-boot-xlnx-uenv', '', d)}" |
77 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'atf-uboot.ub', ' arm-trusted-firmware', '', d)}" | ||
78 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'u-boot.bin', ' ${PREFERRED_PROVIDER_virtual/bootloader}-bin', '', d)}" | ||
79 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'u-boot.elf', ' ${PREFERRED_PROVIDER_virtual/bootloader}-elf', '', d)}" | ||
80 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'Image', ' kernel-image-image', '', d)}" | 70 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'Image', ' kernel-image-image', '', d)}" |
81 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uImage', ' kernel-image-uimage', '', d)}" | 71 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'uImage', ' kernel-image-uimage', '', d)}" |
82 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'zImage', ' kernel-image-zimage', '', d)}" | 72 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS .= "${@bb.utils.contains('IMAGE_BOOT_FILES_INSTALLED', 'zImage', ' kernel-image-zimage', '', d)}" |
@@ -90,6 +80,17 @@ IMAGE_BOOT_FILES ?= "${@get_default_image_boot_files(d)}" | |||
90 | def get_default_image_boot_files(d): | 80 | def get_default_image_boot_files(d): |
91 | files = [] | 81 | files = [] |
92 | 82 | ||
83 | esw_type = d.getVar('XILINX_WITH_ESW') or '' | ||
84 | if esw_type: | ||
85 | if 'zynq' in d.getVar('OVERRIDES').split(':'): | ||
86 | files.append('boot.bin') | ||
87 | if 'zynqmp' in d.getVar('OVERRIDES').split(':'): | ||
88 | files.append('boot.bin') | ||
89 | if 'versal' in d.getVar('OVERRIDES').split(':'): | ||
90 | files.append('boot.bin') | ||
91 | if 'versal-net' in d.getVar('OVERRIDES').split(':'): | ||
92 | files.append('boot.bin') | ||
93 | |||
93 | # kernel images | 94 | # kernel images |
94 | kerneltypes = set((d.getVar("KERNEL_IMAGETYPE") or "").split()) | 95 | kerneltypes = set((d.getVar("KERNEL_IMAGETYPE") or "").split()) |
95 | kerneltypes |= set((d.getVar("KERNEL_IMAGETYPES") or "").split()) | 96 | kerneltypes |= set((d.getVar("KERNEL_IMAGETYPES") or "").split()) |
@@ -103,6 +104,7 @@ def get_default_image_boot_files(d): | |||
103 | 104 | ||
104 | # device trees (device-tree only), these are first as they are likely desired over the kernel ones | 105 | # device trees (device-tree only), these are first as they are likely desired over the kernel ones |
105 | if "device-tree" in (d.getVar("PREFERRED_PROVIDER_virtual/dtb") or ""): | 106 | if "device-tree" in (d.getVar("PREFERRED_PROVIDER_virtual/dtb") or ""): |
107 | files.append("system.dtb") | ||
106 | files.append("devicetree/*.dtb;devicetree/") | 108 | files.append("devicetree/*.dtb;devicetree/") |
107 | files.append("devicetree/*.dtbo;devicetree/") | 109 | files.append("devicetree/*.dtbo;devicetree/") |
108 | 110 | ||
@@ -115,6 +117,34 @@ def get_default_image_boot_files(d): | |||
115 | 117 | ||
116 | return " ".join(files) | 118 | return " ".join(files) |
117 | 119 | ||
120 | EXTRA_IMAGEDEPENDS += "${@get_default_extra_imagedepends(d)}" | ||
121 | |||
122 | def get_default_extra_imagedepends(d): | ||
123 | depends = [] | ||
124 | |||
125 | # Add firmware dependencies | ||
126 | esw_type = d.getVar('XILINX_WITH_ESW') or '' | ||
127 | if esw_type: | ||
128 | depends.append('libyaml-native') | ||
129 | depends.append('python3-cython-native') | ||
130 | depends.append('python3-pyyaml-native') | ||
131 | if 'microblaze' in d.getVar('OVERRIDES').split(':'): | ||
132 | depends.append('virtual/bitstream') | ||
133 | if 'zynq' in d.getVar('OVERRIDES').split(':'): | ||
134 | depends.append('virtual/boot-bin') | ||
135 | if 'zynqmp' in d.getVar('OVERRIDES').split(':'): | ||
136 | depends.append('virtual/boot-bin') | ||
137 | if 'versal' in d.getVar('OVERRIDES').split(':'): | ||
138 | depends.append('virtual/boot-bin') | ||
139 | depends.append('virtual/cdo') | ||
140 | if 'versal-net' in d.getVar('OVERRIDES').split(':'): | ||
141 | depends.append('virtual/boot-bin') | ||
142 | depends.append('virtual/cdo') | ||
143 | |||
144 | return " ".join(depends) | ||
145 | |||
146 | |||
147 | |||
118 | XSERVER_EXT ?= "" | 148 | XSERVER_EXT ?= "" |
119 | 149 | ||
120 | FPGA_MNGR_RECONFIG_ENABLE ?= "1" | 150 | FPGA_MNGR_RECONFIG_ENABLE ?= "1" |
diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc index c450b542..e75f556b 100644 --- a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc +++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc | |||
@@ -9,7 +9,7 @@ PREFERRED_PROVIDER_nativesdk-qemu = "nativesdk-qemu-xilinx" | |||
9 | MACHINEOVERRIDES =. "qemuboot-xilinx:" | 9 | MACHINEOVERRIDES =. "qemuboot-xilinx:" |
10 | 10 | ||
11 | # depend on qemu-helper-native, which will depend on QEMU | 11 | # depend on qemu-helper-native, which will depend on QEMU |
12 | EXTRA_IMAGEDEPENDS += "qemu-system-native qemu-helper-native:do_addto_recipe_sysroot" | 12 | EXTRA_IMAGEDEPENDS += "qemu-devicetrees-native qemu-system-native qemu-helper-native:do_addto_recipe_sysroot" |
13 | 13 | ||
14 | # Use the xilinx specific version for these users | 14 | # Use the xilinx specific version for these users |
15 | IMAGE_CLASSES += "qemuboot-xilinx" | 15 | IMAGE_CLASSES += "qemuboot-xilinx" |
@@ -21,5 +21,5 @@ IMAGE_CLASSES += "qemuboot-xilinx" | |||
21 | # QB_XILINX_SERIAL that will allow us to define serial ports for qemu | 21 | # QB_XILINX_SERIAL that will allow us to define serial ports for qemu |
22 | # emulated boards that may not match the standard Linux behavior. | 22 | # emulated boards that may not match the standard Linux behavior. |
23 | # | 23 | # |
24 | QB_XILINX_SERIAL ?= "" | 24 | QB_XILINX_SERIAL ??= "" |
25 | QB_OPT_APPEND += "${QB_XILINX_SERIAL}" | 25 | QB_OPT_APPEND += "${QB_XILINX_SERIAL} -nodefaults" |
diff --git a/meta-xilinx-core/conf/machine/include/soc-tune-include.inc b/meta-xilinx-core/conf/machine/include/soc-tune-include.inc index b3216426..197a998d 100644 --- a/meta-xilinx-core/conf/machine/include/soc-tune-include.inc +++ b/meta-xilinx-core/conf/machine/include/soc-tune-include.inc | |||
@@ -7,6 +7,7 @@ TUNEFILE[cortexr5hf] = "conf/machine/include/arm/armv7r/tune-cortexr5.inc" | |||
7 | TUNEFILE[cortexr52] = "conf/machine/include/arm/armv8r/tune-cortexr52.inc" | 7 | TUNEFILE[cortexr52] = "conf/machine/include/arm/armv8r/tune-cortexr52.inc" |
8 | TUNEFILE[cortexr52hf] = "conf/machine/include/arm/armv8r/tune-cortexr52.inc" | 8 | TUNEFILE[cortexr52hf] = "conf/machine/include/arm/armv8r/tune-cortexr52.inc" |
9 | TUNEFILE[cortexa9thf-neon] = "conf/machine/include/arm/armv7a/tune-cortexa9.inc" | 9 | TUNEFILE[cortexa9thf-neon] = "conf/machine/include/arm/armv7a/tune-cortexa9.inc" |
10 | TUNEFILE[cortexa9] = "conf/machine/include/arm/armv7a/tune-cortexa9.inc" | ||
10 | TUNEFILE[armv8a] = "conf/machine/include/arm/arch-armv8a.inc" | 11 | TUNEFILE[armv8a] = "conf/machine/include/arm/arch-armv8a.inc" |
11 | TUNEFILE[cortexa53] = "conf/machine/include/arm/armv8a/tune-cortexa53.inc" | 12 | TUNEFILE[cortexa53] = "conf/machine/include/arm/armv8a/tune-cortexa53.inc" |
12 | TUNEFILE[cortexa72] = "conf/machine/include/arm/armv8a/tune-cortexa72.inc" | 13 | TUNEFILE[cortexa72] = "conf/machine/include/arm/armv8a/tune-cortexa72.inc" |
diff --git a/meta-xilinx-core/conf/machine/include/soc-versal-net.inc b/meta-xilinx-core/conf/machine/include/soc-versal-net.inc index b59bdacc..f7898e0d 100644 --- a/meta-xilinx-core/conf/machine/include/soc-versal-net.inc +++ b/meta-xilinx-core/conf/machine/include/soc-versal-net.inc | |||
@@ -7,8 +7,6 @@ require soc-tune-include.inc | |||
7 | # Linux Configuration | 7 | # Linux Configuration |
8 | KERNEL_IMAGETYPE ?= "Image" | 8 | KERNEL_IMAGETYPE ?= "Image" |
9 | 9 | ||
10 | WIC_DEPENDS ?= "virtual/kernel virtual/bootloader virtual/boot-bin virtual/arm-trusted-firmware" | ||
11 | |||
12 | UBOOT_ELF ?= "u-boot.elf" | 10 | UBOOT_ELF ?= "u-boot.elf" |
13 | 11 | ||
14 | # Default, if multiconfig is off, call plm/psm-firmware directly, otherwise call the versal-fw multiconfig version | 12 | # Default, if multiconfig is off, call plm/psm-firmware directly, otherwise call the versal-fw multiconfig version |
diff --git a/meta-xilinx-core/conf/machine/include/soc-versal.inc b/meta-xilinx-core/conf/machine/include/soc-versal.inc index daa129af..1fcb412a 100644 --- a/meta-xilinx-core/conf/machine/include/soc-versal.inc +++ b/meta-xilinx-core/conf/machine/include/soc-versal.inc | |||
@@ -15,8 +15,6 @@ require soc-tune-include.inc | |||
15 | # Linux Configuration | 15 | # Linux Configuration |
16 | KERNEL_IMAGETYPE ?= "Image" | 16 | KERNEL_IMAGETYPE ?= "Image" |
17 | 17 | ||
18 | WIC_DEPENDS ?= "virtual/kernel virtual/bootloader virtual/boot-bin virtual/arm-trusted-firmware" | ||
19 | |||
20 | UBOOT_ELF ?= "u-boot.elf" | 18 | UBOOT_ELF ?= "u-boot.elf" |
21 | 19 | ||
22 | # Default, if multiconfig is off, call plm/psm-firmware directly, otherwise call the versal-fw multiconfig version | 20 | # Default, if multiconfig is off, call plm/psm-firmware directly, otherwise call the versal-fw multiconfig version |
diff --git a/meta-xilinx-core/conf/machine/include/soc-zynq.inc b/meta-xilinx-core/conf/machine/include/soc-zynq.inc index e456a31f..587a0d5a 100644 --- a/meta-xilinx-core/conf/machine/include/soc-zynq.inc +++ b/meta-xilinx-core/conf/machine/include/soc-zynq.inc | |||
@@ -8,15 +8,4 @@ require soc-tune-include.inc | |||
8 | KERNEL_IMAGETYPE ?= "uImage" | 8 | KERNEL_IMAGETYPE ?= "uImage" |
9 | KERNEL_IMAGETYPES += "zImage" | 9 | KERNEL_IMAGETYPES += "zImage" |
10 | 10 | ||
11 | # WIC Specific dependencies | ||
12 | WIC_DEPENDS ?= "virtual/kernel virtual/bootloader virtual/boot-bin" | ||
13 | |||
14 | UBOOT_ELF ?= "u-boot.elf" | 11 | UBOOT_ELF ?= "u-boot.elf" |
15 | |||
16 | # Default, if multiconfig is off, the fsbl is in the regular deploydir, otherwise | ||
17 | # it is located under a multiconfig specific deploydir | ||
18 | FSBL_DEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'fsbl-fw', '', 'fsbl-firmware:do_deploy', d)}" | ||
19 | FSBL_MCDEPENDS ?= "${@bb.utils.contains('BBMULTICONFIG', 'fsbl-fw', 'mc::fsbl-fw:fsbl-firmware:do_deploy', '', d)}" | ||
20 | FSBL_DEPLOY_DIR ?= "${@bb.utils.contains('BBMULTICONFIG', 'fsbl-fw', '${TOPDIR}/tmp-fsbl-fw/deploy/images/${MACHINE}', '${DEPLOY_DIR_IMAGE}', d)}" | ||
21 | FSBL_DEPLOY_DIR[vardepsexclude] += "TOPDIR" | ||
22 | FSBL_IMAGE_NAME ?= "fsbl-${MACHINE}" | ||
diff --git a/meta-xilinx-core/conf/machine/include/soc-zynqmp.inc b/meta-xilinx-core/conf/machine/include/soc-zynqmp.inc index a9c3ad73..aee5c19c 100644 --- a/meta-xilinx-core/conf/machine/include/soc-zynqmp.inc +++ b/meta-xilinx-core/conf/machine/include/soc-zynqmp.inc | |||
@@ -16,8 +16,6 @@ KERNEL_IMAGETYPE ?= "Image" | |||
16 | # Support multilib on zynqmp | 16 | # Support multilib on zynqmp |
17 | DEFAULTTUNE:virtclass-multilib-lib32 ?= "armv7vethf-neon-vfpv4" | 17 | DEFAULTTUNE:virtclass-multilib-lib32 ?= "armv7vethf-neon-vfpv4" |
18 | 18 | ||
19 | WIC_DEPENDS ?= "virtual/kernel virtual/bootloader virtual/boot-bin virtual/arm-trusted-firmware" | ||
20 | |||
21 | UBOOT_SUFFIX ?= "bin" | 19 | UBOOT_SUFFIX ?= "bin" |
22 | 20 | ||
23 | XSERVER_EXT:zynqmp ?= "xf86-video-armsoc" | 21 | XSERVER_EXT:zynqmp ?= "xf86-video-armsoc" |
diff --git a/meta-xilinx-core/conf/machine/microblaze-generic.conf b/meta-xilinx-core/conf/machine/microblaze-generic.conf index 8fb40070..39059511 100644 --- a/meta-xilinx-core/conf/machine/microblaze-generic.conf +++ b/meta-xilinx-core/conf/machine/microblaze-generic.conf | |||
@@ -2,11 +2,6 @@ | |||
2 | #@NAME: microblaze-generic | 2 | #@NAME: microblaze-generic |
3 | #@DESCRIPTION: Machine configuration for the microblaze-generic devices | 3 | #@DESCRIPTION: Machine configuration for the microblaze-generic devices |
4 | 4 | ||
5 | # Deprecated board config | ||
6 | USE_BOARD = "${@"conf/machine/include/xilinx-board-pre.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" | ||
7 | require ${USE_BOARD} | ||
8 | unset USE_BOARD | ||
9 | |||
10 | #### Preamble | 5 | #### Preamble |
11 | MACHINEOVERRIDES =. "${@['', 'microblaze-generic:']['microblaze-generic' != '${MACHINE}']}" | 6 | MACHINEOVERRIDES =. "${@['', 'microblaze-generic:']['microblaze-generic' != '${MACHINE}']}" |
12 | #### Regular settings follow | 7 | #### Regular settings follow |
@@ -19,21 +14,6 @@ DEFAULTTUNE ?= "microblaze" | |||
19 | # defined before calling the required inclusion file else pre-expansion value | 14 | # defined before calling the required inclusion file else pre-expansion value |
20 | # defined in local.conf without machine override will not be reflected. | 15 | # defined in local.conf without machine override will not be reflected. |
21 | 16 | ||
22 | # Yocto Microblaze device-tree variables | ||
23 | YAML_CONSOLE_DEVICE_CONFIG:pn-device-tree ?= "axi_uartlite_0" | ||
24 | YAML_MAIN_MEMORY_CONFIG:pn-device-tree ?= "DDR4_0" | ||
25 | DT_PADDING_SIZE:pn-device-tree ?= "0x1000" | ||
26 | DTC_FLAGS:pn-device-tree ?= "" | ||
27 | XSCTH_PROC:pn-device-tree ?= "microblaze_0" | ||
28 | YAML_DT_BOARD_FLAGS ?= "{BOARD kcu105}" | ||
29 | |||
30 | # Yocto Microblaze FS-Boot variables | ||
31 | YAML_SERIAL_CONSOLE_STDIN:pn-fs-boot ?= "axi_uartlite_0" | ||
32 | YAML_SERIAL_CONSOLE_STDOUT:pn-fs-boot ?= "axi_uartlite_0" | ||
33 | YAML_MAIN_MEMORY_CONFIG:pn-fs-boot ?= "DDR4_0" | ||
34 | YAML_FLASH_MEMORY_CONFIG:pn-fs-boot ?= "axi_quad_spi_0" | ||
35 | XSCTH_PROC:pn-fs-boot ?= "microblaze_0" | ||
36 | |||
37 | # Yocto Microblaze u-boot-xlnx variables | 17 | # Yocto Microblaze u-boot-xlnx variables |
38 | UBOOT_MACHINE ?= "microblaze-generic_defconfig" | 18 | UBOOT_MACHINE ?= "microblaze-generic_defconfig" |
39 | UBOOT_INITIAL_ENV = "" | 19 | UBOOT_INITIAL_ENV = "" |
@@ -46,7 +26,6 @@ KERNEL_EXTRA_ARGS += "UIMAGE_LOADADDR=${UBOOT_ENTRYPOINT}" | |||
46 | 26 | ||
47 | # Microblaze Serial Console settings | 27 | # Microblaze Serial Console settings |
48 | SERIAL_CONSOLES ?= "115200;ttyUL0" | 28 | SERIAL_CONSOLES ?= "115200;ttyUL0" |
49 | YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" | ||
50 | 29 | ||
51 | require conf/machine/include/soc-tune-include.inc | 30 | require conf/machine/include/soc-tune-include.inc |
52 | require conf/machine/include/machine-xilinx-default.inc | 31 | require conf/machine/include/machine-xilinx-default.inc |
@@ -60,27 +39,12 @@ MB_MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH'), d.getVar('TUNE_PKGARCH') + '-ge | |||
60 | 39 | ||
61 | MACHINE_ARCH = "${@['${MB_MACHINE_ARCH}', '${DEF_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}" | 40 | MACHINE_ARCH = "${@['${MB_MACHINE_ARCH}', '${DEF_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}" |
62 | 41 | ||
63 | # microblaze-generic.conf uses kcu105-microblazeel xsa as reference input. | ||
64 | # User can override with custom xsa using HDF_BASE and HDF_PATH variables from | ||
65 | # local.conf. | ||
66 | HDF_MACHINE = "kcu105-microblazeel" | ||
67 | |||
68 | MACHINE_FEATURES = "" | 42 | MACHINE_FEATURES = "" |
69 | 43 | ||
70 | KERNEL_IMAGETYPE ?= "linux.bin.ub" | 44 | KERNEL_IMAGETYPE ?= "linux.bin.ub" |
71 | KERNEL_IMAGETYPES = "" | 45 | KERNEL_IMAGETYPES = "" |
72 | 46 | ||
73 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${PREFERRED_PROVIDER_virtual/dtb}" | ||
74 | |||
75 | IMAGE_BOOT_FILES += " \ | ||
76 | ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ | ||
77 | " | ||
78 | |||
79 | EXTRA_IMAGEDEPENDS += " \ | 47 | EXTRA_IMAGEDEPENDS += " \ |
80 | libyaml-native \ | ||
81 | python3-cython-native \ | ||
82 | python3-pyyaml-native \ | ||
83 | virtual/bitstream \ | ||
84 | virtual/bootloader \ | 48 | virtual/bootloader \ |
85 | virtual/elfrealloc \ | 49 | virtual/elfrealloc \ |
86 | u-boot-xlnx-scr \ | 50 | u-boot-xlnx-scr \ |
@@ -89,9 +53,9 @@ EXTRA_IMAGEDEPENDS += " \ | |||
89 | IMAGE_FSTYPES += "cpio.gz" | 53 | IMAGE_FSTYPES += "cpio.gz" |
90 | 54 | ||
91 | # Microblaze QEMU Configurations | 55 | # Microblaze QEMU Configurations |
92 | QB_MEM = "-m 2G" | 56 | QB_MEM ?= "-m 2G" |
93 | QB_KERNEL_CMDLINE_APPEND = "console=ttyUL0,115200 root=/dev/ram0 rw" | 57 | QB_KERNEL_CMDLINE_APPEND ?= "console=ttyUL0,115200 root=/dev/ram0 rw" |
94 | QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" | 58 | QB_NETWORK_DEVICE ?= "-net nic,netdev=net0,macaddr=@MAC@" |
95 | 59 | ||
96 | # This will work with the default runqemu, as the first serial port is the | 60 | # This will work with the default runqemu, as the first serial port is the |
97 | # correct console | 61 | # correct console |
@@ -99,13 +63,8 @@ QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" | |||
99 | # One total serial port defined in this model (according to the generated dts) | 63 | # One total serial port defined in this model (according to the generated dts) |
100 | # | 64 | # |
101 | # hw serial0 axi_uartlite_0 (40600000) - linux serial0 (ttyUL0) | 65 | # hw serial0 axi_uartlite_0 (40600000) - linux serial0 (ttyUL0) |
102 | QB_XILINX_SERIAL = "" | 66 | QB_XILINX_SERIAL ?= "" |
103 | 67 | ||
104 | #### No additional settings should be after the Postamble | 68 | #### No additional settings should be after the Postamble |
105 | #### Postamble | 69 | #### Postamble |
106 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' ${MB_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}" | 70 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' ${MB_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}" |
107 | |||
108 | # Deprecated board config | ||
109 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" | ||
110 | require ${USE_BOARD} | ||
111 | unset USE_BOARD | ||
diff --git a/meta-xilinx-core/conf/machine/versal-ai-edge-generic.conf b/meta-xilinx-core/conf/machine/versal-ai-edge-generic.conf index 2b4f94d2..0d7f3223 100644 --- a/meta-xilinx-core/conf/machine/versal-ai-edge-generic.conf +++ b/meta-xilinx-core/conf/machine/versal-ai-edge-generic.conf | |||
@@ -8,9 +8,9 @@ MACHINE_FEATURES += "aie vdu" | |||
8 | 8 | ||
9 | # VEK280 board has 12GB memory only but default versal-generic has QB_MEM set to | 9 | # VEK280 board has 12GB memory only but default versal-generic has QB_MEM set to |
10 | # 8G, Hence we need set 12G in QB_MEM. | 10 | # 8G, Hence we need set 12G in QB_MEM. |
11 | QB_MEM = "-m 12G" | 11 | QB_MEM ?= "-m 12G" |
12 | 12 | ||
13 | QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-ps-vek280.dtb" | 13 | QEMU_HW_DTB_PS ?= "${QEMU_HW_DTB_PATH}/board-versal-ps-vek280.dtb" |
14 | 14 | ||
15 | #### No additional settings should be after the Postamble | 15 | #### No additional settings should be after the Postamble |
16 | #### Postamble | 16 | #### Postamble |
diff --git a/meta-xilinx-core/conf/machine/versal-common.conf b/meta-xilinx-core/conf/machine/versal-common.conf new file mode 100644 index 00000000..bc530d63 --- /dev/null +++ b/meta-xilinx-core/conf/machine/versal-common.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | #@TYPE: Machine | ||
2 | #@NAME: versal-common | ||
3 | #@DESCRIPTION: Machine configuration for a common Versal filesystem devices | ||
4 | |||
5 | #### Preamble | ||
6 | MACHINEOVERRIDES =. "${@['', 'versal-common:']['versal-common' != '${MACHINE}']}" | ||
7 | #### Regular settings follow | ||
8 | |||
9 | DEFAULTTUNE = "cortexa72" | ||
10 | |||
11 | require conf/machine/versal-generic.conf | ||
12 | |||
13 | MACHINE_FEATURES += "aie vdu" | ||
14 | |||
15 | #### No additional settings should be after the Postamble | ||
16 | #### Postamble | ||
17 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_common']['versal-common' != "${MACHINE}"]}" | ||
diff --git a/meta-xilinx-core/conf/machine/versal-generic.conf b/meta-xilinx-core/conf/machine/versal-generic.conf index 3ae4b800..9aa47892 100644 --- a/meta-xilinx-core/conf/machine/versal-generic.conf +++ b/meta-xilinx-core/conf/machine/versal-generic.conf | |||
@@ -10,12 +10,6 @@ MACHINEOVERRIDES =. "${@['', 'versal-generic:']['versal-generic' != '${MACHINE}' | |||
10 | # defined before calling the required inclusion file else pre-expansion value | 10 | # defined before calling the required inclusion file else pre-expansion value |
11 | # defined in local.conf without machine override will not be reflected. | 11 | # defined in local.conf without machine override will not be reflected. |
12 | 12 | ||
13 | # Yocto Versal device-tree variables | ||
14 | YAML_CONSOLE_DEVICE_CONFIG:pn-device-tree ?= "CIPS_0_pspmc_0_psv_sbsauart_0" | ||
15 | DT_PADDING_SIZE:pn-device-tree ?= "0x1000" | ||
16 | DTC_FLAGS:pn-device-tree = "-@" | ||
17 | YAML_DT_BOARD_FLAGS ?= "{BOARD versal-vck190-reva-x-ebm-01-reva}" | ||
18 | |||
19 | # Yocto Versal u-boot-xlnx variables | 13 | # Yocto Versal u-boot-xlnx variables |
20 | UBOOT_MACHINE ?= "xilinx_versal_virt_defconfig" | 14 | UBOOT_MACHINE ?= "xilinx_versal_virt_defconfig" |
21 | BOOTMODE ?= "generic.root" | 15 | BOOTMODE ?= "generic.root" |
@@ -23,68 +17,44 @@ BOOTMODE ?= "generic.root" | |||
23 | # Yocto Versal arm-trusted-firmware(TF-A) variables | 17 | # Yocto Versal arm-trusted-firmware(TF-A) variables |
24 | TFA_BL33_LOAD ?= "0x8000000" | 18 | TFA_BL33_LOAD ?= "0x8000000" |
25 | 19 | ||
26 | # Yocto Versal PLM variables | ||
27 | YAML_SERIAL_CONSOLE_STDIN:pn-plm-firmware ?= "CIPS_0_pspmc_0_psv_sbsauart_0" | ||
28 | YAML_SERIAL_CONSOLE_STDOUT:pn-plm-firmware ?= "CIPS_0_pspmc_0_psv_sbsauart_0" | ||
29 | |||
30 | # Yocto Versal KERNEL Variables | 20 | # Yocto Versal KERNEL Variables |
31 | UBOOT_ENTRYPOINT ?= "0x200000" | 21 | UBOOT_ENTRYPOINT ?= "0x200000" |
32 | UBOOT_LOADADDRESS ?= "0x200000" | 22 | UBOOT_LOADADDRESS ?= "0x200000" |
33 | 23 | ||
34 | # Versal Serial Console | 24 | # Versal Serial Console |
35 | SERIAL_CONSOLES ?= "115200;ttyAMA0" | 25 | SERIAL_CONSOLES ?= "115200;ttyAMA0" |
36 | YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" | ||
37 | 26 | ||
38 | require conf/machine/include/soc-versal.inc | 27 | require conf/machine/include/soc-versal.inc |
39 | require conf/machine/include/machine-xilinx-default.inc | 28 | require conf/machine/include/machine-xilinx-default.inc |
40 | require conf/machine/include/machine-xilinx-qemu.inc | 29 | require conf/machine/include/machine-xilinx-qemu.inc |
41 | 30 | ||
42 | # versal-generic.conf uses vck190-versal xsa as reference input. | ||
43 | # User can override with custom xsa using HDF_BASE and HDF_PATH variables from | ||
44 | # local.conf. | ||
45 | HDF_MACHINE = "vck190-versal" | ||
46 | |||
47 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost" | 31 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost" |
48 | 32 | ||
49 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${PREFERRED_PROVIDER_virtual/dtb}" | ||
50 | |||
51 | # Default SD image build onfiguration, use qemu-sd to pad | 33 | # Default SD image build onfiguration, use qemu-sd to pad |
52 | IMAGE_CLASSES += "image-types-xilinx-qemu" | 34 | IMAGE_CLASSES += "image-types-xilinx-qemu" |
53 | # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies | 35 | # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies |
54 | IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot.qemu-sd-fatimg'}" | 36 | IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot.qemu-sd-fatimg'}" |
55 | 37 | ||
56 | EXTRA_IMAGEDEPENDS += " \ | 38 | EXTRA_IMAGEDEPENDS += " \ |
57 | libyaml-native \ | ||
58 | python3-cython-native \ | ||
59 | python3-pyyaml-native \ | ||
60 | arm-trusted-firmware \ | ||
61 | virtual/boot-bin \ | ||
62 | virtual/bootloader \ | ||
63 | virtual/psm-firmware \ | ||
64 | virtual/plm \ | ||
65 | u-boot-xlnx-scr \ | 39 | u-boot-xlnx-scr \ |
66 | qemu-devicetrees:do_deploy \ | ||
67 | virtual/cdo:do_deploy \ | ||
68 | " | 40 | " |
69 | 41 | ||
70 | IMAGE_BOOT_FILES += " \ | 42 | IMAGE_BOOT_FILES += " \ |
71 | boot.bin \ | ||
72 | ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ | ||
73 | Image \ | 43 | Image \ |
74 | boot.scr \ | 44 | boot.scr \ |
75 | " | 45 | " |
76 | 46 | ||
77 | # Versal QEMU Configurations | 47 | # Versal QEMU Configurations |
78 | # This machine has a QEMU model, runqemu setup: | 48 | # This machine has a QEMU model, runqemu setup: |
79 | QB_MEM = "-m 8G" | 49 | QB_MEM ?= "-m 8G" |
80 | QB_DEFAULT_KERNEL = "none" | 50 | QB_DEFAULT_KERNEL ?= "none" |
81 | # Iteration appears to be eth0 then eth1 | 51 | # Iteration appears to be eth0 then eth1 |
82 | QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@ -net nic" | 52 | QB_NETWORK_DEVICE ?= "-net nic,netdev=net0,macaddr=@MAC@ -net nic" |
83 | QB_KERNEL_CMDLINE_APPEND ?= "" | 53 | QB_KERNEL_CMDLINE_APPEND ?= "" |
84 | 54 | ||
85 | QEMU_HW_DTB_PATH = "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" | 55 | QEMU_HW_DTB_PATH ?= "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" |
86 | QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-ps-vck190.dtb" | 56 | QEMU_HW_DTB_PS ?= "${QEMU_HW_DTB_PATH}/board-versal-ps-vck190.dtb" |
87 | QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmc-virt.dtb" | 57 | QEMU_HW_DTB_PMC ?= "${QEMU_HW_DTB_PATH}/board-versal-pmc-virt.dtb" |
88 | 58 | ||
89 | # Four total serial ports defined in this model (according to the dts) | 59 | # Four total serial ports defined in this model (according to the dts) |
90 | # | 60 | # |
@@ -93,7 +63,7 @@ QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmc-virt.dtb" | |||
93 | # hw serial2 pl011 (ff000000) - linux serial0 (ttyAMA0) | 63 | # hw serial2 pl011 (ff000000) - linux serial0 (ttyAMA0) |
94 | # hw serial3 pl011 (ff010000) - linux serial1 (ttyAMA1) (disabled) | 64 | # hw serial3 pl011 (ff010000) - linux serial1 (ttyAMA1) (disabled) |
95 | # ? dcc ? - linux serial2 (????) | 65 | # ? dcc ? - linux serial2 (????) |
96 | QB_XILINX_SERIAL = "-serial null -serial null -serial mon:stdio -serial null" | 66 | QB_XILINX_SERIAL ?= "-serial null -serial null -serial mon:stdio -serial null" |
97 | 67 | ||
98 | QB_OSPI_FILE ??= "" | 68 | QB_OSPI_FILE ??= "" |
99 | 69 | ||
@@ -119,7 +89,7 @@ QB_FW_FILES = " \ | |||
119 | -device loader,file=${DEPLOY_DIR_IMAGE}/CDO/pmc_cdo.bin,addr=0xf2000000,force-raw \ | 89 | -device loader,file=${DEPLOY_DIR_IMAGE}/CDO/pmc_cdo.bin,addr=0xf2000000,force-raw \ |
120 | -device loader,file=${DEPLOY_DIR_IMAGE}/plm-${MACHINE}.elf,cpu-num=1 \ | 90 | -device loader,file=${DEPLOY_DIR_IMAGE}/plm-${MACHINE}.elf,cpu-num=1 \ |
121 | " | 91 | " |
122 | QB_PLM_OPT += "${@'' if d.getVar('QB_OSPI_FILE') else d.getVar('QB_FW_FILES')}" | 92 | QB_PLM_OPT += "${@d.getVar('QB_FW_FILES') if d.getVar('QB_OSPI_FILE') == '' else ''}" |
123 | 93 | ||
124 | QB_OPT_APPEND += " -plm-args '${QB_PLM_OPT}'" | 94 | QB_OPT_APPEND += " -plm-args '${QB_PLM_OPT}'" |
125 | 95 | ||
diff --git a/meta-xilinx-core/conf/machine/versal-hbm-generic.conf b/meta-xilinx-core/conf/machine/versal-hbm-generic.conf index 9fef78f3..805df7fc 100644 --- a/meta-xilinx-core/conf/machine/versal-hbm-generic.conf +++ b/meta-xilinx-core/conf/machine/versal-hbm-generic.conf | |||
@@ -6,9 +6,9 @@ require conf/machine/versal-generic.conf | |||
6 | 6 | ||
7 | # VHK158 has 32GB memory only but default versal-generic has QB_MEM set to 8G, | 7 | # VHK158 has 32GB memory only but default versal-generic has QB_MEM set to 8G, |
8 | # Since versal-vhk158-reva.dts has 32GB set, we need set same in QB_MEM | 8 | # Since versal-vhk158-reva.dts has 32GB set, we need set same in QB_MEM |
9 | QB_MEM = "-m 32G" | 9 | QB_MEM ?= "-m 32G" |
10 | 10 | ||
11 | QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-ps-vhk158.dtb" | 11 | QEMU_HW_DTB_PS ?= "${QEMU_HW_DTB_PATH}/board-versal-ps-vhk158.dtb" |
12 | 12 | ||
13 | #### No additional settings should be after the Postamble | 13 | #### No additional settings should be after the Postamble |
14 | #### Postamble | 14 | #### Postamble |
diff --git a/meta-xilinx-core/conf/machine/versal-net-common.conf b/meta-xilinx-core/conf/machine/versal-net-common.conf new file mode 100644 index 00000000..efde0bbb --- /dev/null +++ b/meta-xilinx-core/conf/machine/versal-net-common.conf | |||
@@ -0,0 +1,15 @@ | |||
1 | #@TYPE: Machine | ||
2 | #@NAME: versal-net-common | ||
3 | #@DESCRIPTION: Machine configuration for a common versal-net filesystem devices | ||
4 | |||
5 | #### Preamble | ||
6 | MACHINEOVERRIDES =. "${@['', 'versal-net-common:']['versal-net-common' != '${MACHINE}']}" | ||
7 | #### Regular settings follow | ||
8 | |||
9 | DEFAULTTUNE = "cortexa78" | ||
10 | |||
11 | require conf/machine/versal-net-generic.conf | ||
12 | |||
13 | #### No additional settings should be after the Postamble | ||
14 | #### Postamble | ||
15 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_net_common']['versal-net-common' != "${MACHINE}"]}" | ||
diff --git a/meta-xilinx-core/conf/machine/versal-net-generic.conf b/meta-xilinx-core/conf/machine/versal-net-generic.conf index d6524510..b26fb5e1 100644 --- a/meta-xilinx-core/conf/machine/versal-net-generic.conf +++ b/meta-xilinx-core/conf/machine/versal-net-generic.conf | |||
@@ -10,12 +10,6 @@ MACHINEOVERRIDES =. "${@['', 'versal-net-generic:']['versal-net-generic' != '${M | |||
10 | # defined before calling the required inclusion file else pre-expansion value | 10 | # defined before calling the required inclusion file else pre-expansion value |
11 | # defined in local.conf without machine override will not be reflected. | 11 | # defined in local.conf without machine override will not be reflected. |
12 | 12 | ||
13 | # Yocto Versal device-tree variables | ||
14 | YAML_CONSOLE_DEVICE_CONFIG:pn-device-tree ?= "psx_wizard_0_psxl_0_psx_sbsauart_0" | ||
15 | DT_PADDING_SIZE:pn-device-tree ?= "0x1000" | ||
16 | DTC_FLAGS:pn-device-tree = "-@" | ||
17 | YAML_DT_BOARD_FLAGS ?= "{BOARD versal-net-ipp-rev1.9}" | ||
18 | |||
19 | # Yocto Versal u-boot-xlnx variables | 13 | # Yocto Versal u-boot-xlnx variables |
20 | UBOOT_MACHINE ?= "xilinx_versal_net_virt_defconfig" | 14 | UBOOT_MACHINE ?= "xilinx_versal_net_virt_defconfig" |
21 | BOOTMODE ?= "generic.root" | 15 | BOOTMODE ?= "generic.root" |
@@ -23,68 +17,44 @@ BOOTMODE ?= "generic.root" | |||
23 | # Yocto Versal arm-trusted-firmware(TF-A) variables | 17 | # Yocto Versal arm-trusted-firmware(TF-A) variables |
24 | TFA_BL33_LOAD ?= "0x8000000" | 18 | TFA_BL33_LOAD ?= "0x8000000" |
25 | 19 | ||
26 | # Yocto Versal PLM variables | ||
27 | YAML_SERIAL_CONSOLE_STDIN:pn-plm-firmware ?= "psx_wizard_0_psxl_0_psx_sbsauart_0" | ||
28 | YAML_SERIAL_CONSOLE_STDOUT:pn-plm-firmware ?= "psx_wizard_0_psxl_0_psx_sbsauart_0" | ||
29 | |||
30 | # Yocto Versal KERNEL Variables | 20 | # Yocto Versal KERNEL Variables |
31 | UBOOT_ENTRYPOINT ?= "0x200000" | 21 | UBOOT_ENTRYPOINT ?= "0x200000" |
32 | UBOOT_LOADADDRESS ?= "0x200000" | 22 | UBOOT_LOADADDRESS ?= "0x200000" |
33 | 23 | ||
34 | # Versal Serial Console | 24 | # Versal Serial Console |
35 | SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1" | 25 | SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1" |
36 | YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" | ||
37 | 26 | ||
38 | require conf/machine/include/soc-versal-net.inc | 27 | require conf/machine/include/soc-versal-net.inc |
39 | require conf/machine/include/machine-xilinx-default.inc | 28 | require conf/machine/include/machine-xilinx-default.inc |
40 | require conf/machine/include/machine-xilinx-qemu.inc | 29 | require conf/machine/include/machine-xilinx-qemu.inc |
41 | 30 | ||
42 | # versal-net-generic.conf uses a qemu only xsa as reference input. | ||
43 | # User can override with custom xsa using HDF_BASE and HDF_PATH variables from | ||
44 | # local.conf. | ||
45 | HDF_MACHINE = "versal-net-generic" | ||
46 | |||
47 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost" | 31 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost" |
48 | 32 | ||
49 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${PREFERRED_PROVIDER_virtual/dtb}" | ||
50 | |||
51 | # Default SD image build onfiguration, use qemu-sd to pad | 33 | # Default SD image build onfiguration, use qemu-sd to pad |
52 | IMAGE_CLASSES += "image-types-xilinx-qemu" | 34 | IMAGE_CLASSES += "image-types-xilinx-qemu" |
53 | # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies | 35 | # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies |
54 | IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot.qemu-sd-fatimg'}" | 36 | IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot.qemu-sd-fatimg'}" |
55 | 37 | ||
56 | EXTRA_IMAGEDEPENDS += " \ | 38 | EXTRA_IMAGEDEPENDS += " \ |
57 | libyaml-native \ | ||
58 | python3-cython-native \ | ||
59 | python3-pyyaml-native \ | ||
60 | arm-trusted-firmware \ | ||
61 | virtual/boot-bin \ | ||
62 | virtual/bootloader \ | ||
63 | virtual/psm-firmware \ | ||
64 | virtual/plm \ | ||
65 | u-boot-xlnx-scr \ | 39 | u-boot-xlnx-scr \ |
66 | qemu-devicetrees:do_deploy \ | ||
67 | virtual/cdo:do_deploy \ | ||
68 | " | 40 | " |
69 | 41 | ||
70 | IMAGE_BOOT_FILES += " \ | 42 | IMAGE_BOOT_FILES += " \ |
71 | boot.bin \ | ||
72 | ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ | ||
73 | Image \ | 43 | Image \ |
74 | boot.scr \ | 44 | boot.scr \ |
75 | " | 45 | " |
76 | 46 | ||
77 | # Versal QEMU Configurations | 47 | # Versal QEMU Configurations |
78 | # This machine has a QEMU model, runqemu setup: | 48 | # This machine has a QEMU model, runqemu setup: |
79 | QB_MEM = "-m 8G" | 49 | QB_MEM ?= "-m 8G" |
80 | QB_DEFAULT_KERNEL = "none" | 50 | QB_DEFAULT_KERNEL ?= "none" |
81 | # Iteration appears to be eth0 then eth1 | 51 | # Iteration appears to be eth0 then eth1 |
82 | QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@ -net nic" | 52 | QB_NETWORK_DEVICE ?= "-net nic,netdev=net0,macaddr=@MAC@ -net nic" |
83 | QB_KERNEL_CMDLINE_APPEND ?= "" | 53 | QB_KERNEL_CMDLINE_APPEND ?= "" |
84 | 54 | ||
85 | QEMU_HW_DTB_PATH = "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" | 55 | QEMU_HW_DTB_PATH ?= "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" |
86 | QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-net-psx-spp-1.4.dtb" | 56 | QEMU_HW_DTB_PS ?= "${QEMU_HW_DTB_PATH}/board-versal-net-psx-spp-1.4.dtb" |
87 | QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmx-virt.dtb" | 57 | QEMU_HW_DTB_PMC ?= "${QEMU_HW_DTB_PATH}/board-versal-pmx-virt.dtb" |
88 | 58 | ||
89 | # Four total serial ports defined in this model (according to the dts) | 59 | # Four total serial ports defined in this model (according to the dts) |
90 | # | 60 | # |
@@ -92,7 +62,7 @@ QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmx-virt.dtb" | |||
92 | # hw serial1 xps-uartlite (0xf0310000) - | 62 | # hw serial1 xps-uartlite (0xf0310000) - |
93 | # hw serial2 pl011 (0xf1920000) - linux serial0 (ttyAMA0) | 63 | # hw serial2 pl011 (0xf1920000) - linux serial0 (ttyAMA0) |
94 | # hw serial3 pl011 (0xf1930000) - linux serial1 (ttyAMA1) | 64 | # hw serial3 pl011 (0xf1930000) - linux serial1 (ttyAMA1) |
95 | QB_XILINX_SERIAL = "-serial null -serial null -serial mon:stdio -serial null" | 65 | QB_XILINX_SERIAL ?= "-serial null -serial null -serial mon:stdio -serial null" |
96 | 66 | ||
97 | QB_OSPI_FILE ??= "" | 67 | QB_OSPI_FILE ??= "" |
98 | 68 | ||
@@ -114,11 +84,11 @@ QB_PLM_OPT = " \ | |||
114 | " | 84 | " |
115 | 85 | ||
116 | QB_FW_FILES = " \ | 86 | QB_FW_FILES = " \ |
117 | -device loader,file=${DEPLOY_DIR_IMAGE}/BOOT-${MACHINE}_bh.bin,addr=0xF201E000,force-raw \ | 87 | -device loader,file=${DEPLOY_DIR_IMAGE}/BOOT-${MACHINE}_bh.bin,addr=0xF201E000,force-raw=on \ |
118 | -device loader,file=${DEPLOY_DIR_IMAGE}/CDO/pmc_cdo.bin,addr=0xf2000000,force-raw \ | 88 | -device loader,file=${DEPLOY_DIR_IMAGE}/CDO/pmc_cdo.bin,addr=0xf2000000,force-raw=on \ |
119 | -device loader,file=${DEPLOY_DIR_IMAGE}/plm-${MACHINE}.elf,cpu-num=1 \ | 89 | -device loader,file=${DEPLOY_DIR_IMAGE}/plm-${MACHINE}.elf,cpu-num=1 \ |
120 | " | 90 | " |
121 | QB_PLM_OPT += "${@'' if d.getVar('QB_OSPI_FILE') else d.getVar('QB_FW_FILES')}" | 91 | QB_PLM_OPT += "${@d.getVar('QB_FW_FILES') if d.getVar('QB_OSPI_FILE') == '' else ''}" |
122 | 92 | ||
123 | QB_OPT_APPEND += " -plm-args '${QB_PLM_OPT}'" | 93 | QB_OPT_APPEND += " -plm-args '${QB_PLM_OPT}'" |
124 | 94 | ||
diff --git a/meta-xilinx-core/conf/machine/zynq-common.conf b/meta-xilinx-core/conf/machine/zynq-common.conf new file mode 100644 index 00000000..f54b6e5b --- /dev/null +++ b/meta-xilinx-core/conf/machine/zynq-common.conf | |||
@@ -0,0 +1,15 @@ | |||
1 | #@TYPE: Machine | ||
2 | #@NAME: zynq-common | ||
3 | #@DESCRIPTION: Machine configuration for a common Zynq7 filesystem devices | ||
4 | |||
5 | #### Preamble | ||
6 | MACHINEOVERRIDES =. "${@['', 'zynq-common:']['zynq-common' != '${MACHINE}']}" | ||
7 | #### Regular settings follow | ||
8 | |||
9 | DEFAULTTUNE = "cortexa9thf-neon" | ||
10 | |||
11 | require conf/machine/zynq-generic.conf | ||
12 | |||
13 | #### No additional settings should be after the Postamble | ||
14 | #### Postamble | ||
15 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' zynq_common']['zynq-common' != "${MACHINE}"]}" | ||
diff --git a/meta-xilinx-core/conf/machine/zynq-generic.conf b/meta-xilinx-core/conf/machine/zynq-generic.conf index 3dea2012..8442e4e3 100644 --- a/meta-xilinx-core/conf/machine/zynq-generic.conf +++ b/meta-xilinx-core/conf/machine/zynq-generic.conf | |||
@@ -10,21 +10,10 @@ MACHINEOVERRIDES =. "${@['', 'zynq-generic:']['zynq-generic' != '${MACHINE}']}" | |||
10 | # defined before calling the required inclusion file else pre-expansion value | 10 | # defined before calling the required inclusion file else pre-expansion value |
11 | # defined in local.conf without machine override will not be reflected. | 11 | # defined in local.conf without machine override will not be reflected. |
12 | 12 | ||
13 | # Yocto Zynq-7000 device-tree variables | ||
14 | YAML_CONSOLE_DEVICE_CONFIG:pn-device-tree ?= "ps7_uart_1" | ||
15 | YAML_MAIN_MEMORY_CONFIG:pn-device-tree ?= "PS7_DDR_0" | ||
16 | DT_PADDING_SIZE:pn-device-tree ?= "0x1000" | ||
17 | DTC_FLAGS:pn-device-tree = "-@" | ||
18 | YAML_DT_BOARD_FLAGS ?= "{BOARD zc702}" | ||
19 | |||
20 | # Yocto Zynq-7000 u-boot-xlnx variables | 13 | # Yocto Zynq-7000 u-boot-xlnx variables |
21 | UBOOT_MACHINE ?= "xilinx_zynq_virt_defconfig" | 14 | UBOOT_MACHINE ?= "xilinx_zynq_virt_defconfig" |
22 | BOOTMODE ?= "generic.root" | 15 | BOOTMODE ?= "generic.root" |
23 | 16 | ||
24 | # Yocto Zynq-7000 FSBL variables | ||
25 | YAML_SERIAL_CONSOLE_STDIN:pn-fsbl-firmware ?= "ps7_uart_1" | ||
26 | YAML_SERIAL_CONSOLE_STDOUT:pn-fsbl-firmware ?= "ps7_uart_1" | ||
27 | |||
28 | # Yocto KERNEL Variables | 17 | # Yocto KERNEL Variables |
29 | UBOOT_ENTRYPOINT ?= "0x200000" | 18 | UBOOT_ENTRYPOINT ?= "0x200000" |
30 | UBOOT_LOADADDRESS ?= "0x200000" | 19 | UBOOT_LOADADDRESS ?= "0x200000" |
@@ -32,34 +21,18 @@ KERNEL_EXTRA_ARGS += "UIMAGE_LOADADDR=${UBOOT_ENTRYPOINT}" | |||
32 | 21 | ||
33 | # Zynq-7000 Serial Console settings | 22 | # Zynq-7000 Serial Console settings |
34 | SERIAL_CONSOLES ?= "115200;ttyPS0" | 23 | SERIAL_CONSOLES ?= "115200;ttyPS0" |
35 | YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" | ||
36 | 24 | ||
37 | require conf/machine/include/soc-zynq.inc | 25 | require conf/machine/include/soc-zynq.inc |
38 | require conf/machine/include/machine-xilinx-default.inc | 26 | require conf/machine/include/machine-xilinx-default.inc |
39 | require conf/machine/include/machine-xilinx-qemu.inc | 27 | require conf/machine/include/machine-xilinx-qemu.inc |
40 | 28 | ||
41 | # zynq-generic.conf uses zc702-zynq7 xsa as reference input. | ||
42 | # User can override with custom xsa using HDF_BASE and HDF_PATH variables from | ||
43 | # local.conf. | ||
44 | HDF_MACHINE = "zc702-zynq7" | ||
45 | |||
46 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost usbgadget" | 29 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost usbgadget" |
47 | 30 | ||
48 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${PREFERRED_PROVIDER_virtual/dtb}" | ||
49 | |||
50 | EXTRA_IMAGEDEPENDS += " \ | 31 | EXTRA_IMAGEDEPENDS += " \ |
51 | libyaml-native \ | ||
52 | python3-cython-native \ | ||
53 | python3-pyyaml-native \ | ||
54 | virtual/fsbl \ | ||
55 | virtual/boot-bin \ | ||
56 | virtual/bootloader \ | ||
57 | u-boot-xlnx-scr \ | 32 | u-boot-xlnx-scr \ |
58 | " | 33 | " |
59 | 34 | ||
60 | IMAGE_BOOT_FILES += " \ | 35 | IMAGE_BOOT_FILES += " \ |
61 | boot.bin \ | ||
62 | ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ | ||
63 | boot.scr \ | 36 | boot.scr \ |
64 | uImage \ | 37 | uImage \ |
65 | " | 38 | " |
@@ -70,10 +43,10 @@ IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' | |||
70 | 43 | ||
71 | # Zynq-7000 QEMU Configurations | 44 | # Zynq-7000 QEMU Configurations |
72 | # This machine has a QEMU model, runqemu setup: | 45 | # This machine has a QEMU model, runqemu setup: |
73 | QB_MEM = "-m 1024" | 46 | QB_MEM ?= "-m 1024" |
74 | QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" | 47 | QB_NETWORK_DEVICE ?= "-net nic,netdev=net0,macaddr=@MAC@" |
75 | 48 | ||
76 | QB_KERNEL_ROOT = "/dev/mmcblk0p2" | 49 | QB_KERNEL_ROOT ?= "/dev/mmcblk0p2" |
77 | 50 | ||
78 | # Side effect of not-enabled serial port is we have to lock | 51 | # Side effect of not-enabled serial port is we have to lock |
79 | # the second (console) to mon:stdio. | 52 | # the second (console) to mon:stdio. |
@@ -82,7 +55,7 @@ QB_KERNEL_ROOT = "/dev/mmcblk0p2" | |||
82 | # | 55 | # |
83 | # hw uart0 xuartps (e0000000) - | 56 | # hw uart0 xuartps (e0000000) - |
84 | # hw uart1 xuartps (e0001000) - linux serial0 (ttyPS0) | 57 | # hw uart1 xuartps (e0001000) - linux serial0 (ttyPS0) |
85 | QB_XILINX_SERIAL = "-serial null -serial mon:stdio" | 58 | QB_XILINX_SERIAL ?= "-serial null -serial mon:stdio" |
86 | 59 | ||
87 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) | 60 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) |
88 | QB_OPT_APPEND += " \ | 61 | QB_OPT_APPEND += " \ |
diff --git a/meta-xilinx-core/conf/machine/zynqmp-common.conf b/meta-xilinx-core/conf/machine/zynqmp-common.conf new file mode 100644 index 00000000..e2e112f9 --- /dev/null +++ b/meta-xilinx-core/conf/machine/zynqmp-common.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | #@TYPE: Machine | ||
2 | #@NAME: zynqmp-common | ||
3 | #@DESCRIPTION: Machine configuration for a common ZynqMP (MPSOC) filesystem devices w/o mali400 | ||
4 | |||
5 | #### Preamble | ||
6 | MACHINEOVERRIDES =. "${@['', 'zynqmp-common:']['zynqmp-common' != '${MACHINE}']}" | ||
7 | #### Regular settings follow | ||
8 | |||
9 | DEFAULTTUNE = "cortexa53" | ||
10 | |||
11 | require conf/machine/zynqmp-generic.conf | ||
12 | |||
13 | MACHINE_FEATURES += "vcu rfsoc" | ||
14 | |||
15 | #### No additional settings should be after the Postamble | ||
16 | #### Postamble | ||
17 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' zynqmp_common']['zynqmp-common' != "${MACHINE}"]}" | ||
diff --git a/meta-xilinx-core/conf/machine/zynqmp-generic.conf b/meta-xilinx-core/conf/machine/zynqmp-generic.conf index b5a2f832..15a48102 100644 --- a/meta-xilinx-core/conf/machine/zynqmp-generic.conf +++ b/meta-xilinx-core/conf/machine/zynqmp-generic.conf | |||
@@ -10,13 +10,6 @@ MACHINEOVERRIDES =. "${@['', 'zynqmp-generic:']['zynqmp-generic' != '${MACHINE}' | |||
10 | # defined before calling the required inclusion file else pre-expansion value | 10 | # defined before calling the required inclusion file else pre-expansion value |
11 | # defined in local.conf without machine override will not be reflected. | 11 | # defined in local.conf without machine override will not be reflected. |
12 | 12 | ||
13 | # Yocto device-tree variables | ||
14 | YAML_CONSOLE_DEVICE_CONFIG:pn-device-tree ?= "psu_uart_0" | ||
15 | YAML_MAIN_MEMORY_CONFIG:pn-device-tree ?= "PSU_DDR_0" | ||
16 | DT_PADDING_SIZE:pn-device-tree ?= "0x1000" | ||
17 | DTC_FLAGS:pn-device-tree = "-@" | ||
18 | YAML_DT_BOARD_FLAGS ?= "{BOARD zcu102-rev1.0}" | ||
19 | |||
20 | # Yocto ZynqMP u-boot-xlnx variables | 13 | # Yocto ZynqMP u-boot-xlnx variables |
21 | UBOOT_MACHINE ?= "xilinx_zynqmp_virt_defconfig" | 14 | UBOOT_MACHINE ?= "xilinx_zynqmp_virt_defconfig" |
22 | BOOTMODE ?= "generic.root" | 15 | BOOTMODE ?= "generic.root" |
@@ -30,31 +23,17 @@ SPL_BINARY ?= "" | |||
30 | # Yocto ZynqMP arm-trusted-firmware(TF-A) variables | 23 | # Yocto ZynqMP arm-trusted-firmware(TF-A) variables |
31 | TFA_BL33_LOAD ?= "0x8000000" | 24 | TFA_BL33_LOAD ?= "0x8000000" |
32 | 25 | ||
33 | # Yocto ZynqMP PMUFW variables | ||
34 | YAML_SERIAL_CONSOLE_STDIN:pn-pmu-firmware ?= "psu_uart_0" | ||
35 | YAML_SERIAL_CONSOLE_STDOUT:pn-pmu-firmware ?= "psu_uart_0" | ||
36 | |||
37 | # Yocto ZynqMP FSBL variables | ||
38 | YAML_SERIAL_CONSOLE_STDIN:pn-fsbl-firmware ?= "psu_uart_0" | ||
39 | YAML_SERIAL_CONSOLE_STDOUT:pn-fsbl-firmware ?= "psu_uart_0" | ||
40 | |||
41 | # Yocto ZynqMP KERNEL Variables | 26 | # Yocto ZynqMP KERNEL Variables |
42 | UBOOT_ENTRYPOINT ?= "0x200000" | 27 | UBOOT_ENTRYPOINT ?= "0x200000" |
43 | UBOOT_LOADADDRESS ?= "0x200000" | 28 | UBOOT_LOADADDRESS ?= "0x200000" |
44 | 29 | ||
45 | # ZynqMP Serial Console | 30 | # ZynqMP Serial Console |
46 | SERIAL_CONSOLES ?= "115200;ttyPS0 115200;ttyPS1" | 31 | SERIAL_CONSOLES ?= "115200;ttyPS0 115200;ttyPS1" |
47 | YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" | ||
48 | 32 | ||
49 | require conf/machine/include/soc-zynqmp.inc | 33 | require conf/machine/include/soc-zynqmp.inc |
50 | require conf/machine/include/machine-xilinx-default.inc | 34 | require conf/machine/include/machine-xilinx-default.inc |
51 | require conf/machine/include/machine-xilinx-qemu.inc | 35 | require conf/machine/include/machine-xilinx-qemu.inc |
52 | 36 | ||
53 | # zynqmp-generic.conf uses zcu102-zynqmp xsa as reference input. | ||
54 | # User can override with custom xsa using HDF_BASE and HDF_PATH variables from | ||
55 | # local.conf. | ||
56 | HDF_MACHINE = "zcu102-zynqmp" | ||
57 | |||
58 | # Machine features must result in a superset | 37 | # Machine features must result in a superset |
59 | # Basic features: | 38 | # Basic features: |
60 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost usbgadget wifi bluetooth" | 39 | MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost usbgadget wifi bluetooth" |
@@ -64,40 +43,28 @@ IMAGE_CLASSES += "image-types-xilinx-qemu" | |||
64 | # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies | 43 | # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies |
65 | IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot'}" | 44 | IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot'}" |
66 | 45 | ||
67 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${PREFERRED_PROVIDER_virtual/dtb}" | ||
68 | |||
69 | EXTRA_IMAGEDEPENDS += " \ | 46 | EXTRA_IMAGEDEPENDS += " \ |
70 | libyaml-native \ | ||
71 | python3-cython-native \ | ||
72 | python3-pyyaml-native \ | ||
73 | virtual/fsbl \ | ||
74 | virtual/pmu-firmware \ | ||
75 | arm-trusted-firmware \ | ||
76 | virtual/boot-bin \ | ||
77 | virtual/bootloader \ | 47 | virtual/bootloader \ |
78 | qemu-devicetrees:do_deploy \ | ||
79 | u-boot-xlnx-uenv \ | 48 | u-boot-xlnx-uenv \ |
80 | u-boot-xlnx-scr \ | 49 | u-boot-xlnx-scr \ |
81 | " | 50 | " |
82 | 51 | ||
83 | IMAGE_BOOT_FILES += " \ | 52 | IMAGE_BOOT_FILES += " \ |
84 | boot.bin \ | ||
85 | ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ | ||
86 | boot.scr \ | 53 | boot.scr \ |
87 | Image \ | 54 | Image \ |
88 | " | 55 | " |
89 | 56 | ||
90 | # ZynqMP QEMU Configurations | 57 | # ZynqMP QEMU Configurations |
91 | # This machine has a QEMU model, runqemu setup: | 58 | # This machine has a QEMU model, runqemu setup: |
92 | QB_MEM = "-m 4096" | 59 | QB_MEM ?= "-m 4096" |
93 | # Iteration appears to be eth3, eth2, eth1, eth0 | 60 | # Iteration appears to be eth3, eth2, eth1, eth0 |
94 | QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" | 61 | QB_NETWORK_DEVICE ?= "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" |
95 | 62 | ||
96 | # Set variables for QEMU DTB PATH, PS DTB and PMU DTB for zynqmp_generic, this | 63 | # Set variables for QEMU DTB PATH, PS DTB and PMU DTB for zynqmp_generic, this |
97 | # allows user to use different QEMU HW DTB to match their board. | 64 | # allows user to use different QEMU HW DTB to match their board. |
98 | QEMU_HW_DTB_PATH = "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" | 65 | QEMU_HW_DTB_PATH ?= "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" |
99 | QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/zcu102-arm.dtb" | 66 | QEMU_HW_DTB_PS ?= "${QEMU_HW_DTB_PATH}/zcu102-arm.dtb" |
100 | QEMU_HW_DTB_PMU = "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb" | 67 | QEMU_HW_DTB_PMU ?= "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb" |
101 | 68 | ||
102 | # Two total serial ports defined in this model (according to the dts) | 69 | # Two total serial ports defined in this model (according to the dts) |
103 | # | 70 | # |
diff --git a/meta-xilinx-core/conf/machine/zynqmp-mali-common.conf b/meta-xilinx-core/conf/machine/zynqmp-mali-common.conf new file mode 100644 index 00000000..7b5dc68c --- /dev/null +++ b/meta-xilinx-core/conf/machine/zynqmp-mali-common.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | #@TYPE: Machine | ||
2 | #@NAME: zynqmp-mali-common | ||
3 | #@DESCRIPTION: Machine configuration for a common ZynqMP (MPSOC) filesystem devices w/ mali400 | ||
4 | |||
5 | #### Preamble | ||
6 | MACHINEOVERRIDES =. "${@['', 'zynqmp-mali-common:']['zynqmp-mali-common' != '${MACHINE}']}" | ||
7 | #### Regular settings follow | ||
8 | |||
9 | DEFAULTTUNE = "cortexa53" | ||
10 | |||
11 | require conf/machine/zynqmp-generic.conf | ||
12 | |||
13 | MACHINE_FEATURES += "mali400 vcu" | ||
14 | |||
15 | #### No additional settings should be after the Postamble | ||
16 | #### Postamble | ||
17 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' zynqmp_mali_common']['zynqmp-mali-common' != "${MACHINE}"]}" | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/device-tree.bbappend index 7dcee565..7d374291 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/device-tree.bbappend +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/device-tree.bbappend | |||
@@ -3,19 +3,19 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | |||
3 | # openamp.dtsi is in the WORKDIR | 3 | # openamp.dtsi is in the WORKDIR |
4 | DT_INCLUDE:append = " ${WORKDIR}" | 4 | DT_INCLUDE:append = " ${WORKDIR}" |
5 | 5 | ||
6 | do_configure[vardeps] += "ENABLE_OPENAMP_DTSI OPENAMP_EXTRA_OVERLAYS" | 6 | do_configure[vardeps] += "ENABLE_OPENAMP_DTSI OPENAMP_EXTRA_DT_INCLUDE_FILES" |
7 | 7 | ||
8 | OPENAMP_EXTRA_OVERLAYS:zynq = "zynq-openamp.dtsi" | 8 | OPENAMP_EXTRA_DT_INCLUDE_FILES ?= "" |
9 | OPENAMP_EXTRA_OVERLAYS:zynqmp = "zynqmp-openamp.dtsi" | 9 | OPENAMP_EXTRA_DT_INCLUDE_FILES:zynqmp = "zynqmp-openamp.dtsi" |
10 | OPENAMP_EXTRA_OVERLAYS:versal = "versal-openamp.dtsi" | 10 | OPENAMP_EXTRA_DT_INCLUDE_FILES:versal = "versal-openamp.dtsi" |
11 | OPENAMP_EXTRA_OVERLAYS:versal-net = "versal-net-openamp.dtsi" | 11 | OPENAMP_EXTRA_DT_INCLUDE_FILES:versal-net = "versal-net-openamp.dtsi" |
12 | 12 | ||
13 | def set_openamp_extra_overlays(d): | 13 | def set_openamp_extra_dt_include_files(d): |
14 | distro_features = d.getVar('DISTRO_FEATURES', True) | 14 | distro_features = d.getVar('DISTRO_FEATURES', True) |
15 | enable_openamp_dtsi = d.getVar('ENABLE_OPENAMP_DTSI') | 15 | enable_openamp_dtsi = d.getVar('ENABLE_OPENAMP_DTSI') |
16 | if 'openamp' in distro_features and enable_openamp_dtsi == '1': | 16 | if 'openamp' in distro_features and enable_openamp_dtsi == '1': |
17 | return ' ${OPENAMP_EXTRA_OVERLAYS}' | 17 | return ' ${OPENAMP_EXTRA_DT_INCLUDE_FILES}' |
18 | else: | 18 | else: |
19 | return '' | 19 | return '' |
20 | 20 | ||
21 | EXTRA_OVERLAYS:append = "${@set_openamp_extra_overlays(d)}" | 21 | EXTRA_DT_INCLUDE_FILES:append = "${@set_openamp_extra_dt_include_files(d)}" |
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-net-openamp.dtsi b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-net-openamp.dtsi index a918faf2..a1c939eb 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-net-openamp.dtsi +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-net-openamp.dtsi | |||
@@ -53,7 +53,7 @@ | |||
53 | reg = <0x0 0xeba00000 0x0 0x10000>; | 53 | reg = <0x0 0xeba00000 0x0 0x10000>; |
54 | status = "okay"; | 54 | status = "okay"; |
55 | compatible = "mmio-sram"; | 55 | compatible = "mmio-sram"; |
56 | power-domain = <&versal_net_firmware 0x183180cb>; | 56 | power-domains = <&versal_net_firmware 0x183180cb>; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | tcm_0b: tcm_0b@eba10000 { | 59 | tcm_0b: tcm_0b@eba10000 { |
@@ -61,7 +61,7 @@ | |||
61 | reg = <0x0 0xeba10000 0x0 0x8000>; | 61 | reg = <0x0 0xeba10000 0x0 0x8000>; |
62 | status = "okay"; | 62 | status = "okay"; |
63 | compatible = "mmio-sram"; | 63 | compatible = "mmio-sram"; |
64 | power-domain = <&versal_net_firmware 0x183180cc>; | 64 | power-domains = <&versal_net_firmware 0x183180cc>; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | tcm_0c: tcm_0b@eba20000 { | 67 | tcm_0c: tcm_0b@eba20000 { |
@@ -69,7 +69,7 @@ | |||
69 | reg = <0x0 0xeba20000 0x0 0x8000>; | 69 | reg = <0x0 0xeba20000 0x0 0x8000>; |
70 | status = "okay"; | 70 | status = "okay"; |
71 | compatible = "mmio-sram"; | 71 | compatible = "mmio-sram"; |
72 | power-domain = <&versal_net_firmware 0x183180cd>; | 72 | power-domains = <&versal_net_firmware 0x183180cd>; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | tcm_1a: tcm_0a@eba40000 { | 75 | tcm_1a: tcm_0a@eba40000 { |
@@ -77,7 +77,7 @@ | |||
77 | reg = <0x0 0xeba40000 0x0 0x10000>; | 77 | reg = <0x0 0xeba40000 0x0 0x10000>; |
78 | status = "okay"; | 78 | status = "okay"; |
79 | compatible = "mmio-sram"; | 79 | compatible = "mmio-sram"; |
80 | power-domain = <&versal_net_firmware 0x183180ce>; | 80 | power-domains = <&versal_net_firmware 0x183180ce>; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | tcm_1b: tcm_0b@eba50000 { | 83 | tcm_1b: tcm_0b@eba50000 { |
@@ -85,7 +85,7 @@ | |||
85 | reg = <0x0 0xeba50000 0x0 0x8000>; | 85 | reg = <0x0 0xeba50000 0x0 0x8000>; |
86 | status = "okay"; | 86 | status = "okay"; |
87 | compatible = "mmio-sram"; | 87 | compatible = "mmio-sram"; |
88 | power-domain = <&versal_net_firmware 0x183180cf>; | 88 | power-domains = <&versal_net_firmware 0x183180cf>; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | tcm_1c: tcm_0b@eba60000 { | 91 | tcm_1c: tcm_0b@eba60000 { |
@@ -93,7 +93,7 @@ | |||
93 | reg = <0x0 0xeba60000 0x0 0x8000>; | 93 | reg = <0x0 0xeba60000 0x0 0x8000>; |
94 | status = "okay"; | 94 | status = "okay"; |
95 | compatible = "mmio-sram"; | 95 | compatible = "mmio-sram"; |
96 | power-domain = <&versal_net_firmware 0x183180d0>; | 96 | power-domains = <&versal_net_firmware 0x183180d0>; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | r52ss { | 99 | r52ss { |
@@ -110,7 +110,7 @@ | |||
110 | ranges; | 110 | ranges; |
111 | sram = <&tcm_0a>, <&tcm_0b>, <&tcm_0c>; | 111 | sram = <&tcm_0a>, <&tcm_0b>, <&tcm_0c>; |
112 | memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; | 112 | memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; |
113 | power-domain = <&versal_net_firmware 0x181100BF>; | 113 | power-domains = <&versal_net_firmware 0x181100BF>; |
114 | mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; | 114 | mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; |
115 | mbox-names = "tx", "rx"; | 115 | mbox-names = "tx", "rx"; |
116 | }; | 116 | }; |
@@ -121,7 +121,7 @@ | |||
121 | ranges; | 121 | ranges; |
122 | sram = <&tcm_1a>, <&tcm_1b>, <&tcm_1c>; | 122 | sram = <&tcm_1a>, <&tcm_1b>, <&tcm_1c>; |
123 | memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; | 123 | memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; |
124 | power-domain = <&versal_net_firmware 0x181100C0>; | 124 | power-domains = <&versal_net_firmware 0x181100C0>; |
125 | mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; | 125 | mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; |
126 | mbox-names = "tx", "rx"; | 126 | mbox-names = "tx", "rx"; |
127 | }; | 127 | }; |
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-openamp.dtsi b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-openamp.dtsi index 01e337c7..b21b4096 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-openamp.dtsi +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/versal-openamp.dtsi | |||
@@ -52,7 +52,7 @@ | |||
52 | reg = <0x0 0xffe00000 0x0 0x10000>; | 52 | reg = <0x0 0xffe00000 0x0 0x10000>; |
53 | status = "okay"; | 53 | status = "okay"; |
54 | compatible = "mmio-sram"; | 54 | compatible = "mmio-sram"; |
55 | power-domain = <&versal_firmware 0x1831800b>; | 55 | power-domains = <&versal_firmware 0x1831800b>; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | tcm_0b: tcm_0b@ffe20000 { | 58 | tcm_0b: tcm_0b@ffe20000 { |
@@ -60,7 +60,7 @@ | |||
60 | reg = <0x0 0xffe20000 0x0 0x10000>; | 60 | reg = <0x0 0xffe20000 0x0 0x10000>; |
61 | status = "okay"; | 61 | status = "okay"; |
62 | compatible = "mmio-sram"; | 62 | compatible = "mmio-sram"; |
63 | power-domain = <&versal_firmware 0x1831800c>; | 63 | power-domains = <&versal_firmware 0x1831800c>; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | tcm_1a: tcm_1a@ffe90000 { | 66 | tcm_1a: tcm_1a@ffe90000 { |
@@ -68,7 +68,7 @@ | |||
68 | reg = <0x0 0xffe90000 0x0 0x10000>; | 68 | reg = <0x0 0xffe90000 0x0 0x10000>; |
69 | status = "okay"; | 69 | status = "okay"; |
70 | compatible = "mmio-sram"; | 70 | compatible = "mmio-sram"; |
71 | power-domain = <&versal_firmware 0x1831800d>; | 71 | power-domains = <&versal_firmware 0x1831800d>; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | tcm_1b: tcm_1b@ffeb0000 { | 74 | tcm_1b: tcm_1b@ffeb0000 { |
@@ -76,7 +76,7 @@ | |||
76 | reg = <0x0 0xffeb0000 0x0 0x10000>; | 76 | reg = <0x0 0xffeb0000 0x0 0x10000>; |
77 | status = "okay"; | 77 | status = "okay"; |
78 | compatible = "mmio-sram"; | 78 | compatible = "mmio-sram"; |
79 | power-domain = <&versal_firmware 0x1831800e>; | 79 | power-domains = <&versal_firmware 0x1831800e>; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | rf5ss@ff9a0000 { | 82 | rf5ss@ff9a0000 { |
@@ -94,7 +94,7 @@ | |||
94 | ranges; | 94 | ranges; |
95 | sram = <&tcm_0a>, <&tcm_0b>; | 95 | sram = <&tcm_0a>, <&tcm_0b>; |
96 | memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; | 96 | memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; |
97 | power-domain = <&versal_firmware 0x18110005>; | 97 | power-domains = <&versal_firmware 0x18110005>; |
98 | mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; | 98 | mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; |
99 | mbox-names = "tx", "rx"; | 99 | mbox-names = "tx", "rx"; |
100 | }; | 100 | }; |
@@ -105,7 +105,7 @@ | |||
105 | ranges; | 105 | ranges; |
106 | sram = <&tcm_1a>, <&tcm_1b>; | 106 | sram = <&tcm_1a>, <&tcm_1b>; |
107 | memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; | 107 | memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; |
108 | power-domain = <&versal_firmware 0x18110006>; | 108 | power-domains = <&versal_firmware 0x18110006>; |
109 | mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; | 109 | mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; |
110 | mbox-names = "tx", "rx"; | 110 | mbox-names = "tx", "rx"; |
111 | }; | 111 | }; |
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynq-openamp-overlay.dts b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynq-openamp-overlay.dts deleted file mode 100644 index b5d238ff..00000000 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynq-openamp-overlay.dts +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * SPDX-License-Identifier: MIT | ||
3 | * | ||
4 | * dts overlay file for Zynq OpenAMP | ||
5 | * | ||
6 | * Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | /dts-v1/; | ||
11 | /plugin/; | ||
12 | |||
13 | #include "zynq-openamp.dtsi" | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynq-openamp.dtsi b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynq-openamp.dtsi deleted file mode 100644 index 0e822202..00000000 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynq-openamp.dtsi +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * SPDX-License-Identifier: MIT | ||
3 | * | ||
4 | * dts file for Zynq OpenAMP | ||
5 | * | ||
6 | * Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | &{/} { | ||
11 | reserved-memory { | ||
12 | #address-cells = <1>; | ||
13 | #size-cells = <1>; | ||
14 | ranges; | ||
15 | vdev0vring0: vdev0vring0@3e800000 { | ||
16 | no-map; | ||
17 | compatible = "shared-dma-pool"; | ||
18 | reg = <0x3e800000 0x4000>; | ||
19 | }; | ||
20 | vdev0vring1: vdev0vring1@3e804000 { | ||
21 | no-map; | ||
22 | compatible = "shared-dma-pool"; | ||
23 | reg = <0x3e804000 0x4000>; | ||
24 | }; | ||
25 | vdev0buffer: vdev0buffer@3e808000 { | ||
26 | no-map; | ||
27 | compatible = "shared-dma-pool"; | ||
28 | reg = <0x3e808000 0x100000>; | ||
29 | }; | ||
30 | rproc_0_reserved: rproc@3e000000 { | ||
31 | no-map; | ||
32 | compatible = "shared-dma-pool"; | ||
33 | reg = <0x3e000000 0x800000>; | ||
34 | }; | ||
35 | }; | ||
36 | |||
37 | remoteproc0: remoteproc@0 { | ||
38 | compatible = "xlnx,zynq_remoteproc"; | ||
39 | firmware = "firmware"; | ||
40 | memory-region = <&rproc_0_reserved>, <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>; | ||
41 | interrupt-parent = <&intc>; | ||
42 | }; | ||
43 | }; | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynqmp-openamp.dtsi b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynqmp-openamp.dtsi index 8ef72656..1ad51fef 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynqmp-openamp.dtsi +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/files/zynqmp-openamp.dtsi | |||
@@ -52,7 +52,7 @@ | |||
52 | reg = <0x0 0xffe00000 0x0 0x10000>; | 52 | reg = <0x0 0xffe00000 0x0 0x10000>; |
53 | status = "okay"; | 53 | status = "okay"; |
54 | compatible = "mmio-sram"; | 54 | compatible = "mmio-sram"; |
55 | power-domain = <&zynqmp_firmware 15>; | 55 | power-domains = <&zynqmp_firmware 15>; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | tcm_0b: tcm_0b@ffe20000 { | 58 | tcm_0b: tcm_0b@ffe20000 { |
@@ -60,14 +60,14 @@ | |||
60 | reg = <0x0 0xffe20000 0x0 0x10000>; | 60 | reg = <0x0 0xffe20000 0x0 0x10000>; |
61 | status = "okay"; | 61 | status = "okay"; |
62 | compatible = "mmio-sram"; | 62 | compatible = "mmio-sram"; |
63 | power-domain = <&zynqmp_firmware 16>; | 63 | power-domains = <&zynqmp_firmware 16>; |
64 | }; | 64 | }; |
65 | tcm_1a: tcm_0a@ffe90000 { | 65 | tcm_1a: tcm_0a@ffe90000 { |
66 | no-map; | 66 | no-map; |
67 | reg = <0x0 0xffe90000 0x0 0x10000>; | 67 | reg = <0x0 0xffe90000 0x0 0x10000>; |
68 | status = "okay"; | 68 | status = "okay"; |
69 | compatible = "mmio-sram"; | 69 | compatible = "mmio-sram"; |
70 | power-domain = <&zynqmp_firmware 17>; | 70 | power-domains = <&zynqmp_firmware 17>; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | tcm_1b: tcm_0b@ffeb0000 { | 73 | tcm_1b: tcm_0b@ffeb0000 { |
@@ -75,7 +75,7 @@ | |||
75 | reg = <0x0 0xffeb0000 0x0 0x10000>; | 75 | reg = <0x0 0xffeb0000 0x0 0x10000>; |
76 | status = "okay"; | 76 | status = "okay"; |
77 | compatible = "mmio-sram"; | 77 | compatible = "mmio-sram"; |
78 | power-domain = <&zynqmp_firmware 18>; | 78 | power-domains = <&zynqmp_firmware 18>; |
79 | }; | 79 | }; |
80 | rf5ss@ff9a0000 { | 80 | rf5ss@ff9a0000 { |
81 | compatible = "xlnx,zynqmp-r5-remoteproc"; | 81 | compatible = "xlnx,zynqmp-r5-remoteproc"; |
@@ -92,7 +92,7 @@ | |||
92 | ranges; | 92 | ranges; |
93 | sram = <&tcm_0a>, <&tcm_0b>; | 93 | sram = <&tcm_0a>, <&tcm_0b>; |
94 | memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; | 94 | memory-region = <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; |
95 | power-domain = <&zynqmp_firmware 7>; | 95 | power-domains = <&zynqmp_firmware 7>; |
96 | mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; | 96 | mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; |
97 | mbox-names = "tx", "rx"; | 97 | mbox-names = "tx", "rx"; |
98 | }; | 98 | }; |
@@ -103,7 +103,7 @@ | |||
103 | ranges; | 103 | ranges; |
104 | sram = <&tcm_1a>, <&tcm_1b>; | 104 | sram = <&tcm_1a>, <&tcm_1b>; |
105 | memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; | 105 | memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; |
106 | power-domain = <&zynqmp_firmware 8>; | 106 | power-domains = <&zynqmp_firmware 8>; |
107 | mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; | 107 | mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; |
108 | mbox-names = "tx", "rx"; | 108 | mbox-names = "tx", "rx"; |
109 | }; | 109 | }; |
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/open-amp-device-tree.bb b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/open-amp-device-tree.bb index 9f481fec..7b626ee3 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/open-amp-device-tree.bb +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-bsp/device-tree/open-amp-device-tree.bb | |||
@@ -5,8 +5,6 @@ LICENSE = "MIT" | |||
5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
6 | 6 | ||
7 | SRC_URI = " \ | 7 | SRC_URI = " \ |
8 | file://zynq-openamp.dtsi \ | ||
9 | file://zynq-openamp-overlay.dts \ | ||
10 | file://zynqmp-openamp.dtsi \ | 8 | file://zynqmp-openamp.dtsi \ |
11 | file://zynqmp-openamp-overlay.dts \ | 9 | file://zynqmp-openamp-overlay.dts \ |
12 | file://versal-openamp.dtsi \ | 10 | file://versal-openamp.dtsi \ |
@@ -18,7 +16,6 @@ SRC_URI = " \ | |||
18 | # We don't have anything to include from the kernel | 16 | # We don't have anything to include from the kernel |
19 | KERNEL_INCLUDE = "" | 17 | KERNEL_INCLUDE = "" |
20 | 18 | ||
21 | COMPATIBLE_MACHINE:zynq = "${MACHINE}" | ||
22 | COMPATIBLE_MACHINE:zynqmp = "${MACHINE}" | 19 | COMPATIBLE_MACHINE:zynqmp = "${MACHINE}" |
23 | COMPATIBLE_MACHINE:versal = "${MACHINE}" | 20 | COMPATIBLE_MACHINE:versal = "${MACHINE}" |
24 | COMPATIBLE_MACHINE:versal-net = "${MACHINE}" | 21 | COMPATIBLE_MACHINE:versal-net = "${MACHINE}" |
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-core/packagegroups/packagegroup-openamp.bb b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-core/packagegroups/packagegroup-openamp.bb new file mode 100644 index 00000000..13992ebc --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-core/packagegroups/packagegroup-openamp.bb | |||
@@ -0,0 +1,38 @@ | |||
1 | DESCRIPTION = "OpenAMP supported packages" | ||
2 | |||
3 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
4 | |||
5 | # We don't support Zynq | ||
6 | COMPATIBLE_MACHINE:zynq = "$^" | ||
7 | |||
8 | inherit packagegroup features_check | ||
9 | |||
10 | REQUIRED_DISTRO_FEATURES = "openamp" | ||
11 | |||
12 | PACKAGES = "\ | ||
13 | packagegroup-openamp-echo-test \ | ||
14 | packagegroup-openamp-matrix-mul \ | ||
15 | packagegroup-openamp-rpc-demo \ | ||
16 | packagegroup-openamp \ | ||
17 | " | ||
18 | |||
19 | RDEPENDS:${PN}-echo-test = "rpmsg-echo-test" | ||
20 | RDEPENDS:${PN}-echo-test:append:zcu102-zynqmp = " openamp-fw-echo-testd" | ||
21 | |||
22 | RDEPENDS:${PN}-matrix-mul = "rpmsg-mat-mul" | ||
23 | RDEPENDS:${PN}-matrix-mul:append:zcu102-zynqmp = " openamp-fw-mat-muld" | ||
24 | |||
25 | RDEPENDS:${PN}-rpc-demo = "rpmsg-proxy-app" | ||
26 | RDEPENDS:${PN}-rpc-demo:append:zcu102-zynqmp = " openamp-fw-rpc-demo" | ||
27 | |||
28 | RDEPENDS:${PN}:append = " ${@'open-amp-device-tree' if d.getVar('ENABLE_OPENAMP_DTSI') != '1' else ''}" | ||
29 | |||
30 | RDEPENDS:${PN}:append = " \ | ||
31 | libmetal \ | ||
32 | libmetal-demos \ | ||
33 | open-amp \ | ||
34 | open-amp-demos \ | ||
35 | packagegroup-openamp-echo-test \ | ||
36 | packagegroup-openamp-matrix-mul \ | ||
37 | packagegroup-openamp-rpc-demo \ | ||
38 | " | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.1.bb b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.1.bb index a03912d7..9ca9cbc1 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.1.bb +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.1.bb | |||
@@ -1,8 +1,8 @@ | |||
1 | SRCBRANCH ?= "2024" | 1 | SRCBRANCH ?= "2024" |
2 | SRCREV = "e2fdb4fecbebe41b4cd1c0b4fbfa3496bcded485" | 2 | SRCREV = "9e9997221ddd335c31cf881edf7026c762024a58" |
3 | BRANCH = "xlnx_rel_v2024.1" | 3 | BRANCH = "xlnx_rel_v2024.1" |
4 | LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=f4d5df0f12dcea1b1a0124219c0dbab4" | 4 | LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=f4d5df0f12dcea1b1a0124219c0dbab4" |
5 | PV = "${SRCBRANCH}+git" | 5 | PV .= "+git" |
6 | 6 | ||
7 | REPO = "git://github.com/Xilinx/libmetal.git;protocol=https" | 7 | REPO = "git://github.com/Xilinx/libmetal.git;protocol=https" |
8 | 8 | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.2.bb b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.2.bb new file mode 100644 index 00000000..bcde904d --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/libmetal/libmetal-xlnx_v2024.2.bb | |||
@@ -0,0 +1,16 @@ | |||
1 | SRCBRANCH ?= "2024" | ||
2 | SRCREV = "e2fdb4fecbebe41b4cd1c0b4fbfa3496bcded485" | ||
3 | BRANCH = "xlnx_rel_v2024.2" | ||
4 | LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=f4d5df0f12dcea1b1a0124219c0dbab4" | ||
5 | PV .= "+git" | ||
6 | |||
7 | REPO = "git://github.com/Xilinx/libmetal.git;protocol=https" | ||
8 | |||
9 | include ${LAYER_PATH_openamp-layer}/recipes-openamp/libmetal/libmetal.inc | ||
10 | include ${LAYER_PATH_openamp-layer}/vendor/xilinx/recipes-openamp/libmetal/libmetal-xlnx.inc | ||
11 | |||
12 | RPROVIDES:${PN}-dbg += "libmetal-dbg" | ||
13 | RPROVIDES:${PN}-dev += "libmetal-dev" | ||
14 | RPROVIDES:${PN}-lic += "libmetal-lic" | ||
15 | RPROVIDES:${PN}-src += "libmetal-src" | ||
16 | RPROVIDES:${PN}-staticdev += "libmetal-staticdev" | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.1.bb b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.1.bb index 94535abc..29d4bc4f 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.1.bb +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.1.bb | |||
@@ -1,8 +1,8 @@ | |||
1 | SRCBRANCH ?= "2024" | 1 | SRCBRANCH ?= "2024" |
2 | SRCREV = "dbf0857389190f4c4cedfb77bd1f9bdd7ab404f3" | 2 | SRCREV = "699ad2c5b9236d61aae1b89e2857361db1bfeb95" |
3 | BRANCH = "xlnx_rel_v2024.1" | 3 | BRANCH = "xlnx_rel_v2024.1" |
4 | LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=ab88daf995c0bd0071c2e1e55f3d3505" | 4 | LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=ab88daf995c0bd0071c2e1e55f3d3505" |
5 | PV = "${SRCBRANCH}+git" | 5 | PV .= "+git" |
6 | REPO = "git://github.com/Xilinx/open-amp.git;protocol=https" | 6 | REPO = "git://github.com/Xilinx/open-amp.git;protocol=https" |
7 | 7 | ||
8 | include ${LAYER_PATH_openamp-layer}/recipes-openamp/open-amp/open-amp.inc | 8 | include ${LAYER_PATH_openamp-layer}/recipes-openamp/open-amp/open-amp.inc |
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.2.bb b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.2.bb new file mode 100644 index 00000000..06c2ecbc --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-openamp/open-amp/open-amp-xlnx_v2024.2.bb | |||
@@ -0,0 +1,16 @@ | |||
1 | SRCBRANCH ?= "2024" | ||
2 | SRCREV = "47caef116ccbf5d5a9778082a98fe8f3710b549c" | ||
3 | BRANCH = "xlnx_rel_v2024.2" | ||
4 | LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=ab88daf995c0bd0071c2e1e55f3d3505" | ||
5 | PV .= "+git" | ||
6 | REPO = "git://github.com/Xilinx/open-amp.git;protocol=https" | ||
7 | |||
8 | include ${LAYER_PATH_openamp-layer}/recipes-openamp/open-amp/open-amp.inc | ||
9 | require ${LAYER_PATH_openamp-layer}/vendor/xilinx/recipes-openamp/open-amp/open-amp-xlnx.inc | ||
10 | |||
11 | RPROVIDES:${PN}-dbg += "open-amp-dbg" | ||
12 | RPROVIDES:${PN}-dev += "open-amp-dev" | ||
13 | RPROVIDES:${PN}-lic += "open-amp-lic" | ||
14 | RPROVIDES:${PN}-src += "open-amp-src" | ||
15 | RPROVIDES:${PN}-staticdev += "open-amp-staticdev" | ||
16 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_%.bbappend b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202210.2.13.479.bbappend index 0e7f3693..0e7f3693 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_%.bbappend +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202210.2.13.479.bbappend | |||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202220.2.14.0.bbappend b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202220.2.14.0.bbappend new file mode 100644 index 00000000..0e7f3693 --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202220.2.14.0.bbappend | |||
@@ -0,0 +1,8 @@ | |||
1 | # Use libmetal for systems with AIE | ||
2 | # For versal devices with the ai-engine | ||
3 | PACKAGE_ARCH_orig := "${PACKAGE_ARCH}" | ||
4 | PACKAGE_ARCH = "${@bb.utils.contains('MACHINE_FEATURES', 'aie', '${MACHINE_ARCH}', '${PACKAGE_ARCH_orig}', d)}" | ||
5 | EXTRA_OECMAKE .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_AIE_BUILD=true', '', d)}" | ||
6 | TARGET_CXXFLAGS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_ENABLE_AIE -DFAL_LINUX=on', '', d)}" | ||
7 | DEPENDS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal', '', d)}" | ||
8 | RDEPENDS:${PN} += "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal', '', d)}" | ||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202310.2.15.0.bbappend b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202310.2.15.0.bbappend index 362dc45a..a7ab6bb8 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202310.2.15.0.bbappend +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202310.2.15.0.bbappend | |||
@@ -1,2 +1,9 @@ | |||
1 | # Older xrt requires a manual dependency on libmetal | 1 | # Use libmetal for systems with AIE |
2 | DEPENDS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libmetal', '', d)}" | 2 | # For versal devices with the ai-engine |
3 | PACKAGE_ARCH_orig := "${PACKAGE_ARCH}" | ||
4 | PACKAGE_ARCH = "${@bb.utils.contains('MACHINE_FEATURES', 'aie', '${MACHINE_ARCH}', '${PACKAGE_ARCH_orig}', d)}" | ||
5 | EXTRA_OECMAKE .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_AIE_BUILD=true', '', d)}" | ||
6 | TARGET_CXXFLAGS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_ENABLE_AIE -DFAL_LINUX=on', '', d)}" | ||
7 | DEPENDS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal libmetal', '', d)}" | ||
8 | RDEPENDS:${PN} += "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal', '', d)}" | ||
9 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202320.2.16.0.bbappend b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202320.2.16.0.bbappend index 362dc45a..a7ab6bb8 100644 --- a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202320.2.16.0.bbappend +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202320.2.16.0.bbappend | |||
@@ -1,2 +1,9 @@ | |||
1 | # Older xrt requires a manual dependency on libmetal | 1 | # Use libmetal for systems with AIE |
2 | DEPENDS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libmetal', '', d)}" | 2 | # For versal devices with the ai-engine |
3 | PACKAGE_ARCH_orig := "${PACKAGE_ARCH}" | ||
4 | PACKAGE_ARCH = "${@bb.utils.contains('MACHINE_FEATURES', 'aie', '${MACHINE_ARCH}', '${PACKAGE_ARCH_orig}', d)}" | ||
5 | EXTRA_OECMAKE .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_AIE_BUILD=true', '', d)}" | ||
6 | TARGET_CXXFLAGS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_ENABLE_AIE -DFAL_LINUX=on', '', d)}" | ||
7 | DEPENDS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal libmetal', '', d)}" | ||
8 | RDEPENDS:${PN} += "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal', '', d)}" | ||
9 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202410.2.17.319.bbappend b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202410.2.17.319.bbappend new file mode 100644 index 00000000..0e7f3693 --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt/xrt_202410.2.17.319.bbappend | |||
@@ -0,0 +1,8 @@ | |||
1 | # Use libmetal for systems with AIE | ||
2 | # For versal devices with the ai-engine | ||
3 | PACKAGE_ARCH_orig := "${PACKAGE_ARCH}" | ||
4 | PACKAGE_ARCH = "${@bb.utils.contains('MACHINE_FEATURES', 'aie', '${MACHINE_ARCH}', '${PACKAGE_ARCH_orig}', d)}" | ||
5 | EXTRA_OECMAKE .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_AIE_BUILD=true', '', d)}" | ||
6 | TARGET_CXXFLAGS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' -DXRT_ENABLE_AIE -DFAL_LINUX=on', '', d)}" | ||
7 | DEPENDS .= "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal', '', d)}" | ||
8 | RDEPENDS:${PN} += "${@bb.utils.contains('MACHINE_FEATURES', 'aie', ' libxaiengine aiefal', '', d)}" | ||
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armosc-Accelerate-picture-composition.patch b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armosc-Accelerate-picture-composition.patch new file mode 100644 index 00000000..3fa4d6ec --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armosc-Accelerate-picture-composition.patch | |||
@@ -0,0 +1,1058 @@ | |||
1 | From 015f8a54f7e5a754e1cefba1aa7b1f6992a8aa9b Mon Sep 17 00:00:00 2001 | ||
2 | From: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
3 | Date: Tue, 16 Jul 2024 19:48:47 +0000 | ||
4 | Subject: [PATCH] xf86-video-armosc: Accelerate picture composition | ||
5 | |||
6 | Introduce Repulsion - simplistic GPU accelerated compositor to back RandR | ||
7 | display manipulation features. This library is inspired by Glamor extension | ||
8 | https://www.freedesktop.org/wiki/Software/Glamor/. Unfortunately Glamor | ||
9 | doesn't work as is on ARM Mali-400 MP due to the lack of required features | ||
10 | and several bugs in Mali EGL/GLES implementation. | ||
11 | |||
12 | Install and manage picture compositor hooks. | ||
13 | |||
14 | Provide access to dma-buf fd from ARSOC buffer object. | ||
15 | |||
16 | Attach shadow buffer object to corresponding pixmap. | ||
17 | |||
18 | Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
19 | --- | ||
20 | src/Makefile.am | 3 +- | ||
21 | src/armsoc_driver.c | 145 ++++++++++ | ||
22 | src/armsoc_driver.h | 7 + | ||
23 | src/armsoc_dumb.c | 8 + | ||
24 | src/armsoc_dumb.h | 1 + | ||
25 | src/armsoc_exa.c | 18 +- | ||
26 | src/armsoc_repulsion.c | 624 +++++++++++++++++++++++++++++++++++++++++ | ||
27 | src/armsoc_repulsion.h | 67 +++++ | ||
28 | 8 files changed, 867 insertions(+), 6 deletions(-) | ||
29 | create mode 100644 src/armsoc_repulsion.c | ||
30 | create mode 100644 src/armsoc_repulsion.h | ||
31 | |||
32 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
33 | index db5f110..cd4f795 100644 | ||
34 | --- a/src/Makefile.am | ||
35 | +++ b/src/Makefile.am | ||
36 | @@ -38,7 +38,7 @@ ERROR_CFLAGS = -Werror -Wall -Wdeclaration-after-statement -Wvla \ | ||
37 | AM_CFLAGS = @XORG_CFLAGS@ $(ERROR_CFLAGS) | ||
38 | armsoc_drv_la_LTLIBRARIES = armsoc_drv.la | ||
39 | armsoc_drv_la_LDFLAGS = -module -avoid-version -no-undefined | ||
40 | -armsoc_drv_la_LIBADD = @XORG_LIBS@ | ||
41 | +armsoc_drv_la_LIBADD = -lMali @XORG_LIBS@ | ||
42 | armsoc_drv_ladir = @moduledir@/drivers | ||
43 | DRMMODE_SRCS = drmmode_exynos/drmmode_exynos.c \ | ||
44 | drmmode_pl111/drmmode_pl111.c \ | ||
45 | @@ -54,4 +54,5 @@ armsoc_drv_la_SOURCES = \ | ||
46 | armsoc_dri2.c \ | ||
47 | armsoc_driver.c \ | ||
48 | armsoc_dumb.c \ | ||
49 | + armsoc_repulsion.c \ | ||
50 | $(DRMMODE_SRCS) | ||
51 | diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c | ||
52 | index a4a1ba3..f5b8f21 100644 | ||
53 | --- a/src/armsoc_driver.c | ||
54 | +++ b/src/armsoc_driver.c | ||
55 | @@ -42,6 +42,7 @@ | ||
56 | #include <pixman.h> | ||
57 | |||
58 | #include "armsoc_driver.h" | ||
59 | +#include "armsoc_repulsion.h" | ||
60 | |||
61 | #include "micmap.h" | ||
62 | |||
63 | @@ -971,6 +972,138 @@ ARMSOCAccelInit(ScreenPtr pScreen) | ||
64 | pARMSOC->dri = FALSE; | ||
65 | } | ||
66 | |||
67 | +#define ARMSOC_ACCEL_MIN_DIMS 200 | ||
68 | + | ||
69 | +/** | ||
70 | + * Classify compositor input to figure out if we can accelerate composition | ||
71 | + */ | ||
72 | +static Bool | ||
73 | +ARMSOCCanAccelerateComposition(CARD8 op, | ||
74 | + PicturePtr src, | ||
75 | + PicturePtr mask, | ||
76 | + PicturePtr dest, | ||
77 | + CARD16 width, | ||
78 | + CARD16 height) | ||
79 | +{ | ||
80 | + /* We only support source to destination pixmap copy */ | ||
81 | + if (op != PictOpSrc) | ||
82 | + return FALSE; | ||
83 | + | ||
84 | + /* | ||
85 | + * Don't accelerate small picture compositions, e.g. toolbars, cursor, | ||
86 | + * icons, etc. | ||
87 | + */ | ||
88 | + if (width < ARMSOC_ACCEL_MIN_DIMS || height < ARMSOC_ACCEL_MIN_DIMS) | ||
89 | + return FALSE; | ||
90 | + | ||
91 | + /* Check source picture */ | ||
92 | + if (!src || !src->pDrawable) | ||
93 | + return FALSE; | ||
94 | + | ||
95 | + /* Check destination picture constraints */ | ||
96 | + if (!dest || !dest->pDrawable || dest->pDrawable->type != DRAWABLE_PIXMAP) | ||
97 | + return FALSE; | ||
98 | + | ||
99 | + /* We don't support masking */ | ||
100 | + if (mask) | ||
101 | + return FALSE; | ||
102 | + | ||
103 | + /* | ||
104 | + * We expect source transform to be assigned, otherwise there is not much | ||
105 | + * to accelerate | ||
106 | + */ | ||
107 | + if (!src->transform) | ||
108 | + return FALSE; | ||
109 | + | ||
110 | + /* We expect buffer object to be assigned to source */ | ||
111 | + if (!draw2pix(src->pDrawable)) | ||
112 | + return FALSE; | ||
113 | + | ||
114 | + /* We expect buffer object to be assigned to destination */ | ||
115 | + if (!draw2pix(dest->pDrawable)) | ||
116 | + return FALSE; | ||
117 | + | ||
118 | + return TRUE; | ||
119 | +} | ||
120 | + | ||
121 | +/** | ||
122 | + * This callback will be invoked every time xserver needs to combine 2 | ||
123 | + * pictures. Our special interest is the case when we need to blit draw buffer | ||
124 | + * into shadow buffer while performing rotation or reflection. Without | ||
125 | + * acceleration such composition will end up in tons of matrix multiplications | ||
126 | + * for every pixel, which is obviously very slow. Here we need to detect such | ||
127 | + * cases and accelerate the composition on the GPU. | ||
128 | + */ | ||
129 | +static void | ||
130 | +ARMSOCComposite(CARD8 op, | ||
131 | + PicturePtr src, | ||
132 | + PicturePtr mask, | ||
133 | + PicturePtr dest, | ||
134 | + INT16 x_src, | ||
135 | + INT16 y_src, | ||
136 | + INT16 x_mask, | ||
137 | + INT16 y_mask, | ||
138 | + INT16 x_dest, | ||
139 | + INT16 y_dest, | ||
140 | + CARD16 width, | ||
141 | + CARD16 height) | ||
142 | +{ | ||
143 | + ScreenPtr pScreen = dest->pDrawable->pScreen; | ||
144 | + PictureScreenPtr ps = GetPictureScreen(pScreen); | ||
145 | + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); | ||
146 | + struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn); | ||
147 | + struct armsoc_bo *src_bo = NULL, *dest_bo = NULL; | ||
148 | + float xform_matrix[3][3] = {}; | ||
149 | + | ||
150 | + Bool can_accelerate = | ||
151 | + ARMSOCCanAccelerateComposition(op, src, mask, dest, width, height); | ||
152 | + | ||
153 | + | ||
154 | + if (can_accelerate) { | ||
155 | + /* Transpose, scale & adjust transformation matrix */ | ||
156 | + int x, y; | ||
157 | + for (y = 0; y < 3; ++y) | ||
158 | + for (x = 0; x < 3; ++x) | ||
159 | + xform_matrix[x][y] = | ||
160 | + (float)src->transform->matrix[y][x] / 65536.f; | ||
161 | + /* | ||
162 | + * TODO: Figure out coordinate system where these sins make sence, | ||
163 | + * insted of just reversing them | ||
164 | + */ | ||
165 | + xform_matrix[0][1] = -xform_matrix[0][1]; | ||
166 | + xform_matrix[1][0] = -xform_matrix[1][0]; | ||
167 | + } | ||
168 | + | ||
169 | + /* Extract source buffer object */ | ||
170 | + if (can_accelerate) { | ||
171 | + PixmapPtr pm = draw2pix(src->pDrawable); | ||
172 | + src_bo = ARMSOCPixmapBo(pm); | ||
173 | + } | ||
174 | + | ||
175 | + /* Extract destination buffer object */ | ||
176 | + if (can_accelerate) { | ||
177 | + PixmapPtr pm = draw2pix(dest->pDrawable); | ||
178 | + dest_bo = ARMSOCPixmapBo(pm); | ||
179 | + } | ||
180 | + | ||
181 | + if (can_accelerate && | ||
182 | + armsoc_repulsion_composite(pARMSOC->repulsion, | ||
183 | + src_bo, | ||
184 | + dest_bo, | ||
185 | + xform_matrix)) { | ||
186 | + } else { | ||
187 | + /* Fallback to saved compositor if accelerated composition fails */ | ||
188 | + pARMSOC->composite_proc(op, src, mask, dest, | ||
189 | + x_src, y_src, x_mask, y_mask, | ||
190 | + x_dest, y_dest, width, height); | ||
191 | + } | ||
192 | + | ||
193 | + if (ps->Composite != ARMSOCComposite) { | ||
194 | + pARMSOC->composite_proc = ps->Composite; | ||
195 | + ps->Composite = ARMSOCComposite; | ||
196 | + } | ||
197 | +} | ||
198 | + | ||
199 | /** | ||
200 | * The driver's ScreenInit() function, called at the start of each server | ||
201 | * generation. Fill in pScreen, map the frame buffer, save state, | ||
202 | @@ -986,6 +1119,7 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) | ||
203 | struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn); | ||
204 | VisualPtr visual; | ||
205 | xf86CrtcConfigPtr xf86_config; | ||
206 | + PictureScreenPtr ps; | ||
207 | int j; | ||
208 | const char *fbdev; | ||
209 | int depth; | ||
210 | @@ -1174,6 +1308,13 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) | ||
211 | pARMSOC->lockFD = -1; | ||
212 | } | ||
213 | |||
214 | + pARMSOC->repulsion = armsoc_repulsion_init(); | ||
215 | + | ||
216 | + ps = GetPictureScreen(pScreen); | ||
217 | + pARMSOC->composite_proc = ps->Composite; | ||
218 | + | ||
219 | + ps->Composite = ARMSOCComposite; | ||
220 | + | ||
221 | TRACE_EXIT(); | ||
222 | return TRUE; | ||
223 | |||
224 | @@ -1250,6 +1391,8 @@ ARMSOCCloseScreen(CLOSE_SCREEN_ARGS_DECL) | ||
225 | |||
226 | TRACE_ENTER(); | ||
227 | |||
228 | + armsoc_repulsion_release(pARMSOC->repulsion); | ||
229 | + | ||
230 | drmmode_screen_fini(pScrn); | ||
231 | drmmode_cursor_fini(pScreen); | ||
232 | |||
233 | @@ -1294,6 +1437,8 @@ ARMSOCCloseScreen(CLOSE_SCREEN_ARGS_DECL) | ||
234 | pARMSOC->lockFD = -1; | ||
235 | } | ||
236 | |||
237 | + armsoc_repulsion_release(pARMSOC->repulsion); | ||
238 | + | ||
239 | TRACE_EXIT(); | ||
240 | |||
241 | return ret; | ||
242 | diff --git a/src/armsoc_driver.h b/src/armsoc_driver.h | ||
243 | index eae76ca..20b0f80 100644 | ||
244 | --- a/src/armsoc_driver.h | ||
245 | +++ b/src/armsoc_driver.h | ||
246 | @@ -38,6 +38,7 @@ | ||
247 | #include "xf86drm.h" | ||
248 | #include <errno.h> | ||
249 | #include "armsoc_exa.h" | ||
250 | +#include "armsoc_repulsion.h" | ||
251 | |||
252 | /* Apparently not used by X server */ | ||
253 | #define ARMSOC_VERSION 1000 | ||
254 | @@ -183,6 +184,12 @@ struct ARMSOCRec { | ||
255 | /* Size of the swap chain. Set to 1 if DRI2SwapLimit unsupported, | ||
256 | * driNumBufs if early display enabled, otherwise driNumBufs-1 */ | ||
257 | unsigned int swap_chain_size; | ||
258 | + | ||
259 | + /* GPU accelerated picture compositor, AKA Repulsion */ | ||
260 | + struct ARMSOCRepulsion *repulsion; | ||
261 | + | ||
262 | + /* SW (pixman based) picture compositor fallback */ | ||
263 | + CompositeProcPtr composite_proc; | ||
264 | }; | ||
265 | |||
266 | /* | ||
267 | diff --git a/src/armsoc_dumb.c b/src/armsoc_dumb.c | ||
268 | index 7e6dbd9..3c16ed2 100644 | ||
269 | --- a/src/armsoc_dumb.c | ||
270 | +++ b/src/armsoc_dumb.c | ||
271 | @@ -130,6 +130,14 @@ int armsoc_bo_has_dmabuf(struct armsoc_bo *bo) | ||
272 | return bo->dmabuf >= 0; | ||
273 | } | ||
274 | |||
275 | +int armsoc_bo_get_dmabuf(struct armsoc_bo *bo) | ||
276 | +{ | ||
277 | + if (!armsoc_bo_has_dmabuf(bo)) | ||
278 | + armsoc_bo_set_dmabuf(bo); | ||
279 | + | ||
280 | + return bo->dmabuf; | ||
281 | +} | ||
282 | + | ||
283 | struct armsoc_bo *armsoc_bo_new_with_dim(struct armsoc_device *dev, | ||
284 | uint32_t width, uint32_t height, uint8_t depth, | ||
285 | uint8_t bpp, enum armsoc_buf_type buf_type) | ||
286 | diff --git a/src/armsoc_dumb.h b/src/armsoc_dumb.h | ||
287 | index a299ccf..3b687c7 100644 | ||
288 | --- a/src/armsoc_dumb.h | ||
289 | +++ b/src/armsoc_dumb.h | ||
290 | @@ -89,6 +89,7 @@ void armsoc_bo_unreference(struct armsoc_bo *bo); | ||
291 | int armsoc_bo_set_dmabuf(struct armsoc_bo *bo); | ||
292 | void armsoc_bo_clear_dmabuf(struct armsoc_bo *bo); | ||
293 | int armsoc_bo_has_dmabuf(struct armsoc_bo *bo); | ||
294 | +int armsoc_bo_get_dmabuf(struct armsoc_bo *bo); | ||
295 | int armsoc_bo_clear(struct armsoc_bo *bo); | ||
296 | int armsoc_bo_rm_fb(struct armsoc_bo *bo); | ||
297 | int armsoc_bo_resize(struct armsoc_bo *bo, uint32_t new_width, | ||
298 | diff --git a/src/armsoc_exa.c b/src/armsoc_exa.c | ||
299 | index a310727..7edf0ac 100644 | ||
300 | --- a/src/armsoc_exa.c | ||
301 | +++ b/src/armsoc_exa.c | ||
302 | @@ -161,10 +161,16 @@ ARMSOCModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, | ||
303 | ScrnInfoPtr pScrn = pix2scrn(pPixmap); | ||
304 | struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn); | ||
305 | enum armsoc_buf_type buf_type = ARMSOC_BO_NON_SCANOUT; | ||
306 | + struct armsoc_bo *fb_bo = NULL; | ||
307 | |||
308 | /* Only modify specified fields, keeping all others intact. */ | ||
309 | - if (pPixData) | ||
310 | + if (pPixData) { | ||
311 | pPixmap->devPrivate.ptr = pPixData; | ||
312 | + if (pARMSOC->shadow && pPixData == armsoc_bo_map(pARMSOC->shadow)) | ||
313 | + fb_bo = pARMSOC->shadow; | ||
314 | + else if (pPixData == armsoc_bo_map(pARMSOC->scanout)) | ||
315 | + fb_bo = pARMSOC->scanout; | ||
316 | + } | ||
317 | |||
318 | if (devKind > 0) | ||
319 | pPixmap->devKind = devKind; | ||
320 | @@ -173,7 +179,7 @@ ARMSOCModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, | ||
321 | * We can't accelerate this pixmap, and don't ever want to | ||
322 | * see it again.. | ||
323 | */ | ||
324 | - if (pPixData && pPixData != armsoc_bo_map(pARMSOC->scanout)) { | ||
325 | + if (pPixData && fb_bo && pPixData != armsoc_bo_map(fb_bo)) { | ||
326 | /* scratch-pixmap (see GetScratchPixmapHeader()) gets recycled, | ||
327 | * so could have a previous bo! | ||
328 | * Pixmap drops ref on its old bo */ | ||
329 | @@ -185,10 +191,10 @@ ARMSOCModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, | ||
330 | } | ||
331 | |||
332 | /* Replacing the pixmap's current bo with the scanout bo */ | ||
333 | - if (pPixData == armsoc_bo_map(pARMSOC->scanout) && priv->bo != pARMSOC->scanout) { | ||
334 | + if (fb_bo && pPixData == armsoc_bo_map(fb_bo) && priv->bo != fb_bo) { | ||
335 | struct armsoc_bo *old_bo = priv->bo; | ||
336 | |||
337 | - priv->bo = pARMSOC->scanout; | ||
338 | + priv->bo = fb_bo; | ||
339 | /* pixmap takes a ref on its new bo */ | ||
340 | armsoc_bo_reference(priv->bo); | ||
341 | |||
342 | @@ -225,7 +231,9 @@ ARMSOCModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, | ||
343 | if (!pPixmap->drawable.width || !pPixmap->drawable.height) | ||
344 | return TRUE; | ||
345 | |||
346 | - assert(priv->bo); | ||
347 | + if(!priv->bo) | ||
348 | + return FALSE; | ||
349 | + | ||
350 | if (armsoc_bo_width(priv->bo) != pPixmap->drawable.width || | ||
351 | armsoc_bo_height(priv->bo) != pPixmap->drawable.height || | ||
352 | armsoc_bo_bpp(priv->bo) != pPixmap->drawable.bitsPerPixel) { | ||
353 | diff --git a/src/armsoc_repulsion.c b/src/armsoc_repulsion.c | ||
354 | new file mode 100644 | ||
355 | index 0000000..1a7c0cd | ||
356 | --- /dev/null | ||
357 | +++ b/src/armsoc_repulsion.c | ||
358 | @@ -0,0 +1,624 @@ | ||
359 | +/* | ||
360 | + * Copyright (C) 2024 AMD, Inc. | ||
361 | + * | ||
362 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
363 | + * copy of this software and associated documentation files (the "Software"), | ||
364 | + * to deal in the Software without restriction, including without limitation | ||
365 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
366 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
367 | + * Software is furnished to do so, subject to the following conditions: | ||
368 | + * | ||
369 | + * The above copyright notice and this permission notice (including the next | ||
370 | + * paragraph) shall be included in all copies or substantial portions of the | ||
371 | + * Software. | ||
372 | + * | ||
373 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
374 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
375 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
376 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
377 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
378 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
379 | + * SOFTWARE. | ||
380 | + * | ||
381 | + * Author: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
382 | + * | ||
383 | + */ | ||
384 | + | ||
385 | +#include "armsoc_repulsion.h" | ||
386 | + | ||
387 | +#include <stdlib.h> | ||
388 | +#include <drm_fourcc.h> | ||
389 | + | ||
390 | +#define EGL_GL_PROTOTYPES 1 | ||
391 | +#include <EGL/egl.h> | ||
392 | +#define EGL_EGLEXT_PROTOTYPES 1 | ||
393 | +#include <EGL/eglext.h> | ||
394 | +#include <GLES2/gl2.h> | ||
395 | +#define GL_GLEXT_PROTOTYPES 1 | ||
396 | +#include <GLES2/gl2ext.h> | ||
397 | + | ||
398 | +#include <xf86.h> | ||
399 | + | ||
400 | +/* ----------------------------------------------------------------------------- | ||
401 | + * Utilities | ||
402 | + */ | ||
403 | + | ||
404 | +#define INFO_LOG(fmt, ...) \ | ||
405 | +do { xf86DrvMsg(0, X_INFO, fmt "\n", ##__VA_ARGS__); } while (0) | ||
406 | + | ||
407 | +#define WARN_LOG(fmt, ...) \ | ||
408 | +do { xf86DrvMsg(0, X_WARNING, "WARNING: " fmt "\n", ##__VA_ARGS__); } while (0) | ||
409 | + | ||
410 | +#define ERROR_LOG(fmt, ...) \ | ||
411 | +do { xf86DrvMsg(0, X_ERROR, "ERROR: " fmt "\n", ##__VA_ARGS__); } while (0) | ||
412 | + | ||
413 | +/** | ||
414 | + * struct RepulsiveVertex - vertex data used for rendering | ||
415 | + * @pos: vertex position in the screen coordinate space | ||
416 | + * @uv: texture coordinate bound to this vertex | ||
417 | + */ | ||
418 | +struct RepulsiveVertex { | ||
419 | + GLfloat pos[3]; | ||
420 | + GLfloat uv[2]; | ||
421 | +}; | ||
422 | + | ||
423 | +/** | ||
424 | + * struct ARMSOCRepulsion - GPU acceleration data | ||
425 | + * @egl: EGL specific bits | ||
426 | + * @egl.display: EGL display connection | ||
427 | + * @egl.context: EGL context | ||
428 | + * @egl.surface: primary EGL surface | ||
429 | + * @gles: OpenGL ES related bits | ||
430 | + * @gles.vbo: Vertex buffer object | ||
431 | + * @gles.ibo: Index buffer object | ||
432 | + * @gles.texture: External texture object | ||
433 | + * @gles.proj_location: Shader location for projection matrix | ||
434 | + * @gles.xform_location: Shader location for transformation matrix | ||
435 | + * @gles.vertices: Array of vertices used in rendering | ||
436 | + */ | ||
437 | +struct ARMSOCRepulsion { | ||
438 | + struct { | ||
439 | + EGLDisplay display; | ||
440 | + EGLContext context; | ||
441 | + EGLSurface surface; | ||
442 | + } egl; | ||
443 | + struct { | ||
444 | + GLuint vbo; | ||
445 | + GLuint ibo; | ||
446 | + GLuint texture; | ||
447 | + GLuint program; | ||
448 | + GLint proj_location; | ||
449 | + GLint xform_location; | ||
450 | + struct RepulsiveVertex vertices[4]; | ||
451 | + } gles; | ||
452 | +}; | ||
453 | + | ||
454 | +/* ----------------------------------------------------------------------------- | ||
455 | + * GLES2 Functions | ||
456 | + */ | ||
457 | + | ||
458 | +static const char *vertex_shader = " \ | ||
459 | +precision highp float; \ | ||
460 | + \ | ||
461 | +uniform mat3 u_projection; \ | ||
462 | +uniform mat3 u_transform; \ | ||
463 | +attribute vec3 a_position; \ | ||
464 | +attribute vec2 a_texcoord; \ | ||
465 | + \ | ||
466 | +varying vec2 v_texcoord; \ | ||
467 | + \ | ||
468 | +void main() \ | ||
469 | +{ \ | ||
470 | + gl_Position.xyz = u_transform * u_projection * a_position; \ | ||
471 | + gl_Position.w = 1.0; \ | ||
472 | + v_texcoord = a_texcoord; \ | ||
473 | +} \ | ||
474 | +"; | ||
475 | + | ||
476 | +static const char *fragment_shader = " \ | ||
477 | +#extension GL_OES_EGL_image_external : require\n \ | ||
478 | +precision highp float; \ | ||
479 | + \ | ||
480 | +uniform samplerExternalOES texture; \ | ||
481 | +varying vec2 v_texcoord; \ | ||
482 | + \ | ||
483 | +void main() \ | ||
484 | +{ \ | ||
485 | + gl_FragColor = texture2D(texture, v_texcoord); \ | ||
486 | +} \ | ||
487 | +"; | ||
488 | + | ||
489 | +#define SHADER_POSITION_ATTR_SLOT 0 | ||
490 | +#define SHADER_TEX_COOR_ATTR_SLOT 1 | ||
491 | + | ||
492 | +static void armsoc_repulsion_gles_log(GLenum source, GLenum type, GLuint id, | ||
493 | + GLenum severity, GLsizei length, | ||
494 | + const GLchar *message, const void *data) | ||
495 | +{ | ||
496 | + switch (severity) { | ||
497 | + case GL_DEBUG_SEVERITY_HIGH_KHR: | ||
498 | + ERROR_LOG("GLES2: %s", message); | ||
499 | + break; | ||
500 | + case GL_DEBUG_SEVERITY_MEDIUM_KHR: | ||
501 | + WARN_LOG("GLES2: %s", message); | ||
502 | + break; | ||
503 | + default: | ||
504 | + INFO_LOG("GLES2: %s", message); | ||
505 | + }; | ||
506 | +} | ||
507 | + | ||
508 | +static const char* gles_error_str(GLenum err) | ||
509 | +{ | ||
510 | + switch (err) { | ||
511 | + case GL_NO_ERROR: return "no error"; | ||
512 | + case GL_INVALID_ENUM: return "invalid enum"; | ||
513 | + case GL_INVALID_VALUE: return "invalid value"; | ||
514 | + case GL_INVALID_OPERATION: return "invalid operation"; | ||
515 | + case GL_OUT_OF_MEMORY: return "out of memory"; | ||
516 | + case GL_INVALID_FRAMEBUFFER_OPERATION: return "invalid fb operation"; | ||
517 | + default: return "unknowm error"; | ||
518 | + } | ||
519 | +}; | ||
520 | + | ||
521 | +static int armsoc_repulsion_compile_shader(struct ARMSOCRepulsion *repulsion) | ||
522 | +{ | ||
523 | + GLuint vs, fs; | ||
524 | + GLint status, texture; | ||
525 | + GLenum err; | ||
526 | + | ||
527 | + vs = glCreateShader(GL_VERTEX_SHADER); | ||
528 | + if (!vs) { | ||
529 | + err = glGetError(); | ||
530 | + return err == GL_NO_ERROR ? -1 : err; | ||
531 | + } | ||
532 | + glShaderSource(vs, 1, &vertex_shader, NULL); | ||
533 | + glCompileShader(vs); | ||
534 | + glGetShaderiv(vs, GL_COMPILE_STATUS, &status); | ||
535 | + if (status == GL_FALSE) { | ||
536 | + GLint max_len = 1024; | ||
537 | + GLchar err_log[1024]; | ||
538 | + glGetShaderInfoLog(vs, max_len, &max_len, &err_log[0]); | ||
539 | + ERROR_LOG("VS: %s", err_log); | ||
540 | + err = glGetError(); | ||
541 | + return err == GL_NO_ERROR ? -1 : err; | ||
542 | + } | ||
543 | + | ||
544 | + fs = glCreateShader(GL_FRAGMENT_SHADER); | ||
545 | + if (!fs) { | ||
546 | + err = glGetError(); | ||
547 | + return err == GL_NO_ERROR ? -1 : err; | ||
548 | + } | ||
549 | + glShaderSource(fs, 1, &fragment_shader, NULL); | ||
550 | + glCompileShader(fs); | ||
551 | + glGetShaderiv(fs, GL_COMPILE_STATUS, &status); | ||
552 | + if (status == GL_FALSE) { | ||
553 | + err = glGetError(); | ||
554 | + return err == GL_NO_ERROR ? -1 : err; | ||
555 | + } | ||
556 | + | ||
557 | + repulsion->gles.program = glCreateProgram(); | ||
558 | + if (!repulsion->gles.program) { | ||
559 | + err = glGetError(); | ||
560 | + return err == GL_NO_ERROR ? -1 : err; | ||
561 | + } | ||
562 | + glAttachShader(repulsion->gles.program, vs); | ||
563 | + glAttachShader(repulsion->gles.program, fs); | ||
564 | + glBindAttribLocation(repulsion->gles.program, SHADER_POSITION_ATTR_SLOT, | ||
565 | + "a_position"); | ||
566 | + glBindAttribLocation(repulsion->gles.program, SHADER_TEX_COOR_ATTR_SLOT, | ||
567 | + "a_texcoord"); | ||
568 | + glLinkProgram(repulsion->gles.program); | ||
569 | + glDetachShader(repulsion->gles.program, vs); | ||
570 | + glDetachShader(repulsion->gles.program, fs); | ||
571 | + glGetProgramiv(repulsion->gles.program, GL_LINK_STATUS, &status); | ||
572 | + if (status == GL_FALSE) { | ||
573 | + err = glGetError(); | ||
574 | + return err == GL_NO_ERROR ? -1 : err; | ||
575 | + } | ||
576 | + glUseProgram(repulsion->gles.program); | ||
577 | + glEnableVertexAttribArray(SHADER_POSITION_ATTR_SLOT); | ||
578 | + glEnableVertexAttribArray(SHADER_TEX_COOR_ATTR_SLOT); | ||
579 | + | ||
580 | + repulsion->gles.proj_location = | ||
581 | + glGetUniformLocation(repulsion->gles.program, "u_projection"); | ||
582 | + repulsion->gles.xform_location = | ||
583 | + glGetUniformLocation(repulsion->gles.program, "u_transform"); | ||
584 | + | ||
585 | + texture = glGetUniformLocation(repulsion->gles.program, "texture"); | ||
586 | + glUniform1i(texture, 0); | ||
587 | + glActiveTexture(GL_TEXTURE0); | ||
588 | + | ||
589 | + return GL_NO_ERROR; | ||
590 | +} | ||
591 | + | ||
592 | +static int armsoc_repulsion_create_vbo(struct ARMSOCRepulsion *repulsion) | ||
593 | +{ | ||
594 | + glGenBuffers(1, &repulsion->gles.vbo); | ||
595 | + glBindBuffer(GL_ARRAY_BUFFER, repulsion->gles.vbo); | ||
596 | + | ||
597 | + return GL_NO_ERROR; | ||
598 | +} | ||
599 | + | ||
600 | +static int armsoc_repulsion_create_ibo(struct ARMSOCRepulsion *repulsion) | ||
601 | +{ | ||
602 | + static const GLushort indices[] = {0, 1, 2, 0, 2, 3}; | ||
603 | + | ||
604 | + glGenBuffers(1, &repulsion->gles.ibo); | ||
605 | + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, repulsion->gles.ibo); | ||
606 | + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, | ||
607 | + GL_STATIC_DRAW); | ||
608 | + | ||
609 | + return GL_NO_ERROR; | ||
610 | +} | ||
611 | + | ||
612 | +static int armsoc_repulsion_create_texture(struct ARMSOCRepulsion *repulsion) | ||
613 | +{ | ||
614 | + glGenTextures(1, &repulsion->gles.texture); | ||
615 | + glBindTexture(GL_TEXTURE_EXTERNAL_OES, repulsion->gles.texture); | ||
616 | + glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | ||
617 | + glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | ||
618 | + glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, | ||
619 | + GL_CLAMP_TO_EDGE); | ||
620 | + glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, | ||
621 | + GL_CLAMP_TO_EDGE); | ||
622 | + | ||
623 | + return GL_NO_ERROR; | ||
624 | +} | ||
625 | + | ||
626 | +static int armsoc_repulsion_init_gles(struct ARMSOCRepulsion *repulsion) | ||
627 | +{ | ||
628 | + int rc; | ||
629 | + | ||
630 | + glEnable(GL_DEBUG_OUTPUT_KHR); | ||
631 | + glDebugMessageCallbackKHR(armsoc_repulsion_gles_log, repulsion); | ||
632 | + | ||
633 | + rc = armsoc_repulsion_compile_shader(repulsion); | ||
634 | + if (rc != GL_NO_ERROR) { | ||
635 | + ERROR_LOG("Failed to compile shader: 0x%04x (%s)", | ||
636 | + rc, gles_error_str(rc)); | ||
637 | + return rc; | ||
638 | + } | ||
639 | + | ||
640 | + rc = armsoc_repulsion_create_vbo(repulsion); | ||
641 | + if (rc != GL_NO_ERROR) { | ||
642 | + ERROR_LOG("Failed to create vertex buffer: 0x%04x (%s)", | ||
643 | + rc, gles_error_str(rc)); | ||
644 | + return rc; | ||
645 | + } | ||
646 | + | ||
647 | + rc = armsoc_repulsion_create_ibo(repulsion); | ||
648 | + if (rc != GL_NO_ERROR) { | ||
649 | + ERROR_LOG("Failed to create index buffer: 0x%04x (%s)", | ||
650 | + rc, gles_error_str(rc)); | ||
651 | + return rc; | ||
652 | + } | ||
653 | + | ||
654 | + rc = armsoc_repulsion_create_texture(repulsion); | ||
655 | + if (rc != GL_NO_ERROR) { | ||
656 | + ERROR_LOG("Failed to create texture: 0x%04x (%s)", | ||
657 | + rc, gles_error_str(rc)); | ||
658 | + return rc; | ||
659 | + } | ||
660 | + | ||
661 | + return GL_NO_ERROR; | ||
662 | +} | ||
663 | + | ||
664 | +static void armsoc_repulsion_release_texture(struct ARMSOCRepulsion *repulsion) | ||
665 | +{ | ||
666 | + glDeleteTextures(1, &repulsion->gles.texture); | ||
667 | +} | ||
668 | + | ||
669 | +static void armsoc_repulsion_release_ibo(struct ARMSOCRepulsion *repulsion) | ||
670 | +{ | ||
671 | + glDeleteBuffers(1, &repulsion->gles.ibo); | ||
672 | +} | ||
673 | + | ||
674 | +static void armsoc_repulsion_release_vbo(struct ARMSOCRepulsion *repulsion) | ||
675 | +{ | ||
676 | + glDeleteBuffers(1, &repulsion->gles.vbo); | ||
677 | +} | ||
678 | + | ||
679 | +static void armsoc_repulsion_release_shader(struct ARMSOCRepulsion *repulsion) | ||
680 | +{ | ||
681 | + glDeleteProgram(repulsion->gles.program); | ||
682 | +} | ||
683 | + | ||
684 | +static void armsoc_repulsion_release_gles(struct ARMSOCRepulsion *repulsion) | ||
685 | +{ | ||
686 | + armsoc_repulsion_release_texture(repulsion); | ||
687 | + armsoc_repulsion_release_ibo(repulsion); | ||
688 | + armsoc_repulsion_release_vbo(repulsion); | ||
689 | + armsoc_repulsion_release_shader(repulsion); | ||
690 | +} | ||
691 | + | ||
692 | +/* ----------------------------------------------------------------------------- | ||
693 | + * EGL Functions | ||
694 | + */ | ||
695 | + | ||
696 | +static const char* egl_error_str(EGLint err) | ||
697 | +{ | ||
698 | + switch (err) { | ||
699 | + case EGL_SUCCESS: return "no error"; | ||
700 | + case EGL_NOT_INITIALIZED: return "not initialized"; | ||
701 | + case EGL_BAD_ACCESS: return "bad access"; | ||
702 | + case EGL_BAD_ALLOC: return "bad alloc"; | ||
703 | + case EGL_BAD_CONFIG: return "bad config"; | ||
704 | + case EGL_BAD_CONTEXT: return "bad context"; | ||
705 | + case EGL_BAD_CURRENT_SURFACE: return "bad current surface"; | ||
706 | + case EGL_BAD_DISPLAY: return "bad display"; | ||
707 | + case EGL_BAD_MATCH: return "bad match"; | ||
708 | + case EGL_BAD_NATIVE_PIXMAP: return "bad native pixmap"; | ||
709 | + case EGL_BAD_NATIVE_WINDOW: return "bad native window"; | ||
710 | + case EGL_BAD_PARAMETER: return "bad parameter"; | ||
711 | + case EGL_BAD_SURFACE: return "bad surface"; | ||
712 | + case EGL_CONTEXT_LOST: return "context lost"; | ||
713 | + default: return "unknowm error"; | ||
714 | + } | ||
715 | +}; | ||
716 | + | ||
717 | +static int armsoc_repulsion_init_egl(struct ARMSOCRepulsion *repulsion) | ||
718 | +{ | ||
719 | + static const EGLint config_attrs[] = { | ||
720 | + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | ||
721 | + EGL_CONFORMANT, EGL_OPENGL_ES2_BIT, | ||
722 | + EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, | ||
723 | + EGL_DEPTH_SIZE, 8, | ||
724 | + EGL_RED_SIZE, 8, | ||
725 | + EGL_GREEN_SIZE, 8, | ||
726 | + EGL_BLUE_SIZE, 8, | ||
727 | + EGL_ALPHA_SIZE, 8, | ||
728 | + EGL_NONE | ||
729 | + }; | ||
730 | + static const EGLint context_attrs[] = { | ||
731 | + EGL_CONTEXT_CLIENT_VERSION, 2, | ||
732 | + EGL_NONE | ||
733 | + }; | ||
734 | + EGLint count; | ||
735 | + EGLConfig config; | ||
736 | + | ||
737 | + repulsion->egl.display = eglGetDisplay(EGL_DEFAULT_DISPLAY); | ||
738 | + if (repulsion->egl.display == EGL_NO_DISPLAY) | ||
739 | + return eglGetError(); | ||
740 | + | ||
741 | + if(!eglInitialize(repulsion->egl.display, NULL, NULL)) | ||
742 | + return eglGetError(); | ||
743 | + | ||
744 | + if (!eglChooseConfig(repulsion->egl.display, config_attrs, &config, 1, | ||
745 | + &count)) | ||
746 | + return eglGetError(); | ||
747 | + | ||
748 | + if (!eglBindAPI(EGL_OPENGL_ES_API)) | ||
749 | + return eglGetError(); | ||
750 | + | ||
751 | + repulsion->egl.context = eglCreateContext(repulsion->egl.display, config, | ||
752 | + EGL_NO_CONTEXT, context_attrs); | ||
753 | + if (repulsion->egl.context == EGL_NO_CONTEXT) | ||
754 | + return eglGetError(); | ||
755 | + | ||
756 | + repulsion->egl.surface = eglCreatePbufferSurface(repulsion->egl.display, | ||
757 | + config, NULL); | ||
758 | + if (repulsion->egl.surface == EGL_NO_SURFACE) | ||
759 | + return eglGetError(); | ||
760 | + | ||
761 | + if (!eglMakeCurrent(repulsion->egl.display, repulsion->egl.surface, | ||
762 | + repulsion->egl.surface, repulsion->egl.context)) | ||
763 | + return eglGetError(); | ||
764 | + | ||
765 | + if (!eglSwapInterval(repulsion->egl.display, 0)) | ||
766 | + return eglGetError(); | ||
767 | + | ||
768 | + return EGL_SUCCESS; | ||
769 | +} | ||
770 | + | ||
771 | +static void armsoc_repulsion_release_egl(struct ARMSOCRepulsion *repulsion) | ||
772 | +{ | ||
773 | + if (repulsion->egl.surface != EGL_NO_SURFACE) | ||
774 | + eglDestroySurface(repulsion->egl.display, repulsion->egl.surface); | ||
775 | + | ||
776 | + if (repulsion->egl.context) | ||
777 | + eglDestroyContext(repulsion->egl.display, repulsion->egl.context); | ||
778 | + | ||
779 | + if (repulsion->egl.display) | ||
780 | + eglTerminate(repulsion->egl.display); | ||
781 | + | ||
782 | + repulsion->egl.display = EGL_NO_DISPLAY; | ||
783 | +} | ||
784 | + | ||
785 | +static EGLint armsoc_repulsion_guess_bo_format(struct armsoc_bo *bo) | ||
786 | +{ | ||
787 | + switch(armsoc_bo_bpp(bo)) { | ||
788 | + case 16: | ||
789 | + return DRM_FORMAT_RGB565; | ||
790 | + case 32: | ||
791 | + return DRM_FORMAT_ARGB8888; | ||
792 | + default: | ||
793 | + return 0; | ||
794 | + } | ||
795 | +} | ||
796 | + | ||
797 | +static EGLImageKHR | ||
798 | +armsoc_repulsion_create_egl_image(struct ARMSOCRepulsion *repulsion, | ||
799 | + struct armsoc_bo *bo) | ||
800 | +{ | ||
801 | + const EGLint attributes[] = { | ||
802 | + EGL_WIDTH, armsoc_bo_width(bo), | ||
803 | + EGL_HEIGHT, armsoc_bo_height(bo), | ||
804 | + EGL_LINUX_DRM_FOURCC_EXT, armsoc_repulsion_guess_bo_format(bo), | ||
805 | + EGL_DMA_BUF_PLANE0_FD_EXT, armsoc_bo_get_dmabuf(bo), | ||
806 | + EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, | ||
807 | + EGL_DMA_BUF_PLANE0_PITCH_EXT, armsoc_bo_pitch(bo), | ||
808 | + EGL_NONE | ||
809 | + }; | ||
810 | + | ||
811 | + return eglCreateImageKHR(repulsion->egl.display, EGL_NO_CONTEXT, | ||
812 | + EGL_LINUX_DMA_BUF_EXT, NULL, attributes); | ||
813 | +} | ||
814 | + | ||
815 | +static void | ||
816 | +armsoc_repulsion_destroy_egl_image(struct ARMSOCRepulsion *repulsion, | ||
817 | + EGLImageKHR img) | ||
818 | +{ | ||
819 | + eglDestroyImageKHR(repulsion->egl.display, img); | ||
820 | +} | ||
821 | + | ||
822 | +/* ----------------------------------------------------------------------------- | ||
823 | + * Repulsion API | ||
824 | + */ | ||
825 | + | ||
826 | +bool armsoc_repulsion_composite(struct ARMSOCRepulsion *repulsion, | ||
827 | + struct armsoc_bo *src, | ||
828 | + struct armsoc_bo *dest, | ||
829 | + float xform_matrix[3][3]) | ||
830 | +{ | ||
831 | + GLuint tex, fbo; | ||
832 | + GLenum status; | ||
833 | + EGLImageKHR dest_img, src_img; | ||
834 | + GLsizei width, height; | ||
835 | + static GLfloat proj_matrix[3][3] = { | ||
836 | + { 2.f, 0.f, 0.f }, | ||
837 | + { 0.f, 2.f, 0.f }, | ||
838 | + { -1.f, -1.f, 0.f }, | ||
839 | + }; | ||
840 | + | ||
841 | + if (!repulsion || !src || !dest) | ||
842 | + return false; | ||
843 | + | ||
844 | + dest_img = armsoc_repulsion_create_egl_image(repulsion, dest); | ||
845 | + if (dest_img == EGL_NO_IMAGE_KHR) { | ||
846 | + EGLint err = eglGetError(); | ||
847 | + ERROR_LOG("Failed to create dest EGL image: 0x%04x (%s)", | ||
848 | + err, egl_error_str(err)); | ||
849 | + return false; | ||
850 | + } | ||
851 | + src_img = armsoc_repulsion_create_egl_image(repulsion, src); | ||
852 | + if (src_img == EGL_NO_IMAGE_KHR) { | ||
853 | + EGLint err = eglGetError(); | ||
854 | + ERROR_LOG("Failed to create src EGL image: 0x%04x (%s)", | ||
855 | + err, egl_error_str(err)); | ||
856 | + armsoc_repulsion_destroy_egl_image(repulsion, dest_img); | ||
857 | + return false; | ||
858 | + } | ||
859 | + | ||
860 | + glGenTextures(1, &tex); | ||
861 | + glBindTexture(GL_TEXTURE_2D, tex); | ||
862 | + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, dest_img); | ||
863 | + | ||
864 | + glGenFramebuffers(1, &fbo); | ||
865 | + glBindFramebuffer(GL_FRAMEBUFFER, fbo); | ||
866 | + | ||
867 | + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | ||
868 | + GL_TEXTURE_2D, tex, 0); | ||
869 | + | ||
870 | + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); | ||
871 | + if (status != GL_FRAMEBUFFER_COMPLETE) { | ||
872 | + ERROR_LOG("Failed to complete framebuffer"); | ||
873 | + glDeleteFramebuffers(1, &fbo); | ||
874 | + glDeleteTextures(1, &tex); | ||
875 | + armsoc_repulsion_destroy_egl_image(repulsion, dest_img); | ||
876 | + armsoc_repulsion_destroy_egl_image(repulsion, src_img); | ||
877 | + return false; | ||
878 | + } | ||
879 | + | ||
880 | + width = armsoc_bo_width(dest); | ||
881 | + height = armsoc_bo_height(dest); | ||
882 | + proj_matrix[0][0] = 2.f / width; | ||
883 | + proj_matrix[1][1] = 2.f / height; | ||
884 | + | ||
885 | + glUniformMatrix3fv(repulsion->gles.proj_location, 1, false, | ||
886 | + &proj_matrix[0][0]); | ||
887 | + | ||
888 | + glUniformMatrix3fv(repulsion->gles.xform_location, 1, false, | ||
889 | + &xform_matrix[0][0]); | ||
890 | + | ||
891 | + glViewport(0, 0, width, height); | ||
892 | + | ||
893 | + glClearColor(0.f, 0.f, 1.f, 1.f); | ||
894 | + glClear(GL_COLOR_BUFFER_BIT); | ||
895 | + | ||
896 | + glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, src_img); | ||
897 | + | ||
898 | + repulsion->gles.vertices[0].pos[0] = 0.f; | ||
899 | + repulsion->gles.vertices[0].pos[1] = height; | ||
900 | + repulsion->gles.vertices[0].pos[2] = 1.f; | ||
901 | + repulsion->gles.vertices[0].uv[0] = 0.f; | ||
902 | + repulsion->gles.vertices[0].uv[1] = 1.f; | ||
903 | + | ||
904 | + repulsion->gles.vertices[1].pos[0] = 0.f; | ||
905 | + repulsion->gles.vertices[1].pos[1] = 0.f; | ||
906 | + repulsion->gles.vertices[1].pos[2] = 1.f; | ||
907 | + repulsion->gles.vertices[1].uv[0] = 0.f; | ||
908 | + repulsion->gles.vertices[1].uv[1] = 0.f; | ||
909 | + | ||
910 | + repulsion->gles.vertices[2].pos[0] = width; | ||
911 | + repulsion->gles.vertices[2].pos[1] = 0.f; | ||
912 | + repulsion->gles.vertices[2].pos[2] = 1.f; | ||
913 | + repulsion->gles.vertices[2].uv[0] = 1.f; | ||
914 | + repulsion->gles.vertices[2].uv[1] = 0.f; | ||
915 | + | ||
916 | + repulsion->gles.vertices[3].pos[0] = width; | ||
917 | + repulsion->gles.vertices[3].pos[1] = height; | ||
918 | + repulsion->gles.vertices[3].pos[2] = 1.f; | ||
919 | + repulsion->gles.vertices[3].uv[0] = 1.f; | ||
920 | + repulsion->gles.vertices[3].uv[1] = 1.f; | ||
921 | + | ||
922 | + glBufferData(GL_ARRAY_BUFFER, sizeof(repulsion->gles.vertices), | ||
923 | + repulsion->gles.vertices, GL_STATIC_DRAW); | ||
924 | + | ||
925 | + glVertexAttribPointer(SHADER_POSITION_ATTR_SLOT, 3, GL_FLOAT, GL_FALSE, | ||
926 | + sizeof(*repulsion->gles.vertices), (const void *)(0)); | ||
927 | + glVertexAttribPointer(SHADER_TEX_COOR_ATTR_SLOT, 2, GL_FLOAT, GL_FALSE, | ||
928 | + sizeof(*repulsion->gles.vertices), | ||
929 | + (const void *)(sizeof(repulsion->gles.vertices->pos))); | ||
930 | + | ||
931 | + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); | ||
932 | + | ||
933 | + glFinish(); | ||
934 | + | ||
935 | + glBindFramebuffer(GL_FRAMEBUFFER, 0); | ||
936 | + glDeleteFramebuffers(1, &fbo); | ||
937 | + glDeleteTextures(1, &tex); | ||
938 | + | ||
939 | + armsoc_repulsion_destroy_egl_image(repulsion, src_img); | ||
940 | + armsoc_repulsion_destroy_egl_image(repulsion, dest_img); | ||
941 | + | ||
942 | + return true; | ||
943 | +} | ||
944 | + | ||
945 | +struct ARMSOCRepulsion *armsoc_repulsion_init(void) | ||
946 | +{ | ||
947 | + int rc; | ||
948 | + struct ARMSOCRepulsion *repulsion = calloc(1, sizeof(*repulsion)); | ||
949 | + if (!repulsion) { | ||
950 | + ERROR_LOG("Out of memory"); | ||
951 | + return NULL; | ||
952 | + } | ||
953 | + | ||
954 | + rc = armsoc_repulsion_init_egl(repulsion); | ||
955 | + if (rc != EGL_SUCCESS) { | ||
956 | + ERROR_LOG("Failed to initialize EGL: 0x%04x (%s)", | ||
957 | + rc, egl_error_str(rc)); | ||
958 | + armsoc_repulsion_release(repulsion); | ||
959 | + return NULL; | ||
960 | + } | ||
961 | + | ||
962 | + rc = armsoc_repulsion_init_gles(repulsion); | ||
963 | + if (rc != GL_NO_ERROR) { | ||
964 | + ERROR_LOG("Failed to initialize GLES: 0x%04x (%s)", | ||
965 | + rc, gles_error_str(rc)); | ||
966 | + armsoc_repulsion_release(repulsion); | ||
967 | + return NULL; | ||
968 | + } | ||
969 | + | ||
970 | + INFO_LOG("Repulsion initialized"); | ||
971 | + | ||
972 | + return repulsion; | ||
973 | +} | ||
974 | + | ||
975 | +void armsoc_repulsion_release(struct ARMSOCRepulsion *repulsion) | ||
976 | +{ | ||
977 | + if (!repulsion) | ||
978 | + return; | ||
979 | + armsoc_repulsion_release_gles(repulsion); | ||
980 | + armsoc_repulsion_release_egl(repulsion); | ||
981 | + free(repulsion); | ||
982 | +} | ||
983 | diff --git a/src/armsoc_repulsion.h b/src/armsoc_repulsion.h | ||
984 | new file mode 100644 | ||
985 | index 0000000..b5e57df | ||
986 | --- /dev/null | ||
987 | +++ b/src/armsoc_repulsion.h | ||
988 | @@ -0,0 +1,67 @@ | ||
989 | +/* | ||
990 | + * Copyright (C) 2024 AMD, Inc. | ||
991 | + * | ||
992 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
993 | + * copy of this software and associated documentation files (the "Software"), | ||
994 | + * to deal in the Software without restriction, including without limitation | ||
995 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
996 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
997 | + * Software is furnished to do so, subject to the following conditions: | ||
998 | + * | ||
999 | + * The above copyright notice and this permission notice (including the next | ||
1000 | + * paragraph) shall be included in all copies or substantial portions of the | ||
1001 | + * Software. | ||
1002 | + * | ||
1003 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
1004 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
1005 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
1006 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
1007 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
1008 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
1009 | + * SOFTWARE. | ||
1010 | + * | ||
1011 | + * Author: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
1012 | + * | ||
1013 | + */ | ||
1014 | + | ||
1015 | +#ifndef ARMSOC_REPULSION_H_ | ||
1016 | +#define ARMSOC_REPULSION_H_ | ||
1017 | + | ||
1018 | +#include <stdbool.h> | ||
1019 | +#include "armsoc_dumb.h" | ||
1020 | + | ||
1021 | +struct ARMSOCRepulsion; | ||
1022 | + | ||
1023 | +/** | ||
1024 | + * Initialize armsoc repulsion compositor. | ||
1025 | + * | ||
1026 | + * Return: pointer to new ARMSOCRepulsion object on success, NULL otherwise. | ||
1027 | + */ | ||
1028 | +struct ARMSOCRepulsion *armsoc_repulsion_init(void); | ||
1029 | + | ||
1030 | +/** | ||
1031 | + * Release armsoc repulsion compositor and free all resources. | ||
1032 | + * @repulsion: pointer to previously allocated ARMSOCRepulsion object. | ||
1033 | + */ | ||
1034 | +void armsoc_repulsion_release(struct ARMSOCRepulsion *repulsion); | ||
1035 | + | ||
1036 | +/** | ||
1037 | + * Perform 2 image composition. | ||
1038 | + * @repulsion: pointer to ARMSOCRepulsion object. | ||
1039 | + * @src: source buffer object. | ||
1040 | + * @dest: destination buffer object. | ||
1041 | + * @xform_matrix: transformation matrix to apply to source image before copying | ||
1042 | + * it into destination. | ||
1043 | + * | ||
1044 | + * This function performs GPU accelerated copy of @src buffer into @dest buffer | ||
1045 | + * while applying linear transformation. | ||
1046 | + * | ||
1047 | + * Return: pointer to new ARMSOCRepulsion object on success, NULL otherwise. | ||
1048 | + */ | ||
1049 | +bool armsoc_repulsion_composite(struct ARMSOCRepulsion *repulsion, | ||
1050 | + struct armsoc_bo *src, | ||
1051 | + struct armsoc_bo *dest, | ||
1052 | + float xform_matrix[3][3]); | ||
1053 | + | ||
1054 | + | ||
1055 | +#endif // ARMSOC_REPULSION_H_ | ||
1056 | -- | ||
1057 | 2.25.1 | ||
1058 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armosc-Option-to-control-acceleration.patch b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armosc-Option-to-control-acceleration.patch new file mode 100644 index 00000000..9cc186de --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armosc-Option-to-control-acceleration.patch | |||
@@ -0,0 +1,110 @@ | |||
1 | From 83047c38b0a9e8cc535eba580ca28497f1bee544 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
3 | Date: Fri, 19 Jul 2024 14:10:22 -0700 | ||
4 | Subject: [PATCH] xf86-video-armosc: Option to control acceleration | ||
5 | |||
6 | Add xorg config option to enable / disable GPU accelerated picture | ||
7 | composition. Enable acceleration by default. | ||
8 | |||
9 | Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
10 | --- | ||
11 | man/armsoc.man | 6 ++++++ | ||
12 | src/armsoc_driver.c | 20 +++++++++++++++----- | ||
13 | src/armsoc_driver.h | 3 +++ | ||
14 | 3 files changed, 24 insertions(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/man/armsoc.man b/man/armsoc.man | ||
17 | index d85c2fa..cdeb19e 100644 | ||
18 | --- a/man/armsoc.man | ||
19 | +++ b/man/armsoc.man | ||
20 | @@ -69,6 +69,12 @@ Default: NULL | ||
21 | Use the umplock module for cross-process access synchronization. It should be only enabled for Mali400 | ||
22 | .IP | ||
23 | Default: Umplock is Disabled | ||
24 | +.TP | ||
25 | +.BI "Option \*qAccelerateComposition\*q \*q" boolean \*q | ||
26 | +Accelerate picture composition on GPU. | ||
27 | +.IP | ||
28 | +Default: Accelerated composition is Enabled | ||
29 | + | ||
30 | |||
31 | .SH DRM DEVICE SELECTION | ||
32 | |||
33 | diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c | ||
34 | index f5b8f21..15cc620 100644 | ||
35 | --- a/src/armsoc_driver.c | ||
36 | +++ b/src/armsoc_driver.c | ||
37 | @@ -110,6 +110,7 @@ enum { | ||
38 | OPTION_DRI_NUM_BUF, | ||
39 | OPTION_INIT_FROM_FBDEV, | ||
40 | OPTION_UMP_LOCK, | ||
41 | + OPTION_ACCELERATE_COMPOSITION, | ||
42 | }; | ||
43 | |||
44 | /** Supported options. */ | ||
45 | @@ -122,6 +123,8 @@ static const OptionInfoRec ARMSOCOptions[] = { | ||
46 | { OPTION_DRI_NUM_BUF, "DRI2MaxBuffers", OPTV_INTEGER, {-1}, FALSE }, | ||
47 | { OPTION_INIT_FROM_FBDEV, "InitFromFBDev", OPTV_STRING, {0}, FALSE }, | ||
48 | { OPTION_UMP_LOCK, "UMP_LOCK", OPTV_BOOLEAN, {0}, FALSE }, | ||
49 | + { OPTION_ACCELERATE_COMPOSITION, "AccelerateComposition", OPTV_BOOLEAN, | ||
50 | + {0}, FALSE }, | ||
51 | { -1, NULL, OPTV_NONE, {0}, FALSE } | ||
52 | }; | ||
53 | |||
54 | @@ -871,6 +874,10 @@ ARMSOCPreInit(ScrnInfoPtr pScrn, int flags) | ||
55 | armsocDebug = xf86ReturnOptValBool(pARMSOC->pOptionInfo, | ||
56 | OPTION_DEBUG, FALSE); | ||
57 | |||
58 | + /* Should we enable GPU accelerated picture composition? */ | ||
59 | + pARMSOC->enable_repulsion = xf86ReturnOptValBool(pARMSOC->pOptionInfo, | ||
60 | + OPTION_ACCELERATE_COMPOSITION, TRUE); | ||
61 | + | ||
62 | if (!xf86GetOptValInteger(pARMSOC->pOptionInfo, OPTION_DRI_NUM_BUF, | ||
63 | &driNumBufs)) { | ||
64 | /* Default to double buffering */ | ||
65 | @@ -1119,7 +1126,6 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) | ||
66 | struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn); | ||
67 | VisualPtr visual; | ||
68 | xf86CrtcConfigPtr xf86_config; | ||
69 | - PictureScreenPtr ps; | ||
70 | int j; | ||
71 | const char *fbdev; | ||
72 | int depth; | ||
73 | @@ -1308,12 +1314,16 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) | ||
74 | pARMSOC->lockFD = -1; | ||
75 | } | ||
76 | |||
77 | - pARMSOC->repulsion = armsoc_repulsion_init(); | ||
78 | + if (pARMSOC->enable_repulsion) { | ||
79 | + PictureScreenPtr ps; | ||
80 | + | ||
81 | + pARMSOC->repulsion = armsoc_repulsion_init(); | ||
82 | |||
83 | - ps = GetPictureScreen(pScreen); | ||
84 | - pARMSOC->composite_proc = ps->Composite; | ||
85 | + ps = GetPictureScreen(pScreen); | ||
86 | + pARMSOC->composite_proc = ps->Composite; | ||
87 | |||
88 | - ps->Composite = ARMSOCComposite; | ||
89 | + ps->Composite = ARMSOCComposite; | ||
90 | + } | ||
91 | |||
92 | TRACE_EXIT(); | ||
93 | return TRUE; | ||
94 | diff --git a/src/armsoc_driver.h b/src/armsoc_driver.h | ||
95 | index 20b0f80..27e978e 100644 | ||
96 | --- a/src/armsoc_driver.h | ||
97 | +++ b/src/armsoc_driver.h | ||
98 | @@ -185,6 +185,9 @@ struct ARMSOCRec { | ||
99 | * driNumBufs if early display enabled, otherwise driNumBufs-1 */ | ||
100 | unsigned int swap_chain_size; | ||
101 | |||
102 | + /* Enable GPU accelerated picture compositor? */ | ||
103 | + Bool enable_repulsion; | ||
104 | + | ||
105 | /* GPU accelerated picture compositor, AKA Repulsion */ | ||
106 | struct ARMSOCRepulsion *repulsion; | ||
107 | |||
108 | -- | ||
109 | 2.25.1 | ||
110 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armsoc-Add-shadow-buffer-hooks.patch b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armsoc-Add-shadow-buffer-hooks.patch new file mode 100644 index 00000000..8a1a8ca7 --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-xf86-video-armsoc-Add-shadow-buffer-hooks.patch | |||
@@ -0,0 +1,141 @@ | |||
1 | From 8c62932a848c3c9eef8b663a24d90026687d5b02 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
3 | Date: Thu, 13 Jun 2024 17:37:46 -0700 | ||
4 | Subject: [PATCH] xf86-video-armsoc: Add shadow buffer hooks | ||
5 | |||
6 | Add shadow buffer management callbacks. These callbacks are required for | ||
7 | RandR extension to operate. Implement the shadow buffer as a dumb DRM | ||
8 | framebuffer. Use the shadow buffer as page flip souce. Fix armsoc_dri2.c | ||
9 | file mode (drop exec bits). | ||
10 | |||
11 | Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
12 | --- | ||
13 | src/armsoc_dri2.c | 3 ++ | ||
14 | src/armsoc_driver.h | 3 ++ | ||
15 | src/drmmode_display.c | 65 +++++++++++++++++++++++++++++++++++++++++++ | ||
16 | 3 files changed, 71 insertions(+) | ||
17 | mode change 100755 => 100644 src/armsoc_dri2.c | ||
18 | |||
19 | diff --git a/src/armsoc_dri2.c b/src/armsoc_dri2.c | ||
20 | old mode 100755 | ||
21 | new mode 100644 | ||
22 | index dc502e4..af5d074 | ||
23 | --- a/src/armsoc_dri2.c | ||
24 | +++ b/src/armsoc_dri2.c | ||
25 | @@ -853,6 +853,9 @@ ARMSOCDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw, | ||
26 | (armsoc_bo_height(src_bo) == armsoc_bo_height(dst_bo)); | ||
27 | |||
28 | if (do_flip) { | ||
29 | + if (pARMSOC->shadow) | ||
30 | + src_fb_id = armsoc_bo_get_fb(pARMSOC->shadow); | ||
31 | + | ||
32 | DEBUG_MSG("FLIPPING: FB%d -> FB%d", src_fb_id, dst_fb_id); | ||
33 | cmd->type = DRI2_FLIP_COMPLETE; | ||
34 | |||
35 | diff --git a/src/armsoc_driver.h b/src/armsoc_driver.h | ||
36 | index ef2836f..eae76ca 100644 | ||
37 | --- a/src/armsoc_driver.h | ||
38 | +++ b/src/armsoc_driver.h | ||
39 | @@ -149,6 +149,9 @@ struct ARMSOCRec { | ||
40 | /** Scan-out buffer. */ | ||
41 | struct armsoc_bo *scanout; | ||
42 | |||
43 | + /** Rotation shadow buffer */ | ||
44 | + struct armsoc_bo *shadow; | ||
45 | + | ||
46 | /** Pointer to the options for this screen. */ | ||
47 | OptionInfoPtr pOptionInfo; | ||
48 | |||
49 | diff --git a/src/drmmode_display.c b/src/drmmode_display.c | ||
50 | index 39fa75c..f054b3a 100644 | ||
51 | --- a/src/drmmode_display.c | ||
52 | +++ b/src/drmmode_display.c | ||
53 | @@ -333,6 +333,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, | ||
54 | goto cleanup; | ||
55 | } | ||
56 | |||
57 | + if (pARMSOC->shadow) | ||
58 | + fb_id = armsoc_bo_get_fb(pARMSOC->shadow); | ||
59 | + | ||
60 | if (crtc->funcs->gamma_set) | ||
61 | crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, | ||
62 | crtc->gamma_blue, crtc->gamma_size); | ||
63 | @@ -860,6 +863,65 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, | ||
64 | } | ||
65 | #endif | ||
66 | |||
67 | +static void* | ||
68 | +drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) | ||
69 | +{ | ||
70 | + ScrnInfoPtr pScrn = crtc->scrn; | ||
71 | + struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn); | ||
72 | + struct armsoc_bo *bo; | ||
73 | + int ret; | ||
74 | + | ||
75 | + bo = armsoc_bo_new_with_dim(pARMSOC->dev, width, height, | ||
76 | + pScrn->bitsPerPixel, pScrn->bitsPerPixel, ARMSOC_BO_SCANOUT); | ||
77 | + if (!bo) | ||
78 | + return NULL; | ||
79 | + | ||
80 | + /* We will use this bo as a scanout, so add it as a framebuffer */ | ||
81 | + ret = armsoc_bo_add_fb(bo); | ||
82 | + if (ret) { | ||
83 | + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, | ||
84 | + "failed to add framebuffer: %s\n", strerror(-ret)); | ||
85 | + armsoc_bo_unreference(bo); | ||
86 | + return NULL; | ||
87 | + } | ||
88 | + | ||
89 | + pARMSOC->shadow = bo; | ||
90 | + | ||
91 | + return bo; | ||
92 | +} | ||
93 | + | ||
94 | +static PixmapPtr | ||
95 | +drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) | ||
96 | +{ | ||
97 | + ScrnInfoPtr pScrn = crtc->scrn; | ||
98 | + ScreenPtr pScreen = pScrn->pScreen; | ||
99 | + struct armsoc_bo *bo = data; | ||
100 | + PixmapPtr pixmap; | ||
101 | + | ||
102 | + pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, armsoc_bo_depth(bo), 0); | ||
103 | + if (!pixmap) { | ||
104 | + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "failed to create pixmap.\n"); | ||
105 | + return NULL; | ||
106 | + } | ||
107 | + (*pScreen->ModifyPixmapHeader)(pixmap, armsoc_bo_width(bo), | ||
108 | + armsoc_bo_height(bo), armsoc_bo_depth(bo), armsoc_bo_bpp(bo), | ||
109 | + armsoc_bo_pitch(bo), armsoc_bo_map(bo)); | ||
110 | + | ||
111 | + return pixmap; | ||
112 | +} | ||
113 | + | ||
114 | +static void | ||
115 | +drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) | ||
116 | +{ | ||
117 | + ScrnInfoPtr pScrn = crtc->scrn; | ||
118 | + struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn); | ||
119 | + struct armsoc_bo *bo = data; | ||
120 | + | ||
121 | + armsoc_bo_unreference(bo); | ||
122 | + | ||
123 | + pARMSOC->shadow = NULL; | ||
124 | +} | ||
125 | + | ||
126 | static const xf86CrtcFuncsRec drmmode_crtc_funcs = { | ||
127 | .dpms = drmmode_crtc_dpms, | ||
128 | .set_mode_major = drmmode_set_mode_major, | ||
129 | @@ -870,6 +932,9 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { | ||
130 | #if 1 == ARMSOC_SUPPORT_GAMMA | ||
131 | .gamma_set = drmmode_gamma_set, | ||
132 | #endif | ||
133 | + .shadow_allocate = drmmode_shadow_allocate, | ||
134 | + .shadow_create = drmmode_shadow_create, | ||
135 | + .shadow_destroy = drmmode_shadow_destroy, | ||
136 | }; | ||
137 | |||
138 | |||
139 | -- | ||
140 | 2.25.1 | ||
141 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend index f7b52f58..9f8af267 100644 --- a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend +++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend | |||
@@ -2,4 +2,12 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/xf86-video-armsoc:" | |||
2 | 2 | ||
3 | SRC_URI:append = " file://0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch \ | 3 | SRC_URI:append = " file://0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch \ |
4 | file://0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch \ | 4 | file://0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch \ |
5 | " | 5 | file://0001-xf86-video-armsoc-Add-shadow-buffer-hooks.patch \ |
6 | " | ||
7 | EXTRA_MALI400_SRC = " file://0001-xf86-video-armosc-Accelerate-picture-composition.patch \ | ||
8 | file://0001-xf86-video-armosc-Option-to-control-acceleration.patch \ | ||
9 | " | ||
10 | SRC_URI:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${EXTRA_MALI400_SRC}', '', d)}" | ||
11 | |||
12 | DEPENDS:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' libmali-xlnx', '', d)}" | ||
13 | |||
diff --git a/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper_git.bbappend b/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper_git.bbappend index 8a2b7a46..6de745a5 100644 --- a/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper_git.bbappend +++ b/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper_git.bbappend | |||
@@ -1,9 +1,9 @@ | |||
1 | SRC_URI = "git://github.com/devicetree-org/lopper.git;branch=v0.2024.x;protocol=https" | 1 | SRC_URI = "git://github.com/devicetree-org/lopper.git;branch=master;protocol=https" |
2 | SRCREV = "4fb08575157d7712e0cd50e9e9c07620bc9f8b4b" | 2 | SRCREV = "c0facd087263a24a83f7fad917884348db03175d" |
3 | 3 | ||
4 | FILESEXTRAPATHS:prepend := "${THISDIR}/lopper:" | 4 | FILESEXTRAPATHS:prepend := "${THISDIR}/lopper:" |
5 | 5 | ||
6 | BASEVERSION = "1.1.0" | 6 | BASEVERSION = "1.2.0" |
7 | 7 | ||
8 | RDEPENDS:${PN} += " \ | 8 | RDEPENDS:${PN} += " \ |
9 | python3-ruamel-yaml \ | 9 | python3-ruamel-yaml \ |
diff --git a/meta-xilinx-core/gen-machine-conf b/meta-xilinx-core/gen-machine-conf | |||
Subproject e3968c5d6b1d02b2c1fa51de838f0757bca1c16 | Subproject 3e691e28bf47876fb7e0c4be3c62be6b9d46bf8 | ||
diff --git a/meta-xilinx-core/lib/devtool/boot-jtag.py b/meta-xilinx-core/lib/devtool/boot-jtag.py index 247851ec..2d8a7d8f 100644 --- a/meta-xilinx-core/lib/devtool/boot-jtag.py +++ b/meta-xilinx-core/lib/devtool/boot-jtag.py | |||
@@ -8,12 +8,9 @@ | |||
8 | # yocto generated images on HW via jtag boot mode. | 8 | # yocto generated images on HW via jtag boot mode. |
9 | 9 | ||
10 | import os | 10 | import os |
11 | import logging | ||
12 | import argparse | ||
13 | from devtool import setup_tinfoil, parse_recipe, DevtoolError | ||
14 | import yaml | ||
15 | import sys | ||
16 | import glob | 11 | import glob |
12 | import logging | ||
13 | from devtool import setup_tinfoil | ||
17 | 14 | ||
18 | logger = logging.getLogger('devtool') | 15 | logger = logging.getLogger('devtool') |
19 | 16 | ||
@@ -24,8 +21,8 @@ def bootjtag(args, config, basepath, workspace): | |||
24 | print('\nINFO: Please specify the target image name. \n\nExample: --image core-image-minimal or petalinux-image-minimal') | 21 | print('\nINFO: Please specify the target image name. \n\nExample: --image core-image-minimal or petalinux-image-minimal') |
25 | return | 22 | return |
26 | 23 | ||
27 | # Get required boot variables | ||
28 | tinfoil = setup_tinfoil(basepath=basepath) | 24 | tinfoil = setup_tinfoil(basepath=basepath) |
25 | # Get required boot variables | ||
29 | try: | 26 | try: |
30 | rd = tinfoil.parse_recipe('u-boot-xlnx-scr') | 27 | rd = tinfoil.parse_recipe('u-boot-xlnx-scr') |
31 | deploy_dir = rd.getVar('DEPLOY_DIR_IMAGE') | 28 | deploy_dir = rd.getVar('DEPLOY_DIR_IMAGE') |
@@ -39,6 +36,7 @@ def bootjtag(args, config, basepath, workspace): | |||
39 | rootfs_load_addr = rd.getVar('RAMDISK_IMAGE_ADDRESS') | 36 | rootfs_load_addr = rd.getVar('RAMDISK_IMAGE_ADDRESS') |
40 | machine_features = rd.getVar('MACHINE_FEATURES') | 37 | machine_features = rd.getVar('MACHINE_FEATURES') |
41 | boot_mode = rd.getVar('BOOTMODE') | 38 | boot_mode = rd.getVar('BOOTMODE') |
39 | image_name_suffix = rd.getVar('IMAGE_NAME_SUFFIX') | ||
42 | finally: | 40 | finally: |
43 | tinfoil.shutdown() | 41 | tinfoil.shutdown() |
44 | 42 | ||
@@ -99,7 +97,7 @@ def bootjtag(args, config, basepath, workspace): | |||
99 | data['kernel'] = os.path.join(deploy_dir, kernel_img_name) | 97 | data['kernel'] = os.path.join(deploy_dir, kernel_img_name) |
100 | 98 | ||
101 | if not args.norootfs: | 99 | if not args.norootfs: |
102 | data['rfs'] = os.path.join(deploy_dir, args.image + '-' + machine + '.cpio.gz.u-boot') | 100 | data['rfs'] = os.path.join(deploy_dir, args.image + '-' + machine + image_name_suffix + '.cpio.gz.u-boot') |
103 | 101 | ||
104 | # Check if all the required boot images exists | 102 | # Check if all the required boot images exists |
105 | for key in data: | 103 | for key in data: |
@@ -258,19 +256,19 @@ def bootjtag(args, config, basepath, workspace): | |||
258 | 256 | ||
259 | def register_commands(subparsers, context): | 257 | def register_commands(subparsers, context): |
260 | """Register devtool subcommands from this plugin""" | 258 | """Register devtool subcommands from this plugin""" |
261 | parser_bootjtag = subparsers.add_parser('boot-jtag', | 259 | parser_bootjtag = subparsers.add_parser('boot-jtag', |
262 | help='Script to deploy target images on HW via JTAG boot mode.', | 260 | help='Script to deploy target images on HW via JTAG boot mode.', |
263 | description='Script to deploy target images on HW via JTAG boot mode. \ | 261 | description='Script to deploy target images on HW via JTAG boot mode. \ |
264 | Example command: MACHINE=zcu102-zynqmp devtool boot-jtag --image ${image_name} --hw_server ${hw_server}') | 262 | Example command: MACHINE=zcu102-zynqmp devtool boot-jtag --image ${image_name} --hw_server ${hw_server}') |
265 | required = parser_bootjtag.add_argument_group('required arguments') | 263 | required = parser_bootjtag.add_argument_group('required arguments') |
266 | required.add_argument('--image', | 264 | required.add_argument('--image', |
267 | help='Specify target image name. Example: core-image-minimal or petalinux-image-minimal') | 265 | help='Specify target image name. Example: core-image-minimal or petalinux-image-minimal') |
268 | parser_bootjtag.add_argument('--hw_server', nargs='?', default='TCP:localhost:3121', | 266 | parser_bootjtag.add_argument('--hw_server', nargs='?', default='TCP:localhost:3121', |
269 | help='URL description of hw_server/TCF agent and port number. (default: %(default)s) \ | 267 | help='URL description of hw_server/TCF agent and port number. (default: %(default)s) \ |
270 | Example: --hw_server TCP:puffball12:3121') | 268 | Example: --hw_server TCP:puffball12:3121') |
271 | 269 | ||
272 | parser_bootjtag.add_argument('-v', '--verbose', | 270 | parser_bootjtag.add_argument('-v', '--verbose', |
273 | help='verbose mode', action="store_true") | 271 | help='verbose mode', action="store_true") |
274 | parser_bootjtag.add_argument('-n', '--norootfs', | 272 | parser_bootjtag.add_argument('-n', '--norootfs', |
275 | help='Don\'t include rootfs', action='store_true') | 273 | help='Don\'t include rootfs', action='store_true') |
276 | parser_bootjtag.set_defaults(func=bootjtag, no_workspace=True) | 274 | parser_bootjtag.set_defaults(func=bootjtag, no_workspace=True) |
diff --git a/meta-xilinx-core/recipes-apps/image-update/image-update_1.1.bb b/meta-xilinx-core/recipes-apps/image-update/image-update_1.3.bb index 63718813..828a3ca1 100644 --- a/meta-xilinx-core/recipes-apps/image-update/image-update_1.1.bb +++ b/meta-xilinx-core/recipes-apps/image-update/image-update_1.3.bb | |||
@@ -6,9 +6,9 @@ SUMMARY = "Image update is used to update alternate image on compatible firmware | |||
6 | LICENSE = "MIT" | 6 | LICENSE = "MIT" |
7 | LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSES/MIT;md5=2ac09a7a37dd6ee0ba23ce497d57d09b" | 7 | LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSES/MIT;md5=2ac09a7a37dd6ee0ba23ce497d57d09b" |
8 | 8 | ||
9 | BRANCH = "xlnx_rel_v2024.1" | 9 | BRANCH = "master" |
10 | SRC_URI = "git://github.com/Xilinx/linux-image_update.git;branch=${BRANCH};protocol=https" | 10 | SRC_URI = "git://github.com/Xilinx/linux-image_update.git;branch=${BRANCH};protocol=https" |
11 | SRCREV = "a68308f329578d3585fd335071a9184aa7f46d2e" | 11 | SRCREV = "1bd7d7405b484d808176c6e711691a846c18b4f0" |
12 | 12 | ||
13 | RDEPENDS:${PN} += "freeipmi" | 13 | RDEPENDS:${PN} += "freeipmi" |
14 | 14 | ||
diff --git a/meta-xilinx-core/recipes-apps/raft/python-async.inc b/meta-xilinx-core/recipes-apps/raft/python-async.inc new file mode 100644 index 00000000..fde86460 --- /dev/null +++ b/meta-xilinx-core/recipes-apps/raft/python-async.inc | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Python framework to process interdependent tasks in a pool of workers" | ||
2 | HOMEPAGE = "http://github.com/gitpython-developers/async" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e" | ||
6 | |||
7 | inherit pypi | ||
8 | |||
9 | SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b" | ||
10 | SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051" | ||
11 | |||
12 | RDEPENDS:${PN} += "${PYTHON_PN}-threading" | ||
13 | |||
14 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta-xilinx-core/recipes-apps/raft/python3-async_0.6.2.bb b/meta-xilinx-core/recipes-apps/raft/python3-async_0.6.2.bb new file mode 100644 index 00000000..0da5fdec --- /dev/null +++ b/meta-xilinx-core/recipes-apps/raft/python3-async_0.6.2.bb | |||
@@ -0,0 +1,2 @@ | |||
1 | inherit setuptools3 | ||
2 | require python-async.inc | ||
diff --git a/meta-xilinx-core/recipes-apps/raft/raft_2024.1.bb b/meta-xilinx-core/recipes-apps/raft/raft_2024.1.bb new file mode 100644 index 00000000..a287d8ce --- /dev/null +++ b/meta-xilinx-core/recipes-apps/raft/raft_2024.1.bb | |||
@@ -0,0 +1,65 @@ | |||
1 | SUMMARY = "RAFT python application" | ||
2 | LICENSE = "MIT & BSD-3-Clause" | ||
3 | LIC_FILES_CHKSUM = " \ | ||
4 | file://${WORKDIR}/git/LICENSE;md5=cc21c526211d34984839aa67dd16f172 \ | ||
5 | file://${WORKDIR}/git/docs/LICENSE;md5=d8f0ffdbc8d019bc821a5a07bdca1406 \ | ||
6 | " | ||
7 | BRANCH = "2024.1" | ||
8 | SRC_URI = "git://github.com/Xilinx/RAFT;protocol=https;branch=${BRANCH}" | ||
9 | SRCREV = "87ea8f4c5ac52fcbc465f41e681fc77aaee9a285" | ||
10 | |||
11 | inherit update-rc.d systemd | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | COMPATIBLE_MACHINE = "^$" | ||
15 | COMPATIBLE_MACHINE:zcu208-zynqmp = "${MACHINE}" | ||
16 | COMPATIBLE_MACHINE:zcu216-zynqmp = "${MACHINE}" | ||
17 | COMPATIBLE_MACHINE:system-controller = "${MACHINE}" | ||
18 | |||
19 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
20 | |||
21 | INITSCRIPT_NAME = "raft-startup" | ||
22 | INITSCRIPT_PARAMS = "start 99 S ." | ||
23 | |||
24 | SYSTEMD_PACKAGES = "${PN}" | ||
25 | SYSTEMD_SERVICE:${PN} = "raft-startup.service" | ||
26 | SYSTEMD_AUTO_ENABLE:${PN}="enable" | ||
27 | |||
28 | DEPENDS += "libmetal" | ||
29 | |||
30 | RDEPENDS:${PN} += "\ | ||
31 | python3 \ | ||
32 | python3-pyro4 \ | ||
33 | python3-cffi \ | ||
34 | python3-serpent \ | ||
35 | bash \ | ||
36 | " | ||
37 | |||
38 | PACKAGECONFIG[raftnotebooks] = "enabled,disabled,,packagegroup-xilinx-jupyter" | ||
39 | PACKAGECONFIG[raftstartup] = "enabled,disabled,,librfdc librfclk libmetal" | ||
40 | PACKAGECONFIG[raftstartupsc] = "enabled,disabled,,python3-psutil python3-periphery" | ||
41 | |||
42 | do_install() { | ||
43 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
44 | SYSCONFDIR=${D}${sysconfdir}/init.d/ | ||
45 | else | ||
46 | SYSCONFDIR='' | ||
47 | fi | ||
48 | oe_runmake install DESTDIR=${D}\ | ||
49 | NOTEBOOKS=${@bb.utils.contains('PACKAGECONFIG','raftnotebooks','enabled','', d)}\ | ||
50 | STARTUPSC=${@bb.utils.contains('PACKAGECONFIG','raftstartupsc','enabled','',d)}\ | ||
51 | STARTUP=${@bb.utils.contains('PACKAGECONFIG','raftstartup','enabled','',d)}\ | ||
52 | BINDIR=${D}${bindir}\ | ||
53 | SYSTEM_UNIT_DIR=${D}${systemd_system_unitdir}\ | ||
54 | SYSCONF_DIR=${SYSCONFDIR} | ||
55 | } | ||
56 | |||
57 | PACKAGECONFIG:append:zcu208-zynqmp = "raftnotebooks raftstartup" | ||
58 | PACKAGECONFIG:append:zcu216-zynqmp = "raftnotebooks raftstartup" | ||
59 | PACKAGECONFIG:append:system-controller = "raftstartupsc" | ||
60 | |||
61 | FILES:${PN} += " \ | ||
62 | ${datadir}/raft/* \ | ||
63 | ${datadir}/notebooks \ | ||
64 | ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${sysconfdir}/*', '', d)} \ | ||
65 | " | ||
diff --git a/meta-xilinx-core/recipes-bsp/ai-engine/ai-engine-driver_3.6.bb b/meta-xilinx-core/recipes-bsp/ai-engine/ai-engine-driver_3.6.bb new file mode 100644 index 00000000..a99f296a --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/ai-engine/ai-engine-driver_3.6.bb | |||
@@ -0,0 +1,40 @@ | |||
1 | SUMMARY = "Xilinx AI Engine runtime" | ||
2 | DESCRIPTION = "This library provides APIs for the runtime support of the Xilinx AI Engine IP" | ||
3 | |||
4 | require aie-rt-2024.2.inc | ||
5 | |||
6 | SECTION = "libs" | ||
7 | |||
8 | AIEDIR ?= "${S}/driver" | ||
9 | S = "${WORKDIR}/git" | ||
10 | I = "${AIEDIR}/include" | ||
11 | |||
12 | IOBACKENDS ?= "Linux" | ||
13 | |||
14 | DEPENDS = "${@bb.utils.contains('IOBACKENDS', 'metal', 'libmetal', '', d)}" | ||
15 | RDEPENDS:${PN} = "${@bb.utils.contains('IOBACKENDS', 'metal', 'libmetal', '', d)}" | ||
16 | |||
17 | PROVIDES = "libxaiengine" | ||
18 | RPROVIDES:${PN} = "libxaiengine" | ||
19 | |||
20 | # The makefile isn't ready for parallel execution at the moment | ||
21 | PARALLEL_MAKE = "-j 1" | ||
22 | |||
23 | CFLAGS += "-Wall -Wextra" | ||
24 | CFLAGS += "${@bb.utils.contains('IOBACKENDS', 'Linux', ' -D__AIELINUX__', '', d)}" | ||
25 | CFLAGS += "${@bb.utils.contains('IOBACKENDS', 'metal', ' -D__AIEMETAL__', '', d)}" | ||
26 | EXTRA_OEMAKE = "-C ${AIEDIR}/src -f Makefile.Linux CFLAGS='${CFLAGS}'" | ||
27 | |||
28 | |||
29 | do_compile(){ | ||
30 | oe_runmake | ||
31 | } | ||
32 | |||
33 | do_install(){ | ||
34 | install -d ${D}${includedir} | ||
35 | install ${I}/*.h ${D}${includedir}/ | ||
36 | install -d ${D}${includedir}/xaiengine | ||
37 | install ${I}/xaiengine/*.h ${D}${includedir}/xaiengine/ | ||
38 | install -d ${D}${libdir} | ||
39 | cp -dr ${AIEDIR}/src/*.so* ${D}${libdir} | ||
40 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/ai-engine/aie-rt-2024.2.inc b/meta-xilinx-core/recipes-bsp/ai-engine/aie-rt-2024.2.inc new file mode 100644 index 00000000..9ccc7621 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/ai-engine/aie-rt-2024.2.inc | |||
@@ -0,0 +1,11 @@ | |||
1 | SECTION = "libs" | ||
2 | |||
3 | REPO ?= "git://github.com/Xilinx/aie-rt.git;protocol=https" | ||
4 | |||
5 | BRANCH ?= "xlnx_rel_v2024.2" | ||
6 | SRCREV ?= "8845d962e5b30b576c87dcf6635fb84a90ef1e36" | ||
7 | |||
8 | LICENSE = "BSD-3-Clause" | ||
9 | LIC_FILES_CHKSUM ?= "file://license.txt;md5=04a153cae61a8a606fc79dff49c2c897" | ||
10 | |||
11 | SRC_URI = "${REPO};branch=${BRANCH}" | ||
diff --git a/meta-xilinx-core/recipes-bsp/ai-engine/aiefal_1.7.bb b/meta-xilinx-core/recipes-bsp/ai-engine/aiefal_1.7.bb new file mode 100644 index 00000000..2e60941b --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/ai-engine/aiefal_1.7.bb | |||
@@ -0,0 +1,27 @@ | |||
1 | SUMMARY = "Xilinx AI Engine FAL(Functional Abstraction Layer)" | ||
2 | DESCRIPTION = "AIE FAL provides functional abstraction APIs for runtime support of Xilinx AI Engine IP" | ||
3 | |||
4 | require aie-rt-2024.2.inc | ||
5 | |||
6 | SECTION = "devel" | ||
7 | |||
8 | XAIEFAL_DIR ?= "fal" | ||
9 | S = "${WORKDIR}/git" | ||
10 | |||
11 | IOBACKENDS ?= "Linux" | ||
12 | |||
13 | PROVIDES = "aiefal" | ||
14 | ALLOW_EMPTY:${PN} = "1" | ||
15 | |||
16 | inherit pkgconfig cmake | ||
17 | |||
18 | DEPENDS = "libxaiengine" | ||
19 | |||
20 | OECMAKE_SOURCEPATH = "${S}/${XAIEFAL_DIR}" | ||
21 | |||
22 | EXTRA_OECMAKE = "-DWITH_TESTS=OFF -DFAL_LINUX=ON " | ||
23 | EXTRA_OECMAKE:append = "${@'-DWITH_EXAMPLES=ON' if d.getVar('WITH_EXAMPLES') == 'y' else '-DWITH_EXAMPLES=OFF'}" | ||
24 | |||
25 | FILES:${PN}-demos = " \ | ||
26 | ${bindir}/* \ | ||
27 | " | ||
diff --git a/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc b/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc index 67b97613..485d3b17 100644 --- a/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc +++ b/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc | |||
@@ -75,9 +75,6 @@ EXTRA_OEMAKE:append:versal = "${@' VERSAL_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.get | |||
75 | EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" | 75 | EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" |
76 | EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" | 76 | EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" |
77 | 77 | ||
78 | ATF_PROVENCORE = "SPD=pncd SPD_PNCD_NS_IRQ=51 ZYNQMP_BL32_MEM_BASE=0x70000000 ZYNQMP_BL32_MEM_SIZE=0x0FF00000" | ||
79 | EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', 'provencore', ' ${ATF_PROVENCORE}', '', d)}" | ||
80 | |||
81 | TFA_BL33_LOAD ?= "" | 78 | TFA_BL33_LOAD ?= "" |
82 | EXTRA_OEMAKE:append = "${@' PRELOADED_BL33_BASE=${TFA_BL33_LOAD}' if d.getVar('TFA_BL33_LOAD', True) != '' else ''}" | 79 | EXTRA_OEMAKE:append = "${@' PRELOADED_BL33_BASE=${TFA_BL33_LOAD}' if d.getVar('TFA_BL33_LOAD', True) != '' else ''}" |
83 | 80 | ||
@@ -129,3 +126,19 @@ FILES:${PN} += "/boot/*.elf /boot/*.bin /boot/*.ub" | |||
129 | # Disable buildpaths QA check warnings for Versal. | 126 | # Disable buildpaths QA check warnings for Versal. |
130 | INSANE_SKIP:${PN}:append:versal = " buildpaths" | 127 | INSANE_SKIP:${PN}:append:versal = " buildpaths" |
131 | INSANE_SKIP:${PN}:append:versal-net = " buildpaths" | 128 | INSANE_SKIP:${PN}:append:versal-net = " buildpaths" |
129 | |||
130 | python() { | ||
131 | soc_family = d.getVar('SOC_FAMILY') | ||
132 | atf_console = d.getVar('ATF_CONSOLE') | ||
133 | |||
134 | # See plat/xilinx/<soc_family>/platform.mk | ||
135 | if soc_family and soc_family == "zynqmp": | ||
136 | if not atf_console in [ 'cadence', 'cadence0', 'cadence1', 'dcc' ]: | ||
137 | raise bb.parse.SkipRecipe('ATF_CONSOLE (%s) is not configured properly for ZynqMP, only cadence, cadence0, cadence1, and dcc are valid options.' % (atf_console)) | ||
138 | elif soc_family and soc_family == "versal": | ||
139 | if not atf_console in [ 'pl011', 'pl011_0', 'pl011_1', 'dcc' ]: | ||
140 | raise bb.parse.SkipRecipe('ATF_CONSOLE (%s) is not configured properly for Versal, only pl011, pl011_0, pl011_1, and dcc are valid options.' % (atf_console)) | ||
141 | elif soc_family and soc_family == "versal-net": | ||
142 | if not atf_console in [ 'pl011', 'pl011_0', 'pl011_1', 'dcc' ]: | ||
143 | raise bb.parse.SkipRecipe('ATF_CONSOLE (%s) is not configured properly for Versal-Net, only pl011, pl011_0, pl011_1, and dcc are valid options.' % (atf_console)) | ||
144 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/base-pdi/base-pdi_1.0.bb b/meta-xilinx-core/recipes-bsp/base-pdi/base-pdi_1.0.bb index f3457640..9fd9c34a 100644 --- a/meta-xilinx-core/recipes-bsp/base-pdi/base-pdi_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/base-pdi/base-pdi_1.0.bb | |||
@@ -4,6 +4,8 @@ LICENSE = "CLOSED" | |||
4 | 4 | ||
5 | PROVIDES = "virtual/base-pdi" | 5 | PROVIDES = "virtual/base-pdi" |
6 | 6 | ||
7 | INHIBIT_DEFAULT_DEPS = "1" | ||
8 | |||
7 | COMPATIBLE_MACHINE = "^$" | 9 | COMPATIBLE_MACHINE = "^$" |
8 | COMPATIBLE_MACHINE:microblaze = ".*" | 10 | COMPATIBLE_MACHINE:microblaze = ".*" |
9 | COMPATIBLE_MACHINE:versal = ".*" | 11 | COMPATIBLE_MACHINE:versal = ".*" |
diff --git a/meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb b/meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb deleted file mode 100644 index f61761f4..00000000 --- a/meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | DESCRIPTION = "Recipe to provide a bitstream via virtual/bitstream" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
5 | |||
6 | INHIBIT_DEFAULT_DEPS = "1" | ||
7 | |||
8 | # We never want to prefer this over another provider | ||
9 | DEFAULT_PREFERENCE = "-1" | ||
10 | |||
11 | PROVIDES = "virtual/bitstream" | ||
12 | |||
13 | COMPATIBLE_MACHINE = "$^" | ||
14 | COMPATIBLE_MACHINE:zynq = ".*" | ||
15 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
16 | |||
17 | # Since we're just copying, we can run any config | ||
18 | COMPATIBLE_HOST = ".*" | ||
19 | |||
20 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
21 | |||
22 | # Path where the bitstream can be found | ||
23 | BITSTREAM_PATH ?= "" | ||
24 | |||
25 | inherit deploy | ||
26 | |||
27 | do_install() { | ||
28 | if [ ! -e ${BITSTREAM_PATH} ]; then | ||
29 | echo "Unable to find BITSTREAM_PATH (${BITSTREAM_PATH})" | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | install -Dm 0644 ${BITSTREAM_PATH} ${D}/boot/. | ||
34 | } | ||
35 | |||
36 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
37 | SHOULD_DEPLOY = "${@'false' if (d.getVar('BITSTREAM_PATH')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" | ||
38 | do_deploy() { | ||
39 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
40 | if ${SHOULD_DEPLOY}; then | ||
41 | install -Dm 0644 ${BITSTREAM_PATH} ${DEPLOYDIR}/. | ||
42 | fi | ||
43 | } | ||
44 | |||
45 | def check_bitstream_vars(d): | ||
46 | # If BITSTREAM_PATH is not defined, we error and instruct the user | ||
47 | # Don't cache this, as the items on disk can change! | ||
48 | d.setVar('BB_DONT_CACHE', '1') | ||
49 | if d.getVar('BITSTREAM_PATH') and not os.path.exists(d.getVar('BITSTREAM_PATH')): | ||
50 | raise bb.parse.SkipRecipe("The expected bitstream file %s is not available.\nSee the meta-xilinx-core README.") | ||
51 | |||
52 | if not d.getVar('BITSTREAM_PATH'): | ||
53 | raise bb.parse.SkipRecipe("Something is depending on virtual/bitstream and you have not provided a bitstream using BITSTREAM_PATH variable.\n See the meta-xilinx-core README.") | ||
54 | |||
55 | python() { | ||
56 | # Need to allow bbappends to change the check | ||
57 | check_bitstream_vars(d) | ||
58 | } | ||
59 | |||
diff --git a/meta-xilinx-core/recipes-bsp/bitstream/bitstream_1.0.bb b/meta-xilinx-core/recipes-bsp/bitstream/bitstream_1.0.bb new file mode 100644 index 00000000..97965279 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/bitstream/bitstream_1.0.bb | |||
@@ -0,0 +1,76 @@ | |||
1 | DESCRIPTION = "Recipe to provide a bitstream via virtual/bitstream" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
5 | |||
6 | INHIBIT_DEFAULT_DEPS = "1" | ||
7 | |||
8 | BITSTREAM_PATH_DEPENDS ??= "" | ||
9 | DEPENDS += "${BITSTREAM_PATH_DEPENDS}" | ||
10 | |||
11 | # We never want to prefer this over another provider | ||
12 | DEFAULT_PREFERENCE = "-1" | ||
13 | |||
14 | PROVIDES = "virtual/bitstream" | ||
15 | |||
16 | COMPATIBLE_MACHINE = "$^" | ||
17 | COMPATIBLE_MACHINE:zynq = ".*" | ||
18 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
19 | |||
20 | # Since we're just copying, we can run any config | ||
21 | COMPATIBLE_HOST = ".*" | ||
22 | |||
23 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
24 | |||
25 | # Path where the bitstream can be found | ||
26 | BITSTREAM_PATH ?= "" | ||
27 | |||
28 | inherit deploy | ||
29 | |||
30 | BITSTREAM_NAME ?= "download" | ||
31 | BITSTREAM_NAME:microblaze ?= "system" | ||
32 | |||
33 | BITSTREAM_BASE_NAME ?= "${BITSTREAM_NAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" | ||
34 | |||
35 | SYSROOT_DIRS += "/boot/bitstream" | ||
36 | |||
37 | do_install() { | ||
38 | if [ ! -e ${BITSTREAM_PATH} ]; then | ||
39 | echo "Unable to find BITSTREAM_PATH (${BITSTREAM_PATH})" | ||
40 | exit 1 | ||
41 | fi | ||
42 | install -d ${D}/boot/bitstream/ | ||
43 | install -Dm 0644 ${BITSTREAM_PATH} ${D}/boot/bitstream/${BITSTREAM_BASE_NAME}.bit | ||
44 | } | ||
45 | |||
46 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
47 | SHOULD_DEPLOY = "${@'false' if (d.getVar('BITSTREAM_PATH')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" | ||
48 | do_deploy() { | ||
49 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
50 | if ${SHOULD_DEPLOY}; then | ||
51 | install -Dm 0644 ${BITSTREAM_PATH} ${DEPLOYDIR}/${BITSTREAM_BASE_NAME}.bit | ||
52 | fi | ||
53 | } | ||
54 | |||
55 | addtask deploy before do_build after do_install | ||
56 | |||
57 | FILES:${PN} += "/boot/bitstream/*.bit" | ||
58 | |||
59 | def check_bitstream_vars(d): | ||
60 | # Assuming if BITSTREAM_PATH_DEPENDS exists, that the file will be available later. | ||
61 | if not d.getVar('BITSTREAM_PATH_DEPENDS'): | ||
62 | # Don't cache this, as the items on disk can change! | ||
63 | d.setVar('BB_DONT_CACHE', '1') | ||
64 | |||
65 | # If BITSTREAM_PATH is not found or defined, we error and instruct the user | ||
66 | if not d.getVar('BITSTREAM_PATH'): | ||
67 | raise bb.parse.SkipRecipe("Something is depending on virtual/bitstream and you have not provided a bitstream using BITSTREAM_PATH variable.\n See the meta-xilinx-core README.") | ||
68 | |||
69 | if d.getVar('BITSTREAM_PATH') and not os.path.exists(d.getVar('BITSTREAM_PATH')): | ||
70 | raise bb.parse.SkipRecipe("The expected bitstream file %s is not available.\nSee the meta-xilinx-core README." % d.getVar('BITSTREAM_PATH')) | ||
71 | |||
72 | python() { | ||
73 | # Need to allow bbappends to change the check | ||
74 | check_bitstream_vars(d) | ||
75 | } | ||
76 | |||
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 | } |
diff --git a/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb index e53d21f7..b9236f55 100644 --- a/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | |||
@@ -7,6 +7,8 @@ LICENSE = "BSD" | |||
7 | 7 | ||
8 | include machine-xilinx-${SOC_FAMILY}.inc | 8 | include machine-xilinx-${SOC_FAMILY}.inc |
9 | 9 | ||
10 | BOOTBIN_INCLUDE ?= "" | ||
11 | |||
10 | inherit deploy | 12 | inherit deploy |
11 | 13 | ||
12 | # Don't allow building for microblaze MACHINE | 14 | # Don't allow building for microblaze MACHINE |
@@ -18,10 +20,11 @@ COMPATIBLE_MACHINE:versal-net = ".*" | |||
18 | 20 | ||
19 | PROVIDES = "virtual/boot-bin" | 21 | PROVIDES = "virtual/boot-bin" |
20 | 22 | ||
21 | DEPENDS += "bootgen-native" | 23 | DEPENDS += "bootgen-native u-boot-xlnx-scr" |
22 | 24 | ||
23 | # There is no bitstream recipe, so really depend on virtual/bitstream | 25 | # There is no bitstream recipe, so really depend on virtual/bitstream |
24 | DEPENDS += "${@(d.getVar('BIF_PARTITION_ATTR') or "").replace('bitstream', 'virtual/bitstream')}" | 26 | # We need to refer to virtual/arm-trusted-firmware and not arm-trusted-firmware as there may be multiple providers |
27 | DEPENDS += "${@(d.getVar('BIF_PARTITION_ATTR') or "").replace('bitstream', 'virtual/bitstream').replace('arm-trusted-firmware', 'virtual/arm-trusted-firmware')}" | ||
25 | 28 | ||
26 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 29 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
27 | 30 | ||
@@ -45,8 +48,17 @@ BOOTGEN_ARCH_DEFAULT:versal-net = "versalnet" | |||
45 | BOOTGEN_ARCH ?= "${BOOTGEN_ARCH_DEFAULT}" | 48 | BOOTGEN_ARCH ?= "${BOOTGEN_ARCH_DEFAULT}" |
46 | BOOTGEN_EXTRA_ARGS ?= "" | 49 | BOOTGEN_EXTRA_ARGS ?= "" |
47 | 50 | ||
51 | QEMU_FLASH_TYPE ?= "qspi" | ||
52 | BOOTSCR_DEP = '' | ||
53 | BOOTSCR_DEP:versal = 'u-boot-xlnx-scr:do_deploy' | ||
54 | BOOTSCR_DEP:versal-net = 'u-boot-xlnx-scr:do_deploy' | ||
55 | |||
56 | BIF_BITSTREAM_ATTR ?= "${@bb.utils.contains('MACHINE_FEATURES', 'fpga-overlay', '', 'bitstream', d)}" | ||
57 | |||
48 | do_patch[noexec] = "1" | 58 | do_patch[noexec] = "1" |
49 | 59 | ||
60 | do_compile[depends] .= " ${BOOTSCR_DEP}" | ||
61 | |||
50 | def create_bif(config, attrflags, attrimage, ids, common_attr, biffd, d): | 62 | def create_bif(config, attrflags, attrimage, ids, common_attr, biffd, d): |
51 | arch = d.getVar("SOC_FAMILY") | 63 | arch = d.getVar("SOC_FAMILY") |
52 | bb.error("create_bif function not defined for arch: %s" % (arch)) | 64 | bb.error("create_bif function not defined for arch: %s" % (arch)) |
@@ -177,6 +189,18 @@ do_compile() { | |||
177 | fi | 189 | fi |
178 | } | 190 | } |
179 | 191 | ||
192 | do_compile:append:versal() { | ||
193 | dd if=/dev/zero bs=256M count=1 > ${B}/qemu-${QEMU_FLASH_TYPE}.bin | ||
194 | dd if=${B}/BOOT.bin of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=0 conv=notrunc | ||
195 | dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=66584576 conv=notrunc | ||
196 | } | ||
197 | |||
198 | do_compile:append:versal-net() { | ||
199 | dd if=/dev/zero bs=256M count=1 > ${B}/qemu-${QEMU_FLASH_TYPE}.bin | ||
200 | dd if=${B}/BOOT.bin of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=0 conv=notrunc | ||
201 | dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=66584576 conv=notrunc | ||
202 | } | ||
203 | |||
180 | do_install() { | 204 | do_install() { |
181 | install -d ${D}/boot | 205 | install -d ${D}/boot |
182 | install -m 0644 ${B}/BOOT.bin ${D}/boot/BOOT.bin | 206 | install -m 0644 ${B}/BOOT.bin ${D}/boot/BOOT.bin |
@@ -184,7 +208,7 @@ do_install() { | |||
184 | 208 | ||
185 | inherit image-artifact-names | 209 | inherit image-artifact-names |
186 | 210 | ||
187 | QEMUQSPI_BASE_NAME ?= "QEMU_qspi-${MACHINE}${IMAGE_VERSION_SUFFIX}" | 211 | QEMU_FLASH_IMAGE_NAME ?= "qemu-${QEMU_FLASH_TYPE}-${MACHINE}${IMAGE_VERSION_SUFFIX}" |
188 | 212 | ||
189 | BOOTBIN_BASE_NAME ?= "BOOT-${MACHINE}${IMAGE_VERSION_SUFFIX}" | 213 | BOOTBIN_BASE_NAME ?= "BOOT-${MACHINE}${IMAGE_VERSION_SUFFIX}" |
190 | 214 | ||
@@ -199,12 +223,18 @@ do_deploy:append:versal () { | |||
199 | 223 | ||
200 | install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin | 224 | install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin |
201 | ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin | 225 | ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin |
226 | |||
227 | install -m 0644 ${B}/qemu-${QEMU_FLASH_TYPE}.bin ${DEPLOYDIR}/${QEMU_FLASH_IMAGE_NAME}.bin | ||
228 | ln -sf ${QEMU_FLASH_IMAGE_NAME}.bin ${DEPLOYDIR}/qemu-${QEMU_FLASH_TYPE}-${MACHINE}.bin | ||
202 | } | 229 | } |
203 | 230 | ||
204 | do_deploy:append:versal-net () { | 231 | do_deploy:append:versal-net () { |
205 | 232 | ||
206 | install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin | 233 | install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin |
207 | ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin | 234 | ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin |
235 | |||
236 | install -m 0644 ${B}/qemu-${QEMU_FLASH_TYPE}.bin ${DEPLOYDIR}/${QEMU_FLASH_IMAGE_NAME}.bin | ||
237 | ln -sf ${QEMU_FLASH_IMAGE_NAME}.bin ${DEPLOYDIR}/qemu-${QEMU_FLASH_TYPE}-${MACHINE}.bin | ||
208 | } | 238 | } |
209 | 239 | ||
210 | FILES:${PN} += "/boot/BOOT.bin" | 240 | FILES:${PN} += "/boot/BOOT.bin" |
diff --git a/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb b/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb index b52c7853..17d8af8c 100644 --- a/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb | |||
@@ -37,4 +37,4 @@ do_deploy() { | |||
37 | install -m 0644 ${B}/pmc_cdo.bin ${DEPLOYDIR}/pmc_cdo.bin | 37 | install -m 0644 ${B}/pmc_cdo.bin ${DEPLOYDIR}/pmc_cdo.bin |
38 | } | 38 | } |
39 | 39 | ||
40 | addtask do_deploy after do_compile | 40 | addtask deploy before do_build after do_install |
diff --git a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb index 4783a329..fbe85f96 100644 --- a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb +++ b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | |||
@@ -23,6 +23,9 @@ inherit devicetree image-artifact-names | |||
23 | SYSTEM_DTFILE ??= "" | 23 | SYSTEM_DTFILE ??= "" |
24 | CONFIG_DTFILE ??= "${SYSTEM_DTFILE}" | 24 | CONFIG_DTFILE ??= "${SYSTEM_DTFILE}" |
25 | 25 | ||
26 | SYSTEM_DTFILE_DEPENDS ??= "" | ||
27 | DEPENDS += "${SYSTEM_DTFILE_DEPENDS}" | ||
28 | |||
26 | BASE_DTS ?= "${@os.path.splitext(os.path.basename(d.getVar('CONFIG_DTFILE') or ''))[0] or 'system-top'}" | 29 | BASE_DTS ?= "${@os.path.splitext(os.path.basename(d.getVar('CONFIG_DTFILE') or ''))[0] or 'system-top'}" |
27 | 30 | ||
28 | EXTRA_DT_FILES ?= "" | 31 | EXTRA_DT_FILES ?= "" |
@@ -31,12 +34,12 @@ EXTRA_DTFILES_BUNDLE ?= "" | |||
31 | UBOOT_DT_FILES ?= "" | 34 | UBOOT_DT_FILES ?= "" |
32 | UBOOT_DTFILE_PREFIX ?= "system-top" | 35 | UBOOT_DTFILE_PREFIX ?= "system-top" |
33 | UBOOT_DTFILES_BUNDLE ?= "" | 36 | UBOOT_DTFILES_BUNDLE ?= "" |
34 | EXTRA_OVERLAYS ?= "" | 37 | EXTRA_DT_INCLUDE_FILES ?= "" |
35 | 38 | ||
36 | SYSTEM_DTFILE[doc] = "System Device Tree which accepts at 0...1 dts file" | 39 | SYSTEM_DTFILE[doc] = "System Device Tree which accepts at 0...1 dts file" |
37 | CONFIG_DTFILE[doc] = "Domain Specific Device Tree which accepts 0...1 dts file" | 40 | CONFIG_DTFILE[doc] = "Domain Specific Device Tree which accepts 0...1 dts file" |
38 | EXTRA_DT_FILES[doc] = "Add extra files to DT_FILES_PATH, it accepts 1...n dtsi files and adds to SRC_URI" | 41 | EXTRA_DT_FILES[doc] = "Add extra files to DT_FILES_PATH, it accepts 1...n dtsi files and adds to SRC_URI" |
39 | EXTRA_OVERLAYS[doc] = "Add extra files to DT_FILES_PATH and adds a #include for each to the BASE_DTS, it access 1..n dtsi files and adds to SRC_URI" | 42 | EXTRA_DT_INCLUDE_FILES[doc] = "Add extra files to DT_FILES_PATH and adds a #include for each to the BASE_DTS, it access 1..n dtsi files and adds to SRC_URI" |
40 | 43 | ||
41 | # There should only be ONE CONFIG_DTFILE listed | 44 | # There should only be ONE CONFIG_DTFILE listed |
42 | # These need to be passed in from global, not from a bbappend | 45 | # These need to be passed in from global, not from a bbappend |
@@ -44,7 +47,7 @@ FILESEXTRAPATHS:prepend := "${@'%s:' % os.path.dirname(d.getVar('CONFIG_DTFILE') | |||
44 | SRC_URI:append := " ${@'file://%s' % os.path.basename(d.getVar('CONFIG_DTFILE') or '') if (d.getVar('CONFIG_DTFILE')) else ''}" | 47 | SRC_URI:append := " ${@'file://%s' % os.path.basename(d.getVar('CONFIG_DTFILE') or '') if (d.getVar('CONFIG_DTFILE')) else ''}" |
45 | 48 | ||
46 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_DT_FILES') or "").split()])}" | 49 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_DT_FILES') or "").split()])}" |
47 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_OVERLAYS') or "").split()])}" | 50 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_DT_INCLUDE_FILES') or "").split()])}" |
48 | 51 | ||
49 | COMPATIBLE_MACHINE:zynq = ".*" | 52 | COMPATIBLE_MACHINE:zynq = ".*" |
50 | COMPATIBLE_MACHINE:zynqmp = ".*" | 53 | COMPATIBLE_MACHINE:zynqmp = ".*" |
@@ -62,7 +65,7 @@ DTB_FILE_NAME ?= "${BASE_DTS}.dtb" | |||
62 | 65 | ||
63 | DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}" | 66 | DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}" |
64 | 67 | ||
65 | # Copy the EXTRA_DT_FILES and EXTRA_OVERLAYS files in prepend operation so that | 68 | # Copy the EXTRA_DT_FILES and EXTRA_DT_INCLUDE_FILES files in prepend operation so that |
66 | # it can be preprocessed. | 69 | # it can be preprocessed. |
67 | do_configure:prepend () { | 70 | do_configure:prepend () { |
68 | # Create DT_FILES_PATH directory if doesn't exist during prepend operation. | 71 | # Create DT_FILES_PATH directory if doesn't exist during prepend operation. |
@@ -70,7 +73,7 @@ do_configure:prepend () { | |||
70 | mkdir -p ${DT_FILES_PATH} | 73 | mkdir -p ${DT_FILES_PATH} |
71 | fi | 74 | fi |
72 | 75 | ||
73 | for f in ${EXTRA_DT_FILES} ${EXTRA_OVERLAYS}; do | 76 | for f in ${EXTRA_DT_FILES} ${EXTRA_DT_INCLUDE_FILES}; do |
74 | if [ "$(realpath ${WORKDIR}/${f})" != "$(realpath ${DT_FILES_PATH}/`basename ${f}`)" ]; then | 77 | if [ "$(realpath ${WORKDIR}/${f})" != "$(realpath ${DT_FILES_PATH}/`basename ${f}`)" ]; then |
75 | cp ${WORKDIR}/${f} ${DT_FILES_PATH}/ | 78 | cp ${WORKDIR}/${f} ${DT_FILES_PATH}/ |
76 | fi | 79 | fi |
@@ -78,12 +81,12 @@ do_configure:prepend () { | |||
78 | } | 81 | } |
79 | 82 | ||
80 | do_configure:append () { | 83 | do_configure:append () { |
81 | for f in ${EXTRA_OVERLAYS}; do | 84 | for f in ${EXTRA_DT_INCLUDE_FILES}; do |
82 | if [ ! -e ${DT_FILES_PATH}/${BASE_DTS}.dts ]; then | 85 | if [ ! -e ${DT_FILES_PATH}/${BASE_DTS}.dts ]; then |
83 | if [ -e ${DT_FILES_PATH}/${BASE_DTS}.dtb ]; then | 86 | if [ -e ${DT_FILES_PATH}/${BASE_DTS}.dtb ]; then |
84 | bberror "Unable to find ${BASE_DTS}.dts, to use EXTRA_OVERLAYS you must use a 'dts' and not 'dtb' in CONFIG_DTFILE" | 87 | bberror "Unable to find ${BASE_DTS}.dts, to use EXTRA_DT_INCLUDE_FILES you must use a 'dts' and not 'dtb' in CONFIG_DTFILE" |
85 | else | 88 | else |
86 | bberror "Unable to find ${BASE_DTS}.dts, to use EXTRA_OVERLAYS you must set a valid CONFIG_DTFILE or use system-top.dts" | 89 | bberror "Unable to find ${BASE_DTS}.dts, to use EXTRA_DT_INCLUDE_FILES you must set a valid CONFIG_DTFILE or use system-top.dts" |
87 | fi | 90 | fi |
88 | exit 1 | 91 | exit 1 |
89 | fi | 92 | fi |
diff --git a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2024.2.bb b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2024.2.bb new file mode 100644 index 00000000..88dec7b8 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_2024.2.bb | |||
@@ -0,0 +1,74 @@ | |||
1 | SUMMARY = "Xilinx dfx-mgr libraries" | ||
2 | DESCRIPTION = "Xilinx Runtime User Space Libraries and Binaries" | ||
3 | |||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=d67bcef754e935bf77b6d7051bd62b5e" | ||
6 | |||
7 | REPO ?= "git://github.com/Xilinx/dfx-mgr.git;protocol=https" | ||
8 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | ||
9 | SRC_URI = "${REPO};${BRANCHARG}" | ||
10 | |||
11 | BRANCH = "xlnx_rel_v2024.2" | ||
12 | SRCREV = "839e8e646c54a63326e36c48a7bd879f5e8efa31" | ||
13 | SOMAJOR = "2" | ||
14 | SOMINOR = "0" | ||
15 | SOVERSION = "${SOMAJOR}.${SOMINOR}" | ||
16 | |||
17 | # Don't allow building for Zynq and Microblaze MACHINE unless it is supported. | ||
18 | COMPATIBLE_MACHINE = "^$" | ||
19 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
20 | COMPATIBLE_MACHINE:versal = ".*" | ||
21 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
22 | |||
23 | S = "${WORKDIR}/git" | ||
24 | |||
25 | inherit cmake update-rc.d systemd | ||
26 | |||
27 | DEPENDS += " libwebsockets inotify-tools libdfx zocl libdrm systemd" | ||
28 | RDEPENDS:${PN} += " freeipmi" | ||
29 | EXTRA_OECMAKE += " \ | ||
30 | -DCMAKE_SYSROOT:PATH=${RECIPE_SYSROOT} \ | ||
31 | " | ||
32 | |||
33 | INITSCRIPT_NAME = "dfx-mgr.sh" | ||
34 | INITSCRIPT_PARAMS = "start 99 S ." | ||
35 | |||
36 | SYSTEMD_PACKAGES="${PN}" | ||
37 | SYSTEMD_SERVICE:${PN}="dfx-mgr.service" | ||
38 | SYSTEMD_AUTO_ENABLE:${PN}="enable" | ||
39 | |||
40 | |||
41 | do_install(){ | ||
42 | install -d ${D}${bindir} | ||
43 | install -d ${D}${libdir} | ||
44 | install -d ${D}${includedir} | ||
45 | install -d ${D}${base_libdir}/firmware/xilinx | ||
46 | install -d ${D}${sysconfdir}/dfx-mgrd | ||
47 | |||
48 | cp ${B}/example/sys/linux/dfx-mgrd-static ${D}${bindir}/dfx-mgrd | ||
49 | cp ${B}/example/sys/linux/dfx-mgr-client-static ${D}${bindir}/dfx-mgr-client | ||
50 | chrpath -d ${D}${bindir}/dfx-mgrd | ||
51 | chrpath -d ${D}${bindir}/dfx-mgr-client | ||
52 | install -m 0644 ${S}/src/dfxmgr_client.h ${D}${includedir} | ||
53 | |||
54 | oe_soinstall ${B}/src/libdfx-mgr.so.${SOVERSION} ${D}${libdir} | ||
55 | |||
56 | install -m 0755 ${S}/src/daemon.conf ${D}${sysconfdir}/dfx-mgrd/ | ||
57 | |||
58 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
59 | install -d ${D}${sysconfdir}/init.d/ | ||
60 | install -m 0755 ${S}/src/dfx-mgr.sh ${D}${sysconfdir}/init.d/ | ||
61 | fi | ||
62 | |||
63 | install -m 0755 ${S}/src/dfx-mgr.sh ${D}${bindir} | ||
64 | install -m 0755 ${S}/src/scripts/xlnx-firmware-detect ${D}${bindir} | ||
65 | |||
66 | install -d ${D}${systemd_system_unitdir} | ||
67 | install -m 0644 ${S}/src/dfx-mgr.service ${D}${systemd_system_unitdir} | ||
68 | } | ||
69 | |||
70 | PACKAGES =+ "libdfx-mgr" | ||
71 | |||
72 | FILES:${PN} += "${base_libdir}/firmware/xilinx" | ||
73 | FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${sysconfdir}/init.d/dfx-mgr.sh', '', d)} ${systemd_system_unitdir}" | ||
74 | FILES:libdfx-mgr = "${libdir}/libdfx-mgr.so.${SOVERSION} ${libdir}/libdfx-mgr.so.${SOMAJOR}" | ||
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/imgrcry.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/imgrcry.bb new file mode 100644 index 00000000..e87e8793 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/imgrcry.bb | |||
@@ -0,0 +1,69 @@ | |||
1 | DESCRIPTION = "Image Recovery" | ||
2 | |||
3 | LICENSE = "CLOSED" | ||
4 | |||
5 | PROVIDES = "virtual/imgrcry" | ||
6 | |||
7 | INHIBIT_DEFAULT_DEPS = "1" | ||
8 | |||
9 | COMPATIBLE_MACHINE = "^$" | ||
10 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
11 | |||
12 | # Since we're just copying, we can run any config | ||
13 | COMPATIBLE_HOST = ".*" | ||
14 | |||
15 | # Default expects the user to provide the imagerecovery in the deploy | ||
16 | # directory, named "image-recovery-${MACHINE}.bin" and "image-recovery-${MACHINE}.bin" | ||
17 | # A machine, multiconfig, or local.conf should override this | ||
18 | IMGRCRY_DEPENDS ??= "" | ||
19 | IMGRCRY_MCDEPENDS ??= "" | ||
20 | IMGRCRY_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | ||
21 | IMGRCRY_DEPLOY_DIR[vardepsexclude] += "TOPDIR" | ||
22 | IMGRCRY_IMAGE_NAME ??= "image-recovery-${MACHINE}" | ||
23 | |||
24 | # Default is for the multilib case (without the extension .bin) | ||
25 | IMGRCRY_FILE ??= "${IMGRCRY_DEPLOY_DIR}/${IMGRCRY_IMAGE_NAME}" | ||
26 | IMGRCRY_FILE[vardepsexclude] = "IMGRCRY_DEPLOY_DIR" | ||
27 | |||
28 | do_fetch[depends] += "${IMGRCRY_DEPENDS}" | ||
29 | do_fetch[mcdepends] += "${IMGRCRY_MCDEPENDS}" | ||
30 | |||
31 | inherit deploy | ||
32 | |||
33 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
34 | SHOULD_DEPLOY = "${@'false' if (d.getVar('IMGRCRY_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" | ||
35 | do_deploy() { | ||
36 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
37 | if ${SHOULD_DEPLOY}; then | ||
38 | install -Dm 0644 ${IMGRCRY_FILE}.bin ${DEPLOYDIR}/${IMGRCRY_IMAGE_NAME}.bin | ||
39 | install -Dm 0644 ${IMGRCRY_FILE}.elf ${DEPLOYDIR}/${IMGRCRY_IMAGE_NAME}.elf | ||
40 | fi | ||
41 | } | ||
42 | |||
43 | addtask deploy before do_build after do_install | ||
44 | |||
45 | INSANE_SKIP:${PN} = "arch" | ||
46 | INSANE_SKIP:${PN}-dbg = "arch" | ||
47 | |||
48 | # Disable buildpaths QA check warnings. | ||
49 | INSANE_SKIP:${PN} += "buildpaths" | ||
50 | |||
51 | def check_imgrcry_variables(d): | ||
52 | # If both are blank, the user MUST pass in the path to the firmware! | ||
53 | if not d.getVar('IMGRCRY_DEPENDS') and not d.getVar('IMGRCRY_MCDEPENDS'): | ||
54 | # Don't cache this, as the items on disk can change! | ||
55 | d.setVar('BB_DONT_CACHE', '1') | ||
56 | |||
57 | if not os.path.exists(d.getVar('IMGRCRY_FILE') + ".bin"): | ||
58 | if not d.getVar('WITHIN_EXT_SDK'): | ||
59 | raise bb.parse.SkipRecipe("The expected file %s.bin is not available.\nSet IMGRCRY_FILE to the path with a precompiled IMGRCRY binary." % d.getVar('IMGRCRY_FILE')) | ||
60 | else: | ||
61 | # We found the file, so be sure to track it | ||
62 | d.setVar('SRC_URI', 'file://${IMGRCRY_FILE}.bin') | ||
63 | d.setVarFlag('do_install', 'file-checksums', '${IMGRCRY_FILE}.bin:True') | ||
64 | d.setVarFlag('do_deploy', 'file-checksums', '${IMGRCRY_FILE}.bin:True') | ||
65 | |||
66 | python() { | ||
67 | # Need to allow bbappends to change the check | ||
68 | check_imgrcry_variables(d) | ||
69 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb new file mode 100644 index 00000000..0c0f1549 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb | |||
@@ -0,0 +1,72 @@ | |||
1 | DESCRIPTION = "Image Selector" | ||
2 | |||
3 | LICENSE = "CLOSED" | ||
4 | |||
5 | PROVIDES = "virtual/imgsel" | ||
6 | |||
7 | INHIBIT_DEFAULT_DEPS = "1" | ||
8 | |||
9 | COMPATIBLE_MACHINE = "^$" | ||
10 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
11 | |||
12 | # Since we're just copying, we can run any config | ||
13 | COMPATIBLE_HOST = ".*" | ||
14 | |||
15 | # Default expects the user to provide the imageselector in the deploy | ||
16 | # directory, named "image-selector-${MACHINE}.bin" and "image-selector-${MACHINE}.bin" | ||
17 | # A machine, multiconfig, or local.conf should override this | ||
18 | IMGSEL_DEPENDS ??= "" | ||
19 | IMGSEL_MCDEPENDS ??= "" | ||
20 | IMGSEL_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | ||
21 | IMGSEL_DEPLOY_DIR[vardepsexclude] += "TOPDIR" | ||
22 | IMGSEL_IMAGE_NAME ??= "image-selector-${MACHINE}" | ||
23 | |||
24 | # Default is for the multilib case (without the extension .bin) | ||
25 | IMGSEL_FILE ??= "${IMGSEL_DEPLOY_DIR}/${IMGSEL_IMAGE_NAME}" | ||
26 | IMGSEL_FILE[vardepsexclude] = "IMGSEL_DEPLOY_DIR" | ||
27 | |||
28 | do_fetch[depends] += "${IMGSEL_DEPENDS}" | ||
29 | do_fetch[mcdepends] += "${IMGSEL_MCDEPENDS}" | ||
30 | |||
31 | inherit deploy | ||
32 | |||
33 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
34 | SHOULD_DEPLOY = "${@'false' if (d.getVar('IMGSEL_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" | ||
35 | do_deploy() { | ||
36 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
37 | if ${SHOULD_DEPLOY}; then | ||
38 | install -Dm 0644 ${IMGSEL_FILE}.bin ${DEPLOYDIR}/${IMGSEL_IMAGE_NAME}.bin | ||
39 | install -Dm 0644 ${IMGSEL_FILE}.elf ${DEPLOYDIR}/${IMGSEL_IMAGE_NAME}.elf | ||
40 | fi | ||
41 | } | ||
42 | |||
43 | addtask deploy before do_build after do_install | ||
44 | |||
45 | INSANE_SKIP:${PN} = "arch" | ||
46 | INSANE_SKIP:${PN}-dbg = "arch" | ||
47 | |||
48 | # Disable buildpaths QA check warnings. | ||
49 | INSANE_SKIP:${PN} += "buildpaths" | ||
50 | |||
51 | #SYSROOT_DIRS += "/boot" | ||
52 | #FILES:${PN} = "/boot/${PN}.bin" | ||
53 | |||
54 | def check_imgsel_variables(d): | ||
55 | # If both are blank, the user MUST pass in the path to the firmware! | ||
56 | if not d.getVar('IMGSEL_DEPENDS') and not d.getVar('IMGSEL_MCDEPENDS'): | ||
57 | # Don't cache this, as the items on disk can change! | ||
58 | d.setVar('BB_DONT_CACHE', '1') | ||
59 | |||
60 | if not os.path.exists(d.getVar('IMGSEL_FILE') + ".bin"): | ||
61 | if not d.getVar('WITHIN_EXT_SDK'): | ||
62 | raise bb.parse.SkipRecipe("The expected file %s.bin is not available.\nSet IMGSEL_FILE to the path with a precompiled IMGSEL binary." % d.getVar('IMGSEL_FILE')) | ||
63 | else: | ||
64 | # We found the file, so be sure to track it | ||
65 | d.setVar('SRC_URI', 'file://${IMGSEL_FILE}.bin') | ||
66 | d.setVarFlag('do_install', 'file-checksums', '${IMGSEL_FILE}.bin:True') | ||
67 | d.setVarFlag('do_deploy', 'file-checksums', '${IMGSEL_FILE}.bin:True') | ||
68 | |||
69 | python() { | ||
70 | # Need to allow bbappends to change the check | ||
71 | check_imgsel_variables(d) | ||
72 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/libdfx/libdfx_2024.2.bb b/meta-xilinx-core/recipes-bsp/libdfx/libdfx_2024.2.bb new file mode 100644 index 00000000..3a097b24 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/libdfx/libdfx_2024.2.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "Xilinx libdfx library" | ||
2 | DESCRIPTION = "Xilinx libdfx Library and headers" | ||
3 | |||
4 | LICENSE = "MIT & GPL-2.0-or-later" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=94aba86aec117f003b958a52f019f1a7" | ||
6 | |||
7 | BRANCH ?= "xlnx_rel_v2024.2" | ||
8 | REPO ?= "git://github.com/Xilinx/libdfx.git;protocol=https" | ||
9 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | ||
10 | SRC_URI = "${REPO};${BRANCHARG}" | ||
11 | SRCREV = "af8d735fae286e7bc94c830a86c960598a4ac014" | ||
12 | |||
13 | # Don't allow building for Zynq and Microblaze MACHINE unless it is supported. | ||
14 | COMPATIBLE_MACHINE = "^$" | ||
15 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
16 | COMPATIBLE_MACHINE:versal = ".*" | ||
17 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | |||
21 | inherit cmake | ||
22 | |||
23 | # Due to an update where the soname/version was defined, we need to use an RREPLACES | ||
24 | # so updates will work properly. | ||
25 | RREPLACES:${PN} = "libdfx" | ||
diff --git a/meta-xilinx-core/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.0-xilinx-v2024.2.bb b/meta-xilinx-core/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.0-xilinx-v2024.2.bb new file mode 100644 index 00000000..e6ba4938 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.0-xilinx-v2024.2.bb | |||
@@ -0,0 +1,154 @@ | |||
1 | require recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | ||
2 | |||
3 | DEPENDS:remove:zynqmp:qemuall = " optee-os" | ||
4 | DEPENDS:remove:versal:qemuall = " optee-os" | ||
5 | DEPENDS:remove:versal-net:qemuall = " optee-os" | ||
6 | |||
7 | # Xilinx TF-A v2.10 | ||
8 | SRC_URI_TRUSTED_FIRMWARE_A = "git://github.com/Xilinx/arm-trusted-firmware.git;protocol=https" | ||
9 | SRCREV_tfa = "14cea4616b6edaceabb607c7c92332436a1699e5" | ||
10 | SRCBRANCH = "xlnx_rebase_v2.10" | ||
11 | |||
12 | LIC_FILES_CHKSUM = "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde" | ||
13 | |||
14 | # mbedtls-3.4.1 is not enabled in this configuration | ||
15 | |||
16 | # The following are Xilinx specific settings | ||
17 | PROVIDES = "virtual/arm-trusted-firmware" | ||
18 | |||
19 | COMPATIBLE_MACHINE ?= "^$" | ||
20 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
21 | COMPATIBLE_MACHINE:versal = ".*" | ||
22 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
23 | |||
24 | ### Platform Settings | ||
25 | TFA_PLATFORM:zynqmp = "zynqmp" | ||
26 | TFA_PLATFORM:versal = "versal" | ||
27 | TFA_PLATFORM:versal-net = "versal_net" | ||
28 | |||
29 | |||
30 | ### Console settings | ||
31 | TFA_CONSOLE_DEFAULT = "" | ||
32 | TFA_CONSOLE_DEFAULT:zynqmp = "cadence" | ||
33 | TFA_CONSOLE_DEFAULT:versal = "pl011" | ||
34 | TFA_CONSOLE_DEFAULT:versal-net = "pl011" | ||
35 | |||
36 | # Use old name for compatibility | ||
37 | ATF_CONSOLE ?= "${TFA_CONSOLE_DEFAULT}" | ||
38 | |||
39 | # Old name to new name | ||
40 | TFA_CONSOLE ?= "${ATF_CONSOLE}" | ||
41 | |||
42 | TFA_CONSOLE_OEMAKE = "" | ||
43 | TFA_CONSOLE_OEMAKE:append:zynqmp = "${@' ZYNQMP_CONSOLE=${TFA_CONSOLE}' if d.getVar('TFA_CONSOLE', True) != '' else ''}" | ||
44 | TFA_CONSOLE_OEMAKE:append:versal = "${@' VERSAL_CONSOLE=${TFA_CONSOLE}' if d.getVar('TFA_CONSOLE', True) != '' else ''}" | ||
45 | TFA_CONSOLE_OEMAKE:append:versal-net = "${@' VERSAL_NET_CONSOLE=${TFA_CONSOLE}' if d.getVar('TFA_CONSOLE', True) != '' else ''}" | ||
46 | |||
47 | EXTRA_OEMAKE += "${TFA_CONSOLE_OEMAKE}" | ||
48 | |||
49 | |||
50 | ### Debug settings | ||
51 | DEBUG_ATF_DEFAULT = "" | ||
52 | DEBUG_ATF_DEFAULT:versal = "1" | ||
53 | DEBUG_ATF_DEFAULT:versal-net = "1" | ||
54 | DEBUG_ATF ?= "${DEBUG_ATF_DEFAULT}" | ||
55 | |||
56 | # Translate old to new name | ||
57 | TFA_DEBUG = "${DEBUG_ATF}" | ||
58 | |||
59 | |||
60 | ### Mem Settings | ||
61 | ATF_MEM_BASE ?= "" | ||
62 | ATF_MEM_SIZE ?= "" | ||
63 | |||
64 | TFA_MEM_BASE ?= "${ATF_MEM_BASE}" | ||
65 | TFA_MEM_SIZE ?= "${ATF_MEM_SIZE}" | ||
66 | |||
67 | TFA_MEM_OEMAKE = "" | ||
68 | TFA_MEM_OEMAKE:append:zynqmp = "${@' ZYNQMP_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" | ||
69 | TFA_MEM_OEMAKE:append:zynqmp = "${@' ZYNQMP_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" | ||
70 | TFA_MEM_OEMAKE:append:versal = "${@' VERSAL_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" | ||
71 | TFA_MEM_OEMAKE:append:versal = "${@' VERSAL_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" | ||
72 | TFA_MEM_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" | ||
73 | TFA_MEM_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" | ||
74 | |||
75 | EXTRA_OEMAKE += "${TFA_MEM_OEMAKE}" | ||
76 | |||
77 | |||
78 | ### Preloaded Base | ||
79 | TFA_BL33_LOAD ?= "" | ||
80 | EXTRA_OEMAKE += "${@' PRELOADED_BL33_BASE=${TFA_BL33_LOAD}' if d.getVar('TFA_BL33_LOAD', True) != '' else ''}" | ||
81 | |||
82 | |||
83 | # Workaround for bl31.elf has a LOAD segment with RWX permissions | ||
84 | EXTRA_OEMAKE += ' TF_LDFLAGS="--no-warn-rwx-segments --fatal-warnings -O1 --gc-sections"' | ||
85 | |||
86 | # We use bl31 | ||
87 | TFA_BUILD_TARGET = "bl31" | ||
88 | TFA_INSTALL_TARGET = "bl31" | ||
89 | |||
90 | inherit image-artifact-names | ||
91 | |||
92 | # arm-trusted-firmware instead of ${PN} for compatibility | ||
93 | ATF_BASE_NAME ?= "arm-trusted-firmware-${PKGE}-${PKGV}-${PKGR}${IMAGE_VERSION_SUFFIX}" | ||
94 | |||
95 | do_install:append() { | ||
96 | # The first TFA_INSTALL_TARGET found will be copied as the standard boot firmware | ||
97 | for atfbin in ${TFA_INSTALL_TARGET} ; do | ||
98 | install -d ${D}/boot | ||
99 | if [ -e ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf ]; then | ||
100 | ln ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf ${D}/boot/${ATF_BASE_NAME}.elf | ||
101 | ln -sf ${ATF_BASE_NAME}.elf ${D}/boot/arm-trusted-firmware.elf | ||
102 | ln ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin ${D}/boot/${ATF_BASE_NAME}.bin | ||
103 | ln -sf ${ATF_BASE_NAME}.bin ${D}/boot/arm-trusted-firmware.bin | ||
104 | |||
105 | # Get the entry point address from the elf. | ||
106 | BL31_BASE_ADDR=$(${READELF} -h ${D}/boot/${ATF_BASE_NAME}.elf | egrep -m 1 -i "entry point.*?0x" | sed -r 's/.*?(0x.*?)/\1/g') | ||
107 | mkimage -A arm64 -O arm-trusted-firmware -T kernel -C none \ | ||
108 | -a $BL31_BASE_ADDR -e $BL31_BASE_ADDR \ | ||
109 | -d ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin ${D}/boot/${ATF_BASE_NAME}.ub | ||
110 | ln -sf ${ATF_BASE_NAME}.ub ${D}/boot/arm-trusted-firmware.ub | ||
111 | ln -sf ${ATF_BASE_NAME}.ub ${D}/boot/atf-uboot.ub | ||
112 | break | ||
113 | fi | ||
114 | done | ||
115 | } | ||
116 | |||
117 | inherit deploy | ||
118 | |||
119 | DEPENDS += "u-boot-mkimage-native" | ||
120 | |||
121 | do_deploy() { | ||
122 | # Copy the /boot items to deploy | ||
123 | install -d ${DEPLOYDIR} | ||
124 | install -m 0644 ${D}/boot/${ATF_BASE_NAME}.elf ${DEPLOYDIR}/${ATF_BASE_NAME}.elf | ||
125 | ln -sf ${ATF_BASE_NAME}.elf ${DEPLOYDIR}/arm-trusted-firmware.elf | ||
126 | install -m 0644 ${D}/boot/${ATF_BASE_NAME}.bin ${DEPLOYDIR}/${ATF_BASE_NAME}.bin | ||
127 | ln -sf ${ATF_BASE_NAME}.bin ${DEPLOYDIR}/arm-trusted-firmware.bin | ||
128 | |||
129 | install -m 0644 ${D}/boot/${ATF_BASE_NAME}.ub ${DEPLOYDIR}/${ATF_BASE_NAME}.ub | ||
130 | ln -sf ${ATF_BASE_NAME}.ub ${DEPLOYDIR}/arm-trusted-firmware.ub | ||
131 | ln -sf ${ATF_BASE_NAME}.ub ${DEPLOYDIR}/atf-uboot.ub | ||
132 | } | ||
133 | |||
134 | addtask deploy before do_build after do_compile | ||
135 | |||
136 | SYSROOT_DIRS += "/boot" | ||
137 | FILES:${PN} += "/boot/*.elf /boot/*.bin /boot/*.ub" | ||
138 | RPROVIDES:${PN} += "arm-trusted-firmware" | ||
139 | |||
140 | python() { | ||
141 | soc_family = d.getVar('SOC_FAMILY') | ||
142 | tfa_console = d.getVar('TFA_CONSOLE') | ||
143 | |||
144 | # See plat/xilinx/<soc_family>/platform.mk | ||
145 | if soc_family and soc_family == "zynqmp": | ||
146 | if not tfa_console in [ 'cadence', 'cadence0', 'cadence1', 'dcc' ]: | ||
147 | raise bb.parse.SkipRecipe('TFA_CONSOLE (%s) is not configured properly for ZynqMP, only cadence, cadence0, cadence1, and dcc are valid options.' % (tfa_console)) | ||
148 | elif soc_family and soc_family == "versal": | ||
149 | if not tfa_console in [ 'pl011', 'pl011_0', 'pl011_1', 'dcc' ]: | ||
150 | raise bb.parse.SkipRecipe('TFA_CONSOLE (%s) is not configured properly for Versal, only pl011, pl011_0, pl011_1, and dcc are valid options.' % (tfa_console)) | ||
151 | elif soc_family and soc_family == "versal-net": | ||
152 | if not tfa_console in [ 'pl011', 'pl011_0', 'pl011_1', 'dcc' ]: | ||
153 | raise bb.parse.SkipRecipe('TFA_CONSOLE (%s) is not configured properly for Versal-Net, only pl011, pl011_0, pl011_1, and dcc are valid options.' % (tfa_console)) | ||
154 | } | ||
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-tools-xlnx_2024.01-xilinx-v2024.2.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-tools-xlnx_2024.01-xilinx-v2024.2.bb new file mode 100644 index 00000000..4214fdd9 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-tools-xlnx_2024.01-xilinx-v2024.2.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | require u-boot-tools-xlnx.inc | ||
2 | require u-boot-xlnx-2024.2.inc | ||
3 | |||
4 | # MUST clear CONFIG_VIDEO to avoid a compilation failure trying to construct | ||
5 | # bmp_logo.h | ||
6 | SED_CONFIG_EFI:append = ' -e "s/CONFIG_VIDEO=.*/# CONFIG_VIDEO is not set/"' | ||
7 | |||
8 | # Default do_compile fails with: | ||
9 | # | error: object directory ../downloads/git2/github.com.Xilinx.u-boot-xlnx.git/objects does not exist; check .git/objects/info/alternates. | ||
10 | # The regular workaround of calling 'git diff' seems to be problematic. | ||
11 | do_compile () { | ||
12 | oe_runmake -C ${S} tools-only_defconfig O=${B} | ||
13 | |||
14 | # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and | ||
15 | # generating it requires bin2header tool, which for target build | ||
16 | # is built with target tools and thus cannot be executed on host. | ||
17 | sed -i -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} ${B}/.config | ||
18 | |||
19 | oe_runmake -C ${S} cross_tools NO_SDL=1 O=${B} | ||
20 | } | ||
21 | |||
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2024.2.inc b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2024.2.inc new file mode 100644 index 00000000..feb9bbcd --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-2024.2.inc | |||
@@ -0,0 +1,17 @@ | |||
1 | UBRANCH = "xlnx_rebase_v2024.01" | ||
2 | |||
3 | SRCREV = "7f6ec94aac7eacfec07bd45c83a6d17df4b7d383" | ||
4 | |||
5 | LICENSE = "GPL-2.0-or-later" | ||
6 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=4;md5=744e7e3bb0c94b4b9f6b3db3bf893897" | ||
7 | |||
8 | # u-boot-xlnx has support for these | ||
9 | HAS_PLATFORM_INIT ?= " \ | ||
10 | xilinx_zynqmp_virt_config \ | ||
11 | xilinx_zynq_virt_defconfig \ | ||
12 | xilinx_versal_vc_p_a2197_revA_x_prc_01_revA \ | ||
13 | " | ||
14 | |||
15 | DEPENDS += "bc-native dtc-native python3-setuptools-native gnutls-native" | ||
16 | |||
17 | FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-v2024.01:" | ||
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc index bbf4125f..7eac6bfd 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc | |||
@@ -9,7 +9,6 @@ IMPORT_CC_DTBS ?= "" | |||
9 | CC_DTBS_DUP ?= "" | 9 | CC_DTBS_DUP ?= "" |
10 | IMPORT_CC_UBOOT_DTBS ?= "" | 10 | IMPORT_CC_UBOOT_DTBS ?= "" |
11 | 11 | ||
12 | DEPENDS:append:eval-brd-sc-zynqmp = " uboot-device-tree" | ||
13 | MKIMAGE_DTBLOB_OPTS ?= "-E -B 0x8" | 12 | MKIMAGE_DTBLOB_OPTS ?= "-E -B 0x8" |
14 | 13 | ||
15 | # Everything is swtiched on with UBOOT_IMAGE_BLOB = '1' | 14 | # Everything is swtiched on with UBOOT_IMAGE_BLOB = '1' |
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb index 678ae236..e13413a1 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb | |||
@@ -39,6 +39,9 @@ DDR_BASEADDR ?= "0x0" | |||
39 | DDR_BASEADDR:microblaze ?= "0x80000000" | 39 | DDR_BASEADDR:microblaze ?= "0x80000000" |
40 | PRE_BOOTENV ?= "" | 40 | PRE_BOOTENV ?= "" |
41 | 41 | ||
42 | # Set debfault SD boot device to mmc 0 interface | ||
43 | SDBOOTDEV ?= "0" | ||
44 | |||
42 | SRC_URI = " \ | 45 | SRC_URI = " \ |
43 | file://boot.cmd.sd.zynq \ | 46 | file://boot.cmd.sd.zynq \ |
44 | file://boot.cmd.sd.zynqmp \ | 47 | file://boot.cmd.sd.zynqmp \ |
@@ -81,7 +84,7 @@ DEVICETREE_OVERLAY_OFFSET:zynqmp ??= "0x100000" | |||
81 | DEVICETREE_OVERLAY_OFFSET:zynq ??= "0x100000" | 84 | DEVICETREE_OVERLAY_OFFSET:zynq ??= "0x100000" |
82 | DEVICETREE_OVERLAY_OFFSET:versal ??= "0x1000" | 85 | DEVICETREE_OVERLAY_OFFSET:versal ??= "0x1000" |
83 | DEVICETREE_OVERLAY_OFFSET:versal-net ??= "0x1000" | 86 | DEVICETREE_OVERLAY_OFFSET:versal-net ??= "0x1000" |
84 | DEVICETREE_OVERLAY_PADSIZE ??= "0xf00000" | 87 | DEVICETREE_OVERLAY_PADSIZE ??= "0x1f00000" |
85 | 88 | ||
86 | DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(append_baseaddr(d,d.getVar('DEVICETREE_OVERLAY_OFFSET')),16) \ | 89 | DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(append_baseaddr(d,d.getVar('DEVICETREE_OVERLAY_OFFSET')),16) \ |
87 | + int(d.getVar('DEVICETREE_OVERLAY_PADSIZE'),16))}" | 90 | + int(d.getVar('DEVICETREE_OVERLAY_PADSIZE'),16))}" |
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic index e09bdfa9..f60a1ea9 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic | |||
@@ -13,7 +13,6 @@ rootfs_name=@@RAMDISK_IMAGE@@ | |||
13 | setenv get_bootargs 'fdt addr $fdtcontroladdr;fdt get value bootargs /chosen bootargs;' | 13 | setenv get_bootargs 'fdt addr $fdtcontroladdr;fdt get value bootargs /chosen bootargs;' |
14 | setenv update_bootargs 'if test -n ${launch_ramdisk_init} && test ${bootargs} = "";then if run get_bootargs;then setenv bootargs "\$bootargs launch_ramdisk_init=${launch_ramdisk_init} $extrabootargs";fi;fi' | 14 | setenv update_bootargs 'if test -n ${launch_ramdisk_init} && test ${bootargs} = "";then if run get_bootargs;then setenv bootargs "\$bootargs launch_ramdisk_init=${launch_ramdisk_init} $extrabootargs";fi;fi' |
15 | 15 | ||
16 | |||
17 | for boot_target in ${boot_targets}; | 16 | for boot_target in ${boot_targets}; |
18 | do | 17 | do |
19 | echo "Trying to load boot images from ${boot_target}" | 18 | echo "Trying to load boot images from ${boot_target}" |
@@ -83,4 +82,15 @@ do | |||
83 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; | 82 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; |
84 | echo "Booting using Separate images failed" | 83 | echo "Booting using Separate images failed" |
85 | fi | 84 | fi |
85 | if test "${boot_target}" = "nor" || test "${boot_target}" = "nor0"; then | ||
86 | cp.b @@QSPI_FIT_IMAGE_OFFSET@@ @@FIT_IMAGE_LOAD_ADDRESS@@ @@QSPI_FIT_IMAGE_SIZE@@ | ||
87 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
88 | echo "Booting using Fit image failed" | ||
89 | |||
90 | cp.b @@QSPI_KERNEL_OFFSET@@ @@KERNEL_LOAD_ADDRESS@@ @@QSPI_KERNEL_SIZE@@ | ||
91 | cp.b @@QSPI_RAMDISK_OFFSET@@ @@RAMDISK_IMAGE_ADDRESS@@ @@QSPI_RAMDISK_SIZE@@ | ||
92 | run update_bootargs | ||
93 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; | ||
94 | echo "Booting using Separate images failed" | ||
95 | fi | ||
86 | done | 96 | done |
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root index ed12f941..a3ec1286 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root | |||
@@ -9,6 +9,7 @@ ramdisk_name=@@RAMDISK_IMAGE1@@ | |||
9 | rootfs_name=@@RAMDISK_IMAGE@@ | 9 | rootfs_name=@@RAMDISK_IMAGE@@ |
10 | @@PRE_BOOTENV@@ | 10 | @@PRE_BOOTENV@@ |
11 | 11 | ||
12 | |||
12 | for boot_target in ${boot_targets}; | 13 | for boot_target in ${boot_targets}; |
13 | do | 14 | do |
14 | echo "Trying to load boot images from ${boot_target}" | 15 | echo "Trying to load boot images from ${boot_target}" |
@@ -43,17 +44,17 @@ do | |||
43 | fi | 44 | fi |
44 | echo "Checking for /${kernel_name}" | 45 | echo "Checking for /${kernel_name}" |
45 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then | 46 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then |
46 | echo "Loading ${kernel_name}"; | 47 | echo "Loading ${kernel_name} at @@KERNEL_LOAD_ADDRESS@@"; |
47 | fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; | 48 | fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; |
48 | fi | 49 | fi |
49 | echo "Checking for /system.dtb" | 50 | echo "Checking for /system.dtb" |
50 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then | 51 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then |
51 | echo "Loading system.dtb"; | 52 | echo "Loading system.dtb at @@DEVICETREE_ADDRESS@@"; |
52 | fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; | 53 | fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; |
53 | fi | 54 | fi |
54 | echo "Checking for /devicetree/openamp.dtbo" | 55 | echo "Checking for /devicetree/openamp.dtbo" |
55 | if test -e ${devtype} ${devnum}:${distro_bootpart} /devicetree/openamp.dtbo; then | 56 | if test -e ${devtype} ${devnum}:${distro_bootpart} /devicetree/openamp.dtbo; then |
56 | echo "Loading and merging openamp.dtbo into device tree"; | 57 | echo "Loading and merging openamp.dtbo into device tree at @@DEVICETREE_OVERLAY_ADDRESS@@"; |
57 | fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo; | 58 | fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo; |
58 | fdt addr @@DEVICETREE_ADDRESS@@ | 59 | fdt addr @@DEVICETREE_ADDRESS@@ |
59 | fdt resize 8192 | 60 | fdt resize 8192 |
@@ -61,7 +62,7 @@ do | |||
61 | fi | 62 | fi |
62 | echo "Checking for /${ramdisk_name}" | 63 | echo "Checking for /${ramdisk_name}" |
63 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then | 64 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then |
64 | echo "Loading ${ramdisk_name}"; | 65 | echo "Loading ${ramdisk_name} at @@RAMDISK_IMAGE_ADDRESS@@"; |
65 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; | 66 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; |
66 | fdt addr @@DEVICETREE_ADDRESS@@ | 67 | fdt addr @@DEVICETREE_ADDRESS@@ |
67 | fdt get value bootargs /chosen bootargs | 68 | fdt get value bootargs /chosen bootargs |
@@ -70,7 +71,7 @@ do | |||
70 | fi | 71 | fi |
71 | echo "Checking for /${rootfs_name}" | 72 | echo "Checking for /${rootfs_name}" |
72 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then | 73 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then |
73 | echo "Loading ${rootfs_name}"; | 74 | echo "Loading ${rootfs_name} at @@RAMDISK_IMAGE_ADDRESS@@"; |
74 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; | 75 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; |
75 | fdt addr @@DEVICETREE_ADDRESS@@ | 76 | fdt addr @@DEVICETREE_ADDRESS@@ |
76 | fdt get value bootargs /chosen bootargs | 77 | fdt get value bootargs /chosen bootargs |
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-uenv.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-uenv.bb index 1efc5392..dafaab25 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-uenv.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-uenv.bb | |||
@@ -16,7 +16,7 @@ def remove_task_from_depends(d): | |||
16 | extra_imagedepends = d.getVar('EXTRA_IMAGEDEPENDS') or '' | 16 | extra_imagedepends = d.getVar('EXTRA_IMAGEDEPENDS') or '' |
17 | uenv_depends = '' | 17 | uenv_depends = '' |
18 | for imagedepend in extra_imagedepends.split(): | 18 | for imagedepend in extra_imagedepends.split(): |
19 | if imagedepend == d.getVar("BPN"): | 19 | if imagedepend == d.getVar("BPN") or '': |
20 | continue | 20 | continue |
21 | elif ':' in imagedepend: | 21 | elif ':' in imagedepend: |
22 | uenv_depends += ' %s' % imagedepend.split(':')[0] | 22 | uenv_depends += ' %s' % imagedepend.split(':')[0] |
@@ -25,16 +25,16 @@ def remove_task_from_depends(d): | |||
25 | return uenv_depends | 25 | return uenv_depends |
26 | 26 | ||
27 | def uboot_boot_cmd(d): | 27 | def uboot_boot_cmd(d): |
28 | if d.getVar("KERNEL_IMAGETYPE") in ["uImage", "fitImage"]: | 28 | if (d.getVar("KERNEL_IMAGETYPE") or '') in ["uImage", "fitImage"]: |
29 | return "bootm" | 29 | return "bootm" |
30 | if d.getVar("KERNEL_IMAGETYPE") in ["zImage"]: | 30 | if (d.getVar("KERNEL_IMAGETYPE") or '') in ["zImage"]: |
31 | return "bootz" | 31 | return "bootz" |
32 | if d.getVar("KERNEL_IMAGETYPE") in ["Image"]: | 32 | if (d.getVar("KERNEL_IMAGETYPE") or '') in ["Image"]: |
33 | return "booti" | 33 | return "booti" |
34 | raise bb.parse.SkipRecipe("Unsupport kernel image type") | 34 | raise bb.parse.SkipRecipe("Unsupport kernel image type") |
35 | 35 | ||
36 | def get_sdbootdev(d): | 36 | def get_sdbootdev(d): |
37 | if d.getVar("SOC_FAMILY") in ["zynqmp"]: | 37 | if (d.getVar("SOC_FAMILY") or '') in ["zynqmp"]: |
38 | return "${devnum}" | 38 | return "${devnum}" |
39 | else: | 39 | else: |
40 | return "0" | 40 | return "0" |
@@ -43,24 +43,24 @@ def uenv_populate(d): | |||
43 | # populate the environment values | 43 | # populate the environment values |
44 | env = {} | 44 | env = {} |
45 | 45 | ||
46 | env["machine_name"] = d.getVar("MACHINE") | 46 | env["machine_name"] = d.getVar("MACHINE") or '' |
47 | 47 | ||
48 | env["kernel_image"] = d.getVar("KERNEL_IMAGETYPE") | 48 | env["kernel_image"] = d.getVar("KERNEL_IMAGETYPE") or '' |
49 | env["kernel_load_address"] = d.getVar("KERNEL_LOAD_ADDRESS") | 49 | env["kernel_load_address"] = d.getVar("KERNEL_LOAD_ADDRESS") or '' |
50 | 50 | ||
51 | env["devicetree_image"] = boot_files_dtb_filepath(d) | 51 | env["devicetree_image"] = boot_files_dtb_filepath(d) |
52 | env["devicetree_load_address"] = d.getVar("DEVICETREE_LOAD_ADDRESS") | 52 | env["devicetree_load_address"] = d.getVar("DEVICETREE_LOAD_ADDRESS") or '' |
53 | env["devicetree_overlay_load_address" ] = d.getVar("DEVICETREE_OVERLAY_LOAD_ADDRESS") | 53 | env["devicetree_overlay_load_address" ] = d.getVar("DEVICETREE_OVERLAY_LOAD_ADDRESS") or '' |
54 | 54 | ||
55 | env["bootargs"] = d.getVar("KERNEL_BOOTARGS") | 55 | env["bootargs"] = d.getVar("KERNEL_BOOTARGS") or '' |
56 | 56 | ||
57 | env["loadkernel"] = "fatload mmc " + get_sdbootdev(d) + " ${kernel_load_address} ${kernel_image}" | 57 | env["loadkernel"] = "fatload mmc " + get_sdbootdev(d) + " ${kernel_load_address} ${kernel_image}" |
58 | env["loaddtb"] = "fatload mmc " + get_sdbootdev(d) + " ${devicetree_load_address} ${devicetree_image}" | 58 | env["loaddtb"] = "fatload mmc " + get_sdbootdev(d) + " ${devicetree_load_address} ${devicetree_image}" |
59 | env["loaddtbo"] = "if test -e mmc " + get_sdbootdev(d) + " /devicetree/openamp.dtbo; then fatload mmc " + get_sdbootdev(d) + " ${devicetree_overlay_load_address} /devicetree/openamp.dtbo ; fdt addr ${devicetree_load_address} ; fdt resize 8192 ; fdt apply ${devicetree_overlay_load_address} ; fi" | 59 | env["loaddtbo"] = "if test -e mmc " + get_sdbootdev(d) + " /devicetree/openamp.dtbo; then fatload mmc " + get_sdbootdev(d) + " ${devicetree_overlay_load_address} /devicetree/openamp.dtbo ; fdt addr ${devicetree_load_address} ; fdt resize 8192 ; fdt apply ${devicetree_overlay_load_address} ; fi" |
60 | env["bootkernel"] = "run loadkernel && run loaddtb && run loaddtbo && " + uboot_boot_cmd(d) + " ${kernel_load_address} - ${devicetree_load_address}" | 60 | env["bootkernel"] = "run loadkernel && run loaddtb && run loaddtbo && " + uboot_boot_cmd(d) + " ${kernel_load_address} - ${devicetree_load_address}" |
61 | 61 | ||
62 | if d.getVar("SOC_FAMILY") in ["zynqmp"]: | 62 | if (d.getVar("SOC_FAMILY") or '') in ["zynqmp"]: |
63 | env["bootkernel"] = "setenv bootargs " + d.getVar("KERNEL_BOOTARGS") + " ; " + env["bootkernel"] | 63 | env["bootkernel"] = "setenv bootargs " + (d.getVar("KERNEL_BOOTARGS") or '') + " ; " + env["bootkernel"] |
64 | 64 | ||
65 | # default uenvcmd does not load bitstream | 65 | # default uenvcmd does not load bitstream |
66 | env["uenvcmd"] = "run bootkernel" | 66 | env["uenvcmd"] = "run bootkernel" |
@@ -89,7 +89,8 @@ KERNEL_LOAD_ADDRESS:zynq = "0x2080000" | |||
89 | KERNEL_LOAD_ADDRESS:zynqmp = "0x200000" | 89 | KERNEL_LOAD_ADDRESS:zynqmp = "0x200000" |
90 | DEVICETREE_LOAD_ADDRESS:zynq = "0x2000000" | 90 | DEVICETREE_LOAD_ADDRESS:zynq = "0x2000000" |
91 | DEVICETREE_LOAD_ADDRESS:zynqmp = "0x4000000" | 91 | DEVICETREE_LOAD_ADDRESS:zynqmp = "0x4000000" |
92 | DEVICETREE_OVERLAY_LOAD_ADDRESS = "${@hex(int(d.getVar("DEVICETREE_LOAD_ADDRESS"),16) + 0xf00000)}" | 92 | DEVICETREE_OVERLAY_LOAD_ADDRESS:zynq = "${@hex(int(d.getVar("DEVICETREE_LOAD_ADDRESS"),16) + 0xf00000)}" |
93 | DEVICETREE_OVERLAY_LOAD_ADDRESS:zynqmp = "${@hex(int(d.getVar("DEVICETREE_LOAD_ADDRESS"),16) + 0xf00000)}" | ||
93 | 94 | ||
94 | python do_compile() { | 95 | python do_compile() { |
95 | env = uenv_populate(d) | 96 | env = uenv_populate(d) |
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2024.01-xilinx-v2024.2.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2024.01-xilinx-v2024.2.bb new file mode 100644 index 00000000..bcadf1e4 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2024.01-xilinx-v2024.2.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | |||
2 | require u-boot-xlnx.inc | ||
3 | require u-boot-spl-zynq-init.inc | ||
4 | require u-boot-xlnx-2024.2.inc | ||
diff --git a/meta-xilinx-core/recipes-connectivity/iproute2/iproute2.inc b/meta-xilinx-core/recipes-connectivity/iproute2/iproute2.inc deleted file mode 100644 index b1bcc143..00000000 --- a/meta-xilinx-core/recipes-connectivity/iproute2/iproute2.inc +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | SUMMARY = "TCP / IP networking and traffic control utilities" | ||
2 | DESCRIPTION = "Iproute2 is a collection of utilities for controlling \ | ||
3 | TCP / IP networking and traffic control in Linux. Of the utilities ip \ | ||
4 | and tc are the most important. ip controls IPv4 and IPv6 \ | ||
5 | configuration and tc stands for traffic control." | ||
6 | HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2" | ||
7 | SECTION = "base" | ||
8 | LICENSE = "GPL-2.0-or-later" | ||
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \ | ||
10 | file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817" | ||
11 | |||
12 | DEPENDS = "flex-native bison-native iptables libcap" | ||
13 | |||
14 | inherit update-alternatives bash-completion pkgconfig | ||
15 | |||
16 | CLEANBROKEN = "1" | ||
17 | |||
18 | PACKAGECONFIG ??= "tipc elf devlink" | ||
19 | PACKAGECONFIG[tipc] = ",,libmnl," | ||
20 | PACKAGECONFIG[elf] = ",,elfutils," | ||
21 | PACKAGECONFIG[devlink] = ",,libmnl," | ||
22 | PACKAGECONFIG[rdma] = ",,libmnl," | ||
23 | |||
24 | IPROUTE2_MAKE_SUBDIRS = "lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc rdma', d)}" | ||
25 | |||
26 | EXTRA_OEMAKE = "\ | ||
27 | CC='${CC}' \ | ||
28 | KERNEL_INCLUDE=${STAGING_INCDIR} \ | ||
29 | DOCDIR=${docdir}/iproute2 \ | ||
30 | SUBDIRS='${IPROUTE2_MAKE_SUBDIRS}' \ | ||
31 | SBINDIR='${base_sbindir}' \ | ||
32 | LIBDIR='${libdir}' \ | ||
33 | " | ||
34 | |||
35 | do_configure:append () { | ||
36 | sh configure ${STAGING_INCDIR} | ||
37 | # Explicitly disable ATM support | ||
38 | sed -i -e '/TC_CONFIG_ATM/d' config.mk | ||
39 | } | ||
40 | |||
41 | do_install () { | ||
42 | oe_runmake DESTDIR=${D} install | ||
43 | mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2 | ||
44 | install -d ${D}${datadir} | ||
45 | mv ${D}/share/* ${D}${datadir}/ || true | ||
46 | rm ${D}/share -rf || true | ||
47 | } | ||
48 | |||
49 | # The .so files in iproute2-tc are modules, not traditional libraries | ||
50 | INSANE_SKIP:${PN}-tc = "dev-so" | ||
51 | |||
52 | IPROUTE2_PACKAGES =+ "\ | ||
53 | ${PN}-devlink \ | ||
54 | ${PN}-genl \ | ||
55 | ${PN}-ifstat \ | ||
56 | ${PN}-ip \ | ||
57 | ${PN}-lnstat \ | ||
58 | ${PN}-nstat \ | ||
59 | ${PN}-rtacct \ | ||
60 | ${PN}-ss \ | ||
61 | ${PN}-tc \ | ||
62 | ${PN}-tipc \ | ||
63 | ${PN}-rdma \ | ||
64 | " | ||
65 | |||
66 | PACKAGE_BEFORE_PN = "${IPROUTE2_PACKAGES}" | ||
67 | RDEPENDS:${PN} += "${PN}-ip" | ||
68 | |||
69 | FILES:${PN}-tc = "${base_sbindir}/tc* \ | ||
70 | ${libdir}/tc/*.so" | ||
71 | FILES:${PN}-lnstat = "${base_sbindir}/lnstat \ | ||
72 | ${base_sbindir}/ctstat \ | ||
73 | ${base_sbindir}/rtstat" | ||
74 | FILES:${PN}-ifstat = "${base_sbindir}/ifstat" | ||
75 | FILES:${PN}-ip = "${base_sbindir}/ip.${PN} ${sysconfdir}/iproute2" | ||
76 | FILES:${PN}-genl = "${base_sbindir}/genl" | ||
77 | FILES:${PN}-rtacct = "${base_sbindir}/rtacct" | ||
78 | FILES:${PN}-nstat = "${base_sbindir}/nstat" | ||
79 | FILES:${PN}-ss = "${base_sbindir}/ss" | ||
80 | FILES:${PN}-tipc = "${base_sbindir}/tipc" | ||
81 | FILES:${PN}-devlink = "${base_sbindir}/devlink" | ||
82 | FILES:${PN}-rdma = "${base_sbindir}/rdma" | ||
83 | |||
84 | ALTERNATIVE:${PN}-ip = "ip" | ||
85 | ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}" | ||
86 | ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip" | ||
87 | ALTERNATIVE_PRIORITY = "100" | ||
88 | |||
89 | ALTERNATIVE:${PN}-tc = "tc" | ||
90 | ALTERNATIVE_LINK_NAME[tc] = "${base_sbindir}/tc" | ||
91 | ALTERNATIVE_PRIORITY_${PN}-tc = "100" | ||
diff --git a/meta-xilinx-core/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch b/meta-xilinx-core/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch deleted file mode 100644 index 74e3de1c..00000000 --- a/meta-xilinx-core/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From c25f8d1f7a6203dfeb10b39f80ffd314bb84a58d Mon Sep 17 00:00:00 2001 | ||
2 | From: Baruch Siach <baruch@tkos.co.il> | ||
3 | Date: Thu, 22 Dec 2016 15:26:30 +0200 | ||
4 | Subject: [PATCH] libc-compat.h: add musl workaround | ||
5 | |||
6 | The libc-compat.h kernel header uses glibc specific macros (__GLIBC__ and | ||
7 | __USE_MISC) to solve conflicts with libc provided headers. This patch makes | ||
8 | libc-compat.h work for musl libc as well. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Taken From: | ||
13 | https://git.buildroot.net/buildroot/tree/package/iproute2/0001-Add-the-musl-workaround-to-the-libc-compat.h-copy.patch | ||
14 | |||
15 | Signed-off-by: Baruch Siach <baruch@tkos.co.il> | ||
16 | Signed-off-by: Maxin B. John <maxin.john@intel.com> | ||
17 | |||
18 | --- | ||
19 | include/uapi/linux/libc-compat.h | 4 +++- | ||
20 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h | ||
23 | index a159991..22198fa 100644 | ||
24 | --- a/include/uapi/linux/libc-compat.h | ||
25 | +++ b/include/uapi/linux/libc-compat.h | ||
26 | @@ -50,10 +50,12 @@ | ||
27 | #define _LIBC_COMPAT_H | ||
28 | |||
29 | /* We have included glibc headers... */ | ||
30 | -#if defined(__GLIBC__) | ||
31 | +#if 1 | ||
32 | +#define __USE_MISC | ||
33 | |||
34 | /* Coordinate with glibc net/if.h header. */ | ||
35 | #if defined(_NET_IF_H) && defined(__USE_MISC) | ||
36 | +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 | ||
37 | |||
38 | /* GLIBC headers included first so don't define anything | ||
39 | * that would already be defined. */ | ||
diff --git a/meta-xilinx-core/recipes-connectivity/iproute2/iproute2_5.15.0.bb b/meta-xilinx-core/recipes-connectivity/iproute2/iproute2_5.15.0.bb deleted file mode 100644 index 99a74339..00000000 --- a/meta-xilinx-core/recipes-connectivity/iproute2/iproute2_5.15.0.bb +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | require iproute2.inc | ||
2 | |||
3 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \ | ||
4 | file://0001-libc-compat.h-add-musl-workaround.patch \ | ||
5 | " | ||
6 | |||
7 | SRC_URI[sha256sum] = "38e3e4a5f9a7f5575c015027a10df097c149111eeb739993128e5b2b35b291ff" | ||
8 | |||
9 | # CFLAGS are computed in Makefile and reference CCOPTS | ||
10 | # | ||
11 | EXTRA_OEMAKE:append = " CCOPTS='${CFLAGS}'" | ||
diff --git a/meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb b/meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb deleted file mode 100644 index 334b786b..00000000 --- a/meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | SUMMARY = "A general purpose TCP-IP emulator" | ||
2 | DESCRIPTION = "A general purpose TCP-IP emulator used by virtual machine hypervisors to provide virtual networking services." | ||
3 | HOMEPAGE = "https://gitlab.freedesktop.org/slirp/libslirp" | ||
4 | LICENSE = "BSD-3-Clause & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bca0186b14e6b05e338e729f106db727" | ||
6 | |||
7 | SRC_URI = "git://gitlab.freedesktop.org/slirp/libslirp.git;protocol=https;branch=master" | ||
8 | SRCREV = "3ad1710a96678fe79066b1469cead4058713a1d9" | ||
9 | PV = "4.7.0" | ||
10 | S = "${WORKDIR}/git" | ||
11 | |||
12 | DEPENDS = " \ | ||
13 | glib-2.0 \ | ||
14 | " | ||
15 | |||
16 | inherit meson pkgconfig | ||
17 | |||
18 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta-xilinx-core/recipes-core/packagegroups/packagegroup-lmsensors.bb b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-lmsensors.bb new file mode 100644 index 00000000..d6df0b13 --- /dev/null +++ b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-lmsensors.bb | |||
@@ -0,0 +1,13 @@ | |||
1 | DESCRIPTION = "PetaLinux packages that provides tools and drivers for monitoring temperatures, voltage" | ||
2 | |||
3 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | ||
4 | |||
5 | inherit packagegroup | ||
6 | |||
7 | LMSENSORS_PACKAGES = " \ | ||
8 | lmsensors-sensors \ | ||
9 | lmsensors-libsensors \ | ||
10 | lmsensors-sensorsdetect \ | ||
11 | " | ||
12 | |||
13 | RDEPENDS:${PN} = "${LMSENSORS_PACKAGES}" | ||
diff --git a/meta-xilinx-core/recipes-core/packagegroups/packagegroup-networking-stack.bb b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-networking-stack.bb new file mode 100644 index 00000000..9378e372 --- /dev/null +++ b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-networking-stack.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | DESCRIPTION = "Packages to extend network stack" | ||
2 | |||
3 | inherit packagegroup | ||
4 | |||
5 | NETWORKING_STACK_PACKAGES = " \ | ||
6 | ethtool \ | ||
7 | phytool \ | ||
8 | netcat \ | ||
9 | net-tools \ | ||
10 | dnsmasq \ | ||
11 | iproute2 \ | ||
12 | iptables \ | ||
13 | rpcbind \ | ||
14 | iperf2 \ | ||
15 | iperf3 \ | ||
16 | " | ||
17 | |||
18 | RDEPENDS:${PN} = "${NETWORKING_STACK_PACKAGES}" | ||
diff --git a/meta-xilinx-core/recipes-core/packagegroups/packagegroup-opencv.bb b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-opencv.bb new file mode 100644 index 00000000..2742b99e --- /dev/null +++ b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-opencv.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | DESCRIPTION = "PetaLinux opencv supported packages" | ||
2 | |||
3 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | ||
4 | |||
5 | inherit packagegroup | ||
6 | |||
7 | OPENCV_PACKAGES = " \ | ||
8 | opencv \ | ||
9 | libopencv-core \ | ||
10 | libopencv-highgui \ | ||
11 | libopencv-imgproc \ | ||
12 | libopencv-objdetect \ | ||
13 | libopencv-ml \ | ||
14 | libopencv-calib3d \ | ||
15 | libopencv-ccalib \ | ||
16 | " | ||
17 | |||
18 | RDEPENDS:${PN} = "${OPENCV_PACKAGES}" | ||
diff --git a/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-audio.bb b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-audio.bb new file mode 100644 index 00000000..45862a87 --- /dev/null +++ b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-audio.bb | |||
@@ -0,0 +1,16 @@ | |||
1 | DESCRIPTION = "ASLA supported packages" | ||
2 | |||
3 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | ||
4 | |||
5 | inherit packagegroup | ||
6 | |||
7 | ALSA_PACKAGES = " \ | ||
8 | libasound \ | ||
9 | alsa-plugins \ | ||
10 | alsa-tools \ | ||
11 | alsa-utils \ | ||
12 | alsa-utils-scripts \ | ||
13 | sox \ | ||
14 | ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio-server pulseaudio-client-conf-sato pulseaudio-misc', '', d)} \ | ||
15 | " | ||
16 | RDEPENDS:${PN} = "${ALSA_PACKAGES}" | ||
diff --git a/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-benchmarks.bb b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-benchmarks.bb new file mode 100644 index 00000000..90131e32 --- /dev/null +++ b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-benchmarks.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | DESCRIPTION = "Packages for Benchmarks" | ||
2 | |||
3 | inherit packagegroup | ||
4 | |||
5 | BENCHMARKS_EXTRAS = " \ | ||
6 | hdparm \ | ||
7 | iotop \ | ||
8 | nicstat \ | ||
9 | lmbench \ | ||
10 | iptraf \ | ||
11 | net-snmp \ | ||
12 | lsof \ | ||
13 | babeltrace \ | ||
14 | sysstat \ | ||
15 | dool \ | ||
16 | dhrystone \ | ||
17 | linpack \ | ||
18 | whetstone \ | ||
19 | iperf3 \ | ||
20 | " | ||
21 | RDEPENDS:${PN} = "${BENCHMARKS_EXTRAS}" | ||
diff --git a/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-gstreamer.bb b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-gstreamer.bb new file mode 100644 index 00000000..26aa26a2 --- /dev/null +++ b/meta-xilinx-core/recipes-core/packagegroups/packagegroup-xilinx-gstreamer.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | DESCRIPTION = "GStreamer packages" | ||
2 | |||
3 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
4 | |||
5 | inherit packagegroup | ||
6 | |||
7 | GSTREAMER_PACKAGES = " \ | ||
8 | gstreamer1.0 \ | ||
9 | gstreamer1.0-python \ | ||
10 | gstreamer1.0-meta-base \ | ||
11 | gstreamer1.0-plugins-base \ | ||
12 | gstreamer1.0-plugins-good \ | ||
13 | gstreamer1.0-plugins-bad \ | ||
14 | gstreamer1.0-rtsp-server \ | ||
15 | gst-shark \ | ||
16 | gstd \ | ||
17 | gst-perf \ | ||
18 | gstreamer1.0-omx \ | ||
19 | " | ||
20 | |||
21 | RDEPENDS:${PN} = "${GSTREAMER_PACKAGES}" | ||
diff --git a/meta-xilinx-core/recipes-devtools/bootgen/bootgen_2024.1.bb b/meta-xilinx-core/recipes-devtools/bootgen/bootgen_2024.2.bb index 3c68f10d..ba6d829d 100644 --- a/meta-xilinx-core/recipes-devtools/bootgen/bootgen_2024.1.bb +++ b/meta-xilinx-core/recipes-devtools/bootgen/bootgen_2024.2.bb | |||
@@ -10,8 +10,8 @@ DEPENDS += "openssl" | |||
10 | RDEPENDS:${PN} += "openssl" | 10 | RDEPENDS:${PN} += "openssl" |
11 | 11 | ||
12 | REPO ?= "git://github.com/Xilinx/bootgen.git;protocol=https" | 12 | REPO ?= "git://github.com/Xilinx/bootgen.git;protocol=https" |
13 | BRANCH = "xlnx_rel_v2024.1" | 13 | BRANCH = "xlnx_rel_v2024.2" |
14 | SRCREV = "92e09bf37ea17d7b1f0e102a2548f27fb768651c" | 14 | SRCREV = "6f448fece5d999985128fd454ae047e065a5e45d" |
15 | 15 | ||
16 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | 16 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" |
17 | SRC_URI = "${REPO};${BRANCHARG}" | 17 | SRC_URI = "${REPO};${BRANCHARG}" |
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-bokeh_3.5.1.bb b/meta-xilinx-core/recipes-devtools/python/python3-bokeh_3.5.1.bb new file mode 100644 index 00000000..75295dec --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/python/python3-bokeh_3.5.1.bb | |||
@@ -0,0 +1,27 @@ | |||
1 | SUMMARY = "Interactive plots and applications in the browser from Python" | ||
2 | HOMEPAGE = "https://bokeh.org" | ||
3 | LICENSE = "BSD-3-Clause" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4d2241e774601133cb2c58ae1277f9a5" | ||
5 | |||
6 | DEPENDS += " \ | ||
7 | python3-colorama-native \ | ||
8 | python3-setuptools-git-versioning-native \ | ||
9 | " | ||
10 | |||
11 | SRC_URI[sha256sum] = "21dbe86842b24d83c73a1aef2de346a1a7c11c437015d6e9d180a1637e6e8197" | ||
12 | |||
13 | inherit pypi python_setuptools_build_meta | ||
14 | |||
15 | RDEPENDS:${PN} = " \ | ||
16 | python3-colorama \ | ||
17 | python3-contourpy \ | ||
18 | python3-jinja2 \ | ||
19 | python3-numpy \ | ||
20 | python3-packaging \ | ||
21 | python3-pandas \ | ||
22 | python3-pillow \ | ||
23 | python3-pyyaml \ | ||
24 | python3-tornado \ | ||
25 | python3-typing-extensions \ | ||
26 | python3-xyzservices \ | ||
27 | " | ||
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-contourpy_1.2.1.bb b/meta-xilinx-core/recipes-devtools/python/python3-contourpy_1.2.1.bb new file mode 100644 index 00000000..5f21b002 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/python/python3-contourpy_1.2.1.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | SUMMARY = "Python library for calculating contours of 2D quadrilateral grids" | ||
2 | HOMEPAGE = "https://github.com/contourpy/contourpy" | ||
3 | LICENSE = "BSD-3-Clause" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a051d5dfc6ccbc7bbe3e626d65156784" | ||
5 | |||
6 | DEPENDS += " \ | ||
7 | meson-native \ | ||
8 | python3-pybind11-native \ | ||
9 | " | ||
10 | |||
11 | SRC_URI[sha256sum] = "4d8908b3bee1c889e547867ca4cdc54e5ab6be6d3e078556814a22457f49423c" | ||
12 | |||
13 | inherit pypi python_mesonpy | ||
14 | |||
15 | RDEPENDS:${PN} = "python3-numpy" | ||
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-mercantile_1.2.1.bb b/meta-xilinx-core/recipes-devtools/python/python3-mercantile_1.2.1.bb new file mode 100644 index 00000000..33987e68 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/python/python3-mercantile_1.2.1.bb | |||
@@ -0,0 +1,16 @@ | |||
1 | SUMMARY = "Web mercator XYZ tile utilities" | ||
2 | HOMEPAGE = "https://github.com/mapbox/mercantile" | ||
3 | LICENSE = "BSD-3-Clause" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=11e1a3a1ec3801b170b9152c135e8f74 \ | ||
5 | file://docs/license.rst;md5=083a4719b463be5b728fd0e3f47db7e7" | ||
6 | |||
7 | SRC_URI[sha256sum] = "fa3c6db15daffd58454ac198b31887519a19caccee3f9d63d17ae7ff61b3b56b" | ||
8 | |||
9 | inherit pypi setuptools3 | ||
10 | |||
11 | RDEPENDS:${PN} += " \ | ||
12 | python3-click \ | ||
13 | python3-core \ | ||
14 | python3-json \ | ||
15 | python3-logging \ | ||
16 | " | ||
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-pybind11_2.13.1.bb b/meta-xilinx-core/recipes-devtools/python/python3-pybind11_2.13.1.bb new file mode 100644 index 00000000..3c03069b --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/python/python3-pybind11_2.13.1.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | SUMMARY = "Seamless operability between C++11 and Python" | ||
2 | LICENSE = "BSD-3-Clause" | ||
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=774f65abd8a7fe3124be2cdf766cd06f" | ||
4 | |||
5 | SRC_URI[sha256sum] = "65be498b1cac516161add1508e65375674916bebf2570d057dc9c3c7bcbbc7b0" | ||
6 | |||
7 | inherit pypi python_setuptools_build_meta | ||
8 | |||
9 | BBCLASSEXTEND += "native" | ||
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-setuptools-git-versioning_2.0.0.bb b/meta-xilinx-core/recipes-devtools/python/python3-setuptools-git-versioning_2.0.0.bb new file mode 100644 index 00000000..53f04b77 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/python/python3-setuptools-git-versioning_2.0.0.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Use git repo data for building a version number according PEP-440" | ||
2 | HOMEPAGE = "https://setuptools-git-versioning.readthedocs.io" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=92e79e3a844e66731724600f3ac9c0d8" | ||
5 | |||
6 | SRC_URI[sha256sum] = "85b5fbe7bda8e9c24bbd9e587a9d4b91129417f4dd3e11e3c0d5f3f835fc4d4d" | ||
7 | |||
8 | inherit pypi setuptools3 | ||
9 | |||
10 | RDEPENDS:${PN} += " \ | ||
11 | python3-core \ | ||
12 | python3-datetime \ | ||
13 | python3-logging \ | ||
14 | python3-packaging \ | ||
15 | python3-pprint \ | ||
16 | python3-setuptools \ | ||
17 | python3-tomllib \ | ||
18 | " | ||
19 | |||
20 | BBCLASSEXTEND += "native" | ||
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-xyzservices_2024.6.0.bb b/meta-xilinx-core/recipes-devtools/python/python3-xyzservices_2024.6.0.bb new file mode 100644 index 00000000..3e9b7ee1 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/python/python3-xyzservices_2024.6.0.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Source of XYZ tiles providers" | ||
2 | HOMEPAGE = "https://github.com/geopandas/xyzservices" | ||
3 | LICENSE = "BSD-3-Clause" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=6a3e440ffacb99f21fa410467c048574" | ||
5 | |||
6 | DEPENDS += "python3-setuptools-scm-native" | ||
7 | |||
8 | SRC_URI[sha256sum] = "58c1bdab4257d2551b9ef91cd48571f77b7c4d2bc45bf5e3c05ac97b3a4d7282" | ||
9 | |||
10 | inherit pypi python_setuptools_build_meta | ||
11 | |||
12 | FILES:${PN} += "${prefix}" | ||
13 | |||
14 | RDEPENDS:${PN} += " \ | ||
15 | python3-core \ | ||
16 | python3-json \ | ||
17 | python3-mercantile \ | ||
18 | python3-netclient \ | ||
19 | python3-requests \ | ||
20 | " | ||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch index f310edfa..77b13aa2 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch +++ b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch | |||
@@ -35,14 +35,45 @@ if '-bootbin' in APU_args: | |||
35 | if PMU_args and PLM_args: | 35 | if PMU_args and PLM_args: |
36 | sys.exit("\nError: -pmu-args can not be used with -plm-args\n") | 36 | sys.exit("\nError: -pmu-args can not be used with -plm-args\n") |
37 | 37 | ||
38 | if ('--help' in APU_args) or (not PMU_args and not PLM_args): | 38 | help_options = ['-h', '-help', '--help'] |
39 | print("AMD FPGA QEMU multiarch wrapper\nVersion 2024.1\n\nUsage:") | 39 | def help(status): |
40 | print("AMD FPGA QEMU multiarch wrapper\nVersion 2024.2\n\nUsage:") | ||
40 | print(f" {sys.argv[0]} <APU options> [-pmu-args <pmu options>]") | 41 | print(f" {sys.argv[0]} <APU options> [-pmu-args <pmu options>]") |
41 | print(f" {sys.argv[0]} <APU options> [-plm-args <plm options>]\n") | 42 | print(f" {sys.argv[0]} <APU options> [-plm-args <plm options>]\n") |
42 | sys.exit(1) | 43 | if status == 0: |
44 | print(f"\n") | ||
45 | if set(PMU_args).intersection(set(help_options)): | ||
46 | print(f"PMU Options:\n") | ||
47 | pmu_args_s = ' '.join(PMU_args) | ||
48 | help_cmd = f'{binpath}/qemu-system-microblazeel {pmu_args_s}' | ||
49 | elif set(PLM_args).intersection(set(help_options)): | ||
50 | print(f"PLM Options:\n") | ||
51 | plm_args_s = ' '.join(PLM_args) | ||
52 | help_cmd = f'{binpath}/qemu-system-microblazeel {plm_args_s}' | ||
53 | else: | ||
54 | if not set(APU_args).intersection(set(help_options)): | ||
55 | APU_args.append('-help') | ||
56 | print(f"APU Options:\n") | ||
57 | print(f" -bootbin <boot.bin> - Use a boot.bin instead of individual firmware, device trees and bootloader\n") | ||
58 | apu_args_s = ' '.join(APU_args) | ||
59 | help_cmd = f'{binpath}/qemu-system-aarch64 {apu_args_s}' | ||
60 | |||
61 | print(f"{help_cmd}\n") | ||
62 | process = subprocess.Popen(help_cmd, shell=True, stderr=subprocess.PIPE) | ||
63 | status = process.wait() | ||
64 | sys.exit(status) | ||
65 | |||
66 | if set(APU_args).intersection(set(help_options)) or set(PMU_args).intersection(set(help_options)) or set(PLM_args).intersection(set(help_options)): | ||
67 | help(0) | ||
68 | |||
69 | if not PMU_args and not PLM_args: | ||
70 | help(1) | ||
43 | 71 | ||
44 | if PMU_args: | 72 | if PMU_args: |
45 | PMU_rom = PMU_args[PMU_args.index('-kernel')+1] | 73 | try: |
74 | PMU_rom = PMU_args[PMU_args.index('-kernel')+1] | ||
75 | except: | ||
76 | PMU_rom = "" | ||
46 | 77 | ||
47 | if not os.path.exists(PMU_rom): | 78 | if not os.path.exists(PMU_rom): |
48 | sys.exit(f'\nERROR: Missing PMU ROM: {PMU_rom}' | 79 | sys.exit(f'\nERROR: Missing PMU ROM: {PMU_rom}' |
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch new file mode 100644 index 00000000..ff7f64ad --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From 84986d94277de2ac853cb613c37dbafe485f0981 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
3 | Date: Fri, 6 Oct 2023 18:41:14 +0300 | ||
4 | Subject: [PATCH 1/2] python: rename QEMUMonitorProtocol.cmd() to cmd_raw() | ||
5 | |||
6 | Having cmd() and command() methods in one class doesn't look good. | ||
7 | Rename cmd() to cmd_raw(), to show its meaning better. | ||
8 | |||
9 | We also want to rename command() to cmd() in future, so this commit is | ||
10 | a necessary step. | ||
11 | |||
12 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
13 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
14 | Message-id: 20231006154125.1068348-5-vsementsov@yandex-team.ru | ||
15 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
16 | |||
17 | Upstream-Status: Backport (37274707f6f3868fae7e0055d9a703006fc142d0) | ||
18 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
19 | --- | ||
20 | python/qemu/machine/machine.py | 2 +- | ||
21 | python/qemu/qmp/legacy.py | 8 ++------ | ||
22 | tests/qemu-iotests/iotests.py | 2 +- | ||
23 | 3 files changed, 4 insertions(+), 8 deletions(-) | ||
24 | |||
25 | diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py | ||
26 | index c16a0b6fed..82fa8cdddf 100644 | ||
27 | --- a/python/qemu/machine/machine.py | ||
28 | +++ b/python/qemu/machine/machine.py | ||
29 | @@ -686,7 +686,7 @@ def qmp(self, cmd: str, | ||
30 | conv_keys = True | ||
31 | |||
32 | qmp_args = self._qmp_args(conv_keys, args) | ||
33 | - ret = self._qmp.cmd(cmd, args=qmp_args) | ||
34 | + ret = self._qmp.cmd_raw(cmd, args=qmp_args) | ||
35 | if cmd == 'quit' and 'error' not in ret and 'return' in ret: | ||
36 | self._quit_issued = True | ||
37 | return ret | ||
38 | diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py | ||
39 | index e1e9383978..e5fa1ce9c4 100644 | ||
40 | --- a/python/qemu/qmp/legacy.py | ||
41 | +++ b/python/qemu/qmp/legacy.py | ||
42 | @@ -194,21 +194,17 @@ def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: | ||
43 | ) | ||
44 | ) | ||
45 | |||
46 | - def cmd(self, name: str, | ||
47 | - args: Optional[Dict[str, object]] = None, | ||
48 | - cmd_id: Optional[object] = None) -> QMPMessage: | ||
49 | + def cmd_raw(self, name: str, | ||
50 | + args: Optional[Dict[str, object]] = None) -> QMPMessage: | ||
51 | """ | ||
52 | Build a QMP command and send it to the QMP Monitor. | ||
53 | |||
54 | :param name: command name (string) | ||
55 | :param args: command arguments (dict) | ||
56 | - :param cmd_id: command id (dict, list, string or int) | ||
57 | """ | ||
58 | qmp_cmd: QMPMessage = {'execute': name} | ||
59 | if args: | ||
60 | qmp_cmd['arguments'] = args | ||
61 | - if cmd_id: | ||
62 | - qmp_cmd['id'] = cmd_id | ||
63 | return self.cmd_obj(qmp_cmd) | ||
64 | |||
65 | def command(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
66 | diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py | ||
67 | index ef66fbd62b..8ffd9fb660 100644 | ||
68 | --- a/tests/qemu-iotests/iotests.py | ||
69 | +++ b/tests/qemu-iotests/iotests.py | ||
70 | @@ -460,7 +460,7 @@ def __init__(self, *args: str, instance_id: str = 'a', qmp: bool = False): | ||
71 | def qmp(self, cmd: str, args: Optional[Dict[str, object]] = None) \ | ||
72 | -> QMPMessage: | ||
73 | assert self._qmp is not None | ||
74 | - return self._qmp.cmd(cmd, args) | ||
75 | + return self._qmp.cmd_raw(cmd, args) | ||
76 | |||
77 | def get_qmp(self) -> QEMUMonitorProtocol: | ||
78 | assert self._qmp is not None | ||
79 | -- | ||
80 | 2.34.1 | ||
81 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch new file mode 100644 index 00000000..e776a537 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch | |||
@@ -0,0 +1,1011 @@ | |||
1 | From a7037d9661d40351b15d8c8bf209b512a7b5047e Mon Sep 17 00:00:00 2001 | ||
2 | From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
3 | Date: Fri, 6 Oct 2023 18:41:15 +0300 | ||
4 | Subject: [PATCH 2/2] python/qemu: rename command() to cmd() | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Use a shorter name. We are going to move in iotests from qmp() to | ||
10 | command() where possible. But command() is longer than qmp() and don't | ||
11 | look better. Let's rename. | ||
12 | |||
13 | You can simply grep for '\.command(' and for 'def command(' to check | ||
14 | that everything is updated (command() in tests/docker/docker.py is | ||
15 | unrelated). | ||
16 | |||
17 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
18 | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> | ||
19 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
20 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
21 | Reviewed-by: Juan Quintela <quintela@redhat.com> | ||
22 | Message-id: 20231006154125.1068348-6-vsementsov@yandex-team.ru | ||
23 | [vsementsov: also update three occurrences in | ||
24 | tests/avocado/machine_aspeed.py and keep r-b] | ||
25 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
26 | |||
27 | Upstream-status: Backport (684750ab4f8a3ad69512b71532408be3ac2547d4) | ||
28 | |||
29 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
30 | --- | ||
31 | docs/devel/testing.rst | 10 +- | ||
32 | python/qemu/machine/machine.py | 8 +- | ||
33 | python/qemu/qmp/legacy.py | 2 +- | ||
34 | python/qemu/qmp/qmp_shell.py | 11 +- | ||
35 | python/qemu/utils/qemu_ga_client.py | 2 +- | ||
36 | python/qemu/utils/qom.py | 8 +- | ||
37 | python/qemu/utils/qom_common.py | 2 +- | ||
38 | python/qemu/utils/qom_fuse.py | 6 +- | ||
39 | scripts/cpu-x86-uarch-abi.py | 4 +- | ||
40 | scripts/device-crash-test | 8 +- | ||
41 | scripts/render_block_graph.py | 8 +- | ||
42 | tests/avocado/avocado_qemu/__init__.py | 4 +- | ||
43 | tests/avocado/cpu_queries.py | 5 +- | ||
44 | tests/avocado/hotplug_cpu.py | 10 +- | ||
45 | tests/avocado/info_usernet.py | 4 +- | ||
46 | tests/avocado/machine_arm_integratorcp.py | 6 +- | ||
47 | tests/avocado/machine_aspeed.py | 12 +- | ||
48 | tests/avocado/machine_m68k_nextcube.py | 4 +- | ||
49 | tests/avocado/machine_mips_malta.py | 6 +- | ||
50 | tests/avocado/machine_s390_ccw_virtio.py | 28 ++-- | ||
51 | tests/avocado/migration.py | 10 +- | ||
52 | tests/avocado/pc_cpu_hotplug_props.py | 2 +- | ||
53 | tests/avocado/version.py | 4 +- | ||
54 | tests/avocado/virtio_check_params.py | 6 +- | ||
55 | tests/avocado/virtio_version.py | 5 +- | ||
56 | tests/avocado/x86_cpu_model_versions.py | 13 +- | ||
57 | tests/migration/guestperf/engine.py | 150 +++++++++++----------- | ||
58 | tests/qemu-iotests/256 | 34 ++--- | ||
59 | tests/qemu-iotests/257 | 36 +++--- | ||
60 | 29 files changed, 207 insertions(+), 201 deletions(-) | ||
61 | |||
62 | diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst | ||
63 | index b6ad21bed1..dddf1d6140 100644 | ||
64 | --- a/docs/devel/testing.rst | ||
65 | +++ b/docs/devel/testing.rst | ||
66 | @@ -1014,8 +1014,8 @@ class. Here's a simple usage example: | ||
67 | """ | ||
68 | def test_qmp_human_info_version(self): | ||
69 | self.vm.launch() | ||
70 | - res = self.vm.command('human-monitor-command', | ||
71 | - command_line='info version') | ||
72 | + res = self.vm.cmd('human-monitor-command', | ||
73 | + command_line='info version') | ||
74 | self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') | ||
75 | |||
76 | To execute your test, run: | ||
77 | @@ -1065,15 +1065,15 @@ and hypothetical example follows: | ||
78 | first_machine.launch() | ||
79 | second_machine.launch() | ||
80 | |||
81 | - first_res = first_machine.command( | ||
82 | + first_res = first_machine.cmd( | ||
83 | 'human-monitor-command', | ||
84 | command_line='info version') | ||
85 | |||
86 | - second_res = second_machine.command( | ||
87 | + second_res = second_machine.cmd( | ||
88 | 'human-monitor-command', | ||
89 | command_line='info version') | ||
90 | |||
91 | - third_res = self.get_vm(name='third_machine').command( | ||
92 | + third_res = self.get_vm(name='third_machine').cmd( | ||
93 | 'human-monitor-command', | ||
94 | command_line='info version') | ||
95 | |||
96 | diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py | ||
97 | index 82fa8cdddf..0c48b76731 100644 | ||
98 | --- a/python/qemu/machine/machine.py | ||
99 | +++ b/python/qemu/machine/machine.py | ||
100 | @@ -691,16 +691,16 @@ def qmp(self, cmd: str, | ||
101 | self._quit_issued = True | ||
102 | return ret | ||
103 | |||
104 | - def command(self, cmd: str, | ||
105 | - conv_keys: bool = True, | ||
106 | - **args: Any) -> QMPReturnValue: | ||
107 | + def cmd(self, cmd: str, | ||
108 | + conv_keys: bool = True, | ||
109 | + **args: Any) -> QMPReturnValue: | ||
110 | """ | ||
111 | Invoke a QMP command. | ||
112 | On success return the response dict. | ||
113 | On failure raise an exception. | ||
114 | """ | ||
115 | qmp_args = self._qmp_args(conv_keys, args) | ||
116 | - ret = self._qmp.command(cmd, **qmp_args) | ||
117 | + ret = self._qmp.cmd(cmd, **qmp_args) | ||
118 | if cmd == 'quit': | ||
119 | self._quit_issued = True | ||
120 | return ret | ||
121 | diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py | ||
122 | index e5fa1ce9c4..22a2b5616e 100644 | ||
123 | --- a/python/qemu/qmp/legacy.py | ||
124 | +++ b/python/qemu/qmp/legacy.py | ||
125 | @@ -207,7 +207,7 @@ def cmd_raw(self, name: str, | ||
126 | qmp_cmd['arguments'] = args | ||
127 | return self.cmd_obj(qmp_cmd) | ||
128 | |||
129 | - def command(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
130 | + def cmd(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
131 | """ | ||
132 | Build and send a QMP command to the monitor, report errors if any | ||
133 | """ | ||
134 | diff --git a/python/qemu/qmp/qmp_shell.py b/python/qemu/qmp/qmp_shell.py | ||
135 | index 619ab42ced..08240c16f8 100644 | ||
136 | --- a/python/qemu/qmp/qmp_shell.py | ||
137 | +++ b/python/qemu/qmp/qmp_shell.py | ||
138 | @@ -194,11 +194,12 @@ def close(self) -> None: | ||
139 | super().close() | ||
140 | |||
141 | def _fill_completion(self) -> None: | ||
142 | - cmds = self.cmd('query-commands') | ||
143 | - if 'error' in cmds: | ||
144 | - return | ||
145 | - for cmd in cmds['return']: | ||
146 | - self._completer.append(cmd['name']) | ||
147 | + try: | ||
148 | + cmds = cast(List[Dict[str, str]], self.cmd('query-commands')) | ||
149 | + for cmd in cmds: | ||
150 | + self._completer.append(cmd['name']) | ||
151 | + except ExecuteError: | ||
152 | + pass | ||
153 | |||
154 | def _completer_setup(self) -> None: | ||
155 | self._completer = QMPCompleter() | ||
156 | diff --git a/python/qemu/utils/qemu_ga_client.py b/python/qemu/utils/qemu_ga_client.py | ||
157 | index d8411bb2d0..9a665e6e99 100644 | ||
158 | --- a/python/qemu/utils/qemu_ga_client.py | ||
159 | +++ b/python/qemu/utils/qemu_ga_client.py | ||
160 | @@ -64,7 +64,7 @@ | ||
161 | class QemuGuestAgent(QEMUMonitorProtocol): | ||
162 | def __getattr__(self, name: str) -> Callable[..., Any]: | ||
163 | def wrapper(**kwds: object) -> object: | ||
164 | - return self.command('guest-' + name.replace('_', '-'), **kwds) | ||
165 | + return self.cmd('guest-' + name.replace('_', '-'), **kwds) | ||
166 | return wrapper | ||
167 | |||
168 | |||
169 | diff --git a/python/qemu/utils/qom.py b/python/qemu/utils/qom.py | ||
170 | index bcf192f477..426a0f245f 100644 | ||
171 | --- a/python/qemu/utils/qom.py | ||
172 | +++ b/python/qemu/utils/qom.py | ||
173 | @@ -84,7 +84,7 @@ def __init__(self, args: argparse.Namespace): | ||
174 | self.value = args.value | ||
175 | |||
176 | def run(self) -> int: | ||
177 | - rsp = self.qmp.command( | ||
178 | + rsp = self.qmp.cmd( | ||
179 | 'qom-set', | ||
180 | path=self.path, | ||
181 | property=self.prop, | ||
182 | @@ -129,7 +129,7 @@ def __init__(self, args: argparse.Namespace): | ||
183 | self.prop = tmp[1] | ||
184 | |||
185 | def run(self) -> int: | ||
186 | - rsp = self.qmp.command( | ||
187 | + rsp = self.qmp.cmd( | ||
188 | 'qom-get', | ||
189 | path=self.path, | ||
190 | property=self.prop | ||
191 | @@ -231,8 +231,8 @@ def _list_node(self, path: str) -> None: | ||
192 | if item.child: | ||
193 | continue | ||
194 | try: | ||
195 | - rsp = self.qmp.command('qom-get', path=path, | ||
196 | - property=item.name) | ||
197 | + rsp = self.qmp.cmd('qom-get', path=path, | ||
198 | + property=item.name) | ||
199 | print(f" {item.name}: {rsp} ({item.type})") | ||
200 | except ExecuteError as err: | ||
201 | print(f" {item.name}: <EXCEPTION: {err!s}> ({item.type})") | ||
202 | diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common.py | ||
203 | index 80da1b2304..dd2c8b1908 100644 | ||
204 | --- a/python/qemu/utils/qom_common.py | ||
205 | +++ b/python/qemu/utils/qom_common.py | ||
206 | @@ -140,7 +140,7 @@ def qom_list(self, path: str) -> List[ObjectPropertyInfo]: | ||
207 | """ | ||
208 | :return: a strongly typed list from the 'qom-list' command. | ||
209 | """ | ||
210 | - rsp = self.qmp.command('qom-list', path=path) | ||
211 | + rsp = self.qmp.cmd('qom-list', path=path) | ||
212 | # qom-list returns List[ObjectPropertyInfo] | ||
213 | assert isinstance(rsp, list) | ||
214 | return [ObjectPropertyInfo.make(x) for x in rsp] | ||
215 | diff --git a/python/qemu/utils/qom_fuse.py b/python/qemu/utils/qom_fuse.py | ||
216 | index 8dcd59fcde..cf7e344bd5 100644 | ||
217 | --- a/python/qemu/utils/qom_fuse.py | ||
218 | +++ b/python/qemu/utils/qom_fuse.py | ||
219 | @@ -137,7 +137,7 @@ def read(self, path: str, size: int, offset: int, fh: IO[bytes]) -> bytes: | ||
220 | if path == '': | ||
221 | path = '/' | ||
222 | try: | ||
223 | - data = str(self.qmp.command('qom-get', path=path, property=prop)) | ||
224 | + data = str(self.qmp.cmd('qom-get', path=path, property=prop)) | ||
225 | data += '\n' # make values shell friendly | ||
226 | except ExecuteError as err: | ||
227 | raise FuseOSError(EPERM) from err | ||
228 | @@ -152,8 +152,8 @@ def readlink(self, path: str) -> Union[bool, str]: | ||
229 | return False | ||
230 | path, prop = path.rsplit('/', 1) | ||
231 | prefix = '/'.join(['..'] * (len(path.split('/')) - 1)) | ||
232 | - return prefix + str(self.qmp.command('qom-get', path=path, | ||
233 | - property=prop)) | ||
234 | + return prefix + str(self.qmp.cmd('qom-get', path=path, | ||
235 | + property=prop)) | ||
236 | |||
237 | def getattr(self, path: str, | ||
238 | fh: Optional[IO[bytes]] = None) -> Mapping[str, object]: | ||
239 | diff --git a/scripts/cpu-x86-uarch-abi.py b/scripts/cpu-x86-uarch-abi.py | ||
240 | index 82ff07582f..379a3c64bd 100644 | ||
241 | --- a/scripts/cpu-x86-uarch-abi.py | ||
242 | +++ b/scripts/cpu-x86-uarch-abi.py | ||
243 | @@ -94,8 +94,8 @@ | ||
244 | |||
245 | for name in sorted(names): | ||
246 | cpu = shell.cmd("query-cpu-model-expansion", | ||
247 | - { "type": "static", | ||
248 | - "model": { "name": name }}) | ||
249 | + { "type": "static", | ||
250 | + "model": { "name": name }}) | ||
251 | |||
252 | got = {} | ||
253 | for (feature, present) in cpu["return"]["model"]["props"].items(): | ||
254 | diff --git a/scripts/device-crash-test b/scripts/device-crash-test | ||
255 | index b74d887331..9bf9d0d6e6 100755 | ||
256 | --- a/scripts/device-crash-test | ||
257 | +++ b/scripts/device-crash-test | ||
258 | @@ -269,14 +269,14 @@ def formatTestCase(t): | ||
259 | |||
260 | def qomListTypeNames(vm, **kwargs): | ||
261 | """Run qom-list-types QMP command, return type names""" | ||
262 | - types = vm.command('qom-list-types', **kwargs) | ||
263 | + types = vm.cmd('qom-list-types', **kwargs) | ||
264 | return [t['name'] for t in types] | ||
265 | |||
266 | |||
267 | def infoQDM(vm): | ||
268 | """Parse 'info qdm' output""" | ||
269 | args = {'command-line': 'info qdm'} | ||
270 | - devhelp = vm.command('human-monitor-command', **args) | ||
271 | + devhelp = vm.cmd('human-monitor-command', **args) | ||
272 | for l in devhelp.split('\n'): | ||
273 | l = l.strip() | ||
274 | if l == '' or l.endswith(':'): | ||
275 | @@ -304,9 +304,9 @@ class QemuBinaryInfo(object): | ||
276 | # there's no way to query DeviceClass::user_creatable using QMP, | ||
277 | # so use 'info qdm': | ||
278 | self.no_user_devs = set([d['name'] for d in infoQDM(vm, ) if d['no-user']]) | ||
279 | - self.machines = list(m['name'] for m in vm.command('query-machines')) | ||
280 | + self.machines = list(m['name'] for m in vm.cmd('query-machines')) | ||
281 | self.user_devs = self.alldevs.difference(self.no_user_devs) | ||
282 | - self.kvm_available = vm.command('query-kvm')['enabled'] | ||
283 | + self.kvm_available = vm.cmd('query-kvm')['enabled'] | ||
284 | finally: | ||
285 | vm.shutdown() | ||
286 | |||
287 | diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py | ||
288 | index 8f731a5cfe..3e1a2e3fa7 100755 | ||
289 | --- a/scripts/render_block_graph.py | ||
290 | +++ b/scripts/render_block_graph.py | ||
291 | @@ -43,13 +43,13 @@ def render_block_graph(qmp, filename, format='png'): | ||
292 | representation in @format into "@filename.@format" | ||
293 | ''' | ||
294 | |||
295 | - bds_nodes = qmp.command('query-named-block-nodes') | ||
296 | + bds_nodes = qmp.cmd('query-named-block-nodes') | ||
297 | bds_nodes = {n['node-name']: n for n in bds_nodes} | ||
298 | |||
299 | - job_nodes = qmp.command('query-block-jobs') | ||
300 | + job_nodes = qmp.cmd('query-block-jobs') | ||
301 | job_nodes = {n['device']: n for n in job_nodes} | ||
302 | |||
303 | - block_graph = qmp.command('x-debug-query-block-graph') | ||
304 | + block_graph = qmp.cmd('x-debug-query-block-graph') | ||
305 | |||
306 | graph = Digraph(comment='Block Nodes Graph') | ||
307 | graph.format = format | ||
308 | @@ -94,7 +94,7 @@ class LibvirtGuest(): | ||
309 | def __init__(self, name): | ||
310 | self.name = name | ||
311 | |||
312 | - def command(self, cmd): | ||
313 | + def cmd(self, cmd): | ||
314 | # only supports qmp commands without parameters | ||
315 | m = {'execute': cmd} | ||
316 | ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)] | ||
317 | diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py | ||
318 | index 33090903f1..1a4d40a46f 100644 | ||
319 | --- a/tests/avocado/avocado_qemu/__init__.py | ||
320 | +++ b/tests/avocado/avocado_qemu/__init__.py | ||
321 | @@ -408,8 +408,8 @@ class LinuxSSHMixIn: | ||
322 | |||
323 | def ssh_connect(self, username, credential, credential_is_key=True): | ||
324 | self.ssh_logger = logging.getLogger('ssh') | ||
325 | - res = self.vm.command('human-monitor-command', | ||
326 | - command_line='info usernet') | ||
327 | + res = self.vm.cmd('human-monitor-command', | ||
328 | + command_line='info usernet') | ||
329 | port = get_info_usernet_hostfwd_port(res) | ||
330 | self.assertIsNotNone(port) | ||
331 | self.assertGreater(port, 0) | ||
332 | diff --git a/tests/avocado/cpu_queries.py b/tests/avocado/cpu_queries.py | ||
333 | index cf69f69b11..86c2d5c92d 100644 | ||
334 | --- a/tests/avocado/cpu_queries.py | ||
335 | +++ b/tests/avocado/cpu_queries.py | ||
336 | @@ -23,12 +23,13 @@ def test(self): | ||
337 | self.vm.add_args('-S') | ||
338 | self.vm.launch() | ||
339 | |||
340 | - cpus = self.vm.command('query-cpu-definitions') | ||
341 | + cpus = self.vm.cmd('query-cpu-definitions') | ||
342 | for c in cpus: | ||
343 | self.log.info("Checking CPU: %s", c) | ||
344 | self.assertNotIn('', c['unavailable-features'], c['name']) | ||
345 | |||
346 | for c in cpus: | ||
347 | model = {'name': c['name']} | ||
348 | - e = self.vm.command('query-cpu-model-expansion', model=model, type='full') | ||
349 | + e = self.vm.cmd('query-cpu-model-expansion', model=model, | ||
350 | + type='full') | ||
351 | self.assertEquals(e['model']['name'], c['name']) | ||
352 | diff --git a/tests/avocado/hotplug_cpu.py b/tests/avocado/hotplug_cpu.py | ||
353 | index 6374bf1b54..292bb43e4d 100644 | ||
354 | --- a/tests/avocado/hotplug_cpu.py | ||
355 | +++ b/tests/avocado/hotplug_cpu.py | ||
356 | @@ -29,9 +29,9 @@ def test(self): | ||
357 | with self.assertRaises(AssertionError): | ||
358 | self.ssh_command('test -e /sys/devices/system/cpu/cpu1') | ||
359 | |||
360 | - self.vm.command('device_add', | ||
361 | - driver='Haswell-x86_64-cpu', | ||
362 | - socket_id=0, | ||
363 | - core_id=1, | ||
364 | - thread_id=0) | ||
365 | + self.vm.cmd('device_add', | ||
366 | + driver='Haswell-x86_64-cpu', | ||
367 | + socket_id=0, | ||
368 | + core_id=1, | ||
369 | + thread_id=0) | ||
370 | self.ssh_command('test -e /sys/devices/system/cpu/cpu1') | ||
371 | diff --git a/tests/avocado/info_usernet.py b/tests/avocado/info_usernet.py | ||
372 | index fdc4d90c42..e1aa7a6e0a 100644 | ||
373 | --- a/tests/avocado/info_usernet.py | ||
374 | +++ b/tests/avocado/info_usernet.py | ||
375 | @@ -22,8 +22,8 @@ def test_hostfwd(self): | ||
376 | self.require_netdev('user') | ||
377 | self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22') | ||
378 | self.vm.launch() | ||
379 | - res = self.vm.command('human-monitor-command', | ||
380 | - command_line='info usernet') | ||
381 | + res = self.vm.cmd('human-monitor-command', | ||
382 | + command_line='info usernet') | ||
383 | port = get_info_usernet_hostfwd_port(res) | ||
384 | self.assertIsNotNone(port, | ||
385 | ('"info usernet" output content does not seem to ' | ||
386 | diff --git a/tests/avocado/machine_arm_integratorcp.py b/tests/avocado/machine_arm_integratorcp.py | ||
387 | index 1ffe1073ef..87f5cf3953 100644 | ||
388 | --- a/tests/avocado/machine_arm_integratorcp.py | ||
389 | +++ b/tests/avocado/machine_arm_integratorcp.py | ||
390 | @@ -81,9 +81,9 @@ def test_framebuffer_tux_logo(self): | ||
391 | self.boot_integratorcp() | ||
392 | framebuffer_ready = 'Console: switching to colour frame buffer device' | ||
393 | wait_for_console_pattern(self, framebuffer_ready) | ||
394 | - self.vm.command('human-monitor-command', command_line='stop') | ||
395 | - self.vm.command('human-monitor-command', | ||
396 | - command_line='screendump %s' % screendump_path) | ||
397 | + self.vm.cmd('human-monitor-command', command_line='stop') | ||
398 | + self.vm.cmd('human-monitor-command', | ||
399 | + command_line='screendump %s' % screendump_path) | ||
400 | logger = logging.getLogger('framebuffer') | ||
401 | |||
402 | cpu_count = 1 | ||
403 | diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py | ||
404 | index 724ee72c02..68619bbbdc 100644 | ||
405 | --- a/tests/avocado/machine_aspeed.py | ||
406 | +++ b/tests/avocado/machine_aspeed.py | ||
407 | @@ -181,8 +181,8 @@ def test_arm_ast2500_evb_buildroot(self): | ||
408 | 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); | ||
409 | exec_command_and_wait_for_pattern(self, | ||
410 | 'cat /sys/class/hwmon/hwmon1/temp1_input', '0') | ||
411 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
412 | - property='temperature', value=18000); | ||
413 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
414 | + property='temperature', value=18000); | ||
415 | exec_command_and_wait_for_pattern(self, | ||
416 | 'cat /sys/class/hwmon/hwmon1/temp1_input', '18000') | ||
417 | |||
418 | @@ -213,8 +213,8 @@ def test_arm_ast2600_evb_buildroot(self): | ||
419 | 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); | ||
420 | exec_command_and_wait_for_pattern(self, | ||
421 | 'cat /sys/class/hwmon/hwmon0/temp1_input', '0') | ||
422 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
423 | - property='temperature', value=18000); | ||
424 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
425 | + property='temperature', value=18000); | ||
426 | exec_command_and_wait_for_pattern(self, | ||
427 | 'cat /sys/class/hwmon/hwmon0/temp1_input', '18000') | ||
428 | |||
429 | @@ -357,8 +357,8 @@ def test_arm_ast2600_evb_sdk(self): | ||
430 | 'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d'); | ||
431 | self.ssh_command_output_contains( | ||
432 | 'cat /sys/class/hwmon/hwmon19/temp1_input', '0') | ||
433 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
434 | - property='temperature', value=18000); | ||
435 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
436 | + property='temperature', value=18000); | ||
437 | self.ssh_command_output_contains( | ||
438 | 'cat /sys/class/hwmon/hwmon19/temp1_input', '18000') | ||
439 | |||
440 | diff --git a/tests/avocado/machine_m68k_nextcube.py b/tests/avocado/machine_m68k_nextcube.py | ||
441 | index 6790e7d9cd..d6da2fbb01 100644 | ||
442 | --- a/tests/avocado/machine_m68k_nextcube.py | ||
443 | +++ b/tests/avocado/machine_m68k_nextcube.py | ||
444 | @@ -43,8 +43,8 @@ def check_bootrom_framebuffer(self, screenshot_path): | ||
445 | # 'displaysurface_create 1120x832' trace-event. | ||
446 | time.sleep(2) | ||
447 | |||
448 | - self.vm.command('human-monitor-command', | ||
449 | - command_line='screendump %s' % screenshot_path) | ||
450 | + self.vm.cmd('human-monitor-command', | ||
451 | + command_line='screendump %s' % screenshot_path) | ||
452 | |||
453 | @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') | ||
454 | def test_bootrom_framebuffer_size(self): | ||
455 | diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mips_malta.py | ||
456 | index 92233451c5..9bd54518bf 100644 | ||
457 | --- a/tests/avocado/machine_mips_malta.py | ||
458 | +++ b/tests/avocado/machine_mips_malta.py | ||
459 | @@ -71,9 +71,9 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count): | ||
460 | framebuffer_ready = 'Console: switching to colour frame buffer device' | ||
461 | wait_for_console_pattern(self, framebuffer_ready, | ||
462 | failure_message='Kernel panic - not syncing') | ||
463 | - self.vm.command('human-monitor-command', command_line='stop') | ||
464 | - self.vm.command('human-monitor-command', | ||
465 | - command_line='screendump %s' % screendump_path) | ||
466 | + self.vm.cmd('human-monitor-command', command_line='stop') | ||
467 | + self.vm.cmd('human-monitor-command', | ||
468 | + command_line='screendump %s' % screendump_path) | ||
469 | logger = logging.getLogger('framebuffer') | ||
470 | |||
471 | match_threshold = 0.95 | ||
472 | diff --git a/tests/avocado/machine_s390_ccw_virtio.py b/tests/avocado/machine_s390_ccw_virtio.py | ||
473 | index e7a2a20ba6..e1f493bc44 100644 | ||
474 | --- a/tests/avocado/machine_s390_ccw_virtio.py | ||
475 | +++ b/tests/avocado/machine_s390_ccw_virtio.py | ||
476 | @@ -107,10 +107,10 @@ def test_s390x_devices(self): | ||
477 | 'dd if=/dev/hwrng of=/dev/null bs=1k count=10', | ||
478 | '10+0 records out') | ||
479 | self.clear_guest_dmesg() | ||
480 | - self.vm.command('device_del', id='rn1') | ||
481 | + self.vm.cmd('device_del', id='rn1') | ||
482 | self.wait_for_crw_reports() | ||
483 | self.clear_guest_dmesg() | ||
484 | - self.vm.command('device_del', id='rn2') | ||
485 | + self.vm.cmd('device_del', id='rn2') | ||
486 | self.wait_for_crw_reports() | ||
487 | exec_command_and_wait_for_pattern(self, | ||
488 | 'dd if=/dev/hwrng of=/dev/null bs=1k count=10', | ||
489 | @@ -132,8 +132,8 @@ def test_s390x_devices(self): | ||
490 | '0x0000000c') | ||
491 | # add another device | ||
492 | self.clear_guest_dmesg() | ||
493 | - self.vm.command('device_add', driver='virtio-net-ccw', | ||
494 | - devno='fe.0.4711', id='net_4711') | ||
495 | + self.vm.cmd('device_add', driver='virtio-net-ccw', | ||
496 | + devno='fe.0.4711', id='net_4711') | ||
497 | self.wait_for_crw_reports() | ||
498 | exec_command_and_wait_for_pattern(self, 'for i in 1 2 3 4 5 6 7 ; do ' | ||
499 | 'if [ -e /sys/bus/ccw/devices/*4711 ]; then break; fi ;' | ||
500 | @@ -141,7 +141,7 @@ def test_s390x_devices(self): | ||
501 | '0.0.4711') | ||
502 | # and detach it again | ||
503 | self.clear_guest_dmesg() | ||
504 | - self.vm.command('device_del', id='net_4711') | ||
505 | + self.vm.cmd('device_del', id='net_4711') | ||
506 | self.vm.event_wait(name='DEVICE_DELETED', | ||
507 | match={'data': {'device': 'net_4711'}}) | ||
508 | self.wait_for_crw_reports() | ||
509 | @@ -151,10 +151,10 @@ def test_s390x_devices(self): | ||
510 | # test the virtio-balloon device | ||
511 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
512 | 'MemTotal: 115640 kB') | ||
513 | - self.vm.command('human-monitor-command', command_line='balloon 96') | ||
514 | + self.vm.cmd('human-monitor-command', command_line='balloon 96') | ||
515 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
516 | 'MemTotal: 82872 kB') | ||
517 | - self.vm.command('human-monitor-command', command_line='balloon 128') | ||
518 | + self.vm.cmd('human-monitor-command', command_line='balloon 128') | ||
519 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
520 | 'MemTotal: 115640 kB') | ||
521 | |||
522 | @@ -245,7 +245,7 @@ def test_s390x_fedora(self): | ||
523 | '12+0 records out') | ||
524 | with tempfile.NamedTemporaryFile(suffix='.ppm', | ||
525 | prefix='qemu-scrdump-') as ppmfile: | ||
526 | - self.vm.command('screendump', filename=ppmfile.name) | ||
527 | + self.vm.cmd('screendump', filename=ppmfile.name) | ||
528 | ppmfile.seek(0) | ||
529 | line = ppmfile.readline() | ||
530 | self.assertEqual(line, b"P6\n") | ||
531 | @@ -261,16 +261,16 @@ def test_s390x_fedora(self): | ||
532 | # Hot-plug a virtio-crypto device and see whether it gets accepted | ||
533 | self.log.info("Test hot-plug virtio-crypto device") | ||
534 | self.clear_guest_dmesg() | ||
535 | - self.vm.command('object-add', qom_type='cryptodev-backend-builtin', | ||
536 | - id='cbe0') | ||
537 | - self.vm.command('device_add', driver='virtio-crypto-ccw', id='crypdev0', | ||
538 | - cryptodev='cbe0', devno='fe.0.2342') | ||
539 | + self.vm.cmd('object-add', qom_type='cryptodev-backend-builtin', | ||
540 | + id='cbe0') | ||
541 | + self.vm.cmd('device_add', driver='virtio-crypto-ccw', id='crypdev0', | ||
542 | + cryptodev='cbe0', devno='fe.0.2342') | ||
543 | exec_command_and_wait_for_pattern(self, | ||
544 | 'while ! (dmesg -c | grep Accelerator.device) ; do' | ||
545 | ' sleep 1 ; done', 'Accelerator device is ready') | ||
546 | exec_command_and_wait_for_pattern(self, 'lscss', '0.0.2342') | ||
547 | - self.vm.command('device_del', id='crypdev0') | ||
548 | - self.vm.command('object-del', id='cbe0') | ||
549 | + self.vm.cmd('device_del', id='crypdev0') | ||
550 | + self.vm.cmd('object-del', id='cbe0') | ||
551 | exec_command_and_wait_for_pattern(self, | ||
552 | 'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do' | ||
553 | ' sleep 1 ; done', 'Start virtcrypto_remove.') | ||
554 | diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py | ||
555 | index fdc1d234fb..09b62f813e 100644 | ||
556 | --- a/tests/avocado/migration.py | ||
557 | +++ b/tests/avocado/migration.py | ||
558 | @@ -30,7 +30,7 @@ class MigrationTest(QemuSystemTest): | ||
559 | |||
560 | @staticmethod | ||
561 | def migration_finished(vm): | ||
562 | - return vm.command('query-migrate')['status'] in ('completed', 'failed') | ||
563 | + return vm.cmd('query-migrate')['status'] in ('completed', 'failed') | ||
564 | |||
565 | def assert_migration(self, src_vm, dst_vm): | ||
566 | wait.wait_for(self.migration_finished, | ||
567 | @@ -41,10 +41,10 @@ def assert_migration(self, src_vm, dst_vm): | ||
568 | timeout=self.timeout, | ||
569 | step=0.1, | ||
570 | args=(dst_vm,)) | ||
571 | - self.assertEqual(src_vm.command('query-migrate')['status'], 'completed') | ||
572 | - self.assertEqual(dst_vm.command('query-migrate')['status'], 'completed') | ||
573 | - self.assertEqual(dst_vm.command('query-status')['status'], 'running') | ||
574 | - self.assertEqual(src_vm.command('query-status')['status'],'postmigrate') | ||
575 | + self.assertEqual(src_vm.cmd('query-migrate')['status'], 'completed') | ||
576 | + self.assertEqual(dst_vm.cmd('query-migrate')['status'], 'completed') | ||
577 | + self.assertEqual(dst_vm.cmd('query-status')['status'], 'running') | ||
578 | + self.assertEqual(src_vm.cmd('query-status')['status'],'postmigrate') | ||
579 | |||
580 | def do_migrate(self, dest_uri, src_uri=None): | ||
581 | dest_vm = self.get_vm('-incoming', dest_uri) | ||
582 | diff --git a/tests/avocado/pc_cpu_hotplug_props.py b/tests/avocado/pc_cpu_hotplug_props.py | ||
583 | index 52b878188e..b56f51d02a 100644 | ||
584 | --- a/tests/avocado/pc_cpu_hotplug_props.py | ||
585 | +++ b/tests/avocado/pc_cpu_hotplug_props.py | ||
586 | @@ -32,4 +32,4 @@ def test_no_die_id(self): | ||
587 | self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8') | ||
588 | self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0') | ||
589 | self.vm.launch() | ||
590 | - self.assertEquals(len(self.vm.command('query-cpus-fast')), 2) | ||
591 | + self.assertEquals(len(self.vm.cmd('query-cpus-fast')), 2) | ||
592 | diff --git a/tests/avocado/version.py b/tests/avocado/version.py | ||
593 | index dd775955eb..93ffdf3d97 100644 | ||
594 | --- a/tests/avocado/version.py | ||
595 | +++ b/tests/avocado/version.py | ||
596 | @@ -20,6 +20,6 @@ class Version(QemuSystemTest): | ||
597 | def test_qmp_human_info_version(self): | ||
598 | self.vm.add_args('-nodefaults') | ||
599 | self.vm.launch() | ||
600 | - res = self.vm.command('human-monitor-command', | ||
601 | - command_line='info version') | ||
602 | + res = self.vm.cmd('human-monitor-command', | ||
603 | + command_line='info version') | ||
604 | self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') | ||
605 | diff --git a/tests/avocado/virtio_check_params.py b/tests/avocado/virtio_check_params.py | ||
606 | index 4093da8a67..f4314ef824 100644 | ||
607 | --- a/tests/avocado/virtio_check_params.py | ||
608 | +++ b/tests/avocado/virtio_check_params.py | ||
609 | @@ -51,8 +51,8 @@ def query_virtqueue(self, vm, dev_type_name): | ||
610 | error = None | ||
611 | props = None | ||
612 | |||
613 | - output = vm.command('human-monitor-command', | ||
614 | - command_line = 'info qtree') | ||
615 | + output = vm.cmd('human-monitor-command', | ||
616 | + command_line = 'info qtree') | ||
617 | props_list = DEV_TYPES[dev_type_name].values(); | ||
618 | pattern = self.make_pattern(props_list) | ||
619 | res = re.findall(pattern, output) | ||
620 | @@ -121,7 +121,7 @@ def test_machine_types(self): | ||
621 | # collect all machine types except 'none', 'isapc', 'microvm' | ||
622 | with QEMUMachine(self.qemu_bin) as vm: | ||
623 | vm.launch() | ||
624 | - machines = [m['name'] for m in vm.command('query-machines')] | ||
625 | + machines = [m['name'] for m in vm.cmd('query-machines')] | ||
626 | vm.shutdown() | ||
627 | machines.remove('none') | ||
628 | machines.remove('isapc') | ||
629 | diff --git a/tests/avocado/virtio_version.py b/tests/avocado/virtio_version.py | ||
630 | index c84e48813a..afe5e828b5 100644 | ||
631 | --- a/tests/avocado/virtio_version.py | ||
632 | +++ b/tests/avocado/virtio_version.py | ||
633 | @@ -48,7 +48,8 @@ def pci_modern_device_id(virtio_devid): | ||
634 | return virtio_devid + 0x1040 | ||
635 | |||
636 | def devtype_implements(vm, devtype, implements): | ||
637 | - return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)] | ||
638 | + return devtype in [d['name'] for d in | ||
639 | + vm.cmd('qom-list-types', implements=implements)] | ||
640 | |||
641 | def get_pci_interfaces(vm, devtype): | ||
642 | interfaces = ('pci-express-device', 'conventional-pci-device') | ||
643 | @@ -78,7 +79,7 @@ def run_device(self, devtype, opts=None, machine='pc'): | ||
644 | vm.add_args('-S') | ||
645 | vm.launch() | ||
646 | |||
647 | - pcibuses = vm.command('query-pci') | ||
648 | + pcibuses = vm.cmd('query-pci') | ||
649 | alldevs = [dev for bus in pcibuses for dev in bus['devices']] | ||
650 | devfortest = [dev for dev in alldevs | ||
651 | if dev['qdev_id'] == 'devfortest'] | ||
652 | diff --git a/tests/avocado/x86_cpu_model_versions.py b/tests/avocado/x86_cpu_model_versions.py | ||
653 | index a6edf74c1c..9e07b8a55d 100644 | ||
654 | --- a/tests/avocado/x86_cpu_model_versions.py | ||
655 | +++ b/tests/avocado/x86_cpu_model_versions.py | ||
656 | @@ -84,7 +84,8 @@ def test_4_0_alias_compatibility(self): | ||
657 | # with older QEMU versions that didn't have the versioned CPU model | ||
658 | self.vm.add_args('-S') | ||
659 | self.vm.launch() | ||
660 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
661 | + cpus = dict((m['name'], m) for m in | ||
662 | + self.vm.cmd('query-cpu-definitions')) | ||
663 | |||
664 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
665 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
666 | @@ -115,7 +116,8 @@ def test_4_1_alias(self): | ||
667 | self.vm.add_args('-S') | ||
668 | self.vm.launch() | ||
669 | |||
670 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
671 | + cpus = dict((m['name'], m) for m in | ||
672 | + self.vm.cmd('query-cpu-definitions')) | ||
673 | |||
674 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
675 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
676 | @@ -220,7 +222,8 @@ def test_none_alias(self): | ||
677 | self.vm.add_args('-S') | ||
678 | self.vm.launch() | ||
679 | |||
680 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
681 | + cpus = dict((m['name'], m) for m in | ||
682 | + self.vm.cmd('query-cpu-definitions')) | ||
683 | |||
684 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
685 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
686 | @@ -246,8 +249,8 @@ class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest): | ||
687 | :avocado: tags=arch:x86_64 | ||
688 | """ | ||
689 | def get_cpu_prop(self, prop): | ||
690 | - cpu_path = self.vm.command('query-cpus-fast')[0].get('qom-path') | ||
691 | - return self.vm.command('qom-get', path=cpu_path, property=prop) | ||
692 | + cpu_path = self.vm.cmd('query-cpus-fast')[0].get('qom-path') | ||
693 | + return self.vm.cmd('qom-get', path=cpu_path, property=prop) | ||
694 | |||
695 | def test_4_1(self): | ||
696 | """ | ||
697 | diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py | ||
698 | index e69d16a62c..da96ca034a 100644 | ||
699 | --- a/tests/migration/guestperf/engine.py | ||
700 | +++ b/tests/migration/guestperf/engine.py | ||
701 | @@ -77,7 +77,7 @@ def _cpu_timing(self, pid): | ||
702 | return TimingRecord(pid, now, 1000 * (stime + utime) / jiffies_per_sec) | ||
703 | |||
704 | def _migrate_progress(self, vm): | ||
705 | - info = vm.command("query-migrate") | ||
706 | + info = vm.cmd("query-migrate") | ||
707 | |||
708 | if "ram" not in info: | ||
709 | info["ram"] = {} | ||
710 | @@ -109,7 +109,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
711 | src_vcpu_time = [] | ||
712 | src_pid = src.get_pid() | ||
713 | |||
714 | - vcpus = src.command("query-cpus-fast") | ||
715 | + vcpus = src.cmd("query-cpus-fast") | ||
716 | src_threads = [] | ||
717 | for vcpu in vcpus: | ||
718 | src_threads.append(vcpu["thread-id"]) | ||
719 | @@ -128,82 +128,82 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
720 | if self._verbose: | ||
721 | print("Starting migration") | ||
722 | if scenario._auto_converge: | ||
723 | - resp = src.command("migrate-set-capabilities", | ||
724 | - capabilities = [ | ||
725 | - { "capability": "auto-converge", | ||
726 | - "state": True } | ||
727 | - ]) | ||
728 | - resp = src.command("migrate-set-parameters", | ||
729 | - cpu_throttle_increment=scenario._auto_converge_step) | ||
730 | + resp = src.cmd("migrate-set-capabilities", | ||
731 | + capabilities = [ | ||
732 | + { "capability": "auto-converge", | ||
733 | + "state": True } | ||
734 | + ]) | ||
735 | + resp = src.cmd("migrate-set-parameters", | ||
736 | + cpu_throttle_increment=scenario._auto_converge_step) | ||
737 | |||
738 | if scenario._post_copy: | ||
739 | - resp = src.command("migrate-set-capabilities", | ||
740 | - capabilities = [ | ||
741 | - { "capability": "postcopy-ram", | ||
742 | - "state": True } | ||
743 | - ]) | ||
744 | - resp = dst.command("migrate-set-capabilities", | ||
745 | - capabilities = [ | ||
746 | - { "capability": "postcopy-ram", | ||
747 | - "state": True } | ||
748 | - ]) | ||
749 | - | ||
750 | - resp = src.command("migrate-set-parameters", | ||
751 | - max_bandwidth=scenario._bandwidth * 1024 * 1024) | ||
752 | - | ||
753 | - resp = src.command("migrate-set-parameters", | ||
754 | - downtime_limit=scenario._downtime) | ||
755 | + resp = src.cmd("migrate-set-capabilities", | ||
756 | + capabilities = [ | ||
757 | + { "capability": "postcopy-ram", | ||
758 | + "state": True } | ||
759 | + ]) | ||
760 | + resp = dst.cmd("migrate-set-capabilities", | ||
761 | + capabilities = [ | ||
762 | + { "capability": "postcopy-ram", | ||
763 | + "state": True } | ||
764 | + ]) | ||
765 | + | ||
766 | + resp = src.cmd("migrate-set-parameters", | ||
767 | + max_bandwidth=scenario._bandwidth * 1024 * 1024) | ||
768 | + | ||
769 | + resp = src.cmd("migrate-set-parameters", | ||
770 | + downtime_limit=scenario._downtime) | ||
771 | |||
772 | if scenario._compression_mt: | ||
773 | - resp = src.command("migrate-set-capabilities", | ||
774 | - capabilities = [ | ||
775 | - { "capability": "compress", | ||
776 | - "state": True } | ||
777 | - ]) | ||
778 | - resp = src.command("migrate-set-parameters", | ||
779 | - compress_threads=scenario._compression_mt_threads) | ||
780 | - resp = dst.command("migrate-set-capabilities", | ||
781 | - capabilities = [ | ||
782 | - { "capability": "compress", | ||
783 | - "state": True } | ||
784 | - ]) | ||
785 | - resp = dst.command("migrate-set-parameters", | ||
786 | - decompress_threads=scenario._compression_mt_threads) | ||
787 | + resp = src.cmd("migrate-set-capabilities", | ||
788 | + capabilities = [ | ||
789 | + { "capability": "compress", | ||
790 | + "state": True } | ||
791 | + ]) | ||
792 | + resp = src.cmd("migrate-set-parameters", | ||
793 | + compress_threads=scenario._compression_mt_threads) | ||
794 | + resp = dst.cmd("migrate-set-capabilities", | ||
795 | + capabilities = [ | ||
796 | + { "capability": "compress", | ||
797 | + "state": True } | ||
798 | + ]) | ||
799 | + resp = dst.cmd("migrate-set-parameters", | ||
800 | + decompress_threads=scenario._compression_mt_threads) | ||
801 | |||
802 | if scenario._compression_xbzrle: | ||
803 | - resp = src.command("migrate-set-capabilities", | ||
804 | - capabilities = [ | ||
805 | - { "capability": "xbzrle", | ||
806 | - "state": True } | ||
807 | - ]) | ||
808 | - resp = dst.command("migrate-set-capabilities", | ||
809 | - capabilities = [ | ||
810 | - { "capability": "xbzrle", | ||
811 | - "state": True } | ||
812 | - ]) | ||
813 | - resp = src.command("migrate-set-parameters", | ||
814 | - xbzrle_cache_size=( | ||
815 | - hardware._mem * | ||
816 | - 1024 * 1024 * 1024 / 100 * | ||
817 | - scenario._compression_xbzrle_cache)) | ||
818 | + resp = src.cmd("migrate-set-capabilities", | ||
819 | + capabilities = [ | ||
820 | + { "capability": "xbzrle", | ||
821 | + "state": True } | ||
822 | + ]) | ||
823 | + resp = dst.cmd("migrate-set-capabilities", | ||
824 | + capabilities = [ | ||
825 | + { "capability": "xbzrle", | ||
826 | + "state": True } | ||
827 | + ]) | ||
828 | + resp = src.cmd("migrate-set-parameters", | ||
829 | + xbzrle_cache_size=( | ||
830 | + hardware._mem * | ||
831 | + 1024 * 1024 * 1024 / 100 * | ||
832 | + scenario._compression_xbzrle_cache)) | ||
833 | |||
834 | if scenario._multifd: | ||
835 | - resp = src.command("migrate-set-capabilities", | ||
836 | - capabilities = [ | ||
837 | - { "capability": "multifd", | ||
838 | - "state": True } | ||
839 | - ]) | ||
840 | - resp = src.command("migrate-set-parameters", | ||
841 | - multifd_channels=scenario._multifd_channels) | ||
842 | - resp = dst.command("migrate-set-capabilities", | ||
843 | - capabilities = [ | ||
844 | - { "capability": "multifd", | ||
845 | - "state": True } | ||
846 | - ]) | ||
847 | - resp = dst.command("migrate-set-parameters", | ||
848 | - multifd_channels=scenario._multifd_channels) | ||
849 | - | ||
850 | - resp = src.command("migrate", uri=connect_uri) | ||
851 | + resp = src.cmd("migrate-set-capabilities", | ||
852 | + capabilities = [ | ||
853 | + { "capability": "multifd", | ||
854 | + "state": True } | ||
855 | + ]) | ||
856 | + resp = src.cmd("migrate-set-parameters", | ||
857 | + multifd_channels=scenario._multifd_channels) | ||
858 | + resp = dst.cmd("migrate-set-capabilities", | ||
859 | + capabilities = [ | ||
860 | + { "capability": "multifd", | ||
861 | + "state": True } | ||
862 | + ]) | ||
863 | + resp = dst.cmd("migrate-set-parameters", | ||
864 | + multifd_channels=scenario._multifd_channels) | ||
865 | + | ||
866 | + resp = src.cmd("migrate", uri=connect_uri) | ||
867 | |||
868 | post_copy = False | ||
869 | paused = False | ||
870 | @@ -228,7 +228,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
871 | |||
872 | if progress._status in ("completed", "failed", "cancelled"): | ||
873 | if progress._status == "completed" and paused: | ||
874 | - dst.command("cont") | ||
875 | + dst.cmd("cont") | ||
876 | if progress_history[-1] != progress: | ||
877 | progress_history.append(progress) | ||
878 | |||
879 | @@ -256,13 +256,13 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
880 | if progress._ram._iterations > scenario._max_iters: | ||
881 | if self._verbose: | ||
882 | print("No completion after %d iterations over RAM" % scenario._max_iters) | ||
883 | - src.command("migrate_cancel") | ||
884 | + src.cmd("migrate_cancel") | ||
885 | continue | ||
886 | |||
887 | if time.time() > (start + scenario._max_time): | ||
888 | if self._verbose: | ||
889 | print("No completion after %d seconds" % scenario._max_time) | ||
890 | - src.command("migrate_cancel") | ||
891 | + src.cmd("migrate_cancel") | ||
892 | continue | ||
893 | |||
894 | if (scenario._post_copy and | ||
895 | @@ -270,7 +270,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
896 | not post_copy): | ||
897 | if self._verbose: | ||
898 | print("Switching to post-copy after %d iterations" % scenario._post_copy_iters) | ||
899 | - resp = src.command("migrate-start-postcopy") | ||
900 | + resp = src.cmd("migrate-start-postcopy") | ||
901 | post_copy = True | ||
902 | |||
903 | if (scenario._pause and | ||
904 | @@ -278,7 +278,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
905 | not paused): | ||
906 | if self._verbose: | ||
907 | print("Pausing VM after %d iterations" % scenario._pause_iters) | ||
908 | - resp = src.command("stop") | ||
909 | + resp = src.cmd("stop") | ||
910 | paused = True | ||
911 | |||
912 | def _is_ppc64le(self): | ||
913 | diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256 | ||
914 | index d7e67f4a05..f34af6cef7 100755 | ||
915 | --- a/tests/qemu-iotests/256 | ||
916 | +++ b/tests/qemu-iotests/256 | ||
917 | @@ -40,25 +40,25 @@ with iotests.FilePath('img0') as img0_path, \ | ||
918 | def create_target(filepath, name, size): | ||
919 | basename = os.path.basename(filepath) | ||
920 | nodename = "file_{}".format(basename) | ||
921 | - log(vm.command('blockdev-create', job_id='job1', | ||
922 | - options={ | ||
923 | - 'driver': 'file', | ||
924 | - 'filename': filepath, | ||
925 | - 'size': 0, | ||
926 | - })) | ||
927 | + log(vm.cmd('blockdev-create', job_id='job1', | ||
928 | + options={ | ||
929 | + 'driver': 'file', | ||
930 | + 'filename': filepath, | ||
931 | + 'size': 0, | ||
932 | + })) | ||
933 | vm.run_job('job1') | ||
934 | - log(vm.command('blockdev-add', driver='file', | ||
935 | - node_name=nodename, filename=filepath)) | ||
936 | - log(vm.command('blockdev-create', job_id='job2', | ||
937 | - options={ | ||
938 | - 'driver': iotests.imgfmt, | ||
939 | - 'file': nodename, | ||
940 | - 'size': size, | ||
941 | - })) | ||
942 | + log(vm.cmd('blockdev-add', driver='file', | ||
943 | + node_name=nodename, filename=filepath)) | ||
944 | + log(vm.cmd('blockdev-create', job_id='job2', | ||
945 | + options={ | ||
946 | + 'driver': iotests.imgfmt, | ||
947 | + 'file': nodename, | ||
948 | + 'size': size, | ||
949 | + })) | ||
950 | vm.run_job('job2') | ||
951 | - log(vm.command('blockdev-add', driver=iotests.imgfmt, | ||
952 | - node_name=name, | ||
953 | - file=nodename)) | ||
954 | + log(vm.cmd('blockdev-add', driver=iotests.imgfmt, | ||
955 | + node_name=name, | ||
956 | + file=nodename)) | ||
957 | |||
958 | log('--- Preparing images & VM ---\n') | ||
959 | vm.add_object('iothread,id=iothread0') | ||
960 | diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 | ||
961 | index e7e7a2317e..7d3720b8e5 100755 | ||
962 | --- a/tests/qemu-iotests/257 | ||
963 | +++ b/tests/qemu-iotests/257 | ||
964 | @@ -160,26 +160,26 @@ class Drive: | ||
965 | file_node_name = "file_{}".format(basename) | ||
966 | vm = self.vm | ||
967 | |||
968 | - log(vm.command('blockdev-create', job_id='bdc-file-job', | ||
969 | - options={ | ||
970 | - 'driver': 'file', | ||
971 | - 'filename': self.path, | ||
972 | - 'size': 0, | ||
973 | - })) | ||
974 | + log(vm.cmd('blockdev-create', job_id='bdc-file-job', | ||
975 | + options={ | ||
976 | + 'driver': 'file', | ||
977 | + 'filename': self.path, | ||
978 | + 'size': 0, | ||
979 | + })) | ||
980 | vm.run_job('bdc-file-job') | ||
981 | - log(vm.command('blockdev-add', driver='file', | ||
982 | - node_name=file_node_name, filename=self.path)) | ||
983 | - | ||
984 | - log(vm.command('blockdev-create', job_id='bdc-fmt-job', | ||
985 | - options={ | ||
986 | - 'driver': fmt, | ||
987 | - 'file': file_node_name, | ||
988 | - 'size': size, | ||
989 | - })) | ||
990 | + log(vm.cmd('blockdev-add', driver='file', | ||
991 | + node_name=file_node_name, filename=self.path)) | ||
992 | + | ||
993 | + log(vm.cmd('blockdev-create', job_id='bdc-fmt-job', | ||
994 | + options={ | ||
995 | + 'driver': fmt, | ||
996 | + 'file': file_node_name, | ||
997 | + 'size': size, | ||
998 | + })) | ||
999 | vm.run_job('bdc-fmt-job') | ||
1000 | - log(vm.command('blockdev-add', driver=fmt, | ||
1001 | - node_name=name, | ||
1002 | - file=file_node_name)) | ||
1003 | + log(vm.cmd('blockdev-add', driver=fmt, | ||
1004 | + node_name=name, | ||
1005 | + file=file_node_name)) | ||
1006 | self.fmt = fmt | ||
1007 | self.size = size | ||
1008 | self.node = name | ||
1009 | -- | ||
1010 | 2.34.1 | ||
1011 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc index 3e56e349..26327ba3 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc | |||
@@ -14,12 +14,12 @@ REPO ?= "git://github.com/Xilinx/qemu-devicetrees.git;protocol=https" | |||
14 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | 14 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" |
15 | SRC_URI = "${REPO};${BRANCHARG}" | 15 | SRC_URI = "${REPO};${BRANCHARG}" |
16 | 16 | ||
17 | SRC_URI += "file://0001-versal-Reorder-serial-ports.patch" | ||
18 | SRC_URI += "file://0001-versal-net-Reorder-serial-port.patch" | ||
19 | |||
17 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
18 | 21 | ||
19 | # Don't need to do anything | 22 | do_install[noexec] = '1' |
20 | do_install() { | ||
21 | : | ||
22 | } | ||
23 | 23 | ||
24 | do_deploy() { | 24 | do_deploy() { |
25 | # single-arch dtbs | 25 | # single-arch dtbs |
@@ -33,4 +33,7 @@ do_deploy() { | |||
33 | done | 33 | done |
34 | } | 34 | } |
35 | 35 | ||
36 | addtask deploy after do_install | 36 | addtask deploy after do_install before do_build |
37 | |||
38 | COMPATIBLE_HOST:class-target = "none" | ||
39 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-Reorder-serial-ports.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-Reorder-serial-ports.patch new file mode 100644 index 00000000..23ed3659 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-Reorder-serial-ports.patch | |||
@@ -0,0 +1,1466 @@ | |||
1 | From 2da2588a1dda1fd7fd2f6fc89db13cc5694d793e Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Hatle <mark.hatle@amd.com> | ||
3 | Date: Sat, 24 Aug 2024 11:23:18 -0600 | ||
4 | Subject: [PATCH] versal: Reorder serial ports | ||
5 | |||
6 | This change affects the order of the serial ports when calling qemu. | ||
7 | Previously the serial ports 0 & 1 were the PMC (firmware) uartlite, | ||
8 | while the standard serial pors were 2 & 3. Reverse this order to | ||
9 | ensure that the first two serial ports are the ones used by Linux. | ||
10 | |||
11 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
12 | --- | ||
13 | board-versal-pmc-virt-alt.dts | 230 ++++++++++++++++ | ||
14 | board-versal-ps-vck190-alt.dts | 58 ++++ | ||
15 | board-versal-ps-virt-alt.dts | 354 +++++++++++++++++++++++++ | ||
16 | versal-pmc-alt.dtsi | 40 +++ | ||
17 | versal-pmc-ppu-alt.dtsi | 252 ++++++++++++++++++ | ||
18 | versal-ps-iou-alt.dtsi | 467 +++++++++++++++++++++++++++++++++ | ||
19 | 6 files changed, 1401 insertions(+) | ||
20 | create mode 100644 board-versal-pmc-virt-alt.dts | ||
21 | create mode 100644 board-versal-ps-vck190-alt.dts | ||
22 | create mode 100644 board-versal-ps-virt-alt.dts | ||
23 | create mode 100644 versal-pmc-alt.dtsi | ||
24 | create mode 100644 versal-pmc-ppu-alt.dtsi | ||
25 | create mode 100644 versal-ps-iou-alt.dtsi | ||
26 | |||
27 | diff --git a/board-versal-pmc-virt-alt.dts b/board-versal-pmc-virt-alt.dts | ||
28 | new file mode 100644 | ||
29 | index 00000000..52d23c83 | ||
30 | --- /dev/null | ||
31 | +++ b/board-versal-pmc-virt-alt.dts | ||
32 | @@ -0,0 +1,230 @@ | ||
33 | +/* | ||
34 | + * Versal Virtual PMC board device tree | ||
35 | + * | ||
36 | + * Copyright (c) 2016, Xilinx Inc | ||
37 | + * All rights reserved. | ||
38 | + * | ||
39 | + * Redistribution and use in source and binary forms, with or without | ||
40 | + * modification, are permitted provided that the following conditions are met: | ||
41 | + * * Redistributions of source code must retain the above copyright | ||
42 | + * notice, this list of conditions and the following disclaimer. | ||
43 | + * * Redistributions in binary form must reproduce the above copyright | ||
44 | + * notice, this list of conditions and the following disclaimer in the | ||
45 | + * documentation and/or other materials provided with the distribution. | ||
46 | + * * Neither the name of the <organization> nor the | ||
47 | + * names of its contributors may be used to endorse or promote products | ||
48 | + * derived from this software without specific prior written permission. | ||
49 | + * | ||
50 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
51 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
52 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
53 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
54 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
55 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
56 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
57 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
58 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
59 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
60 | + */ | ||
61 | + | ||
62 | +/dts-v1/; | ||
63 | + | ||
64 | +#ifndef VERSAL_NPI_OVERRIDE | ||
65 | + #include "versal-npi-memmap.dtsh" | ||
66 | +#endif | ||
67 | + | ||
68 | +#define VERSAL_NPI_GENERIC | ||
69 | + | ||
70 | +#include "versal.dtsh" | ||
71 | + | ||
72 | +#ifndef MULTI_ARCH | ||
73 | +#include "versal-pmc-alt.dtsi" | ||
74 | +#include "versal-psm.dtsi" | ||
75 | +#include "versal-ddrmc.dtsi" | ||
76 | +#include "versal-ps-iou-alt.dtsi" | ||
77 | +#include "versal-pmc-ppu-cpus.dtsi" | ||
78 | +#include "versal-psm-cpu.dtsi" | ||
79 | + | ||
80 | +/ { | ||
81 | + /* FIXME: Once we add the NOC, these should be attached to it. */ | ||
82 | + MEM_REGION(ddr, 0x0, MM_TOP_DDR, 0x00000000, MM_TOP_DDR_SIZE, &ddr_mem) // 2 GB | ||
83 | + MEM_SPEC(ddr_2, MM_TOP_DDR_2_H, MM_TOP_DDR_2_L, MM_TOP_DDR_2, | ||
84 | + MM_TOP_DDR_2_SIZE_H, MM_TOP_DDR_2_SIZE_L, &ddr_2_mem) // 32 GB | ||
85 | + | ||
86 | + /* Dummy APUs. */ | ||
87 | + cpu0: apu@0 { | ||
88 | + }; | ||
89 | + cpu1: apu@1 { | ||
90 | + }; | ||
91 | + rpu_cpu0: rpu_cpu0 { | ||
92 | + }; | ||
93 | + rpu_cpu1: rpu_cpu1 { | ||
94 | + }; | ||
95 | +#ifndef HAVE_DDRMC_CPUS | ||
96 | + ddrmc_ub0: ddrmc_ub@0 { | ||
97 | + #interrupt-cells = <1>; | ||
98 | + interrupt-controller; | ||
99 | + }; | ||
100 | + ddrmc_ub1: ddrmc_ub@1 { | ||
101 | + #interrupt-cells = <1>; | ||
102 | + interrupt-controller; | ||
103 | + }; | ||
104 | +#endif | ||
105 | + /* Dummy GIC. */ | ||
106 | + gic: apu_gic@0 { | ||
107 | + #interrupt-cells = <3>; | ||
108 | + interrupt-controller; | ||
109 | + }; | ||
110 | +}; | ||
111 | + | ||
112 | +&pmc_qspi_0 { | ||
113 | + SPI_FLASH(qspi_flash_lcs_lb,"m25qu02gcbb", 0x02000000, 0x0 0x0) | ||
114 | + SPI_FLASH(qspi_flash_lcs_ub,"m25qu02gcbb", 0x02000000, 0x2 0x1) | ||
115 | + SPI_FLASH(qspi_flash_ucs_lb,"m25qu02gcbb", 0x02000000, 0x1 0x0) | ||
116 | + SPI_FLASH(qspi_flash_ucs_ub,"m25qu02gcbb", 0x02000000, 0x3 0x1) | ||
117 | +}; | ||
118 | + | ||
119 | +&ospi { | ||
120 | + SPI_FLASH(ospi_flash_lcs_lb, "mt35xu01gbba", 0x02000000, 0x0 0x0) | ||
121 | + SPI_FLASH(ospi_flash_lcs_ub, "mt35xu01gbba", 0x02000000, 0x1 0x0) | ||
122 | + SPI_FLASH(ospi_flash_ucs_lb, "mt35xu01gbba", 0x02000000, 0x2 0x0) | ||
123 | + SPI_FLASH(ospi_flash_ucs_ub, "mt35xu01gbba", 0x02000000, 0x3 0x0) | ||
124 | +}; | ||
125 | + | ||
126 | +#else | ||
127 | +#include "versal-icnt.dtsi" | ||
128 | +#include "versal-rams.dtsi" | ||
129 | +#include "versal-pmc-ppu-cpus.dtsi" | ||
130 | +#include "versal-psm-cpu.dtsi" | ||
131 | + | ||
132 | +/ { | ||
133 | + /* FIXME: Once we add the NOC, these should be attached to it. */ | ||
134 | + MEM_REGION(ddr, 0x0, 0x00000000, 0x00000000, 0x80000000, &ddr_mem) | ||
135 | + | ||
136 | + ps_pmc_rp: ps_pmc_rp@0 { | ||
137 | + doc-name = "Remote-port PMC-PS"; | ||
138 | + compatible = "remote-port"; | ||
139 | + chrdev-id = "ps-pmc-rp"; | ||
140 | + }; | ||
141 | + rp_pmc_ppu0: rp_pmc_ppu0@0 { | ||
142 | + compatible = "remote-port-gpio"; | ||
143 | + remote-ports = <&ps_pmc_rp 1>; | ||
144 | + interrupts-extended = < &pmc_ppu0 0 >; | ||
145 | + }; | ||
146 | + rp_pmc_ppu1: rp_pmc_ppu1@0 { | ||
147 | + compatible = "remote-port-gpio"; | ||
148 | + remote-ports = <&ps_pmc_rp 2>; | ||
149 | + interrupts-extended = < &pmc_ppu1 0 >; | ||
150 | + }; | ||
151 | + pmc_global: rp_pmc_global@0 { | ||
152 | + compatible = "remote-port-gpio"; | ||
153 | + remote-ports = <&ps_pmc_rp 3>; | ||
154 | + #gpio-cells = <1>; | ||
155 | + num-gpios = <16>; | ||
156 | + }; | ||
157 | + lmb_pmc_ppu0: lmb_pmc_ppu0@0 { | ||
158 | + rp_lmb_pmc_ppu0@0 { | ||
159 | + compatible = "remote-port-memory-master"; | ||
160 | + remote-ports = <&ps_pmc_rp 4>; | ||
161 | + reg = < 0x0 0x0 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF /* -1 */ >; | ||
162 | + }; | ||
163 | + }; | ||
164 | + lmb_pmc_ppu1: lmb_pmc_ppu1@0 { | ||
165 | + rp_lmb_pmc_ppu1@0 { | ||
166 | + compatible = "remote-port-memory-master"; | ||
167 | + remote-ports = <&ps_pmc_rp 5>; | ||
168 | + reg = < 0x0 0x0 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF /* -1 */ >; | ||
169 | + }; | ||
170 | + }; | ||
171 | + crl: crl@MM_CRL { | ||
172 | + compatible = "remote-port-gpio"; | ||
173 | + remote-ports = <&ps_pmc_rp 6>; | ||
174 | + #gpio-cells = <1>; | ||
175 | + num-gpios = <35>; | ||
176 | + }; | ||
177 | + pmc_clk_rst: pmc_clk_rst@0 { | ||
178 | + compatible = "remote-port-gpio"; | ||
179 | + remote-ports = <&ps_pmc_rp 7>; | ||
180 | + #gpio-cells = <1>; | ||
181 | + num-gpios = <30>; | ||
182 | + }; | ||
183 | + rp_psm0: rp_psm0@0 { | ||
184 | + compatible = "remote-port-gpio"; | ||
185 | + remote-ports = <&ps_pmc_rp 8>; | ||
186 | + interrupts-extended = < &psm0 0 >; | ||
187 | + }; | ||
188 | +#ifdef MM_NPI_DDRMC_MAIN_0 | ||
189 | + rp_ddrmc_ub0: rp_ddrmc_ub@0 { | ||
190 | + compatible = "remote-port-gpio"; | ||
191 | + remote-ports = <&ps_pmc_rp 9>; | ||
192 | +# ifdef HAVE_DDRMC_CPUS | ||
193 | + interrupts-extended = < &ddrmc_ub0 0 >; | ||
194 | +# endif | ||
195 | + }; | ||
196 | + | ||
197 | + npi_ddrmc_ub0: rp_npi_ddrmc_ub@0 { | ||
198 | + compatible = "remote-port-gpio"; | ||
199 | + remote-ports = <&ps_pmc_rp 11>; | ||
200 | + #gpio-cells = <1>; | ||
201 | + }; | ||
202 | +#endif | ||
203 | +#ifdef MM_NPI_DDRMC_MAIN_1 | ||
204 | + rp_ddrmc_ub1: rp_ddrmc_ub@1 { | ||
205 | + compatible = "remote-port-gpio"; | ||
206 | + remote-ports = <&ps_pmc_rp 10>; | ||
207 | + # ifdef HAVE_DDRMC_CPUS | ||
208 | + interrupts-extended = < &ddrmc_ub1 0 >; | ||
209 | + # endif | ||
210 | + }; | ||
211 | + | ||
212 | + npi_ddrmc_ub1: rp_npi_ddrmc_ub@1 { | ||
213 | + compatible = "remote-port-gpio"; | ||
214 | + remote-ports = <&ps_pmc_rp 12>; | ||
215 | + #gpio-cells = <1>; | ||
216 | + }; | ||
217 | +#endif | ||
218 | + lmb_psm: lmb_psm@0 { | ||
219 | + rp_lmb_psm@0 { | ||
220 | + compatible = "remote-port-memory-master"; | ||
221 | + remote-ports = <&ps_pmc_rp 13>; | ||
222 | + reg = < 0x0 0x0 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF /* -1 */ >; | ||
223 | + }; | ||
224 | + }; | ||
225 | + | ||
226 | + /* Dummy stub to avoid ifdefs in the interrupt-map. */ | ||
227 | + pmc_gic_proxy: pmc_gic_proxy { | ||
228 | + doc-ignore = <1>; | ||
229 | + #interrupt-cells = <3>; | ||
230 | + interrupt-controller; | ||
231 | + }; | ||
232 | + psm_gic_proxy: psm_gic_proxy { | ||
233 | + doc-ignore = <1>; | ||
234 | + #interrupt-cells = <3>; | ||
235 | + interrupt-controller; | ||
236 | + }; | ||
237 | + psm0_io_intc: psm0_io_intc { | ||
238 | + doc-ignore = <1>; | ||
239 | + #interrupt-cells = <1>; | ||
240 | + interrupt-controller; | ||
241 | + }; | ||
242 | + pmc_ppu1_io_intc: pmc_ppu1_io_intc { | ||
243 | + doc-ignore = <1>; | ||
244 | + #interrupt-cells = <1>; | ||
245 | + interrupt-controller; | ||
246 | + }; | ||
247 | +}; | ||
248 | +#endif | ||
249 | + | ||
250 | +/ { | ||
251 | + /* | ||
252 | + * FIXME: This legacy hook will reset the entire PMC instance | ||
253 | + * meaning PSM and PMC MicroBlazes for multi-arch and all | ||
254 | + * devices for single-arch. | ||
255 | + * Once the CPU reset infrastructure is improved, we should | ||
256 | + * remove this. | ||
257 | + */ | ||
258 | + pmc_reset: pmc_reset@ { | ||
259 | + compatible = "qemu,reset-device"; | ||
260 | + gpios = <&pmc_clk_rst CRP_RST_PS_PMC_SRST>; | ||
261 | + }; | ||
262 | +}; | ||
263 | diff --git a/board-versal-ps-vck190-alt.dts b/board-versal-ps-vck190-alt.dts | ||
264 | new file mode 100644 | ||
265 | index 00000000..b61d3d5c | ||
266 | --- /dev/null | ||
267 | +++ b/board-versal-ps-vck190-alt.dts | ||
268 | @@ -0,0 +1,58 @@ | ||
269 | +/* | ||
270 | + * Versal Virtual vck190 board device tree | ||
271 | + * | ||
272 | + * Copyright (c) 2020, Xilinx Inc | ||
273 | + * All rights reserved. | ||
274 | + * | ||
275 | + * Redistribution and use in source and binary forms, with or without | ||
276 | + * modification, are permitted provided that the following conditions are met: | ||
277 | + * * Redistributions of source code must retain the above copyright | ||
278 | + * notice, this list of conditions and the following disclaimer. | ||
279 | + * * Redistributions in binary form must reproduce the above copyright | ||
280 | + * notice, this list of conditions and the following disclaimer in the | ||
281 | + * documentation and/or other materials provided with the distribution. | ||
282 | + * * Neither the name of the <organization> nor the | ||
283 | + * names of its contributors may be used to endorse or promote products | ||
284 | + * derived from this software without specific prior written permission. | ||
285 | + * | ||
286 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
287 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
288 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
289 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
290 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
291 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
292 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
293 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
294 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
295 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
296 | + */ | ||
297 | +#include "board-versal-ps-virt-alt.dts" | ||
298 | +#include "versal-silicon-freq.dtsi" | ||
299 | + | ||
300 | +/{ | ||
301 | + MEM_REGION64(ddr_3, MM_TOP_DDR_CH1_H, MM_TOP_DDR_CH1_L, MM_TOP_DDR_CH1, | ||
302 | + 0x2, 0x0, &ddr_3_mem) // 8 GB | ||
303 | +}; | ||
304 | + | ||
305 | +&ps_i2c1 { | ||
306 | + i2cswitch@74 { | ||
307 | + #address-cells = <1>; | ||
308 | + #size-cells = <0>; | ||
309 | + compatible = "nxp,pca9548"; | ||
310 | + reg = <0x74>; | ||
311 | + chip-enable = <0x1>; | ||
312 | + i2c@0 { | ||
313 | + #address-cells = <1>; | ||
314 | + #size-cells = <0>; | ||
315 | + reg = <0>; | ||
316 | + eeprom@54 { | ||
317 | + compatible = "at,24c08"; | ||
318 | + reg = <0x54>; | ||
319 | + }; | ||
320 | + }; | ||
321 | + }; | ||
322 | +}; | ||
323 | + | ||
324 | +&ospi_flash_lcs_lb { | ||
325 | + compatible = "mt35xu02gbba"; | ||
326 | +}; | ||
327 | diff --git a/board-versal-ps-virt-alt.dts b/board-versal-ps-virt-alt.dts | ||
328 | new file mode 100644 | ||
329 | index 00000000..7585d196 | ||
330 | --- /dev/null | ||
331 | +++ b/board-versal-ps-virt-alt.dts | ||
332 | @@ -0,0 +1,354 @@ | ||
333 | +/* | ||
334 | + * Versal Virtual PS board device tree | ||
335 | + * | ||
336 | + * Copyright (c) 2016-2022, Xilinx Inc. | ||
337 | + * Copyright (C) 2022-2024, Advanced Micro Devices, Inc. | ||
338 | + * All rights reserved. | ||
339 | + * | ||
340 | + * Redistribution and use in source and binary forms, with or without | ||
341 | + * modification, are permitted provided that the following conditions are met: | ||
342 | + * * Redistributions of source code must retain the above copyright | ||
343 | + * notice, this list of conditions and the following disclaimer. | ||
344 | + * * Redistributions in binary form must reproduce the above copyright | ||
345 | + * notice, this list of conditions and the following disclaimer in the | ||
346 | + * documentation and/or other materials provided with the distribution. | ||
347 | + * * Neither the name of the <organization> nor the | ||
348 | + * names of its contributors may be used to endorse or promote products | ||
349 | + * derived from this software without specific prior written permission. | ||
350 | + * | ||
351 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
352 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
353 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
354 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
355 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
356 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
357 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
358 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
359 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
360 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
361 | + */ | ||
362 | +#ifndef __BOARD_VERSAL_PS_VIRT__ | ||
363 | +#define __BOARD_VERSAL_PS_VIRT__ | ||
364 | + | ||
365 | +/dts-v1/; | ||
366 | +#ifndef VERSAL_NPI_OVERRIDE | ||
367 | + #include "versal-npi-memmap.dtsh" | ||
368 | +#endif | ||
369 | + | ||
370 | +#ifndef NUM_APUS | ||
371 | +/* Base platform has 2 APUs. */ | ||
372 | +#define NUM_APUS 2 | ||
373 | +#endif | ||
374 | + | ||
375 | +#define HAS_SMMU | ||
376 | +#define HAVE_APU_GIC | ||
377 | + | ||
378 | +#ifndef RPU_GIC_INTERRUPT_TARGET_STEM | ||
379 | +#ifdef MULTI_ARCH | ||
380 | + #define RPU_GIC_INTERRUPT_TARGET_STEM rpu_intc_redirect_ | ||
381 | +#else | ||
382 | + #define RPU_GIC_INTERRUPT_TARGET_STEM rpu_cpu | ||
383 | +#endif | ||
384 | +#endif | ||
385 | + | ||
386 | +#define VERSAL_NPI_GENERIC | ||
387 | + | ||
388 | +#include "versal.dtsh" | ||
389 | + | ||
390 | +#include "versal-pmc.dtsi" | ||
391 | +#include "versal-psm.dtsi" | ||
392 | +#include "versal-ddrmc.dtsi" | ||
393 | +#ifdef VERSAL_PSX | ||
394 | +#include "versal-psx-apu.dtsi" | ||
395 | +#else | ||
396 | +#include "versal-ps-apu.dtsi" | ||
397 | +#include "versal-ps-rpu.dtsi" | ||
398 | +#include "versal-boot-init.dtsi" | ||
399 | +#endif | ||
400 | +#include "versal-ps-iou-alt.dtsi" | ||
401 | +#include "versal-virtio-mmio.dtsi" | ||
402 | +#include "versal-boot-init.dtsi" | ||
403 | +#include "versal-gty.dtsi" | ||
404 | +#include "versal-silicon-freq.dtsi" | ||
405 | + | ||
406 | +/ { | ||
407 | +#ifdef MULTI_ARCH | ||
408 | + ps_pmc_rp: ps_pmc_rp@0 { | ||
409 | + doc-status = "complete"; | ||
410 | + doc-name = "Remote-port PMC"; | ||
411 | + doc-subdtb = "board-versal-pmc-virt.dtb"; | ||
412 | + compatible = "remote-port"; | ||
413 | + chrdev-id = "ps-pmc-rp"; | ||
414 | + }; | ||
415 | + pmc_ppu0: rp_pmc_ppu0@0 { | ||
416 | + compatible = "remote-port-gpio"; | ||
417 | + remote-ports = <&ps_pmc_rp 1>; | ||
418 | + #interrupt-cells = <1>; | ||
419 | + interrupt-controller; | ||
420 | + }; | ||
421 | + pmc_ppu1: rp_pmc_ppu1@0 { | ||
422 | + compatible = "remote-port-gpio"; | ||
423 | + remote-ports = <&ps_pmc_rp 2>; | ||
424 | + #interrupt-cells = <1>; | ||
425 | + interrupt-controller; | ||
426 | + }; | ||
427 | + rp_pmc_global: rp_pmc_global@0 { | ||
428 | + compatible = "remote-port-gpio"; | ||
429 | + remote-ports = <&ps_pmc_rp 3>; | ||
430 | + gpio-controller; | ||
431 | + #gpio-cells = <1>; | ||
432 | + num-gpios = <16>; | ||
433 | + | ||
434 | + /* We only need to proxy GPIO 1 and 2 (PPU1 RST and WAKE). */ | ||
435 | + gpios = < &dummy1 0 | ||
436 | + &pmc_global 1 | ||
437 | + &pmc_global 2 >; | ||
438 | + }; | ||
439 | + rp_lmb_pmc_ppu0: rp_lmb_pmc_ppu0@0 { | ||
440 | + compatible = "remote-port-memory-slave"; | ||
441 | + remote-ports = <&ps_pmc_rp 4>; | ||
442 | + mr = <&lmb_pmc_ppu0>; | ||
443 | + }; | ||
444 | + rp_lmb_pmc_ppu1: rp_lmb_pmc_ppu1@0 { | ||
445 | + compatible = "remote-port-memory-slave"; | ||
446 | + remote-ports = <&ps_pmc_rp 5>; | ||
447 | + mr = <&lmb_pmc_ppu1>; | ||
448 | + }; | ||
449 | + rp_crl: rp_crl@0 { | ||
450 | + compatible = "remote-port-gpio"; | ||
451 | + remote-ports = <&ps_pmc_rp 6>; | ||
452 | + gpio-controller; | ||
453 | + #gpio-cells = <1>; | ||
454 | + num-gpios = <35>; | ||
455 | + | ||
456 | + gpios = < | ||
457 | + &crl 0 | ||
458 | + &crl 1 | ||
459 | + &crl 2 | ||
460 | + &crl 3 | ||
461 | + &crl 4 | ||
462 | + &crl 5 | ||
463 | + &crl 6 | ||
464 | + &crl 7 | ||
465 | + &crl 8 | ||
466 | + &crl 9 | ||
467 | + &crl 10 | ||
468 | + &crl 11 | ||
469 | + &crl 12 | ||
470 | + &crl 13 | ||
471 | + &crl 14 | ||
472 | + &crl 15 | ||
473 | + &crl 16 | ||
474 | + &crl 17 | ||
475 | + &crl 18 | ||
476 | + &crl 19 | ||
477 | + &crl 20 | ||
478 | + &crl 21 | ||
479 | + &crl 22 | ||
480 | + &crl 23 | ||
481 | + &crl 24 | ||
482 | + &crl 25 | ||
483 | + &crl 26 | ||
484 | + &crl 27 | ||
485 | + &crl 28 | ||
486 | + &crl 29 | ||
487 | + &crl 30 | ||
488 | + &crl 31 | ||
489 | + &dummy1 0 | ||
490 | + &dummy1 0 | ||
491 | + &crl 34 >; | ||
492 | + }; | ||
493 | + rp_pmc_clk_rst: rp_pmc_clk_rst@0 { | ||
494 | + compatible = "remote-port-gpio"; | ||
495 | + remote-ports = <&ps_pmc_rp 7>; | ||
496 | + gpio-controller; | ||
497 | + #gpio-cells = <1>; | ||
498 | + num-gpios = <30>; | ||
499 | + | ||
500 | + gpios = < &pmc_clk_rst 0 &pmc_clk_rst 1 | ||
501 | + &pmc_clk_rst 2 &pmc_clk_rst 3 | ||
502 | + &pmc_clk_rst 4 &pmc_clk_rst 5 | ||
503 | + &pmc_clk_rst 6 &pmc_clk_rst 7 | ||
504 | + &pmc_clk_rst 8 &pmc_clk_rst 9 | ||
505 | + &pmc_clk_rst 10 &pmc_clk_rst 11 | ||
506 | + &pmc_clk_rst 12 &pmc_clk_rst 13 | ||
507 | + &pmc_clk_rst 14 &pmc_clk_rst 15 | ||
508 | + &pmc_clk_rst 16 &pmc_clk_rst 17 | ||
509 | + &pmc_clk_rst 18 &pmc_clk_rst 19 | ||
510 | + &pmc_clk_rst 20 &pmc_clk_rst 21 | ||
511 | + &pmc_clk_rst 22 &pmc_clk_rst 23 | ||
512 | + &pmc_clk_rst 24 &pmc_clk_rst 25 | ||
513 | + &pmc_clk_rst 26 &pmc_clk_rst 27 | ||
514 | + &pmc_clk_rst 28 &pmc_clk_rst 29 | ||
515 | + >; | ||
516 | + }; | ||
517 | + psm0: rp_psm0@0 { | ||
518 | + compatible = "remote-port-gpio"; | ||
519 | + remote-ports = <&ps_pmc_rp 8>; | ||
520 | + #interrupt-cells = <1>; | ||
521 | + interrupt-controller; | ||
522 | + }; | ||
523 | +#ifdef MM_NPI_DDRMC_MAIN_0 | ||
524 | + ddrmc_ub0: rp_ddrmc@0 { | ||
525 | + compatible = "remote-port-gpio"; | ||
526 | + remote-ports = <&ps_pmc_rp 9>; | ||
527 | + #interrupt-cells = <1>; | ||
528 | + interrupt-controller; | ||
529 | + }; | ||
530 | + rp_npi_ddrmc_ub0: rp_npi_ddrmc_ub@0 { | ||
531 | + compatible = "remote-port-gpio"; | ||
532 | + remote-ports = <&ps_pmc_rp 11>; | ||
533 | + gpios = < &npi_ddrmc_ub0 0 >; | ||
534 | + }; | ||
535 | +#endif | ||
536 | +#ifdef MM_NPI_DDRMC_MAIN_1 | ||
537 | + ddrmc_ub1: rp_ddrmc@1 { | ||
538 | + compatible = "remote-port-gpio"; | ||
539 | + remote-ports = <&ps_pmc_rp 10>; | ||
540 | + #interrupt-cells = <1>; | ||
541 | + interrupt-controller; | ||
542 | + }; | ||
543 | + rp_npi_ddrmc_ub1: rp_npi_ddrmc_ub@1 { | ||
544 | + compatible = "remote-port-gpio"; | ||
545 | + remote-ports = <&ps_pmc_rp 12>; | ||
546 | + gpios = < &npi_ddrmc_ub1 0 >; | ||
547 | + }; | ||
548 | +#endif | ||
549 | + rp_lmb_psm: rp_lmb_psm@0 { | ||
550 | + compatible = "remote-port-memory-slave"; | ||
551 | + remote-ports = <&ps_pmc_rp 13>; | ||
552 | + mr = <&lmb_psm>; | ||
553 | + }; | ||
554 | + | ||
555 | +#define RPU_INTC_REDIRECT(NCPU, PSMOUT, RPUN) \ | ||
556 | +glue(rpu_intc_redirect_, NCPU): glue(rpu_intc_redirect, NCPU)@NCPU { \ | ||
557 | + #interrupt-cells = <1>; \ | ||
558 | + compatible = "xlnx,zynqmp-intc-redirect"; \ | ||
559 | + interrupt-controller; \ | ||
560 | + interrupts-extended = <glue(&rpu_cpu,NCPU) 0>; \ | ||
561 | + gpios = <&psm_global PSMOUT &rpu_ctrl RPUN>; \ | ||
562 | +}; | ||
563 | + | ||
564 | + amba_rpu: amba_rpu@0 { | ||
565 | + RPU_INTC_REDIRECT(0, 4, 6) | ||
566 | + RPU_INTC_REDIRECT(1, 5, 7) | ||
567 | + }; | ||
568 | + | ||
569 | +#else | ||
570 | + /* Single ARCH PS board has no PPU MicroBlazes. */ | ||
571 | + pmc_ppu0: dummy_ppu0@0 { | ||
572 | + #interrupt-cells = <1>; | ||
573 | + }; | ||
574 | + pmc_ppu1: dummy_ppu1@0 { | ||
575 | + #interrupt-cells = <1>; | ||
576 | + }; | ||
577 | + psm0: dummy_ppu0@0 { | ||
578 | + #interrupt-cells = <1>; | ||
579 | + }; | ||
580 | + ddrmc_ub0: dummy_ddrmc0@0 { | ||
581 | + #interrupt-cells = <1>; | ||
582 | + }; | ||
583 | + ddrmc_ub1: dummy_ddrmc1@0 { | ||
584 | + #interrupt-cells = <1>; | ||
585 | + }; | ||
586 | +#endif | ||
587 | + | ||
588 | + /* FIXME: Once we add the NOC, these should be attached to it. */ | ||
589 | + MEM_REGION(ddr, 0x0, MM_TOP_DDR, 0x00000000, MM_TOP_DDR_SIZE, &ddr_mem) // 2 GB | ||
590 | + MEM_SPEC(ddr_2, MM_TOP_DDR_2_H, MM_TOP_DDR_2_L, MM_TOP_DDR_2, | ||
591 | + MM_TOP_DDR_2_SIZE_H, MM_TOP_DDR_2_SIZE_L, &ddr_2_mem) // 32 GB | ||
592 | + mdio0: mdio { | ||
593 | + #address-cells = <1>; | ||
594 | + #size-cells = <0>; | ||
595 | + #priority-cells = <0>; | ||
596 | + compatible="mdio"; | ||
597 | + phy0: phy@1 { | ||
598 | + compatible = "dp83867"; | ||
599 | + device_type = "ethernet-phy"; | ||
600 | + reg = <1>; | ||
601 | + }; | ||
602 | + phy1: phy@2 { | ||
603 | + compatible = "88e1118r"; | ||
604 | + device_type = "ethernet-phy"; | ||
605 | + reg = <2>; | ||
606 | + }; | ||
607 | + }; | ||
608 | +}; | ||
609 | + | ||
610 | +/* | ||
611 | + * One flash for each SPI-master to match prebuilt system.dtb in BSP | ||
612 | + * xilinx-versal-virt-2019.1 | ||
613 | + */ | ||
614 | +#define BDEV_SPI_FLASH(_NAME, _COMPAT, _SIZEM, _REGVAL) \ | ||
615 | +_NAME: _NAME@0 { \ | ||
616 | + #address-cells = <1>; \ | ||
617 | + #size-cells = <1>; \ | ||
618 | + #priority-cells = <0>; \ | ||
619 | + #bus-cells = <1>; \ | ||
620 | + compatible = _COMPAT, "st,m25p80"; \ | ||
621 | + spi-max-frequency = <50000000>; \ | ||
622 | + reg = <_REGVAL>; \ | ||
623 | + blockdev-node-name = #_NAME; \ | ||
624 | + _NAME@0x00000000 { \ | ||
625 | + label = #_NAME; \ | ||
626 | + reg = <0x00000000 _SIZEM>; \ | ||
627 | + }; \ | ||
628 | +}; | ||
629 | + | ||
630 | +&spi0 { | ||
631 | + BDEV_SPI_FLASH(spi0_flash0, "m25p80", 0x00100000, 0x0 0x0) | ||
632 | +}; | ||
633 | + | ||
634 | +&spi1 { | ||
635 | + BDEV_SPI_FLASH(spi1_flash0, "m25p80", 0x00100000, 0x0 0x0) | ||
636 | +}; | ||
637 | + | ||
638 | +/* | ||
639 | + * Use 2Gbit QSPI flashes to allow verification of Image-searching | ||
640 | + * in ROM upto 256MB. | ||
641 | + */ | ||
642 | +#define DI_SPI_FLASH(_DI, _NAME, _COMPAT, _SIZEM, _REGVAL) \ | ||
643 | +_NAME: _NAME@0 { \ | ||
644 | + #address-cells = <1>; \ | ||
645 | + #size-cells = <1>; \ | ||
646 | + #priority-cells = <0>; \ | ||
647 | + #bus-cells = <1>; \ | ||
648 | + compatible = _COMPAT, "st,m25p80"; \ | ||
649 | + spi-max-frequency = <50000000>; \ | ||
650 | + reg = <_REGVAL>; \ | ||
651 | + drive-index = <_DI>; \ | ||
652 | + _NAME@0x00000000 { \ | ||
653 | + label = #_NAME; \ | ||
654 | + reg = <0x00000000 _SIZEM>; \ | ||
655 | + }; \ | ||
656 | +}; | ||
657 | + | ||
658 | +&pmc_qspi_0 { | ||
659 | + DI_SPI_FLASH(0, qspi_flash_lcs_lb, "m25qu02gcbb", 0x02000000, 0x0 0x0) | ||
660 | + DI_SPI_FLASH(1, qspi_flash_lcs_ub, "m25qu02gcbb", 0x02000000, 0x2 0x1) | ||
661 | + DI_SPI_FLASH(2, qspi_flash_ucs_lb, "m25qu02gcbb", 0x02000000, 0x1 0x0) | ||
662 | + DI_SPI_FLASH(3, qspi_flash_ucs_ub, "m25qu02gcbb", 0x02000000, 0x3 0x1) | ||
663 | +}; | ||
664 | + | ||
665 | +&ospi { | ||
666 | + DI_SPI_FLASH(4, ospi_flash_lcs_lb, "mt35xu01gbba", 0x02000000, 0x0 0x0) | ||
667 | + DI_SPI_FLASH(5, ospi_flash_lcs_ub, "mt35xu01gbba", 0x02000000, 0x1 0x0) | ||
668 | + DI_SPI_FLASH(6, ospi_flash_ucs_lb, "mt35xu01gbba", 0x02000000, 0x2 0x0) | ||
669 | + DI_SPI_FLASH(7, ospi_flash_ucs_ub, "mt35xu01gbba", 0x02000000, 0x3 0x0) | ||
670 | +}; | ||
671 | + | ||
672 | +&gem0 { | ||
673 | + mdio = <&mdio0>; | ||
674 | +}; | ||
675 | + | ||
676 | +&gem1 { | ||
677 | + mdio = <&mdio0>; | ||
678 | +}; | ||
679 | + | ||
680 | +&pmc_tap { | ||
681 | + /* | ||
682 | + * Default device: xcvc1902 | ||
683 | + */ | ||
684 | + idcode = <0x14CA8093>; | ||
685 | +}; | ||
686 | +#endif | ||
687 | diff --git a/versal-pmc-alt.dtsi b/versal-pmc-alt.dtsi | ||
688 | new file mode 100644 | ||
689 | index 00000000..8236911b | ||
690 | --- /dev/null | ||
691 | +++ b/versal-pmc-alt.dtsi | ||
692 | @@ -0,0 +1,40 @@ | ||
693 | +/* | ||
694 | + * Versal PMC | ||
695 | + * | ||
696 | + * Copyright (c) 2016, Xilinx Inc. | ||
697 | + * All rights reserved. | ||
698 | + * | ||
699 | + * Redistribution and use in source and binary forms, with or without | ||
700 | + * modification, are permitted provided that the following conditions are met: | ||
701 | + * * Redistributions of source code must retain the above copyright | ||
702 | + * notice, this list of conditions and the following disclaimer. | ||
703 | + * * Redistributions in binary form must reproduce the above copyright | ||
704 | + * notice, this list of conditions and the following disclaimer in the | ||
705 | + * documentation and/or other materials provided with the distribution. | ||
706 | + * * Neither the name of the <organization> nor the | ||
707 | + * names of its contributors may be used to endorse or promote products | ||
708 | + * derived from this software without specific prior written permission. | ||
709 | + * | ||
710 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
711 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
712 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
713 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
714 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
715 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
716 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
717 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
718 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
719 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
720 | + */ | ||
721 | + | ||
722 | +#include "versal.dtsh" | ||
723 | + | ||
724 | +#include "versal-icnt.dtsi" | ||
725 | +#include "versal-rams.dtsi" | ||
726 | +#include "versal-pmc-ppu-alt.dtsi" | ||
727 | +#include "versal-pmc-iou.dtsi" | ||
728 | +#include "versal-pmc-sys.dtsi" | ||
729 | +#include "versal-pmc-sec.dtsi" | ||
730 | +#include "versal-pmc-npi.dtsi" | ||
731 | +#include "versal-pmc-pl.dtsi" | ||
732 | +#include "versal-pmc-bat.dtsi" | ||
733 | diff --git a/versal-pmc-ppu-alt.dtsi b/versal-pmc-ppu-alt.dtsi | ||
734 | new file mode 100644 | ||
735 | index 00000000..726413f4 | ||
736 | --- /dev/null | ||
737 | +++ b/versal-pmc-ppu-alt.dtsi | ||
738 | @@ -0,0 +1,252 @@ | ||
739 | +/* | ||
740 | + * Versal PMC PPU block | ||
741 | + * | ||
742 | + * Copyright (c) 2016, Xilinx Inc. | ||
743 | + * All rights reserved. | ||
744 | + * | ||
745 | + * Redistribution and use in source and binary forms, with or without | ||
746 | + * modification, are permitted provided that the following conditions are met: | ||
747 | + * * Redistributions of source code must retain the above copyright | ||
748 | + * notice, this list of conditions and the following disclaimer. | ||
749 | + * * Redistributions in binary form must reproduce the above copyright | ||
750 | + * notice, this list of conditions and the following disclaimer in the | ||
751 | + * documentation and/or other materials provided with the distribution. | ||
752 | + * * Neither the name of the <organization> nor the | ||
753 | + * names of its contributors may be used to endorse or promote products | ||
754 | + * derived from this software without specific prior written permission. | ||
755 | + * | ||
756 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
757 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
758 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
759 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
760 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
761 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
762 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
763 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
764 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
765 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
766 | + */ | ||
767 | + | ||
768 | +#include "versal.dtsh" | ||
769 | + | ||
770 | +#define CREATE_PPU_IOMOD(X) \ | ||
771 | + pmc_ppu ## X ## _io_module: io-module@00 { \ | ||
772 | + doc-status = "complete"; \ | ||
773 | + #address-cells = <2>; \ | ||
774 | + #size-cells = <1>; \ | ||
775 | + #priority-cells = <0>; \ | ||
776 | + compatible = "xlnx,iomodule-1.02.a", "syscon", "simple-bus"; \ | ||
777 | + container = <&lmb_pmc_ppu ## X>; \ | ||
778 | + priority = <0xffffffff>; \ | ||
779 | + xlnx,freq = <0x47868c0>; \ | ||
780 | + xlnx,instance = "iomodule_1"; \ | ||
781 | + xlnx,io-mask = <0xfffe0000>; \ | ||
782 | + xlnx,lmb-awidth = <0x20>; \ | ||
783 | + xlnx,lmb-dwidth = <0x20>; \ | ||
784 | + xlnx,mask = <0xffffff80>; \ | ||
785 | + xlnx,use-io-bus = <0x1>; \ | ||
786 | + \ | ||
787 | + pmc_ppu ## X ## _io_intc: pmc_ppu ## X ## _intc@0C { \ | ||
788 | + #interrupt-cells = <1>; \ | ||
789 | + compatible = "xlnx,io-intc-1.02.a", "xlnx,io_intc"; \ | ||
790 | + interrupt-controller ; \ | ||
791 | + interrupts-extended = <&pmc_ppu ## X 0>; \ | ||
792 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(0C) 0x4 0x0 MM_PMC_PPU ## X ## _IOM(30) 0x10 0x0 MM_PMC_PPU ## X ## _IOM(80) 0x7C>; \ | ||
793 | + xlnx,intc-addr-width = <0x20>; \ | ||
794 | + xlnx,intc-base-vectors = <0x0>; \ | ||
795 | + xlnx,intc-has-fast = <0x0>; \ | ||
796 | + xlnx,intc-intr-size = <0x10>; \ | ||
797 | + xlnx,intc-level-edge = <0x0>; \ | ||
798 | + xlnx,intc-positive = <0xffff>; \ | ||
799 | + xlnx,intc-use-ext-intr = <0x1>; \ | ||
800 | + }; \ | ||
801 | + \ | ||
802 | + pmc_ppu ## X ## _io_gpi1: pmc_ppu ## X ## _gpi@20 { \ | ||
803 | + #gpio-cells = <1>; \ | ||
804 | + gpio-controller; \ | ||
805 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
806 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
807 | + interrupts = <11>; \ | ||
808 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(20) 0x4>; \ | ||
809 | + xlnx,gpi-interrupt = <0x1>; \ | ||
810 | + xlnx,gpi-size = <0x20>; \ | ||
811 | + xlnx,use-gpi = <0x1>; \ | ||
812 | + }; \ | ||
813 | + pmc_ppu ## X ## _io_gpi2: pmc_ppu ## X ## _gpi@24 { \ | ||
814 | + #gpio-cells = <1>; \ | ||
815 | + gpio-controller; \ | ||
816 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
817 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
818 | + interrupts = <12>; \ | ||
819 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(24) 0x4>; \ | ||
820 | + xlnx,gpi-interrupt = <0x1>; \ | ||
821 | + xlnx,gpi-size = <0x20>; \ | ||
822 | + xlnx,use-gpi = <0x1>; \ | ||
823 | + }; \ | ||
824 | + pmc_ppu ## X ## _io_gpi3: pmc_ppu ## X ## _gpi@28 { \ | ||
825 | + #gpio-cells = <1>; \ | ||
826 | + gpio-controller; \ | ||
827 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
828 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
829 | + interrupts = <13>; \ | ||
830 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(28) 0x4>; \ | ||
831 | + xlnx,gpi-interrupt = <0x1>; \ | ||
832 | + xlnx,gpi-size = <0x20>; \ | ||
833 | + xlnx,use-gpi = <0x1>; \ | ||
834 | + }; \ | ||
835 | + pmc_ppu ## X ## _io_gpi4: pmc_ppu ## X ## _gpi@2c { \ | ||
836 | + #gpio-cells = <1>; \ | ||
837 | + gpio-controller; \ | ||
838 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
839 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
840 | + interrupts = <14>; \ | ||
841 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(2c) 0x4>; \ | ||
842 | + xlnx,gpi-interrupt = <0x1>; \ | ||
843 | + xlnx,gpi-size = <0x20>; \ | ||
844 | + xlnx,use-gpi = <0x1>; \ | ||
845 | + }; \ | ||
846 | + \ | ||
847 | + pmc_ppu ## X ## _io_gpo1: pmc_ppu ## X ## _gpo@10 { \ | ||
848 | + #gpio-cells = <1>; \ | ||
849 | + gpio-controller; \ | ||
850 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
851 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(10) 0x4>; \ | ||
852 | + xlnx,gpo-init = <0x0>; \ | ||
853 | + xlnx,gpo-size = <0x9>; \ | ||
854 | + xlnx,use-gpo = <0x1>; \ | ||
855 | + }; \ | ||
856 | + pmc_ppu ## X ## _io_gpo2: pmc_ppu ## X ## _gpo@14 { \ | ||
857 | + #gpio-cells = <1>; \ | ||
858 | + gpio-controller; \ | ||
859 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
860 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(14) 0x4>; \ | ||
861 | + xlnx,gpo-init = <0x0>; \ | ||
862 | + xlnx,gpo-size = <0x20>; \ | ||
863 | + xlnx,use-gpo = <0x1>; \ | ||
864 | + }; \ | ||
865 | + pmc_ppu ## X ## _io_gpo3: pmc_ppu ## X ## _gpo@18 { \ | ||
866 | + #gpio-cells = <1>; \ | ||
867 | + gpio-controller; \ | ||
868 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
869 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(18) 0x4>; \ | ||
870 | + xlnx,gpo-init = <0x0>; \ | ||
871 | + xlnx,gpo-size = <0x20>; \ | ||
872 | + xlnx,use-gpo = <0x1>; \ | ||
873 | + }; \ | ||
874 | + pmc_ppu ## X ## _io_gpo4: pmc_ppu ## X ## _gpo@1c { \ | ||
875 | + #gpio-cells = <1>; \ | ||
876 | + gpio-controller; \ | ||
877 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
878 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(1c) 0x4>; \ | ||
879 | + xlnx,gpo-init = <0x0>; \ | ||
880 | + xlnx,gpo-size = <0x20>; \ | ||
881 | + xlnx,use-gpo = <0x1>; \ | ||
882 | + }; \ | ||
883 | + \ | ||
884 | + pmc_ppu ## X ## _io_pit1: pmc_ppu ## X ## _pit@40 { \ | ||
885 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
886 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
887 | + interrupts = <3>; \ | ||
888 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(40) 0xc>; \ | ||
889 | + xlnx,pit-interrupt = <0x1>; \ | ||
890 | + xlnx,pit-prescaler = <0x9>; \ | ||
891 | + xlnx,pit-readable = <0x1>; \ | ||
892 | + xlnx,pit-size = <0x20>; \ | ||
893 | + xlnx,use-pit = <0x1>; \ | ||
894 | + frequency = <460000000>; \ | ||
895 | + gpios = <&pmc_ppu ## X ## _io_gpo1 1 &pmc_ppu ## X ## _io_pit2 0>; \ | ||
896 | + gpio-names = "ps_config","ps_hit_in"; \ | ||
897 | + gpio-controller; \ | ||
898 | + #gpio-cells = <1>; \ | ||
899 | + }; \ | ||
900 | + pmc_ppu ## X ## _io_pit2: pmc_ppu ## X ## _pit@50 { \ | ||
901 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
902 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
903 | + interrupts = <4>; \ | ||
904 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(50) 0xc>; \ | ||
905 | + xlnx,pit-interrupt = <0x1>; \ | ||
906 | + xlnx,pit-prescaler = <0x9>; \ | ||
907 | + xlnx,pit-readable = <0x1>; \ | ||
908 | + xlnx,pit-size = <0x20>; \ | ||
909 | + xlnx,use-pit = <0x1>; \ | ||
910 | + frequency = <460000000>; \ | ||
911 | + gpio-controller; \ | ||
912 | + #gpio-cells = <1>; \ | ||
913 | + }; \ | ||
914 | + pmc_ppu ## X ## _io_pit3: pmc_ppu ## X ## _pit@60 { \ | ||
915 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
916 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
917 | + interrupts = <5>; \ | ||
918 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(60) 0xc>; \ | ||
919 | + xlnx,pit-interrupt = <0x1>; \ | ||
920 | + xlnx,pit-prescaler = <0x9>; \ | ||
921 | + xlnx,pit-readable = <0x1>; \ | ||
922 | + xlnx,pit-size = <0x20>; \ | ||
923 | + xlnx,use-pit = <0x1>; \ | ||
924 | + frequency = <460000000>; \ | ||
925 | + gpios = <&pmc_ppu ## X ## _io_gpo1 6 &pmc_ppu ## X ## _io_pit4 0>; \ | ||
926 | + gpio-names = "ps_config","ps_hit_in"; \ | ||
927 | + gpio-controller; \ | ||
928 | + #gpio-cells = <1>; \ | ||
929 | + }; \ | ||
930 | + pmc_ppu ## X ## _io_pit4: pmc_ppu ## X ## _pit@70 { \ | ||
931 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
932 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
933 | + interrupts = <6>; \ | ||
934 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(70) 0xc>; \ | ||
935 | + xlnx,pit-interrupt = <0x1>; \ | ||
936 | + xlnx,pit-prescaler = <0x9>; \ | ||
937 | + xlnx,pit-readable = <0x1>; \ | ||
938 | + xlnx,pit-size = <0x20>; \ | ||
939 | + xlnx,use-pit = <0x1>; \ | ||
940 | + frequency = <460000000>; \ | ||
941 | + gpio-controller; \ | ||
942 | + #gpio-cells = <1>; \ | ||
943 | + }; \ | ||
944 | + } | ||
945 | + | ||
946 | +/ { | ||
947 | + /* MDM UARTs. We put them here for instantiation ordering purposes | ||
948 | + * making sure that -serial command line options refer to these | ||
949 | + * first. | ||
950 | + */ | ||
951 | + ppu0_mdm_uart@MM_PMC_PPU0_MDM_HSD { | ||
952 | + doc-status = "complete"; | ||
953 | + compatible = "xlnx,xps-uartlite"; | ||
954 | + reg-extended = <&lmb_pmc_ppu0 0x0 MM_PMC_PPU0_MDM_HSD 0x0 0x10 0x1>; | ||
955 | + chardev = "serial2"; | ||
956 | + }; | ||
957 | + | ||
958 | + ppu1_mdm_uart@MM_PMC_PPU1_MDM_HSD { | ||
959 | + doc-status = "complete"; | ||
960 | + compatible = "xlnx,xps-uartlite"; | ||
961 | + reg-extended = <&lmb_pmc_ppu1 0x0 MM_PMC_PPU1_MDM_HSD 0x0 0x10 0x1>; | ||
962 | + chardev = "serial3"; | ||
963 | + }; | ||
964 | +}; | ||
965 | + | ||
966 | +&lmb_pmc_ppu0 { | ||
967 | + doc-name = "LMB PPU0"; | ||
968 | + doc-status = "complete"; | ||
969 | + CREATE_PPU_IOMOD(0); | ||
970 | +}; | ||
971 | + | ||
972 | +&lmb_pmc_ppu1 { | ||
973 | + doc-name = "LMB PPU1"; | ||
974 | + doc-status = "complete"; | ||
975 | + CREATE_PPU_IOMOD(1); | ||
976 | +}; | ||
977 | + | ||
978 | +&amba_pmc_ppu { | ||
979 | + pmc_gic_proxy: pmc_gic_proxy@0 { | ||
980 | + doc-status = "complete"; | ||
981 | + #interrupt-cells = <3>; | ||
982 | + interrupt-controller; | ||
983 | + | ||
984 | + compatible = "xlnx,zynqmp-gicp"; | ||
985 | + reg = <0x0 MM_PMC_GIC_PROXY 0x0 MM_PMC_GIC_PROXY_SIZE 0x0>; | ||
986 | + interrupt-parent = <&pmc_ppu1_io_intc>; | ||
987 | + interrupts = <IRQ_PPU1_INTC_PMC_GICP>; | ||
988 | + }; | ||
989 | +}; | ||
990 | + | ||
991 | diff --git a/versal-ps-iou-alt.dtsi b/versal-ps-iou-alt.dtsi | ||
992 | new file mode 100644 | ||
993 | index 00000000..a6c22b86 | ||
994 | --- /dev/null | ||
995 | +++ b/versal-ps-iou-alt.dtsi | ||
996 | @@ -0,0 +1,467 @@ | ||
997 | +/* | ||
998 | + * Versal PS IOU | ||
999 | + * | ||
1000 | + * Copyright (C) 2016-2022, Xilinx, Inc. | ||
1001 | + * Copyright (C) 2023, Advanced Micro Devices, Inc. | ||
1002 | + * All rights reserved. | ||
1003 | + * | ||
1004 | + * Redistribution and use in source and binary forms, with or without | ||
1005 | + * modification, are permitted provided that the following conditions are met: | ||
1006 | + * * Redistributions of source code must retain the above copyright | ||
1007 | + * notice, this list of conditions and the following disclaimer. | ||
1008 | + * * Redistributions in binary form must reproduce the above copyright | ||
1009 | + * notice, this list of conditions and the following disclaimer in the | ||
1010 | + * documentation and/or other materials provided with the distribution. | ||
1011 | + * * Neither the name of the <organization> nor the | ||
1012 | + * names of its contributors may be used to endorse or promote products | ||
1013 | + * derived from this software without specific prior written permission. | ||
1014 | + * | ||
1015 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
1016 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
1017 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
1018 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
1019 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
1020 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
1021 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
1022 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1023 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
1024 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1025 | + */ | ||
1026 | + | ||
1027 | +#include "versal.dtsh" | ||
1028 | + | ||
1029 | +#define GEM(g_name, g_base, g_size, g_dma, g_irq, rst_idx, pwr_idx) \ | ||
1030 | +g_name: ethernet@g_base { \ | ||
1031 | + #address-cells = <1>; \ | ||
1032 | + #size-cells = <0>; \ | ||
1033 | + #priority-cells = <0>; \ | ||
1034 | + compatible = "cdns,gem"; \ | ||
1035 | + interrupts = <g_irq g_irq>; \ | ||
1036 | + dma = <g_dma>; \ | ||
1037 | + memattr = <& ## g_name ## _memattr_smid>; \ | ||
1038 | + memattr-write = <& ## g_name ## _w_memattr_smid>; \ | ||
1039 | + reg = <0x0 g_base 0x0 g_size 0x0>; \ | ||
1040 | + num-priority-queues = <2>; \ | ||
1041 | + reset-gpios = <&crl rst_idx>; \ | ||
1042 | + power-gpios = <&psm_local pwr_idx>; \ | ||
1043 | +} | ||
1044 | + | ||
1045 | +// FIXME: Add support for SMIDs | ||
1046 | +#define ZDMA_CHANNEL(zname, zdomain, zbase, zirq, zbuswidth, zdma, mid, num) \ | ||
1047 | +zname ## _mattr: zname ## mattr { \ | ||
1048 | + compatible = "qemu:memory-transaction-attr"; \ | ||
1049 | + requester-id = <mid>; \ | ||
1050 | +}; \ | ||
1051 | + \ | ||
1052 | +zname: dma-controller@zbase { \ | ||
1053 | + compatible = "xlnx,zdma"; \ | ||
1054 | + reg = <0x0 zbase 0x0 MM_ADMA_CH0_SIZE 0x0>; \ | ||
1055 | + bus-width = <zbuswidth>; \ | ||
1056 | + has-parity = <1>; \ | ||
1057 | + interrupts = <zirq>; \ | ||
1058 | + #stream-id-cells = <0x1>; \ | ||
1059 | + dma = <zdma>; \ | ||
1060 | + memattr = <& ## zname ## _mattr>; \ | ||
1061 | + reset-gpios = < &crl CRL_RST_ADMA >; \ | ||
1062 | + #gpio-cells = <1>; \ | ||
1063 | + gpio-names = "memattr-secure"; \ | ||
1064 | + gpios = <&lpd_slcr_secure num>; \ | ||
1065 | +} | ||
1066 | + | ||
1067 | +/* | ||
1068 | + * Our XRAM model only has the correctable interrupt line. | ||
1069 | + * All instances connect to a single line in the GIC. | ||
1070 | + * | ||
1071 | + * To support shared memories for co-sim, we provide the | ||
1072 | + * actual RAMs externally and not from the XRAMC model. | ||
1073 | + */ | ||
1074 | +#define XRAM_CTRL(n) xram_ctrl_ ## n { \ | ||
1075 | + compatible = "xlnx,versal-xramc"; \ | ||
1076 | + reg = <0x0 (MM_XRAM + 0x## n ##0000) 0 0x10000 0x0 >; \ | ||
1077 | + interrupts = <XRAM_IRQ_0>; \ | ||
1078 | + alloc-ram = <0>; \ | ||
1079 | +} | ||
1080 | + | ||
1081 | +&amba_fpd { | ||
1082 | +#ifdef MM_FPD_FPD_APU | ||
1083 | + apu_ctrl: apu_ctrl@MM_FPD_FPD_APU { | ||
1084 | + compatible = "xlnx,versal-apu-ctrl"; | ||
1085 | + reg = <0x0 MM_FPD_FPD_APU 0x0 MM_FPD_FPD_APU_SIZE 0x0>; | ||
1086 | + cpu0 = <&cpu0>; | ||
1087 | + cpu1 = <&cpu1>; | ||
1088 | + #gpio-cells = <1>; | ||
1089 | + }; | ||
1090 | +#endif | ||
1091 | + | ||
1092 | + afi_fm@MM_FPD_FPD_AFIFM0 { | ||
1093 | + compatible = "xlnx,versal-afi-fm"; | ||
1094 | + reg = <0x0 MM_FPD_FPD_AFIFM0 0x0 MM_FPD_FPD_AFIFM0_SIZE 0x0>; | ||
1095 | + }; | ||
1096 | + | ||
1097 | + afi_fm@MM_FPD_FPD_AFIFM2 { | ||
1098 | + compatible = "xlnx,versal-afi-fm"; | ||
1099 | + reg = <0x0 MM_FPD_FPD_AFIFM2 0x0 MM_FPD_FPD_AFIFM2_SIZE 0x0>; | ||
1100 | + }; | ||
1101 | + | ||
1102 | +#ifdef MM_FPD_FPD_GPCCI | ||
1103 | + cci_reg@MM_FPD_FPD_GPCCI { | ||
1104 | + compatible = "xlnx,cci_reg"; | ||
1105 | + reg = <0x0 MM_FPD_FPD_GPCCI 0x0 MM_FPD_FPD_MAINCCI_SIZE 0x0>; | ||
1106 | + }; | ||
1107 | +#endif | ||
1108 | + | ||
1109 | +#ifdef MM_FPD_FPD_MAINCCI | ||
1110 | + cci500@MM_FPD_FPD_MAINCCI { | ||
1111 | + compatible = "xlnx,cci500"; | ||
1112 | + reg = <0x0 MM_FPD_FPD_MAINCCI 0x0 MM_FPD_FPD_MAINCCI_SIZE 0x0>; | ||
1113 | + }; | ||
1114 | +#endif | ||
1115 | + | ||
1116 | + cpm_crcpm@MM_CPM_CPM_CRCPM { | ||
1117 | + compatible = "xlnx,versal_cpm_crcpm"; | ||
1118 | + reg = <0x0 MM_CPM_CPM_CRCPM 0x0 MM_CPM_CPM_CRCPM_SIZE 0x0>; | ||
1119 | + }; | ||
1120 | + | ||
1121 | + cpm_pcsr@MM_CPM_CPM_PCSR { | ||
1122 | + compatible = "xlnx,versal_cpm_pcsr"; | ||
1123 | + reg = <0x0 MM_CPM_CPM_PCSR 0x0 MM_CPM_CPM_PCSR_SIZE 0x0>; | ||
1124 | + }; | ||
1125 | + | ||
1126 | + cpm_slcr_secure@MM_CPM_CPM_SLCR_SECURE { | ||
1127 | + compatible = "xlnx.cpm_slcr_secure"; | ||
1128 | + reg = <0x0 MM_CPM_CPM_SLCR_SECURE 0x0 MM_CPM_CPM_SLCR_SECURE_SIZE 0x0>; | ||
1129 | + }; | ||
1130 | + | ||
1131 | + fpd_slcr@MM_FPD_FPD_SLCR { | ||
1132 | + compatible = "xlnx,versal-fpd-slcr"; | ||
1133 | + interrupts = <SLCR_FPD_APB_IRQ_0>; | ||
1134 | + reg = <0x0 MM_FPD_FPD_SLCR 0x0 MM_FPD_FPD_SLCR_SIZE 0x0>; | ||
1135 | + }; | ||
1136 | + | ||
1137 | + fpd_slcr_secure@MM_FPD_FPD_SLCR { | ||
1138 | + compatible = "xlnx,versal-fpd-slcr-secure"; | ||
1139 | + interrupts = <SLCR_SECURE_FPD_APB_IRQ_0>; | ||
1140 | + reg = <0x0 MM_FPD_FPD_SLCR_SECURE 0x0 MM_FPD_FPD_SLCR_SECURE_SIZE 0x0>; | ||
1141 | + }; | ||
1142 | + | ||
1143 | +#ifdef MM_FPD_FPD_WWDT | ||
1144 | + wwdt0: watchdog@MM_FPD_FPD_WWDT { | ||
1145 | + compatible = "xlnx,versal-wwdt"; | ||
1146 | + reg = <0x0 MM_FPD_FPD_WWDT 0x0 MM_FPD_FPD_WWDT_SIZE 0x0>; | ||
1147 | + /* IRQ order must match the QEMU model */ | ||
1148 | + interrupts = <FP_WDT_IRQ_0 | ||
1149 | + FPD_WWDT_RST_PENDING_IRQ_0 | ||
1150 | + FPD_GWDT_WS0_IRQ_0 | ||
1151 | + FPD_GWDT_WS1_IRQ_0>; | ||
1152 | + pclk = <100000000>; | ||
1153 | + reset-gpios = <&crf 27>; | ||
1154 | + }; | ||
1155 | +#endif | ||
1156 | +#ifdef MM_FPD_INTFPD_CONFIG | ||
1157 | + intfpd: intfpd@MM_FPD_INTFPD_CONFIG { | ||
1158 | + compatible = "xlnx-intfpd-config"; | ||
1159 | + reg = <0x0 MM_FPD_INTFPD_CONFIG 0x0 MM_FPD_INTFPD_CONFIG_SIZE 0x0>; | ||
1160 | + interrupts = < | ||
1161 | + #if FPD_APB_INT_IRQ_0 | ||
1162 | + FPD_APB_INT_IRQ_0 | ||
1163 | + #elif INT_FPD_IRQ_0 | ||
1164 | + INT_FPD_IRQ_0 | ||
1165 | + #endif | ||
1166 | + >; | ||
1167 | + }; | ||
1168 | +#endif | ||
1169 | +}; | ||
1170 | + | ||
1171 | +&amba_lpd { | ||
1172 | + GEM(gem0, MM_GEM0, MM_GEM0_SIZE, &smmu_tbu0, GEM0_IRQ_0, CRL_RST_GEM0, PLR_PWR_GEM0); | ||
1173 | + GEM(gem1, MM_GEM1, MM_GEM1_SIZE, &smmu_tbu0, GEM1_IRQ_0, CRL_RST_GEM1, PLR_PWR_GEM1); | ||
1174 | + | ||
1175 | + serial0: serial@MM_UART0 { | ||
1176 | + compatible = "pl011"; | ||
1177 | + interrupts = <UART0_IRQ_0>; | ||
1178 | + reg = <0x0 MM_UART0 0x0 MM_UART0_SIZE 0x0 >; | ||
1179 | + reset-gpios = < &crl CRL_RST_UART0 >; | ||
1180 | + chardev = "serial0"; | ||
1181 | + }; | ||
1182 | + serial1: serial@MM_UART1 { | ||
1183 | + compatible = "pl011"; | ||
1184 | + interrupts = <UART1_IRQ_0>; | ||
1185 | + reg = <0x0 MM_UART1 0x0 MM_UART1_SIZE 0x0 >; | ||
1186 | + reset-gpios = < &crl CRL_RST_UART1 >; | ||
1187 | + chardev = "serial1"; | ||
1188 | + }; | ||
1189 | + | ||
1190 | + canfdbus0: canfdbus@0 { | ||
1191 | + compatible = "can-bus"; | ||
1192 | + }; | ||
1193 | + | ||
1194 | + can0: can@MM_CANFD0 { | ||
1195 | + compatible = "xlnx,versal-canfd"; | ||
1196 | + rx-fifo0 = <0x40>; | ||
1197 | + rx-fifo1 = <0x40>; | ||
1198 | + enable-rx-fifo1 = <0x1>; | ||
1199 | + canfdbus = <&canfdbus0>; | ||
1200 | + interrupts = <CAN0_IRQ_0>; | ||
1201 | + reg = <0x0 MM_CANFD0 0x0 MM_CANFD0_SIZE 0x0>; | ||
1202 | + reset-gpios = <&crl CRL_RST_CAN0>; | ||
1203 | + }; | ||
1204 | + can1: can@MM_CANFD1 { | ||
1205 | + compatible = "xlnx,versal-canfd"; | ||
1206 | + rx-fifo0 = <0x40>; | ||
1207 | + rx-fifo1 = <0x40>; | ||
1208 | + enable-rx-fifo1 = <0x1>; | ||
1209 | + canfdbus = <&canfdbus0>; | ||
1210 | + interrupts = <CAN1_IRQ_0>; | ||
1211 | + reg = <0x0 MM_CANFD1 0x0 MM_CANFD1_SIZE 0x0>; | ||
1212 | + reset-gpios = <&crl CRL_RST_CAN1>; | ||
1213 | + }; | ||
1214 | + | ||
1215 | + crl: crl@MM_CRL { | ||
1216 | + compatible = "xlnx,versal-crl"; | ||
1217 | + reg = <0x0 MM_CRL 0x0 MM_CRL_SIZE 0x0>; | ||
1218 | + gpio-controller; | ||
1219 | + #gpio-cells = <1>; | ||
1220 | + }; | ||
1221 | + | ||
1222 | + lpd_iou_slcr: slcr@MM_LPD_IOU_SLCR { | ||
1223 | + compatible = "xlnx,versal-lpd-iou-slcr"; | ||
1224 | + reg = <0x0 MM_LPD_IOU_SLCR 0x0 MM_LPD_IOU_SLCR_SIZE 0x0>; | ||
1225 | + }; | ||
1226 | + | ||
1227 | +#ifdef MM_RPU | ||
1228 | + rpu_ctrl: rpu_ctrl@MM_RPU { | ||
1229 | + compatible = "xlnx,versal-rpu"; | ||
1230 | + reg-extended = <&amba_lpd 0x0 MM_RPU 0x0 MM_RPU_SIZE 0x0 | ||
1231 | + &amba_r5_0 0x0 0x0 0x0 0x80000 0x0 | ||
1232 | + &amba 0x0 MM_R5_0_ATCM 0x0 0x60000 0x0 | ||
1233 | + &amba_r5_1 0x0 0x0 0x0 0x80000 0x0 | ||
1234 | + &amba 0x0 0xFFE90000 0x0 0x50000 0x0>; | ||
1235 | + rpu0 = <&rpu_cpu0>; | ||
1236 | + rpu1 = <&rpu_cpu1>; | ||
1237 | + | ||
1238 | + gpio-controller; | ||
1239 | + #gpio-cells = <1>; | ||
1240 | + | ||
1241 | + gpios = < &crl CRL_RST_CPU_R5_0 &crl CRL_RST_CPU_R5_1 | ||
1242 | + &psm_local 42 &psm_local 43 | ||
1243 | + >; | ||
1244 | + }; | ||
1245 | +#endif | ||
1246 | + | ||
1247 | + ipi: ipi@MM_IPI { | ||
1248 | + compatible = "xlnx,versal-ipi"; | ||
1249 | + reg = <0x0 MM_IPI 0x0 MM_IPI_SIZE 0x0>; | ||
1250 | + | ||
1251 | + /* Interrupt ordering here needs to match | ||
1252 | + * QEMU's sysbus-irq output order. */ | ||
1253 | + interrupts = <IPI_PSM_IRQ_0 | ||
1254 | + IPI_PMC_IRQ_0 | ||
1255 | + IPI0_IRQ_0 IPI1_IRQ_0 | ||
1256 | + IPI2_IRQ_0 IPI3_IRQ_0 | ||
1257 | + IPI4_IRQ_0 IPI5_IRQ_0 | ||
1258 | + IPI6_IRQ_0 | ||
1259 | + IPI_PMC_NOBUF_IRQ_0 | ||
1260 | + IPI_APB_IRQ_0>; | ||
1261 | + reset-gpios = <&crl CRL_RST_IPI>; | ||
1262 | + }; | ||
1263 | + | ||
1264 | + spi0: spi@MM_SPI0 { | ||
1265 | + compatible = "cdns,spi-r1p6"; | ||
1266 | + interrupts = <SPI0_IRQ_0>; | ||
1267 | + num-ss-bits = <4>; | ||
1268 | + reg = <0x0 MM_SPI0 0x0 MM_SPI0_SIZE 0x0 >; | ||
1269 | + | ||
1270 | + #address-cells = <1>; /* For child; must match SPI_FLASH() */ | ||
1271 | + #size-cells = <0>; | ||
1272 | + #bus-cells = <1>; | ||
1273 | + reset-gpios = <&crl CRL_RST_SPI0>; | ||
1274 | + }; | ||
1275 | + spi1: spi@MM_SPI1 { | ||
1276 | + compatible = "cdns,spi-r1p6"; | ||
1277 | + interrupts = <SPI1_IRQ_0>; | ||
1278 | + num-ss-bits = <4>; | ||
1279 | + reg = <0x0 MM_SPI1 0x0 MM_SPI1_SIZE 0x0 >; | ||
1280 | + | ||
1281 | + #address-cells = <1>; /* For child; must match SPI_FLASH() */ | ||
1282 | + #size-cells = <0>; | ||
1283 | + #bus-cells = <1>; | ||
1284 | + reset-gpios = <&crl CRL_RST_SPI1>; | ||
1285 | + }; | ||
1286 | + | ||
1287 | + dwc3_0: usb2@USB2_0_XHCI { | ||
1288 | + compatible = "usb_dwc3"; | ||
1289 | + reg = <0x0 MM_USB_DWC3_0 0x0 MM_USB_DWC3_0_SIZE 0x0 0x0 MM_USB_XHCI 0x0 MM_USB_XHCI_SIZE 0x0>; | ||
1290 | + interrupts = <USB2_IRQ_0 USB2_IRQ_1 USB2_IRQ_2 USB2_IRQ_3>; | ||
1291 | + dma = <&smmu_tbu0>; | ||
1292 | + memattr = <&usb0_memattr>; | ||
1293 | + reset-gpios = <&crl CRL_RST_USB0>; | ||
1294 | + intrs = <4>; | ||
1295 | + slots = <2>; | ||
1296 | + }; | ||
1297 | + | ||
1298 | + ttc0: timer@MM_TTC0 { | ||
1299 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1300 | + interrupts = <TTC0_IRQ_0 TTC0_IRQ_1 TTC0_IRQ_2>; | ||
1301 | + reg = <0x0 MM_TTC0 0x0 MM_TTC0_SIZE 0x0>; | ||
1302 | + width = <32>; | ||
1303 | + reset-gpios = < &crl CRL_RST_TTC0 >; | ||
1304 | + }; | ||
1305 | + ttc1: timer@MM_TTC1 { | ||
1306 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1307 | + interrupts = <TTC1_IRQ_0 TTC1_IRQ_1 TTC1_IRQ_2>; | ||
1308 | + reg = <0x0 MM_TTC1 0x0 MM_TTC1_SIZE 0x0>; | ||
1309 | + width = <32>; | ||
1310 | + reset-gpios = < &crl CRL_RST_TTC1 >; | ||
1311 | + }; | ||
1312 | + ttc2: timer@MM_TTC2 { | ||
1313 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1314 | + interrupts = <TTC2_IRQ_0 TTC2_IRQ_1 TTC2_IRQ_2>; | ||
1315 | + reg = <0x0 MM_TTC2 0x0 MM_TTC2_SIZE 0x0>; | ||
1316 | + width = <32>; | ||
1317 | + reset-gpios = < &crl CRL_RST_TTC2 >; | ||
1318 | + }; | ||
1319 | + ttc3: timer@MM_TTC3 { | ||
1320 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1321 | + interrupts = <TTC3_IRQ_0 TTC3_IRQ_1 TTC3_IRQ_2>; | ||
1322 | + reg = <0x0 MM_TTC3 0x0 MM_TTC3_SIZE 0x0>; | ||
1323 | + width = <32>; | ||
1324 | + reset-gpios = < &crl CRL_RST_TTC3 >; | ||
1325 | + }; | ||
1326 | + | ||
1327 | + ZDMA_CHANNEL(adma0, adma, MM_ADMA_CH0, ADMA_IRQ_0, 128, &smmu_tbu0, SMID_DMA0_CH0, 0x0); | ||
1328 | + ZDMA_CHANNEL(adma1, adma, MM_ADMA_CH1, ADMA_IRQ_1, 128, &smmu_tbu0, SMID_DMA0_CH1, 0x1); | ||
1329 | + ZDMA_CHANNEL(adma2, adma, MM_ADMA_CH2, ADMA_IRQ_2, 128, &smmu_tbu0, SMID_DMA0_CH2, 0x2); | ||
1330 | + ZDMA_CHANNEL(adma3, adma, MM_ADMA_CH3, ADMA_IRQ_3, 128, &smmu_tbu0, SMID_DMA0_CH3, 0x3); | ||
1331 | + ZDMA_CHANNEL(adma4, adma, MM_ADMA_CH4, ADMA_IRQ_4, 128, &smmu_tbu0, SMID_DMA0_CH4, 0x4); | ||
1332 | + ZDMA_CHANNEL(adma5, adma, MM_ADMA_CH5, ADMA_IRQ_5, 128, &smmu_tbu0, SMID_DMA0_CH5, 0x5); | ||
1333 | + ZDMA_CHANNEL(adma6, adma, MM_ADMA_CH6, ADMA_IRQ_6, 128, &smmu_tbu0, SMID_DMA0_CH6, 0x6); | ||
1334 | + ZDMA_CHANNEL(adma7, adma, MM_ADMA_CH7, ADMA_IRQ_7, 128, &smmu_tbu0, SMID_DMA0_CH7, 0x7); | ||
1335 | + | ||
1336 | + afi_fm@MM_LPD_AFIFM4 { | ||
1337 | + compatible = "xlnx,versal-afi-fm"; | ||
1338 | + reg = <0x0 MM_LPD_AFIFM4 0x0 MM_LPD_AFIFM4_SIZE 0x0>; | ||
1339 | + }; | ||
1340 | + | ||
1341 | + lpd_i2c_wrapper { | ||
1342 | +#ifdef MM_PS_I2C0 | ||
1343 | + ps_i2c0: ps_i2c0@MM_PS_I2C0 { | ||
1344 | + #address-cells = <1>; | ||
1345 | + #size-cells = <0>; | ||
1346 | + compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10"; | ||
1347 | + interrupts = <I2C0_IRQ_0>; | ||
1348 | + reg-extended = <&amba_lpd 0x0 MM_PS_I2C0 0x0 MM_PS_I2C0_SIZE 0x0>; | ||
1349 | + reset-gpios = <&crl CRL_RST_I2C0>; | ||
1350 | + }; | ||
1351 | + ps_i2c1: ps_i2c0@MM_PS_I2C1 { | ||
1352 | + #address-cells = <1>; | ||
1353 | + #size-cells = <0>; | ||
1354 | + compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10"; | ||
1355 | + interrupts = <I2C1_IRQ_0>; | ||
1356 | + reg-extended = <&amba_lpd 0x0 MM_PS_I2C1 0x0 MM_PS_I2C1_SIZE 0x0>; | ||
1357 | + reset-gpios = <&crl CRL_RST_I2C1>; | ||
1358 | + }; | ||
1359 | +#endif | ||
1360 | + }; | ||
1361 | + | ||
1362 | + ocm_ctrl0: ocm_ctrl@OCM { | ||
1363 | + compatible = "xlnx,zynqmp-ocmc"; | ||
1364 | + interrupts = <OCMINTR_IRQ_0>; | ||
1365 | + memsize = <MM_OCM_MEM_SIZE>; | ||
1366 | + reg = <0x0 MM_OCM 0x0 MM_OCM_SIZE 0x0>; | ||
1367 | + reset-gpios = <&crl CRL_RST_OCM>; | ||
1368 | + }; | ||
1369 | + | ||
1370 | +#ifdef MM_XRAM_SLCR | ||
1371 | + xram_slcr@MM_XRAM_SLCR { | ||
1372 | + compatible = "xlnx,xram_slcr"; | ||
1373 | + reg = <0x0 MM_XRAM_SLCR 0x0 MM_XRAM_SLCR_SIZE 0x0>; | ||
1374 | + }; | ||
1375 | +#endif | ||
1376 | + | ||
1377 | + lpd_slcr@MM_LPD_SLCR { | ||
1378 | + compatible = "xlnx,versal-lpd-slcr"; | ||
1379 | + reg = <0x0 MM_LPD_SLCR 0x0 MM_LPD_SLCR_SIZE 0x0>; | ||
1380 | + }; | ||
1381 | + | ||
1382 | + lpd_slcr_secure: lpd_slcr_secure@MM_LPD_SLCR_SECURE { | ||
1383 | + compatible = "xlnx,versal-lpd-slcr-secure"; | ||
1384 | + reg = <0x0 MM_LPD_SLCR_SECURE 0x0 MM_LPD_SLCR_SECURE_SIZE 0x0>; | ||
1385 | + gpio-controller; | ||
1386 | + #gpio-cells = <1>; | ||
1387 | + }; | ||
1388 | + | ||
1389 | + lpd_iou_slcr_secure: lpd_iou_slcr_secure@MM_LPD_IOU_SECURE_SLCR { | ||
1390 | + compatible = "xlnx,versal-lpd-iou-slcr-secure"; | ||
1391 | + reg = <0x0 MM_LPD_IOU_SECURE_SLCR 0x0 MM_LPD_IOU_SECURE_SLCR_SIZE 0x0>; | ||
1392 | + memattr-gem0 = <&gem0_memattr_smid>; | ||
1393 | + memattr-write-gem0 = <&gem0_w_memattr_smid>; | ||
1394 | + memattr-gem1 = <&gem1_memattr_smid>; | ||
1395 | + memattr-write-gem1 = <&gem1_w_memattr_smid>; | ||
1396 | + }; | ||
1397 | + | ||
1398 | +#ifdef MM_WWDT | ||
1399 | + lpd_wwdt: wwdt@MM_WWDT { | ||
1400 | + compatible = "xlnx,versal-wwdt"; | ||
1401 | + reg = <0x0 MM_WWDT 0x0 MM_WWDT_SIZE 0x0>; | ||
1402 | + /* IRQ order must match the QEMU model */ | ||
1403 | + interrupts = <WWDT_IRQ_0 | ||
1404 | + WWDT_RST_PENDING_IRQ_0 | ||
1405 | + GWDT_WS0_IRQ_0 | ||
1406 | + GWDT_WS1_IRQ_0>; | ||
1407 | + pclk = <100000000>; | ||
1408 | + reset-gpios = <&crl CRL_RST_SWDT>; | ||
1409 | + }; | ||
1410 | +#endif | ||
1411 | + | ||
1412 | + lpd_gpio: lpd_gpio@MM_PS_GPIO { | ||
1413 | + #gpio-cells = <1>; | ||
1414 | + compatible = "xlnx,zynqmp-gpio"; | ||
1415 | + gpio-controller; | ||
1416 | + interrupts = <GPIO_IRQ_0>; | ||
1417 | + reg = <0x0 MM_PS_GPIO 0x0 MM_PS_GPIO_SIZE 0x0>; | ||
1418 | + reset-gpios = < &crl CRL_RST_GPIO >; | ||
1419 | + }; | ||
1420 | +#ifdef MM_INTLPD_CONFIG | ||
1421 | + intlpd: intlpd@MM_INTLPD_CONFIG { | ||
1422 | + compatible = "xlnx-intlpd-config"; | ||
1423 | + reg = <0x0 MM_INTLPD_CONFIG 0x0 MM_INTLPD_CONFIG_SIZE 0x0>; | ||
1424 | + interrupts = <INT_LPD_IRQ_0>; | ||
1425 | + }; | ||
1426 | +#endif | ||
1427 | +}; | ||
1428 | + | ||
1429 | +&amba_xram { | ||
1430 | + XRAM_CTRL(0); | ||
1431 | + XRAM_CTRL(1); | ||
1432 | + XRAM_CTRL(2); | ||
1433 | + XRAM_CTRL(3); | ||
1434 | +}; | ||
1435 | + | ||
1436 | +&amba_root { | ||
1437 | + /* These devices need to be created before the CPUs. */ | ||
1438 | + crf: crf@MM_FPD_CRF { | ||
1439 | + compatible = "xlnx,versal-crf"; | ||
1440 | + reg-extended = <&amba_fpd 0x0 MM_FPD_CRF 0x0 MM_FPD_CRF_SIZE 0x0>; | ||
1441 | + gpio-controller; | ||
1442 | + #gpio-cells = <1>; | ||
1443 | + }; | ||
1444 | +}; | ||
1445 | + | ||
1446 | +/ { | ||
1447 | + /* Reset domains. */ | ||
1448 | + lpd_reset_domain@0 { | ||
1449 | + compatible = "qemu,reset-domain"; | ||
1450 | + mr0 = <&amba_lpd>; | ||
1451 | + reset-gpios = < &pmc_clk_rst CRP_RST_PS_PS_SRST | ||
1452 | + &pmc_clk_rst CRP_RST_PS_PS_POR >; | ||
1453 | + }; | ||
1454 | + | ||
1455 | + fpd_reset_domain@0 { | ||
1456 | + compatible = "qemu,reset-domain"; | ||
1457 | + mr0 = <&amba_fpd>; | ||
1458 | + reset-gpios = < &pmc_clk_rst CRP_RST_PS_PS_SRST | ||
1459 | + &pmc_clk_rst CRP_RST_PS_PS_POR | ||
1460 | + &crl CRL_RST_FPD_POR | ||
1461 | + &crl CRL_RST_FPD_SRST >; | ||
1462 | + }; | ||
1463 | +}; | ||
1464 | -- | ||
1465 | 2.34.1 | ||
1466 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-net-Reorder-serial-port.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-net-Reorder-serial-port.patch new file mode 100644 index 00000000..97262ae4 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-net-Reorder-serial-port.patch | |||
@@ -0,0 +1,291 @@ | |||
1 | From 58fdfde013dfabf3a9f2c83525c00a6f057768f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Hatle <mark.hatle@amd.com> | ||
3 | Date: Fri, 4 Oct 2024 15:49:46 -0600 | ||
4 | Subject: [PATCH] versal-net: Reorder serial port | ||
5 | |||
6 | This commit requires the corresponding "versal: Reorder serial ports" | ||
7 | |||
8 | This change affects the order of the serial ports when calling qemu. | ||
9 | Previously the serial ports 0 & 1 were the PMC (firmware) uartlite, | ||
10 | while the standard serial pors were 2 & 3. Reverse this order to | ||
11 | ensure that the first two serial ports are the ones used by Linux. | ||
12 | |||
13 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
14 | --- | ||
15 | board-versal-net-psx-spp-1.4-alt.dts | 36 ++++++++ | ||
16 | board-versal-net-psx-virt-alt.dts | 130 +++++++++++++++++++++++++++ | ||
17 | board-versal-pmx-virt-alt.dts | 82 +++++++++++++++++ | ||
18 | 3 files changed, 248 insertions(+) | ||
19 | create mode 100644 board-versal-net-psx-spp-1.4-alt.dts | ||
20 | create mode 100644 board-versal-net-psx-virt-alt.dts | ||
21 | create mode 100644 board-versal-pmx-virt-alt.dts | ||
22 | |||
23 | diff --git a/board-versal-net-psx-spp-1.4-alt.dts b/board-versal-net-psx-spp-1.4-alt.dts | ||
24 | new file mode 100644 | ||
25 | index 00000000..770a388e | ||
26 | --- /dev/null | ||
27 | +++ b/board-versal-net-psx-spp-1.4-alt.dts | ||
28 | @@ -0,0 +1,36 @@ | ||
29 | +/* | ||
30 | + * Versal Net PSX device tree. | ||
31 | + * | ||
32 | + * Copyright (c) 2022, Xilinx Inc | ||
33 | + * All rights reserved. | ||
34 | + * | ||
35 | + * Redistribution and use in source and binary forms, with or without | ||
36 | + * modification, are permitted provided that the following conditions are met: | ||
37 | + * * Redistributions of source code must retain the above copyright | ||
38 | + * notice, this list of conditions and the following disclaimer. | ||
39 | + * * Redistributions in binary form must reproduce the above copyright | ||
40 | + * notice, this list of conditions and the following disclaimer in the | ||
41 | + * documentation and/or other materials provided with the distribution. | ||
42 | + * * Neither the name of the <organization> nor the | ||
43 | + * names of its contributors may be used to endorse or promote products | ||
44 | + * derived from this software without specific prior written permission. | ||
45 | + * | ||
46 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
47 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
48 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
49 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
50 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
51 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
52 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
53 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
54 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
55 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
56 | + */ | ||
57 | + | ||
58 | +#define VERSAL_NET_APU_CPU_FREQ 100000000 | ||
59 | + | ||
60 | +#include "board-versal-net-psx-virt-alt.dts" | ||
61 | + | ||
62 | +&pmc_tap { | ||
63 | + platform-ver = <0x5>; | ||
64 | +}; | ||
65 | diff --git a/board-versal-net-psx-virt-alt.dts b/board-versal-net-psx-virt-alt.dts | ||
66 | new file mode 100644 | ||
67 | index 00000000..7ee4ad9d | ||
68 | --- /dev/null | ||
69 | +++ b/board-versal-net-psx-virt-alt.dts | ||
70 | @@ -0,0 +1,130 @@ | ||
71 | +/* | ||
72 | + * Versal-Net Virtual PSX board device tree. | ||
73 | + * | ||
74 | + * Copyright (c) 2021-2022, Xilinx Inc. | ||
75 | + * Copyright (C) 2022-2024, Advanced Micro Devices, Inc. | ||
76 | + * All rights reserved. | ||
77 | + * | ||
78 | + * Redistribution and use in source and binary forms, with or without | ||
79 | + * modification, are permitted provided that the following conditions are met: | ||
80 | + * * Redistributions of source code must retain the above copyright | ||
81 | + * notice, this list of conditions and the following disclaimer. | ||
82 | + * * Redistributions in binary form must reproduce the above copyright | ||
83 | + * notice, this list of conditions and the following disclaimer in the | ||
84 | + * documentation and/or other materials provided with the distribution. | ||
85 | + * * Neither the name of the <organization> nor the | ||
86 | + * names of its contributors may be used to endorse or promote products | ||
87 | + * derived from this software without specific prior written permission. | ||
88 | + * | ||
89 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
90 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
91 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
92 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
93 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
94 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
95 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
96 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
97 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
98 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
99 | + */ | ||
100 | + | ||
101 | +#ifndef NUM_APUS | ||
102 | +#define NUM_APUS 16 | ||
103 | +#endif | ||
104 | +#define VERSAL_NET_APU_CPU_FREQ 100000000 | ||
105 | + | ||
106 | +#define NUM_APUS_PER_CLUSTER 4 | ||
107 | + | ||
108 | +#define VERSAL_NPI_GENERIC | ||
109 | +#define VERSAL_PSX | ||
110 | +#define VERSAL_NET | ||
111 | +#define VERSAL_NPI_OVERRIDE | ||
112 | + | ||
113 | +/* TODO: Add GIC interrupt redirection support. */ | ||
114 | +#define RPU_GIC_INTERRUPT_TARGET_STEM rpu_cpu | ||
115 | + | ||
116 | +#define APU_CPU_MODEL "cortex-a78-arm-cpu" | ||
117 | +#define RPU_CPU_MODEL "cortex-r52-arm-cpu" | ||
118 | + | ||
119 | +#include "include/versal-net/npi-memmap.dtsh" | ||
120 | +#include "include/versal-net/fpd-memmap.dtsh" | ||
121 | +#include "board-versal-ps-virt-alt.dts" | ||
122 | +#include "versal-psx.dtsi" | ||
123 | +#include "versal-net-psmx.dtsi" | ||
124 | +#include "versal-psx-rpu.dtsi" | ||
125 | +#include "versal-net-boot-init.dtsi" | ||
126 | +#include "versal-net-hnic.dtsi" | ||
127 | +#include "versal-pmx-shared-overlay.dtsi" | ||
128 | +#include "versal-pmx-system-overlay.dtsi" | ||
129 | +#include "versal-psx-shared-overlay.dtsi" | ||
130 | + | ||
131 | +#ifndef VERSAL_NET_APU_CPU_FREQ | ||
132 | + #define VERSAL_NET_APU_CPU_FREQ 2720000 | ||
133 | +#endif | ||
134 | + | ||
135 | +#define SET_CPU_FREQ(n, f) \ | ||
136 | +&cpu ## n { \ | ||
137 | + generic-timer-frequency = <f>; \ | ||
138 | +} | ||
139 | + | ||
140 | +SET_CPU_FREQ(0, VERSAL_NET_APU_CPU_FREQ); | ||
141 | +SET_CPU_FREQ(1, VERSAL_NET_APU_CPU_FREQ); | ||
142 | +SET_CPU_FREQ(2, VERSAL_NET_APU_CPU_FREQ); | ||
143 | +SET_CPU_FREQ(3, VERSAL_NET_APU_CPU_FREQ); | ||
144 | +SET_CPU_FREQ(4, VERSAL_NET_APU_CPU_FREQ); | ||
145 | +SET_CPU_FREQ(5, VERSAL_NET_APU_CPU_FREQ); | ||
146 | +SET_CPU_FREQ(6, VERSAL_NET_APU_CPU_FREQ); | ||
147 | +SET_CPU_FREQ(7, VERSAL_NET_APU_CPU_FREQ); | ||
148 | +#if (NUM_APUS >= 16) | ||
149 | +SET_CPU_FREQ(8, VERSAL_NET_APU_CPU_FREQ); | ||
150 | +SET_CPU_FREQ(9, VERSAL_NET_APU_CPU_FREQ); | ||
151 | +SET_CPU_FREQ(10,VERSAL_NET_APU_CPU_FREQ); | ||
152 | +SET_CPU_FREQ(11,VERSAL_NET_APU_CPU_FREQ); | ||
153 | +SET_CPU_FREQ(12,VERSAL_NET_APU_CPU_FREQ); | ||
154 | +SET_CPU_FREQ(13,VERSAL_NET_APU_CPU_FREQ); | ||
155 | +SET_CPU_FREQ(14,VERSAL_NET_APU_CPU_FREQ); | ||
156 | +SET_CPU_FREQ(15,VERSAL_NET_APU_CPU_FREQ); | ||
157 | +#endif | ||
158 | +#if (NUM_APUS >= 32) | ||
159 | +SET_CPU_FREQ(16, VERSAL_NET_APU_CPU_FREQ); | ||
160 | +SET_CPU_FREQ(17, VERSAL_NET_APU_CPU_FREQ); | ||
161 | +SET_CPU_FREQ(18, VERSAL_NET_APU_CPU_FREQ); | ||
162 | +SET_CPU_FREQ(19, VERSAL_NET_APU_CPU_FREQ); | ||
163 | +SET_CPU_FREQ(20, VERSAL_NET_APU_CPU_FREQ); | ||
164 | +SET_CPU_FREQ(21, VERSAL_NET_APU_CPU_FREQ); | ||
165 | +SET_CPU_FREQ(22, VERSAL_NET_APU_CPU_FREQ); | ||
166 | +SET_CPU_FREQ(23, VERSAL_NET_APU_CPU_FREQ); | ||
167 | +SET_CPU_FREQ(24, VERSAL_NET_APU_CPU_FREQ); | ||
168 | +SET_CPU_FREQ(25, VERSAL_NET_APU_CPU_FREQ); | ||
169 | +SET_CPU_FREQ(26, VERSAL_NET_APU_CPU_FREQ); | ||
170 | +SET_CPU_FREQ(27, VERSAL_NET_APU_CPU_FREQ); | ||
171 | +SET_CPU_FREQ(28, VERSAL_NET_APU_CPU_FREQ); | ||
172 | +SET_CPU_FREQ(29, VERSAL_NET_APU_CPU_FREQ); | ||
173 | +SET_CPU_FREQ(30, VERSAL_NET_APU_CPU_FREQ); | ||
174 | +SET_CPU_FREQ(31, VERSAL_NET_APU_CPU_FREQ); | ||
175 | +#endif | ||
176 | + | ||
177 | +&rpu_ctrl_a { | ||
178 | + tcm-mr = <&s_axi_tcm_a>; | ||
179 | +}; | ||
180 | +&rpu_ctrl_a0 { | ||
181 | + core = <&rpu_cpu0>; | ||
182 | +}; | ||
183 | +&rpu_ctrl_a1 { | ||
184 | + core = <&rpu_cpu1>; | ||
185 | +}; | ||
186 | + | ||
187 | +&rpu_ctrl_b { | ||
188 | + tcm-mr = <&s_axi_tcm_b>; | ||
189 | +}; | ||
190 | +&rpu_ctrl_b0 { | ||
191 | + core = <&rpu_cpu2>; | ||
192 | +}; | ||
193 | +&rpu_ctrl_b1 { | ||
194 | + core = <&rpu_cpu3>; | ||
195 | +}; | ||
196 | + | ||
197 | +&pmc_tap { | ||
198 | + idcode = <0x14D80093>; | ||
199 | + platform-ver = <0x5>; | ||
200 | +}; | ||
201 | diff --git a/board-versal-pmx-virt-alt.dts b/board-versal-pmx-virt-alt.dts | ||
202 | new file mode 100644 | ||
203 | index 00000000..7a4679d0 | ||
204 | --- /dev/null | ||
205 | +++ b/board-versal-pmx-virt-alt.dts | ||
206 | @@ -0,0 +1,82 @@ | ||
207 | +/* | ||
208 | + * Versal Virtual PMC board device tree | ||
209 | + * | ||
210 | + * Copyright (c) 2016, Xilinx Inc | ||
211 | + * All rights reserved. | ||
212 | + * | ||
213 | + * Redistribution and use in source and binary forms, with or without | ||
214 | + * modification, are permitted provided that the following conditions are met: | ||
215 | + * * Redistributions of source code must retain the above copyright | ||
216 | + * notice, this list of conditions and the following disclaimer. | ||
217 | + * * Redistributions in binary form must reproduce the above copyright | ||
218 | + * notice, this list of conditions and the following disclaimer in the | ||
219 | + * documentation and/or other materials provided with the distribution. | ||
220 | + * * Neither the name of the <organization> nor the | ||
221 | + * names of its contributors may be used to endorse or promote products | ||
222 | + * derived from this software without specific prior written permission. | ||
223 | + * | ||
224 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
225 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
226 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
227 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
228 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
229 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
230 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
231 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
232 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
233 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
234 | + */ | ||
235 | + | ||
236 | +#define VERSAL_PMX | ||
237 | +#define VERSAL_NET | ||
238 | +#define NUM_APUS 16 | ||
239 | +#define NUM_APUS_PER_CLUSTER 4 | ||
240 | +#define VERSAL_NPI_OVERRIDE | ||
241 | + | ||
242 | +#include "include/versal-net/npi-memmap.dtsh" | ||
243 | +#include "include/versal-net/fpd-memmap.dtsh" | ||
244 | +#include "board-versal-pmc-virt-alt.dts" | ||
245 | +#include "versal-pmx-shared-overlay.dtsi" | ||
246 | + | ||
247 | +#ifndef MULTI_ARCH | ||
248 | +/* | ||
249 | + * The single-arch setup has the entire system except | ||
250 | + * the ARM cores. So we need to add the missing dummy | ||
251 | + * ARM cores (pmc-virt.dts already has 0 - 1) and include | ||
252 | + * the PSX and PMX system overlays. | ||
253 | + */ | ||
254 | +#include "versal-pmx-system-overlay.dtsi" | ||
255 | +#include "versal-psx.dtsi" | ||
256 | +#include "versal-psx-shared-overlay.dtsi" | ||
257 | +#include "versal-net-psmx.dtsi" | ||
258 | + | ||
259 | +/ { | ||
260 | + /* Dummy APUs. */ | ||
261 | + cpu2: apu@2 { }; | ||
262 | + cpu3: apu@3 { }; | ||
263 | + cpu4: apu@4 { }; | ||
264 | + cpu5: apu@5 { }; | ||
265 | + cpu6: apu@6 { }; | ||
266 | + cpu7: apu@7 { }; | ||
267 | +#if (NUM_APUS >= 16) | ||
268 | + cpu8: apu@8 { }; | ||
269 | + cpu9: apu@9 { }; | ||
270 | + cpu10: apu@10 { }; | ||
271 | + cpu11: apu@11 { }; | ||
272 | + cpu12: apu@12 { }; | ||
273 | + cpu13: apu@13 { }; | ||
274 | + cpu14: apu@14 { }; | ||
275 | + cpu15: apu@15 { }; | ||
276 | +#endif | ||
277 | + /* Dummy GICs. */ | ||
278 | + rpu_gic_a: rpu_gic_a@0 { | ||
279 | + gpio_controller ; | ||
280 | + #gpio-cells = <1>; | ||
281 | + }; | ||
282 | + | ||
283 | + rpu_gic_b: rpu_gic_b@0 { | ||
284 | + gpio_controller ; | ||
285 | + #gpio-cells = <1>; | ||
286 | + }; | ||
287 | +}; | ||
288 | +#endif | ||
289 | -- | ||
290 | 2.34.1 | ||
291 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb deleted file mode 100644 index d10504d3..00000000 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | |||
2 | require qemu-devicetrees.inc | ||
3 | |||
4 | BRANCH ?= "xlnx_rel_v2024.1" | ||
5 | SRCREV ?= "b9c88cbfaaa0c8b8be70ea3c74f4cb69fb02a080" | ||
6 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.2.bb new file mode 100644 index 00000000..5780aed1 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.2.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | |||
2 | require qemu-devicetrees.inc | ||
3 | |||
4 | BRANCH ?= "xlnx_rel_v2024.2" | ||
5 | SRCREV ?= "a6eeb7ec0fdb765ab0057d95eb6201d97359eff9" | ||
6 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc index 179903c5..da62c8b7 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc | |||
@@ -8,8 +8,8 @@ COMPATIBLE_HOST:arm = "null" | |||
8 | # x86_64 is needed to build nativesdks | 8 | # x86_64 is needed to build nativesdks |
9 | QEMU_TARGETS = "aarch64 arm microblaze microblazeel riscv32 x86_64" | 9 | QEMU_TARGETS = "aarch64 arm microblaze microblazeel riscv32 x86_64" |
10 | 10 | ||
11 | BRANCH = "xlnx_rel_v2024.1" | 11 | BRANCH = "xlnx_rel_v2024.2" |
12 | SRCREV = "2319c870e754148ec3b9d40be0d3dbee959c3251" | 12 | SRCREV = "01482fa113dcbfa785feb7d513df50d15ec4c5df" |
13 | 13 | ||
14 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ |
15 | file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" | 15 | file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" |
@@ -72,6 +72,13 @@ SRC_URI += "\ | |||
72 | # Patch doesn't apply to 8.1.0 | 72 | # Patch doesn't apply to 8.1.0 |
73 | # file://fixmips.patch | 73 | # file://fixmips.patch |
74 | 74 | ||
75 | # Additional patches to match Scarthgap, which requires a slightly newer qmp interface | ||
76 | SRC_URI += "\ | ||
77 | file://0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch \ | ||
78 | file://0002-python-qemu-rename-command-to-cmd.patch \ | ||
79 | " | ||
80 | |||
81 | |||
75 | S = "${WORKDIR}/git" | 82 | S = "${WORKDIR}/git" |
76 | 83 | ||
77 | # Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc | 84 | # Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc |
diff --git a/meta-xilinx-core/recipes-devtools/tcf-agent/tcf-agent_%.bbappend b/meta-xilinx-core/recipes-devtools/tcf-agent/tcf-agent_%.bbappend new file mode 100644 index 00000000..d0bbaa0a --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/tcf-agent/tcf-agent_%.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | # On a Zynq system hardware breakpoints are limited, so used software | ||
2 | CFLAGS:append:zynq = " -DENABLE_HardwareBreakpoints=0" | ||
diff --git a/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in b/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in new file mode 100644 index 00000000..ba8c8f21 --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in | |||
@@ -0,0 +1,8 @@ | |||
1 | # common environment file for sysvinit and systemd | ||
2 | |||
3 | LD_LIBRARY_PATH=/usr/lib/headless:${LD_LIBRARY_PATH} | ||
4 | XSERVER=/usr/bin/Xorg | ||
5 | DISPLAY=:0 | ||
6 | ARGS=" -br -pn @BLANK_ARGS@ @NO_CURSOR_ARG@ " | ||
7 | HOME=@HOME@ | ||
8 | USER=@USER@ | ||
diff --git a/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86Rotate.c-Add-required-NULL-check.patch b/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86Rotate.c-Add-required-NULL-check.patch new file mode 100644 index 00000000..8c086ddb --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86Rotate.c-Add-required-NULL-check.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From e94754360160cfe4faada7b9a523e57004b39e74 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
3 | Date: Thu, 15 Aug 2024 15:48:21 -0700 | ||
4 | Subject: [PATCH] xf86Rotate.c: Add required NULL check | ||
5 | |||
6 | Add missing NULL check on BlockHandler callback before invoking it. There | ||
7 | is no guarantee that said callback is always defined. | ||
8 | |||
9 | Fixes xorg crash on startup when screen rotation is specified in the config | ||
10 | file. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> | ||
15 | --- | ||
16 | hw/xfree86/modes/xf86Rotate.c | 3 ++- | ||
17 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c | ||
20 | index ea9c43c..43eab53 100644 | ||
21 | --- a/hw/xfree86/modes/xf86Rotate.c | ||
22 | +++ b/hw/xfree86/modes/xf86Rotate.c | ||
23 | @@ -230,7 +230,8 @@ xf86RotateBlockHandler(ScreenPtr pScreen, void *pTimeout) | ||
24 | |||
25 | xf86RotateRedisplay(pScreen); | ||
26 | |||
27 | - (*pScreen->BlockHandler) (pScreen, pTimeout); | ||
28 | + if (pScreen->BlockHandler) | ||
29 | + (*pScreen->BlockHandler) (pScreen, pTimeout); | ||
30 | |||
31 | /* Re-wrap if we still need this hook */ | ||
32 | if (xf86_config->rotation_damage != NULL) { | ||
33 | -- | ||
34 | 2.25.1 | ||
35 | |||
diff --git a/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend index dc6a75c6..ebf7cd9e 100644 --- a/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend +++ b/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend | |||
@@ -3,6 +3,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | |||
3 | SRC_URI += " \ | 3 | SRC_URI += " \ |
4 | file://monitor-hotplug.sh \ | 4 | file://monitor-hotplug.sh \ |
5 | file://99-monitor-hotplug.rules \ | 5 | file://99-monitor-hotplug.rules \ |
6 | file://0001-xf86Rotate.c-Add-required-NULL-check.patch \ | ||
6 | " | 7 | " |
7 | 8 | ||
8 | do_install:append() { | 9 | do_install:append() { |
diff --git a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.6.10.bb b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.6.10.bb index 22f363c9..3aaac030 100644 --- a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.6.10.bb +++ b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.6.10.bb | |||
@@ -23,4 +23,3 @@ EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}" | |||
23 | COMPATIBLE_MACHINE = "^$" | 23 | COMPATIBLE_MACHINE = "^$" |
24 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | 24 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" |
25 | COMPATIBLE_MACHINE:versal = "versal" | 25 | COMPATIBLE_MACHINE:versal = "versal" |
26 | COMPATIBLE_MACHINE:versal-net = "versal-net" | ||
diff --git a/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_6.6.10.bb b/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_6.6.40.bb index 318a3cc0..d6b4d565 100644 --- a/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_6.6.10.bb +++ b/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_6.6.40.bb | |||
@@ -8,9 +8,9 @@ PV .= "+git" | |||
8 | 8 | ||
9 | S = "${WORKDIR}/git" | 9 | S = "${WORKDIR}/git" |
10 | 10 | ||
11 | BRANCH ?= "xlnx_rel_v2024.1" | 11 | BRANCH ?= "xlnx_rel_v2024.2" |
12 | REPO ?= "git://github.com/Xilinx/hdmi-modules.git;protocol=https" | 12 | REPO ?= "git://github.com/Xilinx/hdmi-modules.git;protocol=https" |
13 | SRCREV = "edd297762e0bac3f4c5b64ef67244968e22020e2" | 13 | SRCREV = "4bb89eb3f3062eac8de1aa2b7e64d7f861e18caa" |
14 | 14 | ||
15 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | 15 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" |
16 | SRC_URI = "${REPO};${BRANCHARG}" | 16 | SRC_URI = "${REPO};${BRANCHARG}" |
@@ -23,4 +23,3 @@ EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}" | |||
23 | COMPATIBLE_MACHINE = "^$" | 23 | COMPATIBLE_MACHINE = "^$" |
24 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | 24 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" |
25 | COMPATIBLE_MACHINE:versal = "versal" | 25 | COMPATIBLE_MACHINE:versal = "versal" |
26 | COMPATIBLE_MACHINE:versal-net = "versal-net" | ||
diff --git a/meta-xilinx-core/recipes-kernel/hdmi21/kernel-module-hdmi21_2024.2.bb b/meta-xilinx-core/recipes-kernel/hdmi21/kernel-module-hdmi21_2024.2.bb new file mode 100644 index 00000000..806d2515 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/hdmi21/kernel-module-hdmi21_2024.2.bb | |||
@@ -0,0 +1,23 @@ | |||
1 | SUMMARY = "Xilinx HDMI 2.1 FMC linux kernel module" | ||
2 | DESCRIPTION = "Out-of-tree HDMI 2.1 FMC kernel modules provider for aarch64 devices" | ||
3 | SECTION = "PETALINUX/modules" | ||
4 | LICENSE = "GPL-2.0-only" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eb723b61539feef013de476e68b5c50a" | ||
6 | |||
7 | inherit module | ||
8 | |||
9 | SRC_BRANCH = "master" | ||
10 | INHIBIT_PACKAGE_STRIP = "1" | ||
11 | |||
12 | SRC_URI = "git://github.com/Xilinx/hdmi21-modules.git;protocol=https;branch=${SRC_BRANCH}" | ||
13 | |||
14 | SRCREV = "26a1d40723c58783f7aedba028a208ab9410df5f" | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | COMPATIBLE_MACHINE = "^$" | ||
19 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
20 | COMPATIBLE_MACHINE:versal = "versal" | ||
21 | |||
22 | # The inherit of module.bbclass will automatically name module packages with | ||
23 | # "kernel-module-" prefix as required by the oe-core build environment. | ||
diff --git a/meta-xilinx-core/recipes-kernel/libtraceevent/libtraceevent/meson.patch b/meta-xilinx-core/recipes-kernel/libtraceevent/libtraceevent/meson.patch deleted file mode 100644 index 38b61071..00000000 --- a/meta-xilinx-core/recipes-kernel/libtraceevent/libtraceevent/meson.patch +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | Fixes for the Meson build of libtraceevent: | ||
2 | |||
3 | - Make the plugin directory the same as the Makefiles | ||
4 | - Install the plugins as modules not static and versioned shared libraries | ||
5 | - Add an option to disable building the documentation (needs asciidoc and xmlto) | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
9 | |||
10 | diff --git a/meson.build b/meson.build | ||
11 | index b61c873..4bba4d8 100644 | ||
12 | --- a/meson.build | ||
13 | +++ b/meson.build | ||
14 | @@ -25,7 +25,7 @@ htmldir = join_paths(prefixdir, get_option('htmldir')) | ||
15 | libdir = join_paths(prefixdir, get_option('libdir')) | ||
16 | plugindir = get_option('plugindir') | ||
17 | if plugindir == '' | ||
18 | - plugindir = join_paths(libdir, 'libtraceevent/plugins') | ||
19 | + plugindir = join_paths(libdir, 'traceevent/plugins') | ||
20 | endif | ||
21 | |||
22 | add_project_arguments( | ||
23 | @@ -45,10 +45,13 @@ if cunit_dep.found() | ||
24 | subdir('utest') | ||
25 | endif | ||
26 | subdir('samples') | ||
27 | -subdir('Documentation') | ||
28 | |||
29 | -custom_target( | ||
30 | - 'docs', | ||
31 | - output: 'docs', | ||
32 | - depends: [html, man], | ||
33 | - command: ['echo']) | ||
34 | +if get_option('docs') | ||
35 | + subdir('Documentation') | ||
36 | + | ||
37 | + custom_target( | ||
38 | + 'docs', | ||
39 | + output: 'docs', | ||
40 | + depends: [html, man], | ||
41 | + command: ['echo']) | ||
42 | +endif | ||
43 | diff --git a/meson_options.txt b/meson_options.txt | ||
44 | index b2294f6..0611216 100644 | ||
45 | --- a/meson_options.txt | ||
46 | +++ b/meson_options.txt | ||
47 | @@ -4,6 +4,10 @@ | ||
48 | |||
49 | option('plugindir', type : 'string', | ||
50 | description : 'set the plugin dir') | ||
51 | + | ||
52 | +option('docs', type : 'boolean', value: true, | ||
53 | + description : 'build documentation') | ||
54 | + | ||
55 | option('htmldir', type : 'string', value : 'share/doc/libtraceevent-doc', | ||
56 | description : 'directory for HTML documentation') | ||
57 | option('asciidoctor', type : 'boolean', value: false, | ||
58 | diff --git a/plugins/meson.build b/plugins/meson.build | ||
59 | index 74ad664..4919be4 100644 | ||
60 | --- a/plugins/meson.build | ||
61 | +++ b/plugins/meson.build | ||
62 | @@ -19,11 +19,10 @@ plugins = [ | ||
63 | |||
64 | pdeps = [] | ||
65 | foreach plugin : plugins | ||
66 | - pdeps += library( | ||
67 | + pdeps += shared_module( | ||
68 | plugin.replace('.c', ''), | ||
69 | plugin, | ||
70 | name_prefix: '', | ||
71 | - version: library_version, | ||
72 | dependencies: [libtraceevent_dep], | ||
73 | include_directories: [incdir], | ||
74 | install: true, | ||
diff --git a/meta-xilinx-core/recipes-kernel/libtraceevent/libtraceevent_1.7.3.bb b/meta-xilinx-core/recipes-kernel/libtraceevent/libtraceevent_1.7.3.bb deleted file mode 100644 index bee78918..00000000 --- a/meta-xilinx-core/recipes-kernel/libtraceevent/libtraceevent_1.7.3.bb +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | # Copyright (C) 2022 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | SUMMARY = "API to access the kernel tracefs directory" | ||
5 | HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/" | ||
6 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \ | ||
8 | file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd" | ||
9 | SECTION = "libs" | ||
10 | |||
11 | SRCREV = "dd148189b74da3e2f45c7e536319fec97cb71213" | ||
12 | SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \ | ||
13 | file://meson.patch" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | inherit meson pkgconfig | ||
18 | |||
19 | EXTRA_OEMESON = "-Ddocs=false" | ||
20 | |||
21 | PACKAGES += "${PN}-plugins" | ||
22 | |||
23 | FILES:${PN}-plugins += "${libdir}/traceevent/plugins" | ||
diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/linux-xlnx-kmeta/features/hwmon/hwmon_modules.cfg b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/linux-xlnx-kmeta/features/hwmon/hwmon_modules.cfg new file mode 100644 index 00000000..b6db5f90 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/linux-xlnx-kmeta/features/hwmon/hwmon_modules.cfg | |||
@@ -0,0 +1,2 @@ | |||
1 | CONFIG_SENSORS_TPS53679=m | ||
2 | |||
diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/linux-xlnx-kmeta/features/hwmon/hwmon_modules.scc b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/linux-xlnx-kmeta/features/hwmon/hwmon_modules.scc new file mode 100644 index 00000000..25ef4034 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/linux-xlnx-kmeta/features/hwmon/hwmon_modules.scc | |||
@@ -0,0 +1,2 @@ | |||
1 | # SPDX-License-Identifier: MIT | ||
2 | kconf hardware hwmon_modules.cfg | ||
diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.10-v2024.1.bb b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.10-v2024.1.bb index 71ac690e..4558101a 100644 --- a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.10-v2024.1.bb +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.10-v2024.1.bb | |||
@@ -9,11 +9,3 @@ KCONF_AUDIT_LEVEL="0" | |||
9 | include linux-xlnx.inc | 9 | include linux-xlnx.inc |
10 | 10 | ||
11 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | 11 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" |
12 | |||
13 | # Workaround for: | ||
14 | # rm: cannot remove '.../tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/6.6.0-xilinx-v2024.1+gitAUTOINC+340eed5001-r0/image/lib/modules/6.6.0-xilinx-v2024.1-g340eed500130/source': No such file or directory | ||
15 | # This will not be required Scarthgap | ||
16 | kernel_do_install:prepend () { | ||
17 | mkdir -p "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" | ||
18 | touch "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source" | ||
19 | } | ||
diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.40-v2024.2.bb b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.40-v2024.2.bb new file mode 100644 index 00000000..e862f747 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_6.6.40-v2024.2.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | LINUX_VERSION = "6.6.40" | ||
2 | YOCTO_META ?= "git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-6.6;destsuffix=yocto-kmeta" | ||
3 | KBRANCH="xlnx_rebase_v6.6_LTS" | ||
4 | SRCREV = "2b7f6f70a62a52a467bed030a27c2ada879106e9" | ||
5 | SRCREV_meta = "5d0809d0d939c7738cb6e5391126c73fd0e4e865" | ||
6 | |||
7 | KCONF_AUDIT_LEVEL="0" | ||
8 | |||
9 | include linux-xlnx.inc | ||
10 | |||
11 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
diff --git a/meta-xilinx-core/recipes-kernel/perf/perf-perl.inc b/meta-xilinx-core/recipes-kernel/perf/perf-perl.inc deleted file mode 100644 index 491f54c3..00000000 --- a/meta-xilinx-core/recipes-kernel/perf/perf-perl.inc +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | inherit perlnative cpan-base | ||
2 | |||
3 | # Env var which tells perl if it should use host (no) or target (yes) settings | ||
4 | export PERLCONFIGTARGET = "${@is_target(d)}" | ||
5 | export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE" | ||
6 | export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}" | ||
7 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}" | ||
8 | |||
9 | # The perl symbols CPPSTDIN and CPPRUN embed the sysroot into the | ||
10 | # binaries, work needed to remove this | ||
11 | INSANE_SKIP:${PN}-dbg += "buildpaths" | ||
diff --git a/meta-xilinx-core/recipes-kernel/perf/perf.bb b/meta-xilinx-core/recipes-kernel/perf/perf.bb deleted file mode 100644 index 9164d93a..00000000 --- a/meta-xilinx-core/recipes-kernel/perf/perf.bb +++ /dev/null | |||
@@ -1,414 +0,0 @@ | |||
1 | SUMMARY = "Performance analysis tools for Linux" | ||
2 | DESCRIPTION = "Performance counters for Linux are a new kernel-based \ | ||
3 | subsystem that provide a framework for all things \ | ||
4 | performance analysis. It covers hardware level \ | ||
5 | (CPU/PMU, Performance Monitoring Unit) features \ | ||
6 | and software features (software counters, tracepoints) \ | ||
7 | as well." | ||
8 | HOMEPAGE = "https://perf.wiki.kernel.org/index.php/Main_Page" | ||
9 | |||
10 | LICENSE = "GPL-2.0-only" | ||
11 | |||
12 | PE = '1' | ||
13 | |||
14 | PACKAGECONFIG ??= "python tui libunwind libtraceevent" | ||
15 | PACKAGECONFIG[dwarf] = ",NO_DWARF=1" | ||
16 | PACKAGECONFIG[perl] = ",NO_LIBPERL=1,perl" | ||
17 | PACKAGECONFIG[python] = ",NO_LIBPYTHON=1,python3 python3-setuptools-native" | ||
18 | # gui support was added with kernel 3.6.35 | ||
19 | # since 3.10 libnewt was replaced by slang | ||
20 | # to cover a wide range of kernel we add both dependencies | ||
21 | PACKAGECONFIG[tui] = ",NO_NEWT=1,libnewt slang" | ||
22 | PACKAGECONFIG[libunwind] = ",NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1,libunwind" | ||
23 | PACKAGECONFIG[libnuma] = ",NO_LIBNUMA=1" | ||
24 | PACKAGECONFIG[bfd] = ",NO_LIBBFD=1" | ||
25 | PACKAGECONFIG[systemtap] = ",NO_SDT=1,systemtap" | ||
26 | PACKAGECONFIG[jvmti] = ",NO_JVMTI=1" | ||
27 | # libaudit support would need scripting to be enabled | ||
28 | PACKAGECONFIG[audit] = ",NO_LIBAUDIT=1,audit" | ||
29 | PACKAGECONFIG[manpages] = ",,xmlto-native asciidoc-native" | ||
30 | PACKAGECONFIG[cap] = ",,libcap" | ||
31 | PACKAGECONFIG[libtraceevent] = ",NO_LIBTRACEEVENT=1,libtraceevent" | ||
32 | # jevents requires host python for generating a .c file, but is | ||
33 | # unrelated to the python item. | ||
34 | PACKAGECONFIG[jevents] = ",NO_JEVENTS=1,python3-native" | ||
35 | # Arm CoreSight | ||
36 | PACKAGECONFIG[coresight] = "CORESIGHT=1,,opencsd" | ||
37 | PACKAGECONFIG[pfm4] = ",NO_LIBPFM4=1,libpfm4" | ||
38 | PACKAGECONFIG[babeltrace] = ",NO_LIBBABELTRACE=1,babeltrace" | ||
39 | |||
40 | # libunwind is not yet ported for some architectures | ||
41 | PACKAGECONFIG:remove:arc = "libunwind" | ||
42 | PACKAGECONFIG:remove:riscv32 = "libunwind" | ||
43 | |||
44 | DEPENDS = " \ | ||
45 | virtual/${MLPREFIX}libc \ | ||
46 | ${MLPREFIX}elfutils \ | ||
47 | ${MLPREFIX}binutils \ | ||
48 | bison-native flex-native xz \ | ||
49 | " | ||
50 | |||
51 | do_configure[depends] += "virtual/kernel:do_shared_workdir" | ||
52 | |||
53 | PROVIDES = "virtual/perf" | ||
54 | |||
55 | inherit linux-kernel-base kernel-arch manpages | ||
56 | |||
57 | # needed for building the tools/perf Python bindings | ||
58 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} | ||
59 | inherit python3-dir | ||
60 | export PYTHON_SITEPACKAGES_DIR | ||
61 | |||
62 | #kernel 3.1+ supports WERROR to disable warnings as errors | ||
63 | export WERROR = "0" | ||
64 | |||
65 | do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" | ||
66 | |||
67 | # needed for building the tools/perf Perl binding | ||
68 | include ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perf-perl.inc', '', d)} | ||
69 | |||
70 | inherit kernelsrc | ||
71 | |||
72 | S = "${WORKDIR}/${BP}" | ||
73 | SPDX_S = "${S}/tools/perf" | ||
74 | |||
75 | # The LDFLAGS is required or some old kernels fails due missing | ||
76 | # symbols and this is preferred than requiring patches to every old | ||
77 | # supported kernel. | ||
78 | LDFLAGS="-ldl -lutil" | ||
79 | |||
80 | # Perf's build system adds its own optimization flags for most TUs, | ||
81 | # overriding the flags included here. But for some, perf does not add | ||
82 | # any -O option, so ensure the distro's chosen optimization gets used | ||
83 | # for those. Since ${SELECTED_OPTIMIZATION} always includes | ||
84 | # ${DEBUG_FLAGS} which in turn includes ${DEBUG_PREFIX_MAP}, this also | ||
85 | # ensures perf is built with appropriate -f*-prefix-map options, | ||
86 | # avoiding the 'buildpaths' QA warning. | ||
87 | TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}" | ||
88 | |||
89 | EXTRA_OEMAKE = '\ | ||
90 | V=1 \ | ||
91 | VF=1 \ | ||
92 | -C ${S}/tools/perf \ | ||
93 | O=${B} \ | ||
94 | CROSS_COMPILE=${TARGET_PREFIX} \ | ||
95 | ARCH=${ARCH} \ | ||
96 | CC="${CC}" \ | ||
97 | CCLD="${CC}" \ | ||
98 | LDSHARED="${CC} -shared" \ | ||
99 | AR="${AR}" \ | ||
100 | LD="${LD}" \ | ||
101 | EXTRA_CFLAGS="-ldw -I${S}" \ | ||
102 | YFLAGS='-y --file-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR}' \ | ||
103 | EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \ | ||
104 | perfexecdir=${libexecdir} \ | ||
105 | NO_GTK2=1 \ | ||
106 | ${PACKAGECONFIG_CONFARGS} \ | ||
107 | PKG_CONFIG=pkg-config \ | ||
108 | TMPDIR="${B}" \ | ||
109 | LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \ | ||
110 | ' | ||
111 | |||
112 | EXTRA_OEMAKE += "\ | ||
113 | 'DESTDIR=${D}' \ | ||
114 | 'prefix=${prefix}' \ | ||
115 | 'bindir=${bindir}' \ | ||
116 | 'sharedir=${datadir}' \ | ||
117 | 'sysconfdir=${sysconfdir}' \ | ||
118 | 'perfexecdir=${libexecdir}/perf-core' \ | ||
119 | 'ETC_PERFCONFIG=${@os.path.relpath(sysconfdir, prefix)}' \ | ||
120 | 'sharedir=${@os.path.relpath(datadir, prefix)}' \ | ||
121 | 'mandir=${@os.path.relpath(mandir, prefix)}' \ | ||
122 | 'infodir=${@os.path.relpath(infodir, prefix)}' \ | ||
123 | ${@bb.utils.contains('PACKAGECONFIG', 'python', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \ | ||
124 | " | ||
125 | |||
126 | # During do_configure, we might run a 'make clean'. That often breaks | ||
127 | # when done in parallel, so disable parallelism for do_configure. Note | ||
128 | # that it has to be done this way rather than by passing -j1, since | ||
129 | # perf's build system by default ignores any -j argument, but does | ||
130 | # honour a JOBS variable. | ||
131 | EXTRA_OEMAKE:append:task-configure = " JOBS=1" | ||
132 | |||
133 | PERF_SRC ?= "Makefile \ | ||
134 | tools/arch \ | ||
135 | tools/build \ | ||
136 | tools/include \ | ||
137 | tools/lib \ | ||
138 | tools/Makefile \ | ||
139 | tools/perf \ | ||
140 | tools/scripts \ | ||
141 | scripts/ \ | ||
142 | arch/arm64/tools \ | ||
143 | arch/${ARCH}/Makefile \ | ||
144 | " | ||
145 | |||
146 | PERF_EXTRA_LDFLAGS = "" | ||
147 | |||
148 | # MIPS N32/N64 | ||
149 | PERF_EXTRA_LDFLAGS:mipsarchn32eb = "-m elf32btsmipn32" | ||
150 | PERF_EXTRA_LDFLAGS:mipsarchn32el = "-m elf32ltsmipn32" | ||
151 | PERF_EXTRA_LDFLAGS:mipsarchn64eb = "-m elf64btsmip" | ||
152 | PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip" | ||
153 | |||
154 | do_compile() { | ||
155 | # Linux kernel build system is expected to do the right thing | ||
156 | unset CFLAGS | ||
157 | test -e ${S}/tools/lib/traceevent/plugins/Makefile && \ | ||
158 | sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/lib/traceevent/plugins/Makefile | ||
159 | test -e ${S}/tools/perf/Makefile.config && \ | ||
160 | sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/perf/Makefile.config | ||
161 | oe_runmake all | ||
162 | } | ||
163 | |||
164 | do_install() { | ||
165 | # Linux kernel build system is expected to do the right thing | ||
166 | unset CFLAGS | ||
167 | oe_runmake install | ||
168 | # we are checking for this make target to be compatible with older perf versions | ||
169 | if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then | ||
170 | oe_runmake DESTDIR=${D} install-python_ext | ||
171 | if [ -e ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt ]; then | ||
172 | sed -i -e 's#${WORKDIR}##g' ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt | ||
173 | fi | ||
174 | fi | ||
175 | } | ||
176 | |||
177 | do_configure[prefuncs] += "copy_perf_source_from_kernel" | ||
178 | python copy_perf_source_from_kernel() { | ||
179 | sources = (d.getVar("PERF_SRC") or "").split() | ||
180 | src_dir = d.getVar("STAGING_KERNEL_DIR") | ||
181 | dest_dir = d.getVar("S") | ||
182 | bb.utils.mkdirhier(dest_dir) | ||
183 | bb.utils.prunedir(dest_dir) | ||
184 | for s in sources: | ||
185 | src = oe.path.join(src_dir, s) | ||
186 | dest = oe.path.join(dest_dir, s) | ||
187 | if not os.path.exists(src): | ||
188 | bb.warn("Path does not exist: %s. Maybe PERF_SRC lists more files than what your kernel version provides and needs." % src) | ||
189 | continue | ||
190 | if os.path.isdir(src): | ||
191 | oe.path.copyhardlinktree(src, dest) | ||
192 | else: | ||
193 | src_path = os.path.dirname(s) | ||
194 | os.makedirs(os.path.join(dest_dir,src_path),exist_ok=True) | ||
195 | bb.utils.copyfile(src, dest) | ||
196 | } | ||
197 | |||
198 | do_configure:prepend () { | ||
199 | # If building a multlib based perf, the incorrect library path will be | ||
200 | # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit | ||
201 | # build, with a 64 bit multilib, the arch won't match and the detection of a | ||
202 | # 64 bit build (and library) are not exected. To ensure that libraries are | ||
203 | # installed to the correct location, we can use the weak assignment in the | ||
204 | # config/Makefile. | ||
205 | # | ||
206 | # Also need to relocate .config-detected to $(OUTPUT)/config-detected | ||
207 | # for kernel sources that do not already do this | ||
208 | # as two builds (e.g. perf and lib32-perf from mutlilib can conflict | ||
209 | # with each other if its in the shared source directory | ||
210 | # | ||
211 | if [ -e "${S}/tools/perf/config/Makefile" ]; then | ||
212 | perfconfig="${S}/tools/perf/config/Makefile" | ||
213 | fi | ||
214 | if [ -e "${S}/tools/perf/Makefile.config" ]; then | ||
215 | perfconfig="${S}/tools/perf/Makefile.config" | ||
216 | fi | ||
217 | if [ -n "${perfconfig}" ]; then | ||
218 | # Match $(prefix)/$(lib) and $(prefix)/lib | ||
219 | sed -i -e 's,^libdir = \($(prefix)/.*lib\),libdir ?= \1,' \ | ||
220 | -e 's,^perfexecdir = \(.*\),perfexecdir ?= \1,' \ | ||
221 | -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \ | ||
222 | ${perfconfig} | ||
223 | fi | ||
224 | # The man pages installation is "$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)" | ||
225 | # in ${S}/tools/perf/Documentation/Makefile, if the mandir set to '?=', it | ||
226 | # will use the relative path 'share/man', in the way it will resulting in | ||
227 | # incorrect installation for man pages. | ||
228 | if [ -e "${S}/tools/perf/Documentation/Makefile" ]; then | ||
229 | sed -i 's,^mandir?=,mandir:=,' ${S}/tools/perf/Documentation/Makefile | ||
230 | fi | ||
231 | if [ -e "${S}/tools/perf/Makefile.perf" ]; then | ||
232 | sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \ | ||
233 | ${S}/tools/perf/Makefile.perf | ||
234 | sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='\$(DESTDIR)',g" \ | ||
235 | ${S}/tools/perf/Makefile.perf | ||
236 | # backport https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8 | ||
237 | sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC) $(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_dir),g' \ | ||
238 | ${S}/tools/perf/Makefile.perf | ||
239 | fi | ||
240 | sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \ | ||
241 | ${S}/tools/perf/Makefile* | ||
242 | |||
243 | if [ -e "${S}/tools/build/Makefile.build" ]; then | ||
244 | sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \ | ||
245 | ${S}/tools/build/Makefile.build | ||
246 | fi | ||
247 | |||
248 | # start reproducibility substitutions | ||
249 | if [ -e "${S}/tools/perf/Makefile.config" ]; then | ||
250 | # The following line in the Makefle: | ||
251 | # override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON_AUTO)) | ||
252 | # "PYTHON" / "PYTHON_AUTO" have the full path as part of the variable. We've | ||
253 | # ensure that the environment is setup and we do not need the full path to be | ||
254 | # captured, since the symbol gets built into the executable, making it not | ||
255 | # reproducible. | ||
256 | sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(PYTHON_AUTO)),$(notdir $(call get-executable-or-default\,PYTHON\,$(PYTHON_AUTO))),g' \ | ||
257 | ${S}/tools/perf/Makefile.config | ||
258 | # The same line is in older releases, but looking explicitly for Python 2 | ||
259 | sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(PYTHON2)),$(notdir $(call get-executable-or-default\,PYTHON\,$(PYTHON2))),g' \ | ||
260 | ${S}/tools/perf/Makefile.config | ||
261 | |||
262 | # likewise with this substitution. Kernels with commit 18f2967418d031a39 | ||
263 | # [perf tools: Use Python devtools for version autodetection rather than runtime] | ||
264 | # need this substitution for reproducibility. | ||
265 | sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(subst -config\,\,$(PYTHON_AUTO))),$(notdir $(call get-executable-or-default\,PYTHON\,$(subst -config\,\,$(PYTHON_AUTO)))),g' \ | ||
266 | ${S}/tools/perf/Makefile.config | ||
267 | |||
268 | # The following line: | ||
269 | # srcdir_SQ = $(patsubst %tools/perf,tools/perf,$(subst ','\'',$(srcdir))), | ||
270 | # Captures the full src path of perf, which of course makes it not | ||
271 | # reproducible. We really only need the relative location 'tools/perf', so we | ||
272 | # change the Makefile line to remove everything before 'tools/perf' | ||
273 | sed -i -e "s%srcdir_SQ = \$(subst ','\\\'',\$(srcdir))%srcdir_SQ = \$(patsubst \%tools/perf,tools/perf,\$(subst ','\\\'',\$(srcdir)))%g" \ | ||
274 | ${S}/tools/perf/Makefile.config | ||
275 | # Avoid hardcoded path to python-native | ||
276 | sed -i -e 's#\(PYTHON_WORD := \)$(call shell-wordify,$(PYTHON))#\1 python3#g' \ | ||
277 | ${S}/tools/perf/Makefile.config | ||
278 | fi | ||
279 | if [ -e "${S}/tools/perf/tests/Build" ]; then | ||
280 | # OUTPUT is the full path, we have python on the path so we remove it from the | ||
281 | # definition. This is captured in the perf binary, so breaks reproducibility | ||
282 | sed -i -e 's,PYTHONPATH="BUILD_STR($(OUTPUT)python)",PYTHONPATH="BUILD_STR(python)",g' \ | ||
283 | ${S}/tools/perf/tests/Build | ||
284 | fi | ||
285 | if [ -e "${S}/tools/perf/util/Build" ]; then | ||
286 | # To avoid bison generating #ifdefs that have captured paths, we make sure | ||
287 | # all the calls have YFLAGS, which contains prefix mapping information. | ||
288 | sed -i -e 's,$(BISON),$(BISON) $(YFLAGS),g' ${S}/tools/perf/util/Build | ||
289 | fi | ||
290 | if [ -e "${S}/scripts/Makefile.host" ]; then | ||
291 | # To avoid yacc (bison) generating #ifdefs that have captured paths, we make sure | ||
292 | # all the calls have YFLAGS, which contains prefix mapping information. | ||
293 | sed -i -e 's,$(YACC),$(YACC) $(YFLAGS),g' ${S}/scripts/Makefile.host | ||
294 | fi | ||
295 | if [ -e "${S}/tools/perf/pmu-events/Build" ]; then | ||
296 | target='$(OUTPUT)pmu-events/pmu-events.c $(V)' | ||
297 | replacement1='$(OUTPUT)pmu-events/pmu-events.c $(V)\n' | ||
298 | replacement2='\t$(srctree)/sort-pmuevents.py $(OUTPUT)pmu-events/pmu-events.c $(OUTPUT)pmu-events/pmu-events.c.new\n' | ||
299 | replacement3='\tcp $(OUTPUT)pmu-events/pmu-events.c.new $(OUTPUT)pmu-events/pmu-events.c' | ||
300 | sed -i -e "s,$target,$replacement1$replacement2$replacement3,g" \ | ||
301 | "${S}/tools/perf/pmu-events/Build" | ||
302 | fi | ||
303 | if [ -e "${S}/tools/perf/pmu-events/jevents.py" ]; then | ||
304 | sed -i -e "s#os.scandir(path)#sorted(os.scandir(path), key=lambda e: e.name)#g" \ | ||
305 | "${S}/tools/perf/pmu-events/jevents.py" | ||
306 | fi | ||
307 | if [ -e "${S}/tools/perf/arch/arm64/Makefile" ]; then | ||
308 | sed -i 's,sysdef := $(srctree)/,sysdef := ,' ${S}/tools/perf/arch/arm64/Makefile | ||
309 | sed -i 's,$(incpath) $(sysdef),$(incpath) $(srctree)/$(sysdef) $(sysdef),' ${S}/tools/perf/arch/arm64/Makefile | ||
310 | fi | ||
311 | if [ -e "${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl" ]; then | ||
312 | if ! grep -q input_rel ${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl; then | ||
313 | sed -i 's,input=$4,input=$4\ninput_rel=$5,' ${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | ||
314 | fi | ||
315 | sed -i 's,#include \\"\$input\\",#include \\"\$input_rel\\",' ${S}/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | ||
316 | fi | ||
317 | # end reproducibility substitutions | ||
318 | |||
319 | # We need to ensure the --sysroot option in CC is preserved | ||
320 | if [ -e "${S}/tools/perf/Makefile.perf" ]; then | ||
321 | sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf | ||
322 | sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf | ||
323 | sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/perf/Makefile.perf | ||
324 | sed -i 's,PKG_CONFIG = $(CROSS_COMPILE)pkg-config,#PKG_CONFIG,' ${S}/tools/perf/Makefile.perf | ||
325 | fi | ||
326 | if [ -e "${S}/tools/lib/api/Makefile" ]; then | ||
327 | sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile | ||
328 | sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile | ||
329 | sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/lib/api/Makefile | ||
330 | fi | ||
331 | if [ -e "${S}/tools/lib/subcmd/Makefile" ]; then | ||
332 | sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/subcmd/Makefile | ||
333 | sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/subcmd/Makefile | ||
334 | fi | ||
335 | if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then | ||
336 | sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile | ||
337 | fi | ||
338 | if [ -e "${S}/tools/build/Makefile.feature" ]; then | ||
339 | sed -i 's,CFLAGS=,CC="\$(CC)" CFLAGS=,' ${S}/tools/build/Makefile.feature | ||
340 | fi | ||
341 | # The libperl feature check produces fatal warnings due to -Werror being | ||
342 | # used, silence enough errors that the check passes. | ||
343 | sed -i 's/\(FLAGS_PERL_EMBED=.*\)/\1 -Wno-error=unused-function -Wno-error=attributes/' ${S}/tools/build/feature/Makefile | ||
344 | |||
345 | # 3.17-rc1+ has a include issue for arm/powerpc. Temporarily sed in the appropriate include | ||
346 | if [ -e "${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c" ]; then | ||
347 | sed -i 's,#include "util/callchain.h",#include "util/callchain.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c | ||
348 | fi | ||
349 | if [ -e "${S}/tools/perf/arch/arm/util/unwind-libunwind.c" ] && [ -e "${S}/tools/perf/arch/arm/tests/dwarf-unwind.c" ]; then | ||
350 | sed -i 's,#include "tests/tests.h",#include "tests/tests.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/tests/dwarf-unwind.c | ||
351 | sed -i 's,#include "perf_regs.h",#include "perf_regs.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/util/unwind-libunwind.c | ||
352 | fi | ||
353 | |||
354 | # use /usr/bin/env instead of version specific python | ||
355 | for s in `find ${S}/tools/perf/ -name '*.py'` `find ${S}/scripts/ -name 'bpf_helpers_doc.py'`; do | ||
356 | sed -i -e "s,#!.*python.*,#!${USRBINPATH}/env python3," ${s} | ||
357 | done | ||
358 | |||
359 | # unistd.h can be out of sync between libc-headers and the captured version in the perf source | ||
360 | # so we copy it from the sysroot unistd.h to the perf unistd.h | ||
361 | install -D -m0644 ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/tools/include/uapi/asm-generic/unistd.h | ||
362 | install -D -m0644 ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/include/uapi/asm-generic/unistd.h | ||
363 | |||
364 | # the fetcher is inhibited by the 'inherit kernelsrc', so we do a quick check and | ||
365 | # copy for a helper script we need | ||
366 | for p in $(echo ${FILESPATH} | tr ':' '\n'); do | ||
367 | if [ -e $p/sort-pmuevents.py ]; then | ||
368 | cp $p/sort-pmuevents.py ${S} | ||
369 | fi | ||
370 | done | ||
371 | } | ||
372 | |||
373 | python do_package:prepend() { | ||
374 | d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) | ||
375 | } | ||
376 | |||
377 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
378 | |||
379 | |||
380 | PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python" | ||
381 | |||
382 | RDEPENDS:${PN} += "elfutils bash" | ||
383 | RDEPENDS:${PN}-archive =+ "bash" | ||
384 | RDEPENDS:${PN}-python =+ "bash python3 python3-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python', '', d)}" | ||
385 | RDEPENDS:${PN}-perl =+ "bash perl perl-modules" | ||
386 | RDEPENDS:${PN}-tests =+ "python3 bash" | ||
387 | |||
388 | RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests \ | ||
389 | ${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl', '', d)} \ | ||
390 | ${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)} \ | ||
391 | " | ||
392 | FILES_SOLIBSDEV = "" | ||
393 | FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent* ${libdir}/libperf-jvmti.so" | ||
394 | FILES:${PN}-archive = "${libdir}/perf/perf-core/perf-archive" | ||
395 | FILES:${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests" | ||
396 | FILES:${PN}-python = " \ | ||
397 | ${PYTHON_SITEPACKAGES_DIR} \ | ||
398 | ${libexecdir}/perf-core/scripts/python \ | ||
399 | " | ||
400 | FILES:${PN}-perl = "${libexecdir}/perf-core/scripts/perl" | ||
401 | |||
402 | DEBUG_OPTIMIZATION:append = " -Wno-error=maybe-uninitialized" | ||
403 | |||
404 | PACKAGESPLITFUNCS =+ "perf_fix_sources" | ||
405 | |||
406 | perf_fix_sources () { | ||
407 | for f in util/parse-events-flex.h util/parse-events-flex.c util/pmu-flex.c \ | ||
408 | util/pmu-flex.h util/expr-flex.h util/expr-flex.c; do | ||
409 | f=${PKGD}${TARGET_DBGSRC_DIR}/$f | ||
410 | if [ -e $f ]; then | ||
411 | sed -i -e 's#${S}/##g' $f | ||
412 | fi | ||
413 | done | ||
414 | } | ||
diff --git a/meta-xilinx-core/recipes-kernel/perf/perf/sort-pmuevents.py b/meta-xilinx-core/recipes-kernel/perf/perf/sort-pmuevents.py deleted file mode 100755 index 0362f2d8..00000000 --- a/meta-xilinx-core/recipes-kernel/perf/perf/sort-pmuevents.py +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | #!/usr/bin/env python3 | ||
2 | |||
3 | # perf pmu-events sorting tool | ||
4 | # | ||
5 | # Copyright (C) 2021 Bruce Ashfield | ||
6 | # | ||
7 | # SPDX-License-Identifier: MIT | ||
8 | # | ||
9 | |||
10 | import sys | ||
11 | import os | ||
12 | import re | ||
13 | from collections import OrderedDict | ||
14 | |||
15 | if len(sys.argv) < 2: | ||
16 | print( "[ERROR]: input and output pmu files missing" ) | ||
17 | sys.exit(1) | ||
18 | |||
19 | if len(sys.argv) < 3: | ||
20 | print( "[ERROR]: output pmu file missing" ) | ||
21 | sys.exit(1) | ||
22 | |||
23 | infile = sys.argv[1] | ||
24 | outfile = sys.argv[2] | ||
25 | |||
26 | if not os.path.exists(infile): | ||
27 | print( "ERROR. input file does not exist: %s" % infile ) | ||
28 | sys.exit(1) | ||
29 | |||
30 | if os.path.exists(outfile): | ||
31 | print( "WARNING. output file will be overwritten: %s" % infile ) | ||
32 | |||
33 | with open(infile, 'r') as file: | ||
34 | data = file.read() | ||
35 | |||
36 | preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) | ||
37 | |||
38 | preamble = re.search( preamble_regex, data ) | ||
39 | struct_block_regex = re.compile( '^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) | ||
40 | field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) | ||
41 | cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) | ||
42 | name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) | ||
43 | |||
44 | # create a dictionary structure to store all the structs, their | ||
45 | # types and then their fields. | ||
46 | entry_dict = {} | ||
47 | for struct in re.findall( struct_block_regex, data ): | ||
48 | # print( "struct: %s %s %s" % (struct[0],struct[1],struct[2]) ) | ||
49 | entry_dict[struct[2]] = {} | ||
50 | entry_dict[struct[2]]['type_prefix'] = struct[0] | ||
51 | entry_dict[struct[2]]['type'] = struct[1] | ||
52 | entry_dict[struct[2]]['fields'] = {} | ||
53 | for entry in re.findall( field_regex, struct[3] ): | ||
54 | #print( " entry: %s" % entry ) | ||
55 | cpuid = re.search( cpuid_regex, entry ) | ||
56 | if cpuid: | ||
57 | #print( " cpuid found: %s" % cpuid.group(1) ) | ||
58 | entry_dict[struct[2]]['fields'][cpuid.group(1)] = entry | ||
59 | |||
60 | name = re.search( name_regex, entry ) | ||
61 | if name: | ||
62 | #print( " name found: %s" % name.group(1) ) | ||
63 | entry_dict[struct[2]]['fields'][name.group(1)] = entry | ||
64 | |||
65 | # unmatched entries are most likely array terminators and | ||
66 | # should end up as the last element in the sorted list, which | ||
67 | # is achieved by using '0' as the key | ||
68 | if not cpuid and not name: | ||
69 | entry_dict[struct[2]]['fields']['0'] = entry | ||
70 | |||
71 | # created ordered dictionaries from the captured values. These are ordered by | ||
72 | # a sorted() iteration of the keys. We don't care about the order we read | ||
73 | # things, just the sorted order. Hency why we couldn't create these during | ||
74 | # reading. | ||
75 | # | ||
76 | # yes, there's a more concise way to do this, but our nested dictionaries of | ||
77 | # fields make it complex enough that it becomes unreadable. | ||
78 | entry_dict_sorted = OrderedDict() | ||
79 | for i in sorted(entry_dict.keys()): | ||
80 | entry_dict_sorted[i] = {} | ||
81 | entry_dict_sorted[i]['type_prefix'] = entry_dict[i]['type_prefix'] | ||
82 | entry_dict_sorted[i]['type'] = entry_dict[i]['type'] | ||
83 | entry_dict_sorted[i]['fields'] = {} | ||
84 | for f in sorted(entry_dict[i]['fields'].keys()): | ||
85 | entry_dict_sorted[i]['fields'][f] = entry_dict[i]['fields'][f] | ||
86 | |||
87 | # dump the sorted elements to the outfile | ||
88 | outf = open( outfile, 'w' ) | ||
89 | |||
90 | print( preamble.group(1) ) | ||
91 | outf.write( preamble.group(1) ) | ||
92 | for d in entry_dict_sorted: | ||
93 | outf.write( "%s %s %s[] = {\n" % (entry_dict_sorted[d]['type_prefix'], entry_dict_sorted[d]['type'],d) ) | ||
94 | for f in entry_dict_sorted[d]['fields']: | ||
95 | outf.write( entry_dict_sorted[d]['fields'][f] + '\n' ) | ||
96 | |||
97 | outf.write( "};\n" ) | ||
98 | |||
99 | outf.close() | ||
100 | |||
diff --git a/meta-xilinx-core/recipes-multimedia/v4l2apps/files/0001-v4l-utils-Add-support-for-new-media-bus-codes.patch b/meta-xilinx-core/recipes-multimedia/v4l2apps/files/0001-v4l-utils-Add-support-for-new-media-bus-codes.patch deleted file mode 100644 index fac2d719..00000000 --- a/meta-xilinx-core/recipes-multimedia/v4l2apps/files/0001-v4l-utils-Add-support-for-new-media-bus-codes.patch +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | From 373923a8cddb0b1854d3040a6ba0cf016a244128 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anil Kumar M <amamidal@xilinx.com> | ||
3 | Date: Mon, 24 Feb 2020 14:45:46 +0530 | ||
4 | Subject: [PATCH] v4l-utils: Add support for new media bus codes | ||
5 | |||
6 | Add new media bus format codes for supporting xilinx | ||
7 | specific formats. | ||
8 | |||
9 | Signed-off-by: Anil Kumar M <amamidal@xilinx.com> | ||
10 | --- | ||
11 | include/linux/media-bus-format.h | 12 ++++++++++++ | ||
12 | utils/media-ctl/libv4l2subdev.c | 11 +++++++++++ | ||
13 | 2 files changed, 23 insertions(+) | ||
14 | |||
15 | diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h | ||
16 | index d6a5a3b..3fb2346 100644 | ||
17 | --- a/include/linux/media-bus-format.h | ||
18 | +++ b/include/linux/media-bus-format.h | ||
19 | @@ -108,6 +108,18 @@ | ||
20 | #define MEDIA_BUS_FMT_YUV16_1X48 0x202a | ||
21 | #define MEDIA_BUS_FMT_UYYVYY16_0_5X48 0x202b | ||
22 | |||
23 | +/* YUV: Xilinx Specific - next is 0x2109 */ | ||
24 | +#define MEDIA_BUS_FMT_VYYUYY8_1X24 0x2100 | ||
25 | +#define MEDIA_BUS_FMT_VYYUYY10_4X20 0x2101 | ||
26 | +#define MEDIA_BUS_FMT_VUY10_1X30 0x2102 | ||
27 | +#define MEDIA_BUS_FMT_UYYVYY12_4X24 0x2103 | ||
28 | +#define MEDIA_BUS_FMT_VUY12_1X36 0x2104 | ||
29 | +#define MEDIA_BUS_FMT_Y16_1X16 0x2105 | ||
30 | +#define MEDIA_BUS_FMT_UYYVYY16_4X32 0x2106 | ||
31 | +#define MEDIA_BUS_FMT_VUY16_1X48 0x2107 | ||
32 | +#define MEDIA_BUS_FMT_UYVY16_2X32 0x2108 | ||
33 | + | ||
34 | + | ||
35 | /* Bayer - next is 0x3021 */ | ||
36 | #define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001 | ||
37 | #define MEDIA_BUS_FMT_SGBRG8_1X8 0x3013 | ||
38 | diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c | ||
39 | index a989efb..a37541f 100644 | ||
40 | --- a/utils/media-ctl/libv4l2subdev.c | ||
41 | +++ b/utils/media-ctl/libv4l2subdev.c | ||
42 | @@ -34,6 +34,17 @@ | ||
43 | |||
44 | #include <linux/v4l2-subdev.h> | ||
45 | |||
46 | +/* YUV: Xilinx Specific - next is 0x2109 */ | ||
47 | +#define MEDIA_BUS_FMT_VYYUYY8_1X24 (0x2100) | ||
48 | +#define MEDIA_BUS_FMT_VYYUYY10_4X20 (0x2101) | ||
49 | +#define MEDIA_BUS_FMT_VUY10_1X30 (0x2102) | ||
50 | +#define MEDIA_BUS_FMT_UYYVYY12_4X24 (0x2103) | ||
51 | +#define MEDIA_BUS_FMT_VUY12_1X36 (0x2104) | ||
52 | +#define MEDIA_BUS_FMT_Y16_1X16 (0x2105) | ||
53 | +#define MEDIA_BUS_FMT_UYYVYY16_4X32 (0x2106) | ||
54 | +#define MEDIA_BUS_FMT_VUY16_1X48 (0x2107) | ||
55 | +#define MEDIA_BUS_FMT_UYVY16_2X32 (0x2108) | ||
56 | + | ||
57 | #include "mediactl.h" | ||
58 | #include "mediactl-priv.h" | ||
59 | #include "tools.h" | ||
60 | -- | ||
61 | 2.7.4 | ||
diff --git a/meta-xilinx-core/recipes-multimedia/v4l2apps/v4l-utils_%.bbappend b/meta-xilinx-core/recipes-multimedia/v4l2apps/v4l-utils_%.bbappend deleted file mode 100644 index 3d177bce..00000000 --- a/meta-xilinx-core/recipes-multimedia/v4l2apps/v4l-utils_%.bbappend +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | SRC_URI:append = " file://0001-v4l-utils-Add-support-for-new-media-bus-codes.patch" | ||
2 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | ||
diff --git a/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta/0001-Add-support-for-3-planar-YUV444P-8bpc.patch b/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta/0001-Add-support-for-3-planar-YUV444P-8bpc.patch deleted file mode 100644 index 42b108fe..00000000 --- a/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta/0001-Add-support-for-3-planar-YUV444P-8bpc.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From 4d8ac36340423844be76ceb506bc0e4f48772944 Mon Sep 17 00:00:00 2001 | ||
2 | From: Devarsh Thakkar <devarsh.thakkar@xilinx.com> | ||
3 | Date: Tue, 7 Sep 2021 06:08:55 -0700 | ||
4 | Subject: [PATCH 1/2] Add support for 3 planar YUV444P 8bpc | ||
5 | |||
6 | This patch adds support for single contiguous buffer 3 planar YUV444P | ||
7 | 8 bpc format. | ||
8 | |||
9 | Signed-off-by: Devarsh Thakkar <devarsh.thakkar@xilinx.com> | ||
10 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
11 | --- | ||
12 | include/linux/videodev2.h | 1 + | ||
13 | yavta.c | 1 + | ||
14 | 2 files changed, 2 insertions(+) | ||
15 | |||
16 | Index: git/include/linux/videodev2.h | ||
17 | =================================================================== | ||
18 | --- git.orig/include/linux/videodev2.h | ||
19 | +++ git/include/linux/videodev2.h | ||
20 | @@ -545,6 +545,7 @@ struct v4l2_pix_format { | ||
21 | #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ | ||
22 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ | ||
23 | #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */ | ||
24 | +#define V4L2_PIX_FMT_YUV444P v4l2_fourcc('4', '4', '4', 'P') /* 24 YUV444 planar */ | ||
25 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ | ||
26 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ | ||
27 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ | ||
28 | Index: git/yavta.c | ||
29 | =================================================================== | ||
30 | --- git.orig/yavta.c | ||
31 | +++ git/yavta.c | ||
32 | @@ -309,6 +309,7 @@ static struct v4l2_format_info { | ||
33 | { "YVYU", V4L2_PIX_FMT_YVYU, 1 }, | ||
34 | { "NV12", V4L2_PIX_FMT_NV12, 1 }, | ||
35 | { "NV12M", V4L2_PIX_FMT_NV12M, 2 }, | ||
36 | + { "YUV444P", V4L2_PIX_FMT_YUV444P, 1 }, | ||
37 | { "NV21", V4L2_PIX_FMT_NV21, 1 }, | ||
38 | { "NV21M", V4L2_PIX_FMT_NV21M, 2 }, | ||
39 | { "NV16", V4L2_PIX_FMT_NV16, 1 }, | ||
diff --git a/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta/0002-Add-support-3-planar-YUV-444-10bpc-pixel-format-in-c.patch b/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta/0002-Add-support-3-planar-YUV-444-10bpc-pixel-format-in-c.patch deleted file mode 100644 index 5dfbfa2e..00000000 --- a/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta/0002-Add-support-3-planar-YUV-444-10bpc-pixel-format-in-c.patch +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | From dedd0eb76ced425610bdd695029489f553923b2e Mon Sep 17 00:00:00 2001 | ||
2 | From: Rohit Visavalia <rohit.visavalia@xilinx.com> | ||
3 | Date: Wed, 27 Oct 2021 02:45:39 -0700 | ||
4 | Subject: [PATCH 2/2] Add support 3 planar YUV 444 10bpc pixel format in | ||
5 | contiguous memory | ||
6 | |||
7 | The new format X403 is added to support 3 planar YUV 444 10bpc | ||
8 | 30 bits per sample image data in a single contiguous buffer. | ||
9 | |||
10 | Signed-off-by: Rohit Visavalia <rohit.visavalia@xilinx.com> | ||
11 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
12 | --- | ||
13 | include/linux/videodev2.h | 2 ++ | ||
14 | yavta.c | 1 + | ||
15 | 2 files changed, 3 insertions(+) | ||
16 | |||
17 | Index: git/include/linux/videodev2.h | ||
18 | =================================================================== | ||
19 | --- git.orig/include/linux/videodev2.h | ||
20 | +++ git/include/linux/videodev2.h | ||
21 | @@ -585,6 +585,8 @@ struct v4l2_pix_format { | ||
22 | #define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4') /* 24 YUV444 planar */ | ||
23 | #define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2') /* 24 YVU444 planar */ | ||
24 | |||
25 | +#define V4L2_PIX_FMT_X403 v4l2_fourcc('X', '4', '0', '3') /* 32 YUV planar 4:4:4 10-bit */ | ||
26 | + | ||
27 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ | ||
28 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | ||
29 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | ||
30 | Index: git/yavta.c | ||
31 | =================================================================== | ||
32 | --- git.orig/yavta.c | ||
33 | +++ git/yavta.c | ||
34 | @@ -324,6 +324,7 @@ static struct v4l2_format_info { | ||
35 | { "YVU420M", V4L2_PIX_FMT_YVU420M, 3 }, | ||
36 | { "YVU422M", V4L2_PIX_FMT_YVU422M, 3 }, | ||
37 | { "YVU444M", V4L2_PIX_FMT_YVU444M, 3 }, | ||
38 | + { "X403", V4L2_PIX_FMT_X403, 1 }, | ||
39 | { "SBGGR8", V4L2_PIX_FMT_SBGGR8, 1 }, | ||
40 | { "SGBRG8", V4L2_PIX_FMT_SGBRG8, 1 }, | ||
41 | { "SGRBG8", V4L2_PIX_FMT_SGRBG8, 1 }, | ||
diff --git a/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta_%.bbappend b/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta_%.bbappend deleted file mode 100644 index 52eab13d..00000000 --- a/meta-xilinx-core/recipes-multimedia/v4l2apps/yavta_%.bbappend +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
2 | SRC_URI:append = " \ | ||
3 | file://0001-Add-support-for-3-planar-YUV444P-8bpc.patch \ | ||
4 | file://0002-Add-support-3-planar-YUV-444-10bpc-pixel-format-in-c.patch \ | ||
5 | " | ||
diff --git a/meta-xilinx-core/recipes-utils/mb-realoc/files/mb-realoc b/meta-xilinx-core/recipes-utils/mb-realoc/files/mb-realoc new file mode 100755 index 00000000..158560f1 --- /dev/null +++ b/meta-xilinx-core/recipes-utils/mb-realoc/files/mb-realoc | |||
@@ -0,0 +1,239 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # FILE: | ||
4 | # mb-realoc | ||
5 | # | ||
6 | # DESCRIPTION: | ||
7 | # Takes a fully linked and relocated ELF file, and turns it into an | ||
8 | # executable blob that can be run from any valid memory. The ELF image | ||
9 | # (loadable segments only) is converted to a payload. The blob copies | ||
10 | # the payload to the correct address in memory, and then launches it. | ||
11 | # | ||
12 | # MODIFICATION: | ||
13 | # | ||
14 | # LICENSING: | ||
15 | # Copyright (c) 2013 Xilinx Inc. All rights reserved. | ||
16 | # | ||
17 | |||
18 | |||
19 | # Default values for main variables | ||
20 | BLOB_LOAD_ADDR=0x0 | ||
21 | INFILE="" | ||
22 | BLOBNAME="" | ||
23 | JUMP_OFFSET= | ||
24 | |||
25 | # OTher useful vars | ||
26 | TMP_BINFILE=$$.bin | ||
27 | PAYLOAD_SECTION=.payload | ||
28 | BLOBSTUB=/tmp/blobstub-$$ | ||
29 | |||
30 | function usage { | ||
31 | |||
32 | echo "Generate a PIC executable blob that copies the payload to its linked address and executes it." | ||
33 | # echo "Generate a PIC executable blob that copies the payload to its" | ||
34 | # echo "linked address and executes it. The blob itself may be loaded" | ||
35 | # echo "to any physical address and executed, provided that" | ||
36 | # echo " 1) The payload's linked address is writeable" | ||
37 | # echo " 2) The blob's and payload's addresses don't overlap" | ||
38 | # echo "tGenerates blobname.[srec|elf|bin] files into the working directory" | ||
39 | echo "" | ||
40 | echo "Usage:" | ||
41 | echo " mb-realoc [OPTIONS] -i PAYLOAD.elf -o BLOB_NAME" | ||
42 | echo "" | ||
43 | echo "Required:" | ||
44 | echo " -i, --input PAYLOAD[.elf] the fully relocated ELF file that will be the" | ||
45 | echo " payload." | ||
46 | echo " -o, --output BLOB_NAME basename of the resulting blob files." | ||
47 | echo "" | ||
48 | echo "Optional:" | ||
49 | echo " -h, --help show function usage" | ||
50 | echo " -j, --jump-offset OFFS Offset from load address to jump (auto-detect)" | ||
51 | echo " -l, --load LOAD_ADDR address at which FS-boot will load the stub+payload" | ||
52 | echo "" | ||
53 | } | ||
54 | |||
55 | function parse_args { | ||
56 | |||
57 | args=$(getopt -o "j:hi:l:o:" --long "jump-offset:,help,input:,load:,output" -- "$@") | ||
58 | |||
59 | [ $? -ne 0 ] && usage && exit -1 | ||
60 | |||
61 | eval set -- "${args}" | ||
62 | |||
63 | while true; do | ||
64 | case $1 in | ||
65 | -h | --help) usage; exit 0; ;; | ||
66 | -l | --load) BLOB_LOAD_ADDR=$2; | ||
67 | shift; shift; | ||
68 | ;; | ||
69 | -i | --input) INFILE=$2; | ||
70 | shift; shift; | ||
71 | ;; | ||
72 | -j | --jump-offset) JUMP_OFFSET=$2; | ||
73 | shift; shift; | ||
74 | ;; | ||
75 | -o | --output) BLOBNAME=$2; | ||
76 | shift; shift; | ||
77 | ;; | ||
78 | --) shift; break; ;; | ||
79 | *) usage; exit -1; | ||
80 | ;; | ||
81 | esac | ||
82 | done | ||
83 | |||
84 | [ ! -z "$@" ] && echo "ERROR: Extra parameters: $@" && usage && exit -1 | ||
85 | |||
86 | if [ "${INFILE}" == "" -o "${BLOBNAME}" == "" ]; then | ||
87 | echo "Error: Required parameters not provided" | ||
88 | usage && exit -1 | ||
89 | fi | ||
90 | } | ||
91 | |||
92 | function get_elf_addr_and_size { | ||
93 | |||
94 | # Get load address of payload ELF file | ||
95 | ELF_LMA=0x$(${CROSS_COMPILE}objdump --headers $INFILE | grep -w "\.data" | awk '{print $5}') | ||
96 | |||
97 | # Generate binary image of payload | ||
98 | ${CROSS_COMPILE}objcopy -R .note -R .comment -R .note.gnu.build-id -O binary $INFILE $TMP_BINFILE | ||
99 | |||
100 | # Work out its size | ||
101 | ELF_SIZE=$(${CROSS_COMPILE}size --target binary ${TMP_BINFILE} | grep "${TMP_BINFILE}" | cut -f 4) | ||
102 | |||
103 | } | ||
104 | |||
105 | function get_elf_jump_offset { | ||
106 | entry_point=$(${CROSS_COMPILE}readelf -h ${INFILE} | awk '/Entry point/ {print $4}') | ||
107 | JUMP_OFFSET=$(printf "0x%08x" $((${entry_point} - ${ELF_LMA}))) | ||
108 | } | ||
109 | |||
110 | function create_blobstub:microblaze { | ||
111 | |||
112 | cat > ${BLOBSTUB}.s.in << __eof | ||
113 | /* | ||
114 | // blobstub.s.in | ||
115 | // template for relocatable code blob mechanism | ||
116 | // | ||
117 | // LICENSING: | ||
118 | // Copyright (c) 2013 Xilinx Inc. All rights reserved. | ||
119 | */ | ||
120 | .section .text | ||
121 | |||
122 | .org 0x0 | ||
123 | |||
124 | .globl bootstub | ||
125 | .global _start | ||
126 | .func bootstub | ||
127 | |||
128 | _start: | ||
129 | bootstub: | ||
130 | brlid r5, locator; /* r5 gets address of bootstub */ | ||
131 | nop; | ||
132 | locator: | ||
133 | addi r5, r5, 0x100; /* Shift up to start of payload */ | ||
134 | lwi r6, r5, 0; /* Destination of payload */ | ||
135 | lwi r7, r5, 4; /* Length of payload */ | ||
136 | lwi r9, r5, 8; /* boot offset */ | ||
137 | addi r5, r5, 0xc; /* Start of payload */ | ||
138 | add r4, r6, r0; /* Save payload destination (for jump) */ | ||
139 | |||
140 | addi r7, r7, 0x3; /* Convert length to words */ | ||
141 | srl r7, r7; /* Rounded up */ | ||
142 | srl r7, r7; | ||
143 | |||
144 | or r10, r0, r0; /* Setup r10 for incrementing address offset */ | ||
145 | copyloop: | ||
146 | beqi r7, copy_done; /* Finished copying? */ | ||
147 | lw r8, r5, r10; /* Read word from payload */ | ||
148 | sw r8, r6, r10; /* Write to destination */ | ||
149 | addi r10, r10, 4; /* Increment ptr offset */ | ||
150 | brid copyloop; /* Loop with delay slot */ | ||
151 | addi r7, r7, -1; /* Decrement copy count */ | ||
152 | |||
153 | copy_done: | ||
154 | add r4, r4, r9; /* Apply any boot offset */ | ||
155 | bra r4; /* Launch payload */ | ||
156 | |||
157 | .align 2 | ||
158 | .org 0x100 | ||
159 | payload: | ||
160 | .int @destination@ | ||
161 | .int @bytecount@ | ||
162 | .int @jump_offset@ | ||
163 | |||
164 | .end bootstub | ||
165 | |||
166 | __eof | ||
167 | |||
168 | } | ||
169 | |||
170 | function build_blobstub { | ||
171 | # Substitute address and size of payload into blobstub | ||
172 | # source file | ||
173 | sed -e "s/@destination@/${ELF_LMA}/" \ | ||
174 | -e "s/@bytecount@/${ELF_SIZE}/" \ | ||
175 | -e "s/@jump_offset@/${JUMP_OFFSET}/" ${BLOBSTUB}.s.in > ${BLOBSTUB}.s | ||
176 | |||
177 | # Build the blobstub | ||
178 | ${CROSS_COMPILE}as -o ${BLOBSTUB}.o ${BLOBSTUB}.s | ||
179 | |||
180 | # Remove blobstub assembly file and template | ||
181 | rm ${BLOBSTUB}.s.in | ||
182 | rm ${BLOBSTUB}.s | ||
183 | } | ||
184 | |||
185 | function insert_payload { | ||
186 | |||
187 | # Add the payload in a new section | ||
188 | ${CROSS_COMPILE}objcopy --add-section=${PAYLOAD_SECTION}=${TMP_BINFILE}\ | ||
189 | --adjust-section-vma=${PAYLOAD_SECTION}=0x10C \ | ||
190 | --set-section-flags=${PAYLOAD_SECTION}=alloc,load,data \ | ||
191 | ${BLOBSTUB}.o ${BLOBNAME}.elf | ||
192 | |||
193 | # Remove temporary binary image and blobstub object file | ||
194 | rm ${TMP_BINFILE} | ||
195 | rm ${BLOBSTUB}.o | ||
196 | } | ||
197 | |||
198 | function relocate_blob { | ||
199 | # Relocate the entire package to the desired FS-boot load address | ||
200 | ${CROSS_COMPILE}objcopy --change-addresses=${BLOB_LOAD_ADDR} ${BLOBNAME}.elf | ||
201 | } | ||
202 | |||
203 | function generate_output_files { | ||
204 | ${CROSS_COMPILE}objcopy -O srec ${BLOBNAME}.elf ${BLOBNAME}.srec | ||
205 | ${CROSS_COMPILE}objcopy -O binary ${BLOBNAME}.elf ${BLOBNAME}.bin | ||
206 | } | ||
207 | |||
208 | function xlnx_readelf { | ||
209 | ${CROSS_COMPILE}readelf $@ | ||
210 | } | ||
211 | |||
212 | parse_args "$@" | ||
213 | |||
214 | if [ ! -f $INFILE ]; then | ||
215 | echo "Error: ${INFILE} does not exist" | ||
216 | exit -1; | ||
217 | fi | ||
218 | |||
219 | get_elf_addr_and_size | ||
220 | [ -z "${JUMP_OFFSET}" ] && get_elf_jump_offset | ||
221 | |||
222 | echo "INFO: Payload load address:$ELF_LMA" | ||
223 | echo "INFO: Payload size:$ELF_SIZE" | ||
224 | echo "INFO: Jump offset:$JUMP_OFFSET" | ||
225 | |||
226 | PETALINUX_ARCH=$(xlnx_readelf -e ${INFILE} | grep "Machine:" | awk '{print $2}') | ||
227 | echo "ELF ARCH is ${PETALINUX_ARCH}" | ||
228 | |||
229 | if [ "${PETALINUX_ARCH}" == "Xilinx" ]; then | ||
230 | create_blobstub:microblaze | ||
231 | build_blobstub | ||
232 | insert_payload | ||
233 | relocate_blob | ||
234 | else | ||
235 | echo "Architecture is not Microblaze" | ||
236 | rm ${TMP_BINFILE} | ||
237 | ${CROSS_COMPILE}objcopy $INFILE ${BLOBNAME}.elf | ||
238 | fi | ||
239 | generate_output_files | ||
diff --git a/meta-xilinx-core/recipes-utils/mb-realoc/mb-realoc.bb b/meta-xilinx-core/recipes-utils/mb-realoc/mb-realoc.bb new file mode 100644 index 00000000..f3b53c25 --- /dev/null +++ b/meta-xilinx-core/recipes-utils/mb-realoc/mb-realoc.bb | |||
@@ -0,0 +1,36 @@ | |||
1 | DESCRIPTION = "mb-realoc" | ||
2 | |||
3 | LICENSE = "CLOSED" | ||
4 | |||
5 | PROVIDES = "virtual/elfrealloc" | ||
6 | |||
7 | inherit deploy | ||
8 | |||
9 | SRC_URI:append = " file://mb-realoc" | ||
10 | |||
11 | PV = "0.1" | ||
12 | |||
13 | ELF_LOAD_ADDR ?= "0" | ||
14 | ELF_JUMP_OFFSET ?= "" | ||
15 | ELF_INFILE ?= "${DEPLOY_DIR_IMAGE}/u-boot.elf" | ||
16 | OUTFILE_NAME ?= "u-boot-s" | ||
17 | B = "${WORKDIR}" | ||
18 | |||
19 | PARALLEL_MAKE="" | ||
20 | |||
21 | do_configure[noexec]="1" | ||
22 | do_compile[depends] = "virtual/bootloader:do_deploy" | ||
23 | |||
24 | do_compile() { | ||
25 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
26 | ${WORKDIR}/mb-realoc -l ${ELF_LOAD_ADDR} -i ${ELF_INFILE} -o ${OUTFILE_NAME} | ||
27 | } | ||
28 | |||
29 | do_install[noexec] = "1" | ||
30 | |||
31 | do_deploy() { | ||
32 | install -d ${DEPLOYDIR} | ||
33 | install -m 0644 ${WORKDIR}/${OUTFILE_NAME}.bin ${DEPLOYDIR}/${OUTFILE_NAME}.bin | ||
34 | } | ||
35 | |||
36 | addtask deploy after do_compile | ||
diff --git a/meta-xilinx-core/recipes-xrt/xrt/xclbinutil-native_202420.2.18.0.bb b/meta-xilinx-core/recipes-xrt/xrt/xclbinutil-native_202420.2.18.0.bb new file mode 100644 index 00000000..6e280009 --- /dev/null +++ b/meta-xilinx-core/recipes-xrt/xrt/xclbinutil-native_202420.2.18.0.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | SUMMARY = "Xilinx Runtime(XRT) - minimal native build for xclbinutil" | ||
2 | DESCRIPTION = "Native build of xclbinutil using XRT codebase" | ||
3 | |||
4 | require xrt-${PV}.inc | ||
5 | |||
6 | FILESEXTRAPATHS:append := ":${THISDIR}/xrt" | ||
7 | |||
8 | LICENSE = "GPL-2.0-or-later & Apache-2.0 & MIT" | ||
9 | LIC_FILES_CHKSUM = " \ | ||
10 | file://../LICENSE;md5=de2c993ac479f02575bcbfb14ef9b485 \ | ||
11 | file://runtime_src/core/edge/drm/zocl/LICENSE;md5=7d040f51aae6ac6208de74e88a3795f8 \ | ||
12 | file://runtime_src/core/pcie/driver/linux/xocl/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
13 | file://runtime_src/core/pcie/linux/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
14 | file://runtime_src/core/tools/xbutil2/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
15 | file://runtime_src/core/common/elf/LICENSE.txt;md5=b996e8b74af169e7e72e22d9e7d05b06 \ | ||
16 | " | ||
17 | |||
18 | S = "${WORKDIR}/git/src" | ||
19 | |||
20 | inherit cmake pkgconfig native | ||
21 | |||
22 | DEPENDS = "libdrm-native opencl-headers-native ocl-icd-native boost-native rapidjson-native protobuf-native python3-pybind11-native systemtap-native" | ||
23 | |||
24 | EXTRA_OECMAKE += " -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMANDS=ON" | ||
25 | |||
26 | do_install() { | ||
27 | install -d ${D}${bindir} | ||
28 | install -Dm 0755 ${WORKDIR}/build/runtime_src/tools/xclbinutil/xclbinutil ${D}${bindir} | ||
29 | } | ||
diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt-202420.2.18.0.inc b/meta-xilinx-core/recipes-xrt/xrt/xrt-202420.2.18.0.inc new file mode 100644 index 00000000..27522dd8 --- /dev/null +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt-202420.2.18.0.inc | |||
@@ -0,0 +1,6 @@ | |||
1 | REPO ?= "gitsm://github.com/Xilinx/XRT.git;protocol=https" | ||
2 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | ||
3 | SRC_URI = "${REPO};${BRANCHARG};name=xrt" | ||
4 | |||
5 | BRANCH = "2024.2" | ||
6 | SRCREV_xrt = "d05b18dc38cc6804ecb4b3dbe6de23f158319567" | ||
diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt_202310.2.15.0.bb b/meta-xilinx-core/recipes-xrt/xrt/xrt_202310.2.15.0.bb index cad8ccee..0ee4d137 100644 --- a/meta-xilinx-core/recipes-xrt/xrt/xrt_202310.2.15.0.bb +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt_202310.2.15.0.bb | |||
@@ -15,6 +15,7 @@ LIC_FILES_CHKSUM = "file://../LICENSE;md5=da5408f748bce8a9851dac18e66f4bcf \ | |||
15 | COMPATIBLE_MACHINE ?= "^$" | 15 | COMPATIBLE_MACHINE ?= "^$" |
16 | COMPATIBLE_MACHINE:zynqmp = ".*" | 16 | COMPATIBLE_MACHINE:zynqmp = ".*" |
17 | COMPATIBLE_MACHINE:versal = ".*" | 17 | COMPATIBLE_MACHINE:versal = ".*" |
18 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
18 | 19 | ||
19 | S = "${WORKDIR}/git/src" | 20 | S = "${WORKDIR}/git/src" |
20 | 21 | ||
diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt_202320.2.16.0.bb b/meta-xilinx-core/recipes-xrt/xrt/xrt_202320.2.16.0.bb index 5824ae9c..946b6551 100644 --- a/meta-xilinx-core/recipes-xrt/xrt/xrt_202320.2.16.0.bb +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt_202320.2.16.0.bb | |||
@@ -16,6 +16,7 @@ LIC_FILES_CHKSUM = "file://../LICENSE;md5=de2c993ac479f02575bcbfb14ef9b485 \ | |||
16 | COMPATIBLE_MACHINE ?= "^$" | 16 | COMPATIBLE_MACHINE ?= "^$" |
17 | COMPATIBLE_MACHINE:zynqmp = ".*" | 17 | COMPATIBLE_MACHINE:zynqmp = ".*" |
18 | COMPATIBLE_MACHINE:versal = ".*" | 18 | COMPATIBLE_MACHINE:versal = ".*" |
19 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
19 | 20 | ||
20 | S = "${WORKDIR}/git/src" | 21 | S = "${WORKDIR}/git/src" |
21 | 22 | ||
diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt_202410.2.17.319.bb b/meta-xilinx-core/recipes-xrt/xrt/xrt_202410.2.17.319.bb index 7f211e6f..ff058db3 100644 --- a/meta-xilinx-core/recipes-xrt/xrt/xrt_202410.2.17.319.bb +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt_202410.2.17.319.bb | |||
@@ -16,6 +16,7 @@ LIC_FILES_CHKSUM = "file://../LICENSE;md5=de2c993ac479f02575bcbfb14ef9b485 \ | |||
16 | COMPATIBLE_MACHINE ?= "^$" | 16 | COMPATIBLE_MACHINE ?= "^$" |
17 | COMPATIBLE_MACHINE:zynqmp = ".*" | 17 | COMPATIBLE_MACHINE:zynqmp = ".*" |
18 | COMPATIBLE_MACHINE:versal = ".*" | 18 | COMPATIBLE_MACHINE:versal = ".*" |
19 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
19 | 20 | ||
20 | S = "${WORKDIR}/git/src" | 21 | S = "${WORKDIR}/git/src" |
21 | 22 | ||
diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt_202420.2.18.0.bb b/meta-xilinx-core/recipes-xrt/xrt/xrt_202420.2.18.0.bb new file mode 100644 index 00000000..d538f947 --- /dev/null +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt_202420.2.18.0.bb | |||
@@ -0,0 +1,60 @@ | |||
1 | SUMMARY = "Xilinx Runtime(XRT) libraries" | ||
2 | DESCRIPTION = "Xilinx Runtime User Space Libraries and headers" | ||
3 | |||
4 | require xrt-${PV}.inc | ||
5 | |||
6 | LICENSE = "GPL-2.0-or-later & Apache-2.0 & MIT" | ||
7 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=de2c993ac479f02575bcbfb14ef9b485 \ | ||
8 | file://runtime_src/core/edge/drm/zocl/LICENSE;md5=7d040f51aae6ac6208de74e88a3795f8 \ | ||
9 | file://runtime_src/core/pcie/driver/linux/xocl/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
10 | file://runtime_src/core/pcie/linux/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
11 | file://runtime_src/core/tools/xbutil2/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
12 | file://runtime_src/core/common/elf/LICENSE.txt;md5=b996e8b74af169e7e72e22d9e7d05b06 " | ||
13 | |||
14 | COMPATIBLE_HOST = "^$" | ||
15 | COMPATIBLE_HOST:aarch64 = ".*" | ||
16 | |||
17 | S = "${WORKDIR}/git/src" | ||
18 | |||
19 | inherit cmake pkgconfig | ||
20 | |||
21 | BBCLASSEXTEND = "native nativesdk" | ||
22 | |||
23 | PACKAGECONFIG ??= "aie" | ||
24 | PACKAGECONFIG[aie] = ",,libxaiengine aiefal,libxaiengine aiefal" | ||
25 | |||
26 | # util-linux is for libuuid-dev. | ||
27 | DEPENDS = "libdrm opencl-headers ocl-icd opencl-clhpp boost util-linux git-replacement-native protobuf-native protobuf elfutils libffi rapidjson systemtap libdfx" | ||
28 | RDEPENDS:${PN} = "bash ocl-icd boost-system boost-filesystem zocl (= ${PV})" | ||
29 | |||
30 | EXTRA_OECMAKE += " \ | ||
31 | -DCMAKE_BUILD_TYPE=Release \ | ||
32 | -DCMAKE_EXPORT_COMPILE_COMANDS=ON \ | ||
33 | -DXRT_LIBDFX=true \ | ||
34 | " | ||
35 | |||
36 | EXTRA_OECMAKE .= "${@bb.utils.contains('PACKAGECONFIG', 'aie', ' -DXRT_AIE_BUILD=true', '', d)}" | ||
37 | TARGET_CXXFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'aie', ' -DXRT_ENABLE_AIE -DFAL_LINUX=on', '', d)}" | ||
38 | |||
39 | # Systems with AIE also require libmetal, this is implemented in the dynamic-layers | ||
40 | # See: meta-xilinx-core/dynamic-layers/openamp-layer/recipes-xrt/xrt_gt.bbappend | ||
41 | # Note: If meta-openamp is not available, AIE will not be enabled. | ||
42 | |||
43 | FILES_SOLIBSDEV = "" | ||
44 | FILES:${PN} += "\ | ||
45 | ${libdir}/lib*.so \ | ||
46 | ${libdir}/lib*.so.* \ | ||
47 | ${libdir}/ps_kernels_lib \ | ||
48 | /lib/*.so* \ | ||
49 | ${datadir}" | ||
50 | INSANE_SKIP:${PN} += "dev-so" | ||
51 | |||
52 | pkg_postinst_ontarget:${PN}() { | ||
53 | #!/bin/sh | ||
54 | if [ ! -e /etc/OpenCL/vendors/xilinx.icd ]; then | ||
55 | echo "INFO: Creating ICD entry for Xilinx Platform" | ||
56 | mkdir -p /etc/OpenCL/vendors | ||
57 | echo "libxilinxopencl.so" > /etc/OpenCL/vendors/xilinx.icd | ||
58 | chmod -R 755 /etc/OpenCL | ||
59 | fi | ||
60 | } | ||
diff --git a/meta-xilinx-core/recipes-xrt/zocl/zocl_202420.2.18.0.bb b/meta-xilinx-core/recipes-xrt/zocl/zocl_202420.2.18.0.bb new file mode 100644 index 00000000..e5efd89c --- /dev/null +++ b/meta-xilinx-core/recipes-xrt/zocl/zocl_202420.2.18.0.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "Xilinx Runtime(XRT) driver module" | ||
2 | DESCRIPTION = "Xilinx Runtime driver module provides memory management and compute unit schedule" | ||
3 | |||
4 | COMPATIBLE_MACHINE:microblaze = "none" | ||
5 | |||
6 | PROVIDES += "zocl" | ||
7 | |||
8 | require recipes-xrt/xrt/xrt-${PV}.inc | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://LICENSE;md5=7d040f51aae6ac6208de74e88a3795f8" | ||
11 | LICENSE = "GPL-2.0-or-later & Apache-2.0" | ||
12 | |||
13 | COMPATIBLE_MACHINE ?= "^$" | ||
14 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
15 | COMPATIBLE_MACHINE:versal = ".*" | ||
16 | COMPATIBLE_MACHINE:versal-net = ".*" | ||
17 | |||
18 | S = "${WORKDIR}/git/src/runtime_src/core/edge/drm/zocl" | ||
19 | |||
20 | inherit module | ||
21 | |||
22 | pkg_postinst_ontarget:${PN}() { | ||
23 | #!/bin/sh | ||
24 | echo "Unloading old XRT Linux kernel modules" | ||
25 | ( rmmod zocl || true ) > /dev/null 2>&1 | ||
26 | echo "Loading new XRT Linux kernel modules" | ||
27 | modprobe zocl | ||
28 | } | ||