aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2016-06-01 18:57:39 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2016-06-07 10:17:45 +1000
commitb3162f22cb3cbca73d4c90b936dbadff6954e2f6 (patch)
treef3847fa10def627d8939effda29621cdc7414ba4 /hw/ppc
parentacf1b6dd22ef8ccd5431e933706f12ce643f6cf0 (diff)
downloadqemu-b3162f22cb3cbca73d4c90b936dbadff6954e2f6.zip
qemu-b3162f22cb3cbca73d4c90b936dbadff6954e2f6.tar.gz
qemu-b3162f22cb3cbca73d4c90b936dbadff6954e2f6.tar.bz2
spapr_pci: Add and export DMA resetting helper
This will be later used by the "ibm,reset-pe-dma-window" RTAS handler which resets the DMA configuration to the defaults. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_pci.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 4a7be4d..68de523 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1485,9 +1485,8 @@ static int spapr_phb_children_reset(Object *child, void *opaque)
return 0;
}
-static void spapr_phb_reset(DeviceState *qdev)
+void spapr_phb_dma_reset(sPAPRPHBState *sphb)
{
- sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev);
sPAPRTCETable *tcet = spapr_tce_find_by_liobn(sphb->dma_liobn);
if (tcet && tcet->nb_table) {
@@ -1497,6 +1496,13 @@ static void spapr_phb_reset(DeviceState *qdev)
/* Register default 32bit DMA window */
spapr_tce_table_enable(tcet, SPAPR_TCE_PAGE_SHIFT, sphb->dma_win_addr,
sphb->dma_win_size >> SPAPR_TCE_PAGE_SHIFT);
+}
+
+static void spapr_phb_reset(DeviceState *qdev)
+{
+ sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev);
+
+ spapr_phb_dma_reset(sphb);
/* Reset the IOMMU state */
object_child_foreach(OBJECT(qdev), spapr_phb_children_reset, NULL);