diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-01-21 00:42:45 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 06:52:54 -0500 |
commit | f5d67bd5ecd90cc03eb84f709ab83ccc05a37eee (patch) | |
tree | 9a87802c7cde50465be11023202c3abef2d8758c /arch | |
parent | 35e4a6e26d0c6bc7f32087db61f0fb3666531183 (diff) |
[POWERPC] Have cell use its own dma_direct_offset variable
Rather than using the global variable, have cell use its own variable
to store the direct DMA 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 | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 9682b63dfc78..7f45d59cdf2a 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -490,6 +490,8 @@ static struct cbe_iommu *cell_iommu_for_node(int nid) | |||
490 | return NULL; | 490 | return NULL; |
491 | } | 491 | } |
492 | 492 | ||
493 | static unsigned long cell_dma_direct_offset; | ||
494 | |||
493 | static void cell_dma_dev_setup(struct device *dev) | 495 | static void cell_dma_dev_setup(struct device *dev) |
494 | { | 496 | { |
495 | struct iommu_window *window; | 497 | struct iommu_window *window; |
@@ -497,7 +499,7 @@ static void cell_dma_dev_setup(struct device *dev) | |||
497 | struct dev_archdata *archdata = &dev->archdata; | 499 | struct dev_archdata *archdata = &dev->archdata; |
498 | 500 | ||
499 | if (get_pci_dma_ops() == &dma_direct_ops) { | 501 | if (get_pci_dma_ops() == &dma_direct_ops) { |
500 | archdata->dma_data = (void *)dma_direct_offset; | 502 | archdata->dma_data = (void *)cell_dma_direct_offset; |
501 | return; | 503 | return; |
502 | } | 504 | } |
503 | 505 | ||
@@ -655,7 +657,7 @@ static int __init cell_iommu_init_disabled(void) | |||
655 | 657 | ||
656 | /* If we have no Axon, we set up the spider DMA magic offset */ | 658 | /* If we have no Axon, we set up the spider DMA magic offset */ |
657 | if (of_find_node_by_name(NULL, "axon") == NULL) | 659 | if (of_find_node_by_name(NULL, "axon") == NULL) |
658 | dma_direct_offset = SPIDER_DMA_OFFSET; | 660 | cell_dma_direct_offset = SPIDER_DMA_OFFSET; |
659 | 661 | ||
660 | /* Now we need to check to see where the memory is mapped | 662 | /* Now we need to check to see where the memory is mapped |
661 | * in PCI space. We assume that all busses use the same dma | 663 | * in PCI space. We assume that all busses use the same dma |
@@ -689,13 +691,13 @@ static int __init cell_iommu_init_disabled(void) | |||
689 | return -ENODEV; | 691 | return -ENODEV; |
690 | } | 692 | } |
691 | 693 | ||
692 | dma_direct_offset += base; | 694 | cell_dma_direct_offset += base; |
693 | 695 | ||
694 | if (dma_direct_offset != 0) | 696 | if (cell_dma_direct_offset != 0) |
695 | ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; | 697 | ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; |
696 | 698 | ||
697 | printk("iommu: disabled, direct DMA offset is 0x%lx\n", | 699 | printk("iommu: disabled, direct DMA offset is 0x%lx\n", |
698 | dma_direct_offset); | 700 | cell_dma_direct_offset); |
699 | 701 | ||
700 | return 0; | 702 | return 0; |
701 | } | 703 | } |