qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Sergio Lopez <slp@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>,
	Shannon Zhao <shannon.zhaosl@gmail.com>,
	qemu-arm@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [PATCH 4/8] arm/virt: add device tree node for xhci
Date: Fri, 23 Oct 2020 09:10:18 +0200	[thread overview]
Message-ID: <20201023071022.24916-5-kraxel@redhat.com> (raw)
In-Reply-To: <20201023071022.24916-1-kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/arm/virt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index f2b34fd33be4..4319dd95ef78 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -812,7 +812,10 @@ static void create_rtc(const VirtMachineState *vms)
 static void create_xhci(const VirtMachineState *vms)
 {
     hwaddr base = base_memmap[VIRT_XHCI].base;
+    hwaddr size = base_memmap[VIRT_XHCI].size;
     int irq = vms->irqmap[VIRT_XHCI];
+    const char compat[] = "generic-xhci";
+    char *nodename;
     DeviceState *dev;
 
     dev = qdev_new(TYPE_XHCI_SYSBUS);
@@ -823,6 +826,16 @@ static void create_xhci(const VirtMachineState *vms)
     sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(vms->gic, irq));
+
+    nodename = g_strdup_printf("/usb@%" PRIx64, base);
+    qemu_fdt_add_subnode(vms->fdt, nodename);
+    qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat));
+    qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg",
+                                 2, base, 2, size);
+    qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts",
+                           GIC_FDT_IRQ_TYPE_SPI, irq,
+                           GIC_FDT_IRQ_FLAGS_LEVEL_HI);
+    g_free(nodename);
 }
 
 static DeviceState *gpio_key_dev;
-- 
2.27.0



  parent reply	other threads:[~2020-10-23  7:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  7:10 [PATCH 0/8] arm/virt: add usb support Gerd Hoffmann
2020-10-23  7:10 ` [PATCH 1/8] tests/acpi: allow updates for expected data files Gerd Hoffmann
2020-10-23  7:10 ` [PATCH 2/8] tests/acpi: add empty tests/data/acpi/virt/DSDT.usb file Gerd Hoffmann
2020-10-23  7:10 ` [PATCH 3/8] arm/virt: add support for -machine usb=on Gerd Hoffmann
2020-10-23  7:10 ` Gerd Hoffmann [this message]
2020-10-23  7:10 ` [PATCH 5/8] arm/virt: add acpi dsdt entry for xhci Gerd Hoffmann
2020-10-23  7:10 ` [PATCH 6/8] tests/acpi: add usb testcase for virt Gerd Hoffmann
2020-10-23  7:10 ` [PATCH 7/8] tests/acpi: update expected data files Gerd Hoffmann
2020-10-23  7:10 ` [PATCH 8/8] tests/acpi: disallow updates for " Gerd Hoffmann
2020-10-23 11:36 ` [PATCH 0/8] arm/virt: add usb support Peter Maydell
2020-10-26  7:01   ` Gerd Hoffmann
2020-10-26  9:57     ` Peter Maydell
2020-10-27  6:56       ` Gerd Hoffmann
2020-10-23 16:03 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201023071022.24916-5-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sai.pavan.boddu@xilinx.com \
    --cc=shannon.zhaosl@gmail.com \
    --cc=slp@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).