summary refs log tree commit diff stats
path: root/hw/ppc/spapr_pci.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2014-05-27 15:36:37 +1000
committerAlexander Graf <agraf@suse.de>2014-06-16 13:24:39 +0200
commit1b8eceee280d3fab11812271f4956f7b69287ef0 (patch)
tree4bbffe4a21da4c76cd5b90b6a0898b206c03c18b /hw/ppc/spapr_pci.c
parent650f33adbd53b0bacdd5d3392ea5b11a8a0fba42 (diff)
downloadfocaccia-qemu-1b8eceee280d3fab11812271f4956f7b69287ef0.tar.gz
focaccia-qemu-1b8eceee280d3fab11812271f4956f7b69287ef0.zip
spapr_iommu: Introduce bus_offset in sPAPRTCETable
This adds @bus_offset into sPAPRTCETable to tell where TCE table starts
from. It is set to 0 for emulated devices. Dynamic DMA windows will use
other offset.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r--hw/ppc/spapr_pci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index ee1ff9e2bb..3b01beadbb 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -656,6 +656,7 @@ static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp)
     sPAPRTCETable *tcet;
 
     tcet = spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn,
+                               0,
                                SPAPR_TCE_PAGE_SHIFT,
                                0x40000000 >> SPAPR_TCE_PAGE_SHIFT);
     if (!tcet) {
@@ -813,8 +814,8 @@ static int spapr_phb_children_dt(Object *child, void *opaque)
     }
 
     spapr_dma_dt(p->fdt, p->node_off, "ibm,dma-window",
-                 tcet->liobn, 0,
-                 tcet->nb_table << SPAPR_TCE_PAGE_SHIFT);
+                 tcet->liobn, tcet->bus_offset,
+                 tcet->nb_table << tcet->page_shift);
     /* Stop after the first window */
 
     return 1;