diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-01-21 00:42:41 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 06:52:53 -0500 |
commit | 110f95c9f082709c5a28a64c00bae819916e8578 (patch) | |
tree | d3f4c888ddc4a7549c368a925364ade23b95b223 /arch | |
parent | 9d5f49283b85d925f17fa07af5e4879465e179d6 (diff) |
[POWERPC] Set archdata.dma_data for direct DMA in cell_dma_dev_setup()
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>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | 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 bceb5e13da5c..9682b63dfc78 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) | |||
496 | struct cbe_iommu *iommu; | 496 | struct cbe_iommu *iommu; |
497 | struct dev_archdata *archdata = &dev->archdata; | 497 | struct dev_archdata *archdata = &dev->archdata; |
498 | 498 | ||
499 | /* If we run without iommu, no need to do anything */ | 499 | if (get_pci_dma_ops() == &dma_direct_ops) { |
500 | if (get_pci_dma_ops() == &dma_direct_ops) | 500 | archdata->dma_data = (void *)dma_direct_offset; |
501 | return; | 501 | return; |
502 | } | ||
502 | 503 | ||
503 | /* Current implementation uses the first window available in that | 504 | /* Current implementation uses the first window available in that |
504 | * node's iommu. We -might- do something smarter later though it may | 505 | * node's iommu. We -might- do something smarter later though it may |
@@ -690,6 +691,9 @@ static int __init cell_iommu_init_disabled(void) | |||
690 | 691 | ||
691 | dma_direct_offset += base; | 692 | dma_direct_offset += base; |
692 | 693 | ||
694 | if (dma_direct_offset != 0) | ||
695 | ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; | ||
696 | |||
693 | printk("iommu: disabled, direct DMA offset is 0x%lx\n", | 697 | printk("iommu: disabled, direct DMA offset is 0x%lx\n", |
694 | dma_direct_offset); | 698 | dma_direct_offset); |
695 | 699 | ||