apci: assign memory regions to ich9 lpc device
Get rid of get_system_io() usage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
56e5b2a1a6
commit
503b19fc5d
@ -202,11 +202,13 @@ static void pm_powerdown_req(Notifier *n, void *opaque)
|
||||
acpi_pm1_evt_power_down(&pm->acpi_regs);
|
||||
}
|
||||
|
||||
void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
|
||||
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
|
||||
qemu_irq sci_irq, qemu_irq cmos_s3)
|
||||
{
|
||||
memory_region_init(&pm->io, "ich9-pm", ICH9_PMIO_SIZE);
|
||||
memory_region_set_enabled(&pm->io, false);
|
||||
memory_region_add_subregion(get_system_io(), 0, &pm->io);
|
||||
memory_region_add_subregion(pci_address_space_io(lpc_pci),
|
||||
0, &pm->io);
|
||||
|
||||
acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
|
||||
acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
|
||||
|
@ -30,9 +30,11 @@ typedef struct ICH9LPCPMRegs {
|
||||
* PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
|
||||
*/
|
||||
ACPIREGS acpi_regs;
|
||||
|
||||
MemoryRegion io;
|
||||
MemoryRegion io_gpe;
|
||||
MemoryRegion io_smi;
|
||||
|
||||
uint32_t smi_en;
|
||||
uint32_t smi_sts;
|
||||
|
||||
@ -42,7 +44,7 @@ typedef struct ICH9LPCPMRegs {
|
||||
Notifier powerdown_notifier;
|
||||
} ICH9LPCPMRegs;
|
||||
|
||||
void ich9_pm_init(ICH9LPCPMRegs *pm,
|
||||
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
|
||||
qemu_irq sci_irq, qemu_irq cmos_s3_resume);
|
||||
void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
|
||||
extern const VMStateDescription vmstate_ich9_pm;
|
||||
|
@ -336,7 +336,7 @@ void ich9_lpc_pm_init(PCIDevice *lpc_pci, qemu_irq cmos_s3)
|
||||
qemu_irq *sci_irq;
|
||||
|
||||
sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
|
||||
ich9_pm_init(&lpc->pm, sci_irq[0], cmos_s3);
|
||||
ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0], cmos_s3);
|
||||
|
||||
ich9_lpc_reset(&lpc->d.qdev);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user