From nobody Thu Nov 6 08:24:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539868292922819.2412094161216; Thu, 18 Oct 2018 06:11:32 -0700 (PDT) Received: from localhost ([::1]:42357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD85L-0003fj-Qj for importer@patchew.org; Thu, 18 Oct 2018 09:11:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD7zH-00071K-Ax for qemu-devel@nongnu.org; Thu, 18 Oct 2018 09:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gD7z9-0003h3-Os for qemu-devel@nongnu.org; Thu, 18 Oct 2018 09:05:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gD7z1-0003S9-Ry; Thu, 18 Oct 2018 09:05:00 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1371A88E55; Thu, 18 Oct 2018 13:04:59 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.158]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54FCA10018F8; Thu, 18 Oct 2018 13:04:56 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peng Hao Date: Thu, 18 Oct 2018 15:04:34 +0200 Message-Id: <20181018130434.23237-5-philmd@redhat.com> In-Reply-To: <20181018130434.23237-1-philmd@redhat.com> References: <20181018130434.23237-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 18 Oct 2018 13:04:59 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 4/4] hw/arm/virt: Use the pvpanic device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Wen Congyang , Hu Tao , qemu-devel@nongnu.org, "open list:ARM" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peng Hao Signed-off-by: Philippe Mathieu-Daud=C3=A9 [PMD: Use TYPE_PVPANIC definition, split in 2 patches] --- default-configs/arm-softmmu.mak | 2 +- hw/arm/virt.c | 21 +++++++++++++++++++++ include/hw/arm/virt.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.= mak index 2420491aac..def07fa095 100644 --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@ -43,7 +43,7 @@ CONFIG_USB_MUSB=3Dy CONFIG_USB_EHCI_SYSBUS=3Dy CONFIG_PLATFORM_BUS=3Dy CONFIG_VIRTIO_MMIO=3Dy - +CONFIG_PVPANIC=3Dy CONFIG_ARM11MPCORE=3Dy CONFIG_A9MPCORE=3Dy CONFIG_A15MPCORE=3Dy diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9f677825f9..40469e6785 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -59,6 +59,7 @@ #include "qapi/visitor.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h" +#include "hw/misc/pvpanic.h" =20 #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ @@ -140,6 +141,7 @@ static const MemMapEntry a15memmap[] =3D { [VIRT_UART] =3D { 0x09000000, 0x00001000 }, [VIRT_RTC] =3D { 0x09010000, 0x00001000 }, [VIRT_FW_CFG] =3D { 0x09020000, 0x00000018 }, + [VIRT_PVPANIC_MMIO] =3D { 0x09020018, 0x00000002 }, [VIRT_GPIO] =3D { 0x09030000, 0x00001000 }, [VIRT_SECURE_UART] =3D { 0x09040000, 0x00001000 }, [VIRT_SMMU] =3D { 0x09050000, 0x00020000 }, @@ -802,6 +804,23 @@ static void create_gpio(const VirtMachineState *vms, q= emu_irq *pic) g_free(nodename); } =20 +static void create_pvpanic_device(const VirtMachineState *vms) +{ + char *nodename; + hwaddr base =3D vms->memmap[VIRT_PVPANIC_MMIO].base; + hwaddr size =3D vms->memmap[VIRT_PVPANIC_MMIO].size; + + sysbus_create_simple(TYPE_PVPANIC, base, NULL); + + nodename =3D g_strdup_printf("/pvpanic-mmio@%" PRIx64, base); + qemu_fdt_add_subnode(vms->fdt, nodename); + qemu_fdt_setprop_string(vms->fdt, nodename, + "compatible", "pvpanic,mmio"); + qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + 2, base, 2, size); + g_free(nodename); +} + static void create_virtio_devices(const VirtMachineState *vms, qemu_irq *p= ic) { int i; @@ -1548,6 +1567,8 @@ static void machvirt_init(MachineState *machine) =20 create_pcie(vms, pic); =20 + create_pvpanic_device(vms); + create_gpio(vms, pic); =20 /* Create mmio transports, so the user can create virtio backends diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 4cc57a7ef6..61cc3109b2 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -70,6 +70,7 @@ enum { VIRT_MMIO, VIRT_RTC, VIRT_FW_CFG, + VIRT_PVPANIC_MMIO, VIRT_PCIE, VIRT_PCIE_MMIO, VIRT_PCIE_PIO, --=20 2.17.2