qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/8] arm/virt: add acpi dsdt entry for xhci


From: Gerd Hoffmann
Subject: [PATCH 5/8] arm/virt: add acpi dsdt entry for xhci
Date: Fri, 23 Oct 2020 09:10:19 +0200

Also tweak xhci_sysbus_build_aml, add _UID and _CCA.
Without _CCA the linux kernel's xhci probe fails on arm.

ASL changes:

         Device (XHCI)
         {
             Name (_HID, EisaId ("PNP0D10") /* XHCI USB Controller with debug 
*/)  // _HID: Hardware ID
+            Name (_UID, Zero)  // _UID: Unique ID
+            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
             Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
             {
                 Memory32Fixed (ReadWrite,
                     0xFE900000,         // Address Base
                     0x00004000,         // Address Length
                     )
                 Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                 {
                     0x0000000A,
                 }
             })
         }

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/arm/virt-acpi-build.c | 6 ++++++
 hw/usb/hcd-xhci-sysbus.c | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 9747a6458f0b..147332b37597 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -54,6 +54,7 @@
 #include "kvm_arm.h"
 #include "migration/vmstate.h"
 #include "hw/acpi/ghes.h"
+#include "hw/usb/xhci.h"
 
 #define ARM_SPI_BASE 32
 
@@ -631,6 +632,11 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, 
VirtMachineState *vms)
         }
     }
 
+    if (machine_usb(MACHINE(vms))) {
+        xhci_sysbus_build_aml(scope, memmap[VIRT_XHCI].base,
+                              irqmap[VIRT_XHCI] + ARM_SPI_BASE);
+    }
+
     acpi_dsdt_add_power_button(scope);
     acpi_dsdt_add_tpm(scope, vms);
 
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index 29185d2261fb..fa963a5de4fa 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -79,6 +79,8 @@ void xhci_sysbus_build_aml(Aml *scope, uint32_t mmio, 
unsigned int irq)
                                   AML_EXCLUSIVE, &irq, 1));
 
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0D10")));
+    aml_append(dev, aml_name_decl("_UID", aml_int(0)));
+    aml_append(dev, aml_name_decl("_CCA", aml_int(1)));
     aml_append(dev, aml_name_decl("_CRS", crs));
     aml_append(scope, dev);
 }
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]