[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/56] acpi: move aml builder code for parallel device
From: |
Michael S. Tsirkin |
Subject: |
[PULL 11/56] acpi: move aml builder code for parallel device |
Date: |
Wed, 10 Jun 2020 00:26:56 -0400 |
From: Gerd Hoffmann <kraxel@redhat.com>
Also adds support for multiple LPT devices.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200515150421.25479-8-kraxel@redhat.com>
---
hw/char/parallel.c | 22 ++++++++++++++++++++++
hw/i386/acpi-build.c | 23 -----------------------
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 8dd67d1375..c0f34bf924 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -28,6 +28,7 @@
#include "qemu/module.h"
#include "chardev/char-parallel.h"
#include "chardev/char-fe.h"
+#include "hw/acpi/aml-build.h"
#include "hw/irq.h"
#include "hw/isa/isa.h"
#include "hw/qdev-properties.h"
@@ -568,6 +569,25 @@ static void parallel_isa_realizefn(DeviceState *dev, Error
**errp)
s, "parallel");
}
+static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
+{
+ ISAParallelState *isa = ISA_PARALLEL(isadev);
+ Aml *dev;
+ Aml *crs;
+
+ crs = aml_resource_template();
+ aml_append(crs, aml_io(AML_DECODE16, isa->iobase, isa->iobase, 0x08,
0x08));
+ aml_append(crs, aml_irq_no_flags(isa->isairq));
+
+ dev = aml_device("LPT%d", isa->index + 1);
+ aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
+ aml_append(dev, aml_name_decl("_UID", aml_int(isa->index + 1)));
+ aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
+ aml_append(dev, aml_name_decl("_CRS", crs));
+
+ aml_append(scope, dev);
+}
+
/* Memory mapped interface */
static uint64_t parallel_mm_readfn(void *opaque, hwaddr addr, unsigned size)
{
@@ -624,9 +644,11 @@ static Property parallel_isa_properties[] = {
static void parallel_isa_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
dc->realize = parallel_isa_realizefn;
dc->vmsd = &vmstate_parallel_isa;
+ isa->build_aml = parallel_isa_build_aml;
device_class_set_props(dc, parallel_isa_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2cafad03e2..58fe505fb6 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1173,28 +1173,6 @@ static Aml *build_mouse_device_aml(void)
return dev;
}
-static void build_lpt_device_aml(Aml *scope)
-{
- Aml *dev;
- Aml *crs;
-
- if (!memory_region_present(get_system_io(), 0x0378)) {
- return;
- }
-
- dev = aml_device("LPT");
- aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
-
- aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
- crs = aml_resource_template();
- aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
- aml_append(crs, aml_irq_no_flags(7));
- aml_append(dev, aml_name_decl("_CRS", crs));
-
- aml_append(scope, dev);
-}
-
static void build_isa_devices_aml(Aml *table)
{
ISADevice *fdc = pc_find_fdc0();
@@ -1208,7 +1186,6 @@ static void build_isa_devices_aml(Aml *table)
if (fdc) {
aml_append(scope, build_fdc_device_aml(fdc));
}
- build_lpt_device_aml(scope);
if (ambiguous) {
error_report("Multiple ISA busses, unable to define IPMI ACPI data");
--
MST
- [PULL 45/56] Lift max ram slots limit in libvhost-user, (continued)
- [PULL 45/56] Lift max ram slots limit in libvhost-user, Michael S. Tsirkin, 2020/06/10
- [PULL 46/56] libvhost-user: advertise vring features, Michael S. Tsirkin, 2020/06/10
- [PULL 47/56] hw/pci: Fix crash when running QEMU with "-nic model=rocker", Michael S. Tsirkin, 2020/06/10
- [PULL 48/56] vhost-vsock: add vhost-vsock-common abstraction, Michael S. Tsirkin, 2020/06/10
- [PULL 50/56] virtio: add vhost-user-vsock-pci device, Michael S. Tsirkin, 2020/06/10
- [PULL 55/56] acpi: ged: rename event memory region, Michael S. Tsirkin, 2020/06/10
- [PULL 56/56] Fix parameter type in vhost migration log path, Michael S. Tsirkin, 2020/06/10
- [PULL 03/56] hw/acpi/nvdimm: add a helper to augment SRAT generation, Michael S. Tsirkin, 2020/06/10
- [PULL 30/56] hw/pci-host/prep: Correct RAVEN bus bridge memory region size, Michael S. Tsirkin, 2020/06/10
- [PULL 04/56] tests/acpi: update expected SRAT files, Michael S. Tsirkin, 2020/06/10
- [PULL 11/56] acpi: move aml builder code for parallel device,
Michael S. Tsirkin <=
- [PULL 05/56] qtest: allow DSDT acpi table changes, Michael S. Tsirkin, 2020/06/10
- [PULL 26/56] virtio-balloon: Provide an interface for free page reporting, Michael S. Tsirkin, 2020/06/10
- [PULL 53/56] acpi: madt: skip pci override on pci-less systems., Michael S. Tsirkin, 2020/06/10
- [PULL 43/56] Support adding individual regions in libvhost-user, Michael S. Tsirkin, 2020/06/10
- [PULL 37/56] Add vhost-user helper to get MemoryRegion data, Michael S. Tsirkin, 2020/06/10
- [PULL 52/56] acpi: create acpi-common.c and move madt code, Michael S. Tsirkin, 2020/06/10
- [PULL 54/56] acpi: fadt: add hw-reduced sleep register support, Michael S. Tsirkin, 2020/06/10
- [PULL 51/56] acpi: make build_madt() more generic., Michael S. Tsirkin, 2020/06/10
- [PULL 49/56] virtio: add vhost-user-vsock base device, Michael S. Tsirkin, 2020/06/10
- Re: [PULL 00/56] virtio,acpi,pci: features, fixes, cleanups, tests, no-reply, 2020/06/10