diff options
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index b3655aa88ddb..a6e6bc1b020f 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -507,17 +507,12 @@ static struct cbe_iommu *cell_iommu_for_node(int nid) | |||
507 | 507 | ||
508 | static unsigned long cell_dma_direct_offset; | 508 | static unsigned long cell_dma_direct_offset; |
509 | 509 | ||
510 | static void cell_dma_dev_setup(struct device *dev) | 510 | static void cell_dma_dev_setup_iommu(struct device *dev) |
511 | { | 511 | { |
512 | struct iommu_window *window; | 512 | struct iommu_window *window; |
513 | struct cbe_iommu *iommu; | 513 | struct cbe_iommu *iommu; |
514 | struct dev_archdata *archdata = &dev->archdata; | 514 | struct dev_archdata *archdata = &dev->archdata; |
515 | 515 | ||
516 | if (get_pci_dma_ops() == &dma_direct_ops) { | ||
517 | archdata->dma_data = (void *)cell_dma_direct_offset; | ||
518 | return; | ||
519 | } | ||
520 | |||
521 | /* Current implementation uses the first window available in that | 516 | /* Current implementation uses the first window available in that |
522 | * node's iommu. We -might- do something smarter later though it may | 517 | * node's iommu. We -might- do something smarter later though it may |
523 | * never be necessary | 518 | * never be necessary |
@@ -534,6 +529,18 @@ static void cell_dma_dev_setup(struct device *dev) | |||
534 | archdata->dma_data = &window->table; | 529 | archdata->dma_data = &window->table; |
535 | } | 530 | } |
536 | 531 | ||
532 | static void cell_dma_dev_setup(struct device *dev) | ||
533 | { | ||
534 | struct dev_archdata *archdata = &dev->archdata; | ||
535 | |||
536 | if (get_pci_dma_ops() == &dma_iommu_ops) | ||
537 | cell_dma_dev_setup_iommu(dev); | ||
538 | else if (get_pci_dma_ops() == &dma_direct_ops) | ||
539 | archdata->dma_data = (void *)cell_dma_direct_offset; | ||
540 | else | ||
541 | BUG(); | ||
542 | } | ||
543 | |||
537 | static void cell_pci_dma_dev_setup(struct pci_dev *dev) | 544 | static void cell_pci_dma_dev_setup(struct pci_dev *dev) |
538 | { | 545 | { |
539 | cell_dma_dev_setup(&dev->dev); | 546 | cell_dma_dev_setup(&dev->dev); |