From nobody Tue Feb 10 09:25:00 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588168416; cv=none; d=zohomail.com; s=zohoarc; b=hHDNNMv4yian0Zw/prgA4KUeIcz3UB3j214W2tKl6jAc6FuyaTQbOB3s3/VIueFGghm7WH9uPXaTIZQ/XhZ70FhfYl0BIfPFQwR7zMQjdex3N0fkka2Lr//790Kih6RMK3eTf6HrVu1qDxdGFrk2sWLdQSw1fHe1s6u70vXcCko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588168416; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To; bh=KvC1ZtFcv65UWpi4buuxuRz2D5pIAXgoGqgVAAaXrik=; b=WZSILpIsNDVgvjzIZZKeRovHhazDO2eZ4dHTlYKvCyYglROQjHM02w0QrE05yjczmapALzaOGwGJufBw8CvmkMQV/a8CQya2FRisk3UV2N/0IbCAYIwwd/s4xpQPwruDx3CLT18bhnpkTX571ZOqKB+NiOz+766pB2QiZ0DGIEU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1588168416331138.1478026467894; Wed, 29 Apr 2020 06:53:36 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id AC63510C195E; Wed, 29 Apr 2020 13:53:32 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 4F6CA10C1954 for ; Wed, 29 Apr 2020 13:53:08 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-weQ_VCgNMOum9d4iLvThBg-1; Wed, 29 Apr 2020 09:46:59 -0400 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 175711895A2C for ; Wed, 29 Apr 2020 13:46:58 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8B005C221; Wed, 29 Apr 2020 13:46:57 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) id 2C75F9DA2; Wed, 29 Apr 2020 15:46:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cbPoJuA3NkvZHGUElZUzbW5N5JE/kVRmUzCGboPqtjg=; b=cTnvgziF/4OAGhAlb3srkoEhsn4Jut9zJDjZipqN8bHSLZaM7HED8xffEbIcRI3hXsDac4 LvbXNoLjqoQnbcEcLee/gWAj90st92ZZXNfPi7d1GvjeVer6+2O5kbditmtNoIl0fg4dsq B8p+0SwnZa5Z44KWyqWR5x10NGAUCfQ= X-MC-Unique: weQ_VCgNMOum9d4iLvThBg-1 From: Gerd Hoffmann To: seabios@seabios.org Date: Wed, 29 Apr 2020 15:46:43 +0200 Message-Id: <20200429134643.2001-10-kraxel@redhat.com> In-Reply-To: <20200429134643.2001-1-kraxel@redhat.com> References: <20200429134643.2001-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: CSJTBIHPDTIYHHERPUROOCEBNEHAQXCM X-Message-ID-Hash: CSJTBIHPDTIYHHERPUROOCEBNEHAQXCM X-MailFrom: kraxel@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Gerd Hoffmann X-Mailman-Version: 3.3.1 Precedence: list Subject: [SeaBIOS] [PATCH v3 9/9] acpi: find and register virtio-mmio devices List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Seach for virtio-mmio devices in the DSDT table, register the devices found. Signed-off-by: Gerd Hoffmann --- src/hw/virtio-mmio.h | 1 + src/fw/paravirt.c | 2 ++ src/hw/virtio-mmio.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/hw/virtio-mmio.h b/src/hw/virtio-mmio.h index 9e0dae421009..69fbd23c3101 100644 --- a/src/hw/virtio-mmio.h +++ b/src/hw/virtio-mmio.h @@ -70,6 +70,7 @@ typedef struct virtio_mmio_cfg { u32 config_generation; } virtio_mmio_cfg; =20 +void virtio_mmio_setup_acpi(void); void virtio_mmio_setup_one(u64 mmio); void vp_init_mmio(struct vp_device *vp, void *mmio); =20 diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index 9247288a28c3..e446569345c1 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -16,6 +16,7 @@ #include "hw/pci_regs.h" // PCI_DEVICE_ID #include "hw/serialio.h" // PORT_SERIAL1 #include "hw/rtc.h" // CMOS_* +#include "hw/virtio-mmio.h" // virtio_mmio_acpi #include "malloc.h" // malloc_tmp #include "output.h" // dprintf #include "paravirt.h" // qemu_cfg_preinit @@ -235,6 +236,7 @@ qemu_platform_setup(void) =20 if (RsdpAddr) { acpi_dsdt_parse(); + virtio_mmio_setup_acpi(); return; } /* If present, loader should have installed an RSDP. diff --git a/src/hw/virtio-mmio.c b/src/hw/virtio-mmio.c index dabef7b7e53a..44344a4993f4 100644 --- a/src/hw/virtio-mmio.c +++ b/src/hw/virtio-mmio.c @@ -3,12 +3,32 @@ #include "output.h" // dprintf #include "stacks.h" // run_thread #include "string.h" // memset +#include "util.h" // acpi_dsdt_* #include "virtio-pci.h" #include "virtio-blk.h" #include "virtio-scsi.h" #include "virtio-ring.h" #include "virtio-mmio.h" =20 +void virtio_mmio_setup_acpi(void) +{ + static const char *virtio_hid =3D "LNRO0005"; + struct acpi_device *dev; + u64 mem, irq, unused; + + for (dev =3D acpi_dsdt_find_string(NULL, virtio_hid); + dev !=3D NULL; + dev =3D acpi_dsdt_find_string(dev, virtio_hid)) { + if (acpi_dsdt_find_mem(dev, &mem, &unused) < 0) + continue; + if (acpi_dsdt_find_irq(dev, &irq) < 0) + continue; + dprintf(1, "ACPI: virtio-mmio device %s at 0x%llx, irq %lld\n", + acpi_dsdt_name(dev), mem, irq); + virtio_mmio_setup_one(mem); + } +} + void virtio_mmio_setup_one(u64 addr) { static const char *names[] =3D { --=20 2.18.2 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org