[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/17] usb/xhci: add xhci_sysbus_build_aml() helper
From: |
Gerd Hoffmann |
Subject: |
[PULL 10/17] usb/xhci: add xhci_sysbus_build_aml() helper |
Date: |
Wed, 21 Oct 2020 16:48:45 +0200 |
The helper generates an acpi dsdt device entry
for the xhci sysbus device.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20201020074844.5304-4-kraxel@redhat.com
---
include/hw/usb/xhci.h | 2 ++
hw/usb/hcd-xhci-sysbus.c | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/hw/usb/xhci.h b/include/hw/usb/xhci.h
index dc0c29930dcc..5c90e1373e55 100644
--- a/include/hw/usb/xhci.h
+++ b/include/hw/usb/xhci.h
@@ -16,4 +16,6 @@
/* must be power of 2 */
#define XHCI_LEN_REGS 0x4000
+void xhci_sysbus_build_aml(Aml *scope, uint32_t mmio, unsigned int irq);
+
#endif
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index 570618467356..29185d2261fb 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -13,6 +13,7 @@
#include "trace.h"
#include "qapi/error.h"
#include "hcd-xhci-sysbus.h"
+#include "hw/acpi/aml-build.h"
#include "hw/irq.h"
static void xhci_sysbus_intr_raise(XHCIState *xhci, int n, bool level)
@@ -68,6 +69,20 @@ static void xhci_sysbus_instance_init(Object *obj)
s->xhci.intr_raise = xhci_sysbus_intr_raise;
}
+void xhci_sysbus_build_aml(Aml *scope, uint32_t mmio, unsigned int irq)
+{
+ Aml *dev = aml_device("XHCI");
+ Aml *crs = aml_resource_template();
+
+ aml_append(crs, aml_memory32_fixed(mmio, XHCI_LEN_REGS, AML_READ_WRITE));
+ aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH,
+ AML_EXCLUSIVE, &irq, 1));
+
+ aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0D10")));
+ aml_append(dev, aml_name_decl("_CRS", crs));
+ aml_append(scope, dev);
+}
+
static Property xhci_sysbus_props[] = {
DEFINE_PROP_UINT32("intrs", XHCISysbusState, xhci.numintrs, XHCI_MAXINTRS),
DEFINE_PROP_UINT32("slots", XHCISysbusState, xhci.numslots, XHCI_MAXSLOTS),
--
2.27.0
- [PULL 00/17] Microvm 20201021 patches, Gerd Hoffmann, 2020/10/21
- [PULL 04/17] microvm: set pci_irq_mask, Gerd Hoffmann, 2020/10/21
- [PULL 14/17] tests/acpi: add empty tests/data/acpi/microvm/DSDT.{usb, rtc} files, Gerd Hoffmann, 2020/10/21
- [PULL 13/17] tests/acpi: allow updates for expected data files, Gerd Hoffmann, 2020/10/21
- [PULL 17/17] tests/acpi: update expected data files, Gerd Hoffmann, 2020/10/21
- [PULL 05/17] apci: drop has_pci arg for acpi_build_madt, Gerd Hoffmann, 2020/10/21
- [PULL 11/17] usb/xhci: fixup xhci kconfig deps, Gerd Hoffmann, 2020/10/21
- [PULL 07/17] tests/acpi: disallow changes for microvm/APIC.pcie, Gerd Hoffmann, 2020/10/21
- [PULL 08/17] acpi: add aml builder stubs, Gerd Hoffmann, 2020/10/21
- [PULL 10/17] usb/xhci: add xhci_sysbus_build_aml() helper,
Gerd Hoffmann <=
- [PULL 09/17] usb/xhci: add include/hw/usb/xhci.h header file, Gerd Hoffmann, 2020/10/21
- [PULL 01/17] tests/acpi: allow changes for microvm/APIC.pcie, Gerd Hoffmann, 2020/10/21
- [PULL 02/17] tests/acpi: add empty microvm/APIC.pcie, Gerd Hoffmann, 2020/10/21
- [PULL 15/17] tests/acpi: add microvm usb test, Gerd Hoffmann, 2020/10/21
- [PULL 12/17] microvm: add usb support, Gerd Hoffmann, 2020/10/21
- [PULL 03/17] x86: make pci irqs runtime configurable, Gerd Hoffmann, 2020/10/21
- [PULL 16/17] tests/acpi: add microvm rtc test, Gerd Hoffmann, 2020/10/21
- [PULL 06/17] tests/acpi: update expected data files, Gerd Hoffmann, 2020/10/21
- Re: [PULL 00/17] Microvm 20201021 patches, Peter Maydell, 2020/10/22