diff options
author | Cédric Le Goater <clg@kaod.org> | 2019-03-06 09:50:18 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-03-12 14:33:04 +1100 |
commit | f7eb6a0a9b9326d3daae4bf0d9c664c8e79bea39 (patch) | |
tree | 08f93cd51c22e41b47187b6b7e8f8de12d11e211 /hw/ppc | |
parent | 029699aa0483d195f96cdbece8a0f8d02081bb70 (diff) | |
download | qemu-f7eb6a0a9b9326d3daae4bf0d9c664c8e79bea39.zip qemu-f7eb6a0a9b9326d3daae4bf0d9c664c8e79bea39.tar.gz qemu-f7eb6a0a9b9326d3daae4bf0d9c664c8e79bea39.tar.bz2 |
ppc/pnv: psi: add a reset handler
Reset all regs but keep the MMIO BAR enabled as it is at realize time.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190306085032.15744-14-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/pnv_psi.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index a2f8d0d..e61861b 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -442,6 +442,15 @@ static const MemoryRegionOps pnv_psi_xscom_ops = { } }; +static void pnv_psi_reset(void *dev) +{ + PnvPsi *psi = PNV_PSI(dev); + + memset(psi->regs, 0x0, sizeof(psi->regs)); + + psi->regs[PSIHB_XSCOM_BAR] = psi->bar | PSIHB_BAR_EN; +} + static void pnv_psi_init(Object *obj) { PnvPsi *psi = PNV_PSI(obj); @@ -511,6 +520,8 @@ static void pnv_psi_realize(DeviceState *dev, Error **errp) psi->regs[xivr] = PSIHB_XIVR_PRIO_MSK | ((uint64_t) i << PSIHB_XIVR_SRC_SH); } + + qemu_register_reset(pnv_psi_reset, dev); } static int pnv_psi_dt_xscom(PnvXScomInterface *dev, void *fdt, int xscom_offset) |