diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-28 12:42:49 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-30 11:29:56 +0200 |
commit | 24db877ab6e6dc999016f1f29e59c7eb1539f5d3 (patch) | |
tree | 28c49e12f78e90557f805c821daa7bbbb531c648 /hw/i386/acpi-microvm.c | |
parent | ebf187757048e972eea1054cb1b5b54a3e47356b (diff) | |
download | qemu-24db877ab6e6dc999016f1f29e59c7eb1539f5d3.zip qemu-24db877ab6e6dc999016f1f29e59c7eb1539f5d3.tar.gz qemu-24db877ab6e6dc999016f1f29e59c7eb1539f5d3.tar.bz2 |
microvm: add pcie support
Uses the existing gpex device which is also used as pcie host bridge on
arm/aarch64. For now only a 32bit mmio window and no ioport support.
It is disabled by default, use "-machine microvm,pcie=on" to enable.
ACPI support must be enabled too because the bus is declared in the
DSDT table.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20200928104256.9241-6-kraxel@redhat.com
Diffstat (limited to 'hw/i386/acpi-microvm.c')
-rw-r--r-- | hw/i386/acpi-microvm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index df39c5d..f16f231 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -33,6 +33,8 @@ #include "hw/boards.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" +#include "hw/pci/pci.h" +#include "hw/pci/pcie_host.h" #include "hw/virtio/virtio-mmio.h" #include "acpi-common.h" @@ -87,6 +89,15 @@ static void acpi_dsdt_add_virtio(Aml *scope, } } +static void acpi_dsdt_add_pci(Aml *scope, MicrovmMachineState *mms) +{ + if (mms->pcie != ON_OFF_AUTO_ON) { + return; + } + + acpi_dsdt_add_gpex(scope, &mms->gpex); +} + static void build_dsdt_microvm(GArray *table_data, BIOSLinker *linker, MicrovmMachineState *mms) @@ -112,6 +123,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_pci(sb_scope, mms); aml_append(dsdt, sb_scope); /* ACPI 5.0: Table 7-209 System State Package */ |