summaryrefslogtreecommitdiff
path: root/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files')
-rw-r--r--meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0001-Add-enable-disable-udev.patch31
-rw-r--r--meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch93
-rw-r--r--meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/flash_stripe.c176
-rw-r--r--meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch68
4 files changed, 0 insertions, 368 deletions
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0001-Add-enable-disable-udev.patch b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0001-Add-enable-disable-udev.patch
deleted file mode 100644
index f38862fac..000000000
--- a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0001-Add-enable-disable-udev.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 96f204df74f7dde5f4c9ad6e6eefc2d46219ccd9 Mon Sep 17 00:00:00 2001
-From: Jeremy Puhlman <jpuhlman@mvista.com>
-Date: Thu, 19 Mar 2020 11:54:26 -0700
-Subject: [PATCH] Add enable/disable libudev
-
-Upstream-Status: Pending
-Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
-
-%% original patch: 0001-Add-enable-disable-udev.patch
----
- configure | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/configure b/configure
-index c9a4e73..75f9773 100755
---- a/configure
-+++ b/configure
-@@ -1606,6 +1606,10 @@ for opt do
- ;;
- --gdb=*) gdb_bin="$optarg"
- ;;
-+ --enable-libudev) libudev="yes"
-+ ;;
-+ --disable-libudev) libudev="no"
-+ ;;
- *)
- echo "ERROR: unknown option $opt"
- echo "Try '$0 --help' for more information"
---
-2.7.4
-
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch
deleted file mode 100644
index a8ab7daa4..000000000
--- a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 5214dd4461f2090ef0965b4d2518f49927d61cbc Mon Sep 17 00:00:00 2001
-From: He Zhe <zhe.he@windriver.com>
-Date: Wed, 28 Aug 2019 19:56:28 +0800
-Subject: [Qemu-devel] [PATCH] configure: Add pkg-config handling for libgcrypt
-
-libgcrypt may also be controlled by pkg-config, this patch adds pkg-config
-handling for libgcrypt.
-
-Upstream-Status: Denied [https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg06333.html]
-
-Signed-off-by: He Zhe <zhe.he@windriver.com>
----
- configure | 48 ++++++++++++++++++++++++++++++++++++++++--------
- 1 file changed, 40 insertions(+), 8 deletions(-)
-
-diff --git a/configure b/configure
-index e44e454..0f362a7 100755
---- a/configure
-+++ b/configure
-@@ -2875,6 +2875,30 @@ has_libgcrypt() {
- return 0
- }
-
-+has_libgcrypt_pkgconfig() {
-+ if ! has $pkg_config ; then
-+ return 1
-+ fi
-+
-+ if ! $pkg_config --list-all | grep libgcrypt > /dev/null 2>&1 ; then
-+ return 1
-+ fi
-+
-+ if test -n "$cross_prefix" ; then
-+ host=$($pkg_config --variable=host libgcrypt)
-+ if test "${host%-gnu}-" != "${cross_prefix%-gnu}" ; then
-+ print_error "host($host) does not match cross_prefix($cross_prefix)"
-+ return 1
-+ fi
-+ fi
-+
-+ if ! $pkg_config --atleast-version=1.5.0 libgcrypt ; then
-+ print_error "libgcrypt version is $($pkg_config --modversion libgcrypt)"
-+ return 1
-+ fi
-+
-+ return 0
-+}
-
- if test "$nettle" != "no"; then
- pass="no"
-@@ -2902,7 +2926,14 @@ fi
-
- if test "$gcrypt" != "no"; then
- pass="no"
-- if has_libgcrypt; then
-+ if has_libgcrypt_pkgconfig; then
-+ gcrypt_cflags=$($pkg_config --cflags libgcrypt)
-+ if test "$static" = "yes" ; then
-+ gcrypt_libs=$($pkg_config --libs --static libgcrypt)
-+ else
-+ gcrypt_libs=$($pkg_config --libs libgcrypt)
-+ fi
-+ elif has_libgcrypt; then
- gcrypt_cflags=$(libgcrypt-config --cflags)
- gcrypt_libs=$(libgcrypt-config --libs)
- # Debian has removed -lgpg-error from libgcrypt-config
-@@ -2912,15 +2943,16 @@ if test "$gcrypt" != "no"; then
- then
- gcrypt_libs="$gcrypt_libs -lgpg-error"
- fi
-+ fi
-
-- # Link test to make sure the given libraries work (e.g for static).
-- write_c_skeleton
-- if compile_prog "" "$gcrypt_libs" ; then
-- LIBS="$gcrypt_libs $LIBS"
-- QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
-- pass="yes"
-- fi
-+ # Link test to make sure the given libraries work (e.g for static).
-+ write_c_skeleton
-+ if compile_prog "" "$gcrypt_libs" ; then
-+ LIBS="$gcrypt_libs $LIBS"
-+ QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
-+ pass="yes"
- fi
-+
- if test "$pass" = "yes"; then
- gcrypt="yes"
- cat > $TMPC << EOF
---
-2.7.4
-
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/flash_stripe.c b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/flash_stripe.c
deleted file mode 100644
index a9a6e76a5..000000000
--- a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/flash_stripe.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Stripe a flash image across multiple files.
- *
- * Copyright (C) 2019 Xilinx, Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-/* N way (num) in place bit striper. Lay out row wise bits column wise
- * (from element 0 to N-1). num is the length of x, and dir reverses the
- * direction of the transform. be determines the bit endianess scheme.
- * false to lay out bits LSB to MSB (little endian) and true for big endian.
- *
- * Best illustrated by examples:
- * Each digit in the below array is a single bit (num == 3, be == false):
- *
- * {{ 76543210, } ----- stripe (dir == false) -----> {{ FCheb630, }
- * { hgfedcba, } { GDAfc741, }
- * { HGFEDCBA, }} <---- upstripe (dir == true) ----- { HEBgda52, }}
- *
- * Same but with be == true:
- *
- * {{ 76543210, } ----- stripe (dir == false) -----> {{ 741gdaFC, }
- * { hgfedcba, } { 630fcHEB, }
- * { HGFEDCBA, }} <---- upstripe (dir == true) ----- { 52hebGDA, }}
- */
-
-static inline void stripe8(uint8_t *x, int num, bool dir, bool be)
-{
- uint8_t r[num];
- memset(r, 0, sizeof(uint8_t) * num);
- int idx[2] = {0, 0};
- int bit[2] = {0, be ? 7 : 0};
- int d = dir;
-
- for (idx[0] = 0; idx[0] < num; ++idx[0]) {
- for (bit[0] = be ? 7 : 0; bit[0] != (be ? -1 : 8); bit[0] += be ? -1 : 1) {
- r[idx[!d]] |= x[idx[d]] & 1 << bit[d] ? 1 << bit[!d] : 0;
- idx[1] = (idx[1] + 1) % num;
- if (!idx[1]) {
- bit[1] += be ? -1 : 1;
- }
- }
- }
- memcpy(x, r, sizeof(uint8_t) * num);
-}
-
-int main (int argc, char *argv []) {
-#ifdef UNSTRIPE
- bool unstripe = true;
-#else
- bool unstripe = false;
-#endif
-
-#ifdef FLASH_STRIPE_BE
- bool be = true;
-#else
- bool be = false;
-#endif
-
- int i;
-
- const char *exe_name = argv[0];
- argc--;
- argv++;
-
- if (argc < 2) {
- fprintf(stderr, "ERROR: %s requires at least two args\n", exe_name);
- return 1;
- }
-
- const char *single_f = argv[0];
- int single;
-
- if (unstripe) {
- single = creat(single_f, 0644);
- } else {
- single = open(single_f, 0);
- }
- if (single == -1) {
- perror(argv[0]);
- return 1;
- }
-
- argv++;
- argc--;
-
- int multiple[argc];
-
- for (i = 0; i < argc; ++i) {
- if (unstripe) {
- multiple[i] = open(argv[i], 0);
- } else {
- multiple[i] = creat(argv[i], 0644);
- }
- if (multiple[i] == -1) {
- perror(argv[i]);
- return 1;
- }
- }
-
- while (true) {
- uint8_t buf[argc];
- for (i = 0; i < argc; ++i) {
- switch (read(!unstripe ? single : multiple[
-#if defined(FLASH_STRIPE_BW) && defined (FLASH_STRIPE_BE)
- argc - 1 -
-#endif
- i], &buf[i], 1)) {
- case 0:
- if (i == 0) {
- goto done;
- } else if (!unstripe) {
- fprintf(stderr, "WARNING:input file %s is not multiple of "
- "%d bytes, padding with garbage byte\n", single_f,
- argc);
- }
- break;
- case -1:
- perror(unstripe ? argv[i] : single_f);
- return 1;
- }
- }
-
-#ifndef FLASH_STRIPE_BW
- stripe8(buf, argc, unstripe, be);
-#endif
-
- for (i = 0; i < argc; ++i) {
- switch (write(unstripe ? single : multiple[
-#if defined(FLASH_STRIPE_BW) && defined (FLASH_STRIPE_BE)
- argc - 1 -
-#endif
- i], &buf[i], 1)) {
- case -1:
- perror(unstripe ? single_f : argv[i]);
- return 1;
- case 0:
- i--; /* try again */
- }
- }
- }
-
-done:
- close(single);
- for (i = 0; i < argc; ++i) {
- close(multiple[argc]);
- }
- return 0;
-}
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
deleted file mode 100644
index 6f7fb5225..000000000
--- a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python3
-
-# Xilinx QEMU wrapper to launch both PMU and APU instances (multiarch)
-import os
-import subprocess
-import sys
-import tempfile
-import shutil
-
-binpath = os.path.dirname(os.path.abspath(__file__))
-mach_path = tempfile.mkdtemp()
-
-
-# Separate PMU and APU arguments
-APU_args = sys.argv[1:]
-mbtype=''
-
-if '-pmu-args' in APU_args:
- MB_args = APU_args[APU_args.index('-pmu-args')+1]
- APU_args.remove('-pmu-args')
- APU_args.remove(MB_args)
- MB_args = MB_args.split()
- PMU_rom = MB_args[MB_args.index('-kernel')+1]
- mbtype='PMU'
-elif '-plm-args' in APU_args:
- MB_args = APU_args[APU_args.index('-plm-args')+1]
- APU_args.remove('-plm-args')
- APU_args.remove(MB_args)
- MB_args = MB_args.split()
- mbtype='PLM'
-else:
- error_msg = '\nMultiarch not setup properly.'
- sys.exit(error_msg)
-
-error_msg = None
-if (mbtype == 'PMU' and os.path.exists(PMU_rom)) or mbtype == 'PLM':
-
- # We need to switch tcp serial arguments (if they exist, e.g. qemurunner) to get the output correctly
- tcp_serial_ports = [i for i, s in enumerate(APU_args) if 'tcp:127.0.0.1:' in s]
-
- #NEED TO FIX for next yocto release (dont need to switch ports anymore, they will be provided correctly upstream
- # 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
- if len(tcp_serial_ports) == 2:
- APU_args[tcp_serial_ports[0]],APU_args[tcp_serial_ports[1]] = APU_args[tcp_serial_ports[1]],APU_args[tcp_serial_ports[0]]
-
- mb_cmd = binpath + '/qemu-system-microblazeel ' + ' '.join(MB_args) + ' -machine-path ' + mach_path
- apu_cmd = binpath + '/qemu-system-aarch64 ' + ' '.join(APU_args) + ' -machine-path ' + mach_path
-
- # Debug prints
- print('\n%s instance cmd: %s\n' % (mbtype, mb_cmd))
- print('APU instance cmd: %s\n' % apu_cmd)
-
-
- # Invoke QEMU pmu instance
- process_pmu = subprocess.Popen(mb_cmd, shell=True, stderr=subprocess.PIPE)
-
- # Invoke QEMU APU instance
- process_apu = subprocess.Popen(apu_cmd, shell=True, stderr=subprocess.PIPE)
- if process_apu.wait():
- error_msg = '\nQEMU APU instance failed:\n%s' % process_apu.stderr.read().decode()
-
-else:
- if mbtype == 'PMU':
- error_msg = '\nError: Missing PMU ROM: %s' % PMU_rom
- error_msg += '\nSee "meta-xilinx/README.qemu.md" for more information on accquiring the PMU ROM.\n'
-
-shutil.rmtree(mach_path)
-sys.exit(error_msg)