pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/emulators/qemu Add *local* patch for the Qemu MIPS tar...
details: https://anonhg.NetBSD.org/pkgsrc/rev/60f934b9c229
branches: trunk
changeset: 447093:60f934b9c229
user: reinoud <reinoud%pkgsrc.org@localhost>
date: Mon Feb 15 22:15:12 2021 +0000
description:
Add *local* patch for the Qemu MIPS target MIPSSIM adding VirtIO devices for
development purposes.
diffstat:
emulators/qemu/Makefile | 4 +-
emulators/qemu/distinfo | 4 +-
emulators/qemu/patches/patch-hw-mips-Kconfig | 13 +++++
emulators/qemu/patches/patch-hw-mips-mipssim.c | 67 ++++++++++++++++++++++++++
4 files changed, 85 insertions(+), 3 deletions(-)
diffs (119 lines):
diff -r ad2ac683647b -r 60f934b9c229 emulators/qemu/Makefile
--- a/emulators/qemu/Makefile Mon Feb 15 21:18:59 2021 +0000
+++ b/emulators/qemu/Makefile Mon Feb 15 22:15:12 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.260 2021/01/03 21:42:29 roy Exp $
+# $NetBSD: Makefile,v 1.261 2021/02/15 22:15:12 reinoud Exp $
DISTNAME= qemu-5.1.0
-PKGREVISION= 11
+PKGREVISION= 12
CATEGORIES= emulators
MASTER_SITES= https://download.qemu.org/
EXTRACT_SUFX= .tar.xz
diff -r ad2ac683647b -r 60f934b9c229 emulators/qemu/distinfo
--- a/emulators/qemu/distinfo Mon Feb 15 21:18:59 2021 +0000
+++ b/emulators/qemu/distinfo Mon Feb 15 22:15:12 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.167 2020/11/02 17:17:15 martin Exp $
+$NetBSD: distinfo,v 1.168 2021/02/15 22:15:12 reinoud Exp $
SHA1 (palcode-clipper) = e25ae10a10e0801e47b62b9ee2d10c8ccb4ee940
RMD160 (palcode-clipper) = a637f1cc38dabfdff36e3f02b6dd02d7c63cb8db
@@ -16,6 +16,8 @@
SHA1 (patch-configure) = 2f5689b83b58066865598a83d53be2de6b42e303
SHA1 (patch-contrib_ivshmem-client_ivshmem-client.c) = 40c8751607cbf66a37e4c4e08f2664b864e2e984
SHA1 (patch-contrib_ivshmem-server_ivshmem-server.c) = d8f53432b5752f4263dc4ef96108a976a05147a3
+SHA1 (patch-hw-mips-Kconfig) = c7199ad26ac45116ab4d38252db4234ae93bdf9a
+SHA1 (patch-hw-mips-mipssim.c) = 30f31c90306e73b6adb3afad4934c91ce5141e86
SHA1 (patch-hw_alpha_alpha_sys.h) = 5908698208937ff9eb0bf1c504e1144af3d1bcc4
SHA1 (patch-hw_alpha_dp264.c) = 856304784f098863728ecac3d0a9287aa22190d7
SHA1 (patch-hw_alpha_typhoon.c) = 1bed5cd6f355c4163585c5331356ebf38c5c3a16
diff -r ad2ac683647b -r 60f934b9c229 emulators/qemu/patches/patch-hw-mips-Kconfig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/patches/patch-hw-mips-Kconfig Mon Feb 15 22:15:12 2021 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-hw-mips-Kconfig,v 1.1 2021/02/15 22:15:12 reinoud Exp $
+
+--- hw/mips/Kconfig.orig 2020-08-11 19:17:15.000000000 +0000
++++ hw/mips/Kconfig
+@@ -20,6 +20,8 @@ config MIPSSIM
+ select ISA_BUS
+ select SERIAL_ISA
+ select MIPSNET
++ select VIRTIO_MMIO
++ select OR_IRQ
+
+ config JAZZ
+ bool
diff -r ad2ac683647b -r 60f934b9c229 emulators/qemu/patches/patch-hw-mips-mipssim.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/patches/patch-hw-mips-mipssim.c Mon Feb 15 22:15:12 2021 +0000
@@ -0,0 +1,67 @@
+$NetBSD: patch-hw-mips-mipssim.c,v 1.1 2021/02/15 22:15:12 reinoud Exp $
+
+--- hw/mips/mipssim.c.orig 2020-08-11 19:17:15.000000000 +0000
++++ hw/mips/mipssim.c
+@@ -38,6 +38,7 @@
+ #include "hw/boards.h"
+ #include "hw/mips/bios.h"
+ #include "hw/loader.h"
++#include "hw/or-irq.h"
+ #include "elf.h"
+ #include "hw/sysbus.h"
+ #include "hw/qdev-properties.h"
+@@ -45,6 +46,13 @@
+ #include "qemu/error-report.h"
+ #include "sysemu/qtest.h"
+ #include "sysemu/reset.h"
++#include "hw/virtio/virtio-mmio.h"
++
++#define NUM_VIRTIO_TRANSPORTS 32
++
++#define DEV_SPACING 0x10000 /* space devices every 64k */
++#define ISA_BASE 0x1fd00000
++#define VIRTIO_MMIO_BASE (ISA_BASE + DEV_SPACING)
+
+ static struct _loaderparams {
+ int ram_size;
+@@ -150,6 +158,7 @@ mips_mipssim_init(MachineState *machine)
+ MemoryRegion *address_space_mem = get_system_memory();
+ MemoryRegion *isa = g_new(MemoryRegion, 1);
+ MemoryRegion *bios = g_new(MemoryRegion, 1);
++ DeviceState *virtio_orgate;
+ MIPSCPU *cpu;
+ CPUMIPSState *env;
+ ResetData *reset_info;
+@@ -209,7 +218,7 @@ mips_mipssim_init(MachineState *machine)
+ /* Register 64 KB of ISA IO space at 0x1fd00000. */
+ memory_region_init_alias(isa, NULL, "isa_mmio",
+ get_system_io(), 0, 0x00010000);
+- memory_region_add_subregion(get_system_memory(), 0x1fd00000, isa);
++ memory_region_add_subregion(get_system_memory(), ISA_BASE, isa);
+
+ /*
+ * A single 16450 sits at offset 0x3f8. It is attached to
+@@ -229,6 +238,23 @@ mips_mipssim_init(MachineState *machine)
+ if (nd_table[0].used)
+ /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
+ mipsnet_init(0x4200, env->irq[2], &nd_table[0]);
++
++ /*
++ * virtio extention; register 32 virtio devices just after the ISA space
++ * at 0x1fd10000 with stride of 512 bytes as per i386s microvm target.
++ * register these devices in reverse order (see comments in hw/arm/virt.c)
++ */
++ virtio_orgate = DEVICE(object_new(TYPE_OR_IRQ));
++ object_property_set_int(OBJECT(virtio_orgate),
++ "num-lines", NUM_VIRTIO_TRANSPORTS, &error_fatal);
++ qdev_realize_and_unref(virtio_orgate, NULL, &error_fatal);
++
++ for (int i = NUM_VIRTIO_TRANSPORTS - 1; i >= 0; i--) {
++ sysbus_create_simple("virtio-mmio",
++ 0x1fd10000 + i * 512,
++ qdev_get_gpio_in(virtio_orgate, i));
++ }
++ qdev_connect_gpio_out(DEVICE(virtio_orgate), 0, env->irq[3]);
+ }
+
+ static void mips_mipssim_machine_init(MachineClass *mc)
Home |
Main Index |
Thread Index |
Old Index