linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] Set archdata.dma_data for direct DMA in cell_dma_dev_setup()
@ 2008-01-21  5:42 Michael Ellerman
  2008-01-21  5:42 ` [PATCH 2/7] Add celleb_dma_dev_setup() Michael Ellerman
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Michael Ellerman @ 2008-01-21  5:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Arnd Bergmann, cbe-oss-dev

Store the direct_dma_offset in each device's dma_data in the case
where we're using the direct DMA ops.

We need to make sure we setup the ppc_md.pci_dma_dev_setup() callback
if we're using a non-zero offset.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/platforms/cell/iommu.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index bceb5e1..9682b63 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -496,9 +496,10 @@ static void cell_dma_dev_setup(struct device *dev)
 	struct cbe_iommu *iommu;
 	struct dev_archdata *archdata = &dev->archdata;
 
-	/* If we run without iommu, no need to do anything */
-	if (get_pci_dma_ops() == &dma_direct_ops)
+	if (get_pci_dma_ops() == &dma_direct_ops) {
+		archdata->dma_data = (void *)dma_direct_offset;
 		return;
+	}
 
 	/* Current implementation uses the first window available in that
 	 * node's iommu. We -might- do something smarter later though it may
@@ -690,6 +691,9 @@ static int __init cell_iommu_init_disabled(void)
 
 	dma_direct_offset += base;
 
+	if (dma_direct_offset != 0)
+		ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
+
 	printk("iommu: disabled, direct DMA offset is 0x%lx\n",
 	       dma_direct_offset);
 
-- 
1.5.2.rc1.1884.g59b20

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-01-21  6:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21  5:42 [PATCH 1/7] Set archdata.dma_data for direct DMA in cell_dma_dev_setup() Michael Ellerman
2008-01-21  5:42 ` [PATCH 2/7] Add celleb_dma_dev_setup() Michael Ellerman
2008-01-21  6:20   ` Benjamin Herrenschmidt
2008-01-21  5:42 ` [PATCH 3/7] Use archdata.dma_data in dma_direct_ops and add the offset Michael Ellerman
2008-01-21  6:21   ` Benjamin Herrenschmidt
2008-01-21  5:42 ` [PATCH 4/7] Have cell use its own dma_direct_offset variable Michael Ellerman
2008-01-21  6:21   ` Benjamin Herrenschmidt
2008-01-21  6:21   ` Benjamin Herrenschmidt
2008-01-21  5:42 ` [PATCH 5/7] Have celleb " Michael Ellerman
2008-01-21  6:21   ` Benjamin Herrenschmidt
2008-01-21  5:42 ` [PATCH 6/7] Remove the global dma_direct_offset Michael Ellerman
2008-01-21  6:21   ` Benjamin Herrenschmidt
2008-01-21  5:42 ` [PATCH 7/7] Remove bogus comment in dma_direct_alloc_coherent() Michael Ellerman
2008-01-21  6:22   ` Benjamin Herrenschmidt
2008-01-21  6:20 ` [PATCH 1/7] Set archdata.dma_data for direct DMA in cell_dma_dev_setup() Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).