Skip to content

Commit

Permalink
ppc/pnv: psi: add a reset handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
legoater authored and dgibson committed Mar 12, 2019
1 parent 029699a commit f7eb6a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hw/ppc/pnv_psi.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f7eb6a0

Please sign in to comment.