]> git.proxmox.com Git - mirror_qemu.git/commitdiff
spapr_pci: Add and export DMA resetting helper
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 1 Jun 2016 08:57:39 +0000 (18:57 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 7 Jun 2016 00:17:45 +0000 (10:17 +1000)
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>
hw/ppc/spapr_pci.c
include/hw/pci-host/spapr.h

index 4a7be4d7468ab7511ef75c463ddae1b8643cb8ca..68de5235c2465ddf144dc582c8b8e2e928e2ef45 100644 (file)
@@ -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);
index 03ee006406f6d4c56d267856c1daa0d58e7e2471..7848366b2a20b46050065b8deec8efacef418b65 100644 (file)
@@ -147,4 +147,6 @@ static inline void spapr_phb_vfio_reset(DeviceState *qdev)
 }
 #endif
 
+void spapr_phb_dma_reset(sPAPRPHBState *sphb);
+
 #endif /* __HW_SPAPR_PCI_H__ */