aboutsummaryrefslogtreecommitdiff
path: root/hw/lpc_ich9.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-12-10 08:33:11 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-12-10 08:33:11 -0600
commit8385b173a0ca4c2345434104e6cc2a7259adc4b9 (patch)
treebc80c590aafe83e4febc227a03b6763e19cd6f49 /hw/lpc_ich9.c
parent16ef55ca85ac8c8fcac46547108bd1c8b44943a2 (diff)
parent3e43749882c558875f70ac5deda39cdc9797e245 (diff)
downloadqemu-8385b173a0ca4c2345434104e6cc2a7259adc4b9.zip
qemu-8385b173a0ca4c2345434104e6cc2a7259adc4b9.tar.gz
qemu-8385b173a0ca4c2345434104e6cc2a7259adc4b9.tar.bz2
Merge remote-tracking branch 'kraxel/acpi.1' into staging
* kraxel/acpi.1: acpi: drop debug port q35: update lpc pci config space according to configured devices apci: switch piix4 pci hotplug to memory api acpi: remove acpi_gpe_blk apci: switch piix4 gpe to memory api acpi: fix piix4 smbus mapping acpi: switch smbus to memory api acpi: cleanup ich9 memory region apci: switch ich9 smi to memory api apci: switch ich9 gpe to memory api acpi: cleanup vt82c686 memory region acpi: cleanup piix4 memory region apci: switch evt to memory api apci: switch cnt to memory api apci: switch timer to memory api apci: switch vt82c686 to memory api apci: switch ich9 to memory api apci: switch piix4 to memory api Conflicts: hw/lpc_ich9.c Resolved merge conflict due to apm_init adding an argument. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/lpc_ich9.c')
-rw-r--r--hw/lpc_ich9.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
index 7de5427..878a43e 100644
--- a/hw/lpc_ich9.c
+++ b/hw/lpc_ich9.c
@@ -60,6 +60,7 @@
#include "pam.h"
#include "pci_internals.h"
#include "exec-memory.h"
+#include "sysemu.h"
static int ich9_lpc_sci_irq(ICH9LPCState *lpc);
@@ -456,6 +457,30 @@ static const MemoryRegionOps rbca_mmio_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
+static void ich9_lpc_machine_ready(Notifier *n, void *opaque)
+{
+ ICH9LPCState *s = container_of(n, ICH9LPCState, machine_ready);
+ uint8_t *pci_conf;
+
+ pci_conf = s->d.config;
+ if (isa_is_ioport_assigned(0x3f8)) {
+ /* com1 */
+ pci_conf[0x82] |= 0x01;
+ }
+ if (isa_is_ioport_assigned(0x2f8)) {
+ /* com2 */
+ pci_conf[0x82] |= 0x02;
+ }
+ if (isa_is_ioport_assigned(0x378)) {
+ /* lpt */
+ pci_conf[0x82] |= 0x04;
+ }
+ if (isa_is_ioport_assigned(0x3f0)) {
+ /* floppy */
+ pci_conf[0x82] |= 0x08;
+ }
+}
+
static int ich9_lpc_initfn(PCIDevice *d)
{
ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
@@ -473,6 +498,10 @@ static int ich9_lpc_initfn(PCIDevice *d)
ich9_cc_init(lpc);
apm_init(d, &lpc->apm, ich9_apm_ctrl_changed, lpc);
+
+ lpc->machine_ready.notify = ich9_lpc_machine_ready;
+ qemu_add_machine_init_done_notifier(&lpc->machine_ready);
+
return 0;
}