diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-10-02 22:21:57 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-10-02 22:25:59 +0300 |
commit | 286d45cc649a5b852a27b48e61b51bf75e9d1cee (patch) | |
tree | 90095cb0d2c571fd8de164caf2ca2f2e4d3f7247 /meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu | |
parent | d4b38429f6dec208547bf3d250a0c06f5d0fbcb2 (diff) | |
download | openbmc-286d45cc649a5b852a27b48e61b51bf75e9d1cee.tar.xz |
Add meta-xilinx subtree
Import git://git.yoctoproject.org/meta-xilinx from 5fccc46503 as
meta-xilinx subtree.
Change-Id: I3d59bcf3a57cee588aab7f5cdd0287af66450c8a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu')
8 files changed, 237 insertions, 0 deletions
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/memfd.patch b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/memfd.patch new file mode 100644 index 000000000..62e8d3800 --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/memfd.patch @@ -0,0 +1,57 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini <pbonzini@redhat.com> +Date: Tue, 28 Nov 2017 11:51:27 +0100 +Subject: [PATCH] memfd: fix configure test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Recent glibc added memfd_create in sys/mman.h. This conflicts with +the definition in util/memfd.c: + + /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration + +Fix the configure test, and remove the sys/memfd.h inclusion since the +file actually does not exist---it is a typo in the memfd_create(2) man +page. + +Cc: Marc-André Lureau <marcandre.lureau@redhat.com> +Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> +--- + configure | 2 +- + util/memfd.c | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index 9c8aa5a98b..99ccc1725a 100755 +--- a/configure ++++ b/configure +@@ -3923,7 +3923,7 @@ fi + # check if memfd is supported + memfd=no + cat > $TMPC << EOF +-#include <sys/memfd.h> ++#include <sys/mman.h> + + int main(void) + { +diff --git a/util/memfd.c b/util/memfd.c +index 4571d1aba8..412e94a405 100644 +--- a/util/memfd.c ++++ b/util/memfd.c +@@ -31,9 +31,7 @@ + + #include "qemu/memfd.h" + +-#ifdef CONFIG_MEMFD +-#include <sys/memfd.h> +-#elif defined CONFIG_LINUX ++#if defined CONFIG_LINUX && !defined CONFIG_MEMFD + #include <sys/syscall.h> + #include <asm/unistd.h> + +-- +2.11.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 new file mode 100644 index 000000000..15124c1b7 --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch @@ -0,0 +1,32 @@ +#!/bin/bash + +BINPATH=$(dirname $0) +MACHINE_PATH=$(mktemp -d) + +APU_ARGS= +PMU_ARGS= + +while [ ! -z "$1" ]; do + if [ "$1" = "-pmu-args" ]; then + PMU_ARGS+=" $2" + shift + else + APU_ARGS+=" $1" + fi + shift +done + +PMU_ROM=$(last=; for i in $PMU_ARGS; do if [ "$last" = "-kernel" ]; then echo "$i"; break; fi; last=$i; done) +if [ ! -e $PMU_ROM ]; then + echo "------" + echo "Error: Missing PMU ROM - $PMU_ROM" + echo " See 'meta-xilinx/README.qemu.md' for more information on accquiring the PMU ROM." + echo "------" + exit 255 +fi + +# start the PMU instance +$BINPATH/qemu-system-microblazeel $PMU_ARGS -machine-path $MACHINE_PATH & +# start the APU instance +$BINPATH/qemu-system-aarch64 $APU_ARGS -machine-path $MACHINE_PATH + diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-devicetrees.inc b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-devicetrees.inc new file mode 100644 index 000000000..d4044ed72 --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-devicetrees.inc @@ -0,0 +1,37 @@ +SUMMARY = "Xilinx's hardware device trees required for QEMU" +HOMEPAGE = "https://github.com/xilinx/qemu-devicetrees/" +LICENSE = "BSD" +DEPENDS += "dtc-native" + +inherit deploy + +LIC_FILES_CHKSUM = "file://Makefile;beginline=1;endline=27;md5=7348b6cbcae69912cb1dee68d6c68d99" + +PV = "xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" + +BRANCH ?= "" +REPO ?= "git://github.com/Xilinx/qemu-devicetrees.git;protocol=https" + +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" +SRC_URI = "${REPO};${BRANCHARG}" + +S = "${WORKDIR}/git" + +# Don't need to do anything +do_install() { + : +} + +do_deploy() { + # single-arch dtbs + for DTS_FILE in ${S}/LATEST/SINGLE_ARCH/*.dtb; do + install -Dm 0644 $DTS_FILE ${DEPLOYDIR}/qemu-hw-devicetrees/$(basename $DTS_FILE .dtb).dtb + done + + # multi-arch dtbs + for DTS_FILE in ${S}/LATEST/MULTI_ARCH/*.dtb; do + install -Dm 0644 $DTS_FILE ${DEPLOYDIR}/qemu-hw-devicetrees/multiarch/$(basename $DTS_FILE .dtb).dtb + done +} + +addtask deploy after do_install diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-devicetrees_2018.1.bb b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-devicetrees_2018.1.bb new file mode 100644 index 000000000..a73b9e57d --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-devicetrees_2018.1.bb @@ -0,0 +1,6 @@ +require qemu-devicetrees.inc + +XILINX_RELEASE_VERSION = "v2018.1" + +BRANCH ?= "master" +SRCREV ?= "d5017f8119b6493d8b2fcdfd5caa4e8b16580877" diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb new file mode 100644 index 000000000..55b35b53e --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb @@ -0,0 +1,28 @@ + +python () { + if d.getVar("PREFERRED_PROVIDER_qemu-helper-native") != d.getVar("PN"): + raise bb.parse.SkipRecipe("Set qemu-helper-native provider to use this recipe") +} + +def get_filespath_extra(d, subpath): + metaroot = next((p for p in d.getVar('BBPATH').split(':') if os.path.basename(p) == 'meta'), None) + if metaroot: + return os.path.join(metaroot, subpath) + ":" + return "" + +# TODO: improve this, since it is very hacky that this recipe need to build tunctl. +# include the existing qemu-helper-native +require recipes-devtools/qemu/qemu-helper-native_1.0.bb +# get the path to tunctl.c +FILESEXTRAPATHS_prepend := "${@get_filespath_extra(d, 'recipes-devtools/qemu/qemu-helper')}" + +# provide it, to replace the existing +PROVIDES += "qemu-helper-native" + +# replace qemu with qemu-xilinx +DEPENDS_remove = "qemu-native" +DEPENDS_append = " \ + qemu-xilinx-native \ + qemu-xilinx-multiarch-helper-native \ + " + diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb new file mode 100644 index 000000000..a9b11c6c6 --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb @@ -0,0 +1,20 @@ +SUMMARY = "Helper scripts for executing a multi-arch instance of Xilinx QEMU" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +RDEPENDS_${PN} = "qemu-xilinx-native" + +inherit native + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI = "file://qemu-system-aarch64-multiarch" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +SYSROOT_DIRS += "${bindir}/qemu-xilinx" + +do_install() { + install -Dm 0755 ${WORKDIR}/qemu-system-aarch64-multiarch ${D}${bindir}/qemu-xilinx/qemu-system-aarch64-multiarch +} + diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx.inc b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx.inc new file mode 100644 index 000000000..b6c5dee56 --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx.inc @@ -0,0 +1,51 @@ +QEMU_TARGETS = "aarch64 arm microblaze microblazeel" + +require recipes-devtools/qemu/qemu.inc + +SUMMARY = "Xilinx's fork of a fast open source processor emulator" +HOMEPAGE = "https://github.com/xilinx/qemu/" + +LIC_FILES_CHKSUM = " \ + file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ + file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913 \ + " + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PV = "${XILINX_QEMU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" +BRANCH ?= "" +REPO ?= "git://github.com/Xilinx/qemu.git;protocol=https" + +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" +SRC_URI = "${REPO};${BRANCHARG} \ + file://memfd.patch \ + " + +S = "${WORKDIR}/git" + +# Disable KVM completely +PACKAGECONFIG_remove = "kvm" + +# Enable libgcrypt +PACKAGECONFIG_append = " gcrypt" + +DISABLE_STATIC_pn-${PN} = "" + +PTEST_ENABLED = "" + +# append a suffix dir, to allow multiple versions of QEMU to be installed +EXTRA_OECONF_append = " \ + --bindir=${bindir}/qemu-xilinx \ + --libexecdir=${libexecdir}/qemu-xilinx \ + " + +do_configure_prepend() { + # rewrite usage of 'libgcrypt-config' with 'pkg-config libgcrypt' + sed -r -i 's/libgcrypt-config(\s*--)/pkg-config libgcrypt\1/g' ${S}/configure +} + +do_install_append() { + # Prevent QA warnings about installed ${localstatedir}/run + if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi +} + diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx_2018.1.bb b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx_2018.1.bb new file mode 100644 index 000000000..1d6697cdb --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-devtools/qemu/qemu-xilinx_2018.1.bb @@ -0,0 +1,6 @@ +require qemu-xilinx.inc + +XILINX_RELEASE_VERSION = "v2018.1" +XILINX_QEMU_VERSION ?= "v2.11.0" +BRANCH ?= "master" +SRCREV ?= "1d5516986ea296d91a599ac23252e302a4003914" |