diff mbox series

[v5,2/5] hw/isa/vt82c686: Add missing initialization of ACPI general purpose event registers

Message ID 20231028091606.23700-3-shentey@gmail.com
State New
Headers show
Series VIA PM: Implement basic ACPI support | expand

Commit Message

Bernhard Beschow Oct. 28, 2023, 9:16 a.m. UTC
In order to be able to reuse acpi_update_sci(), these registers need to be
initialized.

In PIIX4, these registers are used to implement the Frankenstein hotplug
functionality and are mapped outside of the device's IO region. Don't do that
for VIA for now to avoid the Frankenstein functionality. Still, initialize them
to the size of the real VIA PM controller general purpose event registers but
stay conservative and don't map them for now.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/isa/vt82c686.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index aeb9434a46..60ca781e03 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -40,6 +40,8 @@ 
 #define TYPE_VIA_PM "via-pm"
 OBJECT_DECLARE_SIMPLE_TYPE(ViaPMState, VIA_PM)
 
+#define VIA_PM_GPE_LEN 4
+
 #define VIA_PM_SCI_SELECT_OFS 0x42
 #define VIA_PM_SCI_SELECT_MASK 0xf
 
@@ -179,6 +181,7 @@  static void via_pm_reset(DeviceState *d)
     acpi_pm1_evt_reset(&s->ar);
     acpi_pm1_cnt_reset(&s->ar);
     acpi_pm_tmr_reset(&s->ar);
+    acpi_gpe_reset(&s->ar);
     pm_update_sci(s);
 
     pm_io_space_update(s);
@@ -205,6 +208,7 @@  static void via_pm_realize(PCIDevice *dev, Error **errp)
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_cnt_init(&s->ar, &s->io, false, false, 2, false);
+    acpi_gpe_init(&s->ar, VIA_PM_GPE_LEN);
 }
 
 static void via_pm_init(Object *obj)