summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-devtools
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2021-12-15 13:52:16 -0800
committerMark Hatle <mark.hatle@xilinx.com>2021-12-22 08:19:01 -0800
commit322e23dc213d51a12345ca705b3776f189dc413f (patch)
treee257ca97fa6d3eef83c845b67d711b2d8ecba5ba /meta-xilinx-core/recipes-devtools
parentdd95dde009dc7968f6e6e4c0609e7b443c55c627 (diff)
downloadmeta-xilinx-322e23dc213d51a12345ca705b3776f189dc413f.tar.gz
Initial restructure/split of meta-xilinx-bsp
Create a new meta-xilinx-core, move core functionality to the core, keeping board specific files in the bsp layer. zynqmp-generic changed from require <board> to include, so if meta-xilinx-bsp is not available it will not fail. Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-core/recipes-devtools')
-rw-r--r--meta-xilinx-core/recipes-devtools/python/python3-anytree_2.8.0.bb22
-rw-r--r--meta-xilinx-core/recipes-devtools/python/python3-flask-restful_%.bbappend1
-rw-r--r--meta-xilinx-core/recipes-devtools/python/python3-flask_%.bbappend1
-rw-r--r--meta-xilinx-core/recipes-devtools/python/python3-itsdangerous_%.bbappend1
-rw-r--r--meta-xilinx-core/recipes-devtools/python/python3-pandas_%.bbappend1
-rw-r--r--meta-xilinx-core/recipes-devtools/python/python3-werkzeug_%.bbappend1
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch29
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/cross.patch40
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/flash_stripe.c176
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch68
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/flashstrip_1.0.bb27
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc39
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-Makefile-Use-python3-instead-of-python.patch37
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb5
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb34
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb20
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc11
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.1.bb7
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb18
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc48
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.1.bb17
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend2
-rw-r--r--meta-xilinx-core/recipes-devtools/run-postinsts/run-postinsts_%.bbappend7
23 files changed, 612 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-anytree_2.8.0.bb b/meta-xilinx-core/recipes-devtools/python/python3-anytree_2.8.0.bb
new file mode 100644
index 00000000..f5070be7
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/python/python3-anytree_2.8.0.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Powerful and Lightweight Python Tree Data Structure"
2
3HOMEPAGE = "https://github.com/c0fec0de/anytree"
4LICENSE = "Apache-2.0"
5
6LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
7
8DEPENDS += "python3-six"
9
10SRC_URI = "git://github.com/c0fec0de/anytree.git;protocol=https"
11SRCREV = "75c0198636f8997967ba00df5077cd21350f68ce"
12
13S = "${WORKDIR}/git"
14
15inherit setuptools3
16
17do_install:append() {
18 rm -f ${D}/${datadir}/LICENSE
19 rmdir ${D}/${datadir} || :
20}
21
22BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-flask-restful_%.bbappend b/meta-xilinx-core/recipes-devtools/python/python3-flask-restful_%.bbappend
new file mode 100644
index 00000000..608377e3
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/python/python3-flask-restful_%.bbappend
@@ -0,0 +1 @@
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-flask_%.bbappend b/meta-xilinx-core/recipes-devtools/python/python3-flask_%.bbappend
new file mode 100644
index 00000000..608377e3
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/python/python3-flask_%.bbappend
@@ -0,0 +1 @@
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-itsdangerous_%.bbappend b/meta-xilinx-core/recipes-devtools/python/python3-itsdangerous_%.bbappend
new file mode 100644
index 00000000..608377e3
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/python/python3-itsdangerous_%.bbappend
@@ -0,0 +1 @@
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-pandas_%.bbappend b/meta-xilinx-core/recipes-devtools/python/python3-pandas_%.bbappend
new file mode 100644
index 00000000..608377e3
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/python/python3-pandas_%.bbappend
@@ -0,0 +1 @@
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/python/python3-werkzeug_%.bbappend b/meta-xilinx-core/recipes-devtools/python/python3-werkzeug_%.bbappend
new file mode 100644
index 00000000..608377e3
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/python/python3-werkzeug_%.bbappend
@@ -0,0 +1 @@
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta-xilinx-core/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch
new file mode 100644
index 00000000..4298964d
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch
@@ -0,0 +1,29 @@
1From b51e6dd833172954c718bd600d846540eeb07220 Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Wed, 28 Aug 2019 19:56:28 +0800
4Subject: [PATCH] configure: Add pkg-config handling for libgcrypt
5
6libgcrypt may also be controlled by pkg-config, this patch adds pkg-config
7handling for libgcrypt.
8
9Upstream-Status: Denied [https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg06333.html]
10
11Signed-off-by: He Zhe <zhe.he@windriver.com>
12
13---
14 meson.build | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/meson.build b/meson.build
18index b3e7ec0e9..4cbe715b7 100644
19--- a/meson.build
20+++ b/meson.build
21@@ -874,7 +874,7 @@ endif
22 if not gnutls_crypto.found()
23 if (not get_option('gcrypt').auto() or have_system) and not get_option('nettle').enabled()
24 gcrypt = dependency('libgcrypt', version: '>=1.8',
25- method: 'config-tool',
26+ method: 'pkg-config',
27 required: get_option('gcrypt'),
28 kwargs: static_kwargs)
29 # Debian has removed -lgpg-error from libgcrypt-config
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/cross.patch b/meta-xilinx-core/recipes-devtools/qemu/files/cross.patch
new file mode 100644
index 00000000..bdb77ec7
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/cross.patch
@@ -0,0 +1,40 @@
1From f51ece86f84c877f255746cba22a6745f37d2b7f Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Tue, 5 Jan 2021 23:00:14 +0000
4Subject: [PATCH] qemu: Upgrade 5.1.0->5.2.0
5
6We need to be able to trigger configure's cross code but we don't want
7to set cross_prefix as it does other things we don't want. Patch things
8so we can do what we need in the target config case.
9
10Upstream-Status: Inappropriate [may be rewritten in a way upstream may accept?]
11Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
12---
13 configure | 4 ----
14 1 file changed, 4 deletions(-)
15
16diff --git a/configure b/configure
17index 9a79a004d..563b7827f 100755
18--- a/configure
19+++ b/configure
20@@ -5128,7 +5128,6 @@ if test "$skip_meson" = no; then
21 fi
22 echo "strip = [$(meson_quote $strip)]" >> $cross
23 echo "windres = [$(meson_quote $windres)]" >> $cross
24- if test "$cross_compile" = "yes"; then
25 cross_arg="--cross-file config-meson.cross"
26 echo "[host_machine]" >> $cross
27 if test "$mingw32" = "yes" ; then
28@@ -5160,9 +5159,6 @@ if test "$skip_meson" = no; then
29 else
30 echo "endian = 'little'" >> $cross
31 fi
32- else
33- cross_arg="--native-file config-meson.cross"
34- fi
35 mv $cross config-meson.cross
36
37 rm -rf meson-private meson-info meson-logs
38--
392.17.1
40
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/flash_stripe.c b/meta-xilinx-core/recipes-devtools/qemu/files/flash_stripe.c
new file mode 100644
index 00000000..a9a6e76a
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/flash_stripe.c
@@ -0,0 +1,176 @@
1/*
2 * Stripe a flash image across multiple files.
3 *
4 * Copyright (C) 2019 Xilinx, Inc. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#include <stdio.h>
26#include <stdlib.h>
27#include <stdint.h>
28#include <stdbool.h>
29#include <unistd.h>
30#include <sys/types.h>
31#include <sys/stat.h>
32#include <fcntl.h>
33#include <string.h>
34
35/* N way (num) in place bit striper. Lay out row wise bits column wise
36 * (from element 0 to N-1). num is the length of x, and dir reverses the
37 * direction of the transform. be determines the bit endianess scheme.
38 * false to lay out bits LSB to MSB (little endian) and true for big endian.
39 *
40 * Best illustrated by examples:
41 * Each digit in the below array is a single bit (num == 3, be == false):
42 *
43 * {{ 76543210, } ----- stripe (dir == false) -----> {{ FCheb630, }
44 * { hgfedcba, } { GDAfc741, }
45 * { HGFEDCBA, }} <---- upstripe (dir == true) ----- { HEBgda52, }}
46 *
47 * Same but with be == true:
48 *
49 * {{ 76543210, } ----- stripe (dir == false) -----> {{ 741gdaFC, }
50 * { hgfedcba, } { 630fcHEB, }
51 * { HGFEDCBA, }} <---- upstripe (dir == true) ----- { 52hebGDA, }}
52 */
53
54static inline void stripe8(uint8_t *x, int num, bool dir, bool be)
55{
56 uint8_t r[num];
57 memset(r, 0, sizeof(uint8_t) * num);
58 int idx[2] = {0, 0};
59 int bit[2] = {0, be ? 7 : 0};
60 int d = dir;
61
62 for (idx[0] = 0; idx[0] < num; ++idx[0]) {
63 for (bit[0] = be ? 7 : 0; bit[0] != (be ? -1 : 8); bit[0] += be ? -1 : 1) {
64 r[idx[!d]] |= x[idx[d]] & 1 << bit[d] ? 1 << bit[!d] : 0;
65 idx[1] = (idx[1] + 1) % num;
66 if (!idx[1]) {
67 bit[1] += be ? -1 : 1;
68 }
69 }
70 }
71 memcpy(x, r, sizeof(uint8_t) * num);
72}
73
74int main (int argc, char *argv []) {
75#ifdef UNSTRIPE
76 bool unstripe = true;
77#else
78 bool unstripe = false;
79#endif
80
81#ifdef FLASH_STRIPE_BE
82 bool be = true;
83#else
84 bool be = false;
85#endif
86
87 int i;
88
89 const char *exe_name = argv[0];
90 argc--;
91 argv++;
92
93 if (argc < 2) {
94 fprintf(stderr, "ERROR: %s requires at least two args\n", exe_name);
95 return 1;
96 }
97
98 const char *single_f = argv[0];
99 int single;
100
101 if (unstripe) {
102 single = creat(single_f, 0644);
103 } else {
104 single = open(single_f, 0);
105 }
106 if (single == -1) {
107 perror(argv[0]);
108 return 1;
109 }
110
111 argv++;
112 argc--;
113
114 int multiple[argc];
115
116 for (i = 0; i < argc; ++i) {
117 if (unstripe) {
118 multiple[i] = open(argv[i], 0);
119 } else {
120 multiple[i] = creat(argv[i], 0644);
121 }
122 if (multiple[i] == -1) {
123 perror(argv[i]);
124 return 1;
125 }
126 }
127
128 while (true) {
129 uint8_t buf[argc];
130 for (i = 0; i < argc; ++i) {
131 switch (read(!unstripe ? single : multiple[
132#if defined(FLASH_STRIPE_BW) && defined (FLASH_STRIPE_BE)
133 argc - 1 -
134#endif
135 i], &buf[i], 1)) {
136 case 0:
137 if (i == 0) {
138 goto done;
139 } else if (!unstripe) {
140 fprintf(stderr, "WARNING:input file %s is not multiple of "
141 "%d bytes, padding with garbage byte\n", single_f,
142 argc);
143 }
144 break;
145 case -1:
146 perror(unstripe ? argv[i] : single_f);
147 return 1;
148 }
149 }
150
151#ifndef FLASH_STRIPE_BW
152 stripe8(buf, argc, unstripe, be);
153#endif
154
155 for (i = 0; i < argc; ++i) {
156 switch (write(unstripe ? single : multiple[
157#if defined(FLASH_STRIPE_BW) && defined (FLASH_STRIPE_BE)
158 argc - 1 -
159#endif
160 i], &buf[i], 1)) {
161 case -1:
162 perror(unstripe ? single_f : argv[i]);
163 return 1;
164 case 0:
165 i--; /* try again */
166 }
167 }
168 }
169
170done:
171 close(single);
172 for (i = 0; i < argc; ++i) {
173 close(multiple[argc]);
174 }
175 return 0;
176}
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
new file mode 100644
index 00000000..6f7fb522
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
@@ -0,0 +1,68 @@
1#!/usr/bin/env python3
2
3# Xilinx QEMU wrapper to launch both PMU and APU instances (multiarch)
4import os
5import subprocess
6import sys
7import tempfile
8import shutil
9
10binpath = os.path.dirname(os.path.abspath(__file__))
11mach_path = tempfile.mkdtemp()
12
13
14# Separate PMU and APU arguments
15APU_args = sys.argv[1:]
16mbtype=''
17
18if '-pmu-args' in APU_args:
19 MB_args = APU_args[APU_args.index('-pmu-args')+1]
20 APU_args.remove('-pmu-args')
21 APU_args.remove(MB_args)
22 MB_args = MB_args.split()
23 PMU_rom = MB_args[MB_args.index('-kernel')+1]
24 mbtype='PMU'
25elif '-plm-args' in APU_args:
26 MB_args = APU_args[APU_args.index('-plm-args')+1]
27 APU_args.remove('-plm-args')
28 APU_args.remove(MB_args)
29 MB_args = MB_args.split()
30 mbtype='PLM'
31else:
32 error_msg = '\nMultiarch not setup properly.'
33 sys.exit(error_msg)
34
35error_msg = None
36if (mbtype == 'PMU' and os.path.exists(PMU_rom)) or mbtype == 'PLM':
37
38 # We need to switch tcp serial arguments (if they exist, e.g. qemurunner) to get the output correctly
39 tcp_serial_ports = [i for i, s in enumerate(APU_args) if 'tcp:127.0.0.1:' in s]
40
41 #NEED TO FIX for next yocto release (dont need to switch ports anymore, they will be provided correctly upstream
42 # We can only switch these if there are exactly two, otherwise we can't assume what is being executed so we leave it as is
43 if len(tcp_serial_ports) == 2:
44 APU_args[tcp_serial_ports[0]],APU_args[tcp_serial_ports[1]] = APU_args[tcp_serial_ports[1]],APU_args[tcp_serial_ports[0]]
45
46 mb_cmd = binpath + '/qemu-system-microblazeel ' + ' '.join(MB_args) + ' -machine-path ' + mach_path
47 apu_cmd = binpath + '/qemu-system-aarch64 ' + ' '.join(APU_args) + ' -machine-path ' + mach_path
48
49 # Debug prints
50 print('\n%s instance cmd: %s\n' % (mbtype, mb_cmd))
51 print('APU instance cmd: %s\n' % apu_cmd)
52
53
54 # Invoke QEMU pmu instance
55 process_pmu = subprocess.Popen(mb_cmd, shell=True, stderr=subprocess.PIPE)
56
57 # Invoke QEMU APU instance
58 process_apu = subprocess.Popen(apu_cmd, shell=True, stderr=subprocess.PIPE)
59 if process_apu.wait():
60 error_msg = '\nQEMU APU instance failed:\n%s' % process_apu.stderr.read().decode()
61
62else:
63 if mbtype == 'PMU':
64 error_msg = '\nError: Missing PMU ROM: %s' % PMU_rom
65 error_msg += '\nSee "meta-xilinx/README.qemu.md" for more information on accquiring the PMU ROM.\n'
66
67shutil.rmtree(mach_path)
68sys.exit(error_msg)
diff --git a/meta-xilinx-core/recipes-devtools/qemu/flashstrip_1.0.bb b/meta-xilinx-core/recipes-devtools/qemu/flashstrip_1.0.bb
new file mode 100644
index 00000000..e1dcc5ae
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/flashstrip_1.0.bb
@@ -0,0 +1,27 @@
1SUMMARY = "Building and installing flash strip utility"
2DESCRIPTION = "Building and installing flash strip utility"
3
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://../flash_stripe.c;beginline=1;endline=23;md5=abb859d98b7c4eede655e1b71824125a"
6
7B = "${WORKDIR}/build"
8
9SRC_URI += "file://flash_stripe.c"
10
11TARGET_CC_ARCH += "${LDFLAGS}"
12
13do_compile() {
14 ${CC} ${WORKDIR}/flash_stripe.c -o flash_strip
15 ${CC} ${WORKDIR}/flash_stripe.c -o flash_unstrip
16 ${CC} ${WORKDIR}/flash_stripe.c -o flash_strip_bw -DFLASH_STRIPE_BW
17 ${CC} ${WORKDIR}/flash_stripe.c -o flash_unstrip_bw -DUNSTRIP -DFLASH_STRIPE_BW
18}
19
20do_install() {
21 install -d ${D}${bindir}
22 install -Dm 0755 ${B}/* ${D}${bindir}/
23}
24
25FILES:${PN} = "${bindir}/*"
26
27BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc
new file mode 100644
index 00000000..6d834297
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc
@@ -0,0 +1,39 @@
1SUMMARY = "Xilinx's hardware device trees required for QEMU"
2HOMEPAGE = "https://github.com/xilinx/qemu-devicetrees/"
3LICENSE = "BSD"
4DEPENDS += "dtc-native"
5
6inherit deploy
7
8LIC_FILES_CHKSUM = "file://Makefile;beginline=1;endline=27;md5=7348b6cbcae69912cb1dee68d6c68d99"
9
10PV = "xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}"
11
12FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
13SRC_URI:append = " file://0001-Makefile-Use-python3-instead-of-python.patch"
14
15REPO ?= "git://github.com/Xilinx/qemu-devicetrees.git;protocol=https"
16
17BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
18SRC_URI = "${REPO};${BRANCHARG}"
19
20S = "${WORKDIR}/git"
21
22# Don't need to do anything
23do_install() {
24 :
25}
26
27do_deploy() {
28 # single-arch dtbs
29 for DTS_FILE in ${S}/LATEST/SINGLE_ARCH/*.dtb; do
30 install -Dm 0644 $DTS_FILE ${DEPLOYDIR}/qemu-hw-devicetrees/$(basename $DTS_FILE .dtb).dtb
31 done
32
33 # multi-arch dtbs
34 for DTS_FILE in ${S}/LATEST/MULTI_ARCH/*.dtb; do
35 install -Dm 0644 $DTS_FILE ${DEPLOYDIR}/qemu-hw-devicetrees/multiarch/$(basename $DTS_FILE .dtb).dtb
36 done
37}
38
39addtask deploy after do_install
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-Makefile-Use-python3-instead-of-python.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-Makefile-Use-python3-instead-of-python.patch
new file mode 100644
index 00000000..425145d0
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-Makefile-Use-python3-instead-of-python.patch
@@ -0,0 +1,37 @@
1From e80324e3497e5768c9fdbde3c0660a03d0dcc3ee Mon Sep 17 00:00:00 2001
2From: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
3Date: Mon, 8 Feb 2021 16:32:34 -0800
4Subject: [PATCH] Makefile:Use python3 instead of python
5
6Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
7---
8 Makefile | 12 ++++++------
9 1 file changed, 6 insertions(+), 6 deletions(-)
10
11diff --git a/Makefile b/Makefile
12index a110483..fd8868c 100644
13--- a/Makefile
14+++ b/Makefile
15@@ -91,13 +91,13 @@ $(LQSPI_XIP_OUTDIR)/%.dts: %.dts $(DTSI_FILES) $(HEADER_FILES)
16 # TODO: Add support for auto-generated dependency list
17 versal-pmc-npi.dtsi: versal-pmc-npi-nxx.dtsi versal-h10-pmc-npi-nxx.dtsi
18 versal-pmc-npi-nxx.dtsi: Makefile
19- @python -c 'for a in range(0, 54): print("\tGEN_NMU(" + str(a) + ")")' > $@
20- @python -c 'for a in range(0, 50): print("\tGEN_NSU(" + str(a) + ")")' >> $@
21- @python -c 'for a in range(0, 146): print("\tGEN_NPS(" + str(a) + ")")' >> $@
22+ @python3 -c 'for a in range(0, 54): print("\tGEN_NMU(" + str(a) + ")")' > $@
23+ @python3 -c 'for a in range(0, 50): print("\tGEN_NSU(" + str(a) + ")")' >> $@
24+ @python3 -c 'for a in range(0, 146): print("\tGEN_NPS(" + str(a) + ")")' >> $@
25 versal-h10-pmc-npi-nxx.dtsi: Makefile
26- @python -c 'for a in range(0, 37): print("\tGEN_NMU(" + str(a) + ")")' > $@
27- @python -c 'for a in range(0, 33): print("\tGEN_NSU(" + str(a) + ")")' >> $@
28- @python -c 'for a in range(0, 135): print("\tGEN_NPS(" + str(a) + ")")' >> $@
29+ @python3 -c 'for a in range(0, 37): print("\tGEN_NMU(" + str(a) + ")")' > $@
30+ @python3 -c 'for a in range(0, 33): print("\tGEN_NSU(" + str(a) + ")")' >> $@
31+ @python3 -c 'for a in range(0, 135): print("\tGEN_NPS(" + str(a) + ")")' >> $@
32
33 clean:
34 $(RM) versal-pmc-npi-nxx.dtsi
35--
362.7.4
37
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb
new file mode 100644
index 00000000..3b4e0263
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb
@@ -0,0 +1,5 @@
1
2require qemu-devicetrees.inc
3
4BRANCH ?= "master"
5SRCREV ?= "a224c69f66ebd4cd705b6f1b319c2db0dbd602b9"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb
new file mode 100644
index 00000000..eb14c0c1
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb
@@ -0,0 +1,34 @@
1FILESEXTRAPATHS:prepend := "${COREBASE}/meta/recipes-devtools/qemu/qemu-helper:"
2
3# provide it, to replace the existing
4PROVIDES = "qemu-helper-native"
5
6LICENSE = "GPLv2"
7LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999"
8
9SRC_URI = "\
10 file://tunctl.c \
11 "
12
13S = "${WORKDIR}"
14
15inherit native
16
17do_compile() {
18 ${CC} ${CFLAGS} ${LDFLAGS} -Wall tunctl.c -o tunctl
19}
20# replace qemu with qemu-xilinx
21DEPENDS:remove = "qemu-system-native"
22DEPENDS:append = " \
23 qemu-xilinx-system-native \
24 qemu-xilinx-multiarch-helper-native \
25 "
26
27RDEPENDS:${PN}:remove = "qemu-system-native"
28RDEPENDS:${PN}:append = " qemu-xilinx-system-native"
29
30do_install() {
31 install -d ${STAGING_BINDIR_NATIVE}
32 install tunctl ${STAGING_BINDIR_NATIVE}
33
34}
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb
new file mode 100644
index 00000000..1eec0163
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb
@@ -0,0 +1,20 @@
1SUMMARY = "Helper scripts for executing a multi-arch instance of Xilinx QEMU"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
4RDEPENDS:${PN} = "qemu-xilinx-native"
5
6inherit native
7
8FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
9
10SRC_URI = "file://qemu-system-aarch64-multiarch"
11
12do_configure[noexec] = "1"
13do_compile[noexec] = "1"
14
15SYSROOT_DIRS += "${bindir}/qemu-xilinx"
16
17do_install() {
18 install -Dm 0755 ${WORKDIR}/qemu-system-aarch64-multiarch ${D}${bindir}/qemu-system-aarch64-multiarch
19}
20
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc
new file mode 100644
index 00000000..3faabe5b
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc
@@ -0,0 +1,11 @@
1require recipes-devtools/qemu/qemu-native.inc
2require qemu-xilinx.inc
3
4DEPENDS = "glib-2.0-native zlib-native"
5
6SRC_URI:remove = "file://0012-fix-libcap-header-issue-on-some-distro.patch"
7SRC_URI:remove = "file://0013-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch"
8
9do_install:append(){
10 rm -rf ${D}${datadir}/icons
11}
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.1.bb
new file mode 100644
index 00000000..5e6c2d28
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.1.bb
@@ -0,0 +1,7 @@
1require qemu-xilinx-native.inc
2BPN = "qemu-xilinx"
3
4EXTRA_OECONF:append = " --target-list=${@get_qemu_usermode_target_list(d)} --disable-tools --disable-blobs --disable-guest-agent"
5
6PROVIDES = "qemu-native"
7PACKAGECONFIG ??= "pie"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb
new file mode 100644
index 00000000..f5b89f05
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb
@@ -0,0 +1,18 @@
1require qemu-xilinx-native.inc
2
3EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}"
4
5PACKAGECONFIG ??= "fdt alsa kvm pie"
6
7PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
8
9DEPENDS += "pixman-native qemu-xilinx-native bison-native ninja-native meson-native"
10
11do_install:append() {
12 # The following is also installed by qemu-native
13 rm -f ${D}${datadir}/qemu/trace-events-all
14 rm -rf ${D}${datadir}/qemu/keymaps
15 rm -rf ${D}${datadir}/icons
16 rm -rf ${D}${includedir}/qemu-plugin.h
17}
18
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc
new file mode 100644
index 00000000..d268f3e7
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc
@@ -0,0 +1,48 @@
1SUMMARY = "Xilinx's fork of a fast open source processor emulator"
2HOMEPAGE = "https://github.com/xilinx/qemu/"
3
4# x86_64 is needed to build nativesdks
5QEMU_TARGETS = "aarch64 arm microblaze microblazeel x86_64"
6
7LIC_FILES_CHKSUM = " \
8 file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
9 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f \
10 "
11DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native"
12
13XILINX_QEMU_VERSION ?= "v6.1.0"
14BRANCH ?= "master"
15SRCREV = "8dd1b8cabff3e3e5b965d7a60472278ca4e27ceb"
16
17FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
18
19PV = "${XILINX_QEMU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}"
20REPO ?= "gitsm://github.com/Xilinx/qemu.git;protocol=https"
21
22BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
23SRC_URI = "${REPO};${BRANCHARG}"
24
25SRC_URI:append = " file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch"
26
27S = "${WORKDIR}/git"
28
29# Disable KVM completely
30PACKAGECONFIG:remove = "kvm"
31PACKAGECONFIG:append = " fdt sdl gcrypt pie"
32
33PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
34PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2"
35PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,,"
36
37DISABLE_STATIC:pn-${PN} = ""
38EXTRA_OECONF:remove = " --with-git=/bin/false --with-git-submodules=ignore"
39
40PTEST_ENABLED = ""
41
42do_install:append() {
43 # Prevent QA warnings about installed ${localstatedir}/run
44 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
45}
46
47FILES:${PN} += "${datadir}/qemu/"
48FILES:${PN}:append:class-nativesdk:mingw32 = " ${SDKPATHNATIVE}"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.1.bb
new file mode 100644
index 00000000..4983b4df
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.1.bb
@@ -0,0 +1,17 @@
1require recipes-devtools/qemu/qemu.inc
2require qemu-xilinx.inc
3
4BBCLASSEXTEND = "nativesdk"
5
6RDEPENDS:${PN}:class-target += "bash"
7
8PROVIDES:class-nativesdk = "nativesdk-qemu"
9RPROVIDES:${PN}:class-nativesdk = "nativesdk-qemu"
10
11EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}"
12EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
13EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
14
15do_install:append:class-nativesdk() {
16 ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
17}
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend b/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend
new file mode 100644
index 00000000..bb792de2
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend
@@ -0,0 +1,2 @@
1# Has a dependency on libmali
2PACKAGE_ARCH:mali400 = "${SOC_VARIANT_ARCH}"
diff --git a/meta-xilinx-core/recipes-devtools/run-postinsts/run-postinsts_%.bbappend b/meta-xilinx-core/recipes-devtools/run-postinsts/run-postinsts_%.bbappend
new file mode 100644
index 00000000..cb5a912b
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/run-postinsts/run-postinsts_%.bbappend
@@ -0,0 +1,7 @@
1# Update-alternatives is not able to find stdout when using JTAG boot mode on
2# our devices, exits ungracefully without performing the required work (symbolic
3# linking), pass kmsg to it as output to achieve proper behavior.
4
5do_install:append(){
6 sed -i "s/sh -c \$i \$append_log/sh -c \$i > \/dev\/kmsg/" ${D}${sbindir}/run-postinsts
7}