aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/acpi-microvm.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-10-20 09:48:39 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-10-21 11:36:19 +0200
commitd4a42e85818141b190af9c6f43175393f1fcbb44 (patch)
tree5a8f49a4dbfb5dbf6d4f44f7ac9e235439bf323b /hw/i386/acpi-microvm.c
parent7114f6eac333d99b1db87eedd3f6620a98354296 (diff)
microvm: add usb support
Wire up "usb=on" machine option, when enabled add a sysbus xhci controller with 8 ports. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20201020074844.5304-6-kraxel@redhat.com
Diffstat (limited to 'hw/i386/acpi-microvm.c')
-rw-r--r--hw/i386/acpi-microvm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c
index 5efa89c327..d34a301b84 100644
--- a/hw/i386/acpi-microvm.c
+++ b/hw/i386/acpi-microvm.c
@@ -35,6 +35,7 @@
#include "hw/i386/microvm.h"
#include "hw/pci/pci.h"
#include "hw/pci/pcie_host.h"
+#include "hw/usb/xhci.h"
#include "hw/virtio/virtio-mmio.h"
#include "acpi-common.h"
@@ -89,6 +90,13 @@ static void acpi_dsdt_add_virtio(Aml *scope,
}
}
+static void acpi_dsdt_add_xhci(Aml *scope, MicrovmMachineState *mms)
+{
+ if (machine_usb(MACHINE(mms))) {
+ xhci_sysbus_build_aml(scope, MICROVM_XHCI_BASE, MICROVM_XHCI_IRQ);
+ }
+}
+
static void acpi_dsdt_add_pci(Aml *scope, MicrovmMachineState *mms)
{
if (mms->pcie != ON_OFF_AUTO_ON) {
@@ -123,6 +131,7 @@ build_dsdt_microvm(GArray *table_data, BIOSLinker *linker,
GED_MMIO_IRQ, AML_SYSTEM_MEMORY, GED_MMIO_BASE);
acpi_dsdt_add_power_button(sb_scope);
acpi_dsdt_add_virtio(sb_scope, mms);
+ acpi_dsdt_add_xhci(sb_scope, mms);
acpi_dsdt_add_pci(sb_scope, mms);
aml_append(dsdt, sb_scope);