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>2022-01-14 15:37:02 -0800
commitf900c6a0c8908e370689235230094308ec419cf9 (patch)
treebd9ca83e452c263c7a421b826086048cf8130f34 /meta-xilinx-core/recipes-devtools
parentaaddcc3f785404da04af9ea3d005f2f520b4ec9e (diff)
downloadmeta-xilinx-f900c6a0c8908e370689235230094308ec419cf9.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/0001-Add-enable-disable-udev.patch30
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch93
-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_2021.2.bb4
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb24
-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_2021.2.bb6
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2021.2.bb17
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc50
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2021.2.bb16
-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, 654 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/0001-Add-enable-disable-udev.patch b/meta-xilinx-core/recipes-devtools/qemu/files/0001-Add-enable-disable-udev.patch
new file mode 100644
index 00000000..32c33385
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/0001-Add-enable-disable-udev.patch
@@ -0,0 +1,30 @@
1From 4ebe009d505bf10b0d90bad081d3fe5bd1cf7441 Mon Sep 17 00:00:00 2001
2From: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
3Date: Thu, 6 May 2021 14:33:42 -0700
4Subject: [PATCH] Add enable/disable libudev
5
6Upstream-Status: Pending
7Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
8Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
9---
10 configure | 4 ++++
11 1 file changed, 4 insertions(+)
12
13diff --git a/configure b/configure
14index c2ef164..612f987 100755
15--- a/configure
16+++ b/configure
17@@ -1633,6 +1633,10 @@ for opt do
18 ;;
19 --gdb=*) gdb_bin="$optarg"
20 ;;
21+ --enable-libudev) libudev="yes"
22+ ;;
23+ --disable-libudev) libudev="no"
24+ ;;
25 --enable-rng-none) rng_none=yes
26 ;;
27 --disable-rng-none) rng_none=no
28--
292.7.4
30
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..a8ab7daa
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch
@@ -0,0 +1,93 @@
1From 5214dd4461f2090ef0965b4d2518f49927d61cbc Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Wed, 28 Aug 2019 19:56:28 +0800
4Subject: [Qemu-devel] [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 configure | 48 ++++++++++++++++++++++++++++++++++++++++--------
14 1 file changed, 40 insertions(+), 8 deletions(-)
15
16diff --git a/configure b/configure
17index e44e454..0f362a7 100755
18--- a/configure
19+++ b/configure
20@@ -2875,6 +2875,30 @@ has_libgcrypt() {
21 return 0
22 }
23
24+has_libgcrypt_pkgconfig() {
25+ if ! has $pkg_config ; then
26+ return 1
27+ fi
28+
29+ if ! $pkg_config --list-all | grep libgcrypt > /dev/null 2>&1 ; then
30+ return 1
31+ fi
32+
33+ if test -n "$cross_prefix" ; then
34+ host=$($pkg_config --variable=host libgcrypt)
35+ if test "${host%-gnu}-" != "${cross_prefix%-gnu}" ; then
36+ print_error "host($host) does not match cross_prefix($cross_prefix)"
37+ return 1
38+ fi
39+ fi
40+
41+ if ! $pkg_config --atleast-version=1.5.0 libgcrypt ; then
42+ print_error "libgcrypt version is $($pkg_config --modversion libgcrypt)"
43+ return 1
44+ fi
45+
46+ return 0
47+}
48
49 if test "$nettle" != "no"; then
50 pass="no"
51@@ -2902,7 +2926,14 @@ fi
52
53 if test "$gcrypt" != "no"; then
54 pass="no"
55- if has_libgcrypt; then
56+ if has_libgcrypt_pkgconfig; then
57+ gcrypt_cflags=$($pkg_config --cflags libgcrypt)
58+ if test "$static" = "yes" ; then
59+ gcrypt_libs=$($pkg_config --libs --static libgcrypt)
60+ else
61+ gcrypt_libs=$($pkg_config --libs libgcrypt)
62+ fi
63+ elif has_libgcrypt; then
64 gcrypt_cflags=$(libgcrypt-config --cflags)
65 gcrypt_libs=$(libgcrypt-config --libs)
66 # Debian has removed -lgpg-error from libgcrypt-config
67@@ -2912,15 +2943,16 @@ if test "$gcrypt" != "no"; then
68 then
69 gcrypt_libs="$gcrypt_libs -lgpg-error"
70 fi
71+ fi
72
73- # Link test to make sure the given libraries work (e.g for static).
74- write_c_skeleton
75- if compile_prog "" "$gcrypt_libs" ; then
76- LIBS="$gcrypt_libs $LIBS"
77- QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
78- pass="yes"
79- fi
80+ # Link test to make sure the given libraries work (e.g for static).
81+ write_c_skeleton
82+ if compile_prog "" "$gcrypt_libs" ; then
83+ LIBS="$gcrypt_libs $LIBS"
84+ QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
85+ pass="yes"
86 fi
87+
88 if test "$pass" = "yes"; then
89 gcrypt="yes"
90 cat > $TMPC << EOF
91--
922.7.4
93
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_2021.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2021.2.bb
new file mode 100644
index 00000000..98785e7e
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2021.2.bb
@@ -0,0 +1,4 @@
1require qemu-devicetrees.inc
2
3BRANCH ?= "xlnx_rel_v2021.2"
4SRCREV ?= "0462d4d4866481c19102e05ebefe9f1691ed7ee8"
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..efd23d50
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb
@@ -0,0 +1,24 @@
1
2python () {
3 if d.getVar("PREFERRED_PROVIDER_qemu-helper-native") != d.getVar("PN"):
4 raise bb.parse.SkipRecipe("Set qemu-helper-native provider to use this recipe")
5}
6
7# TODO: improve this, since it is very hacky that this recipe need to build tunctl.
8# include the existing qemu-helper-native
9require recipes-devtools/qemu/qemu-helper-native_1.0.bb
10# get the path to tunctl.c (from oe-core!)
11FILESEXTRAPATHS:prepend := "${COREBASE}/meta/recipes-devtools/qemu/qemu-helper:"
12
13# provide it, to replace the existing
14PROVIDES += "qemu-helper-native"
15
16# replace qemu with qemu-xilinx
17DEPENDS:remove = "qemu-system-native"
18DEPENDS:append = " \
19 qemu-xilinx-system-native \
20 qemu-xilinx-multiarch-helper-native \
21 "
22
23RDEPENDS:${PN}:remove = "qemu-system-native"
24RDEPENDS:${PN}:append = " qemu-xilinx-system-native"
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_2021.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2021.2.bb
new file mode 100644
index 00000000..f657186f
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2021.2.bb
@@ -0,0 +1,6 @@
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"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2021.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2021.2.bb
new file mode 100644
index 00000000..b30777d2
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2021.2.bb
@@ -0,0 +1,17 @@
1require qemu-xilinx-native.inc
2
3EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}"
4
5PACKAGECONFIG ??= "fdt alsa kvm"
6
7PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
8
9DEPENDS += "pixman-native qemu-xilinx-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}
17
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..dcdf520f
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc
@@ -0,0 +1,50 @@
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"
12
13XILINX_QEMU_VERSION ?= "v5.1.0"
14BRANCH ?= "xlnx_rel_v2021.2"
15SRCREV = "303b509ec23138c43be8a3712068347210df67fd"
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 file://0001-Add-enable-disable-udev.patch \
27"
28SRC_URI:remove:class-target = " file://cross.patch"
29SRC_URI:remove:class-nativesdk = " file://cross.patch"
30
31S = "${WORKDIR}/git"
32
33# Disable KVM completely
34PACKAGECONFIG:remove = "kvm"
35PACKAGECONFIG:append = " fdt gcrypt"
36
37DISABLE_STATIC:pn-${PN} = ""
38
39PTEST_ENABLED = ""
40
41EXTRA_OECONF:append = " --with-git=/bin/false --disable-git-update"
42EXTRA_OECONF:remove = " --with-suffix=${BPN} --with-git-submodules=ignore --meson=meson"
43
44do_install:append() {
45 # Prevent QA warnings about installed ${localstatedir}/run
46 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
47}
48
49FILES:${PN} += "${datadir}/qemu/"
50FILES:${PN}:append:class-nativesdk:mingw32 = " ${SDKPATHNATIVE}"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2021.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2021.2.bb
new file mode 100644
index 00000000..5189595a
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2021.2.bb
@@ -0,0 +1,16 @@
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)}"
13
14do_install:append:class-nativesdk() {
15 ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
16}
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}