diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/celleb/iommu.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c index 41e1e6f8e059..843a66f422bb 100644 --- a/arch/powerpc/platforms/celleb/iommu.c +++ b/arch/powerpc/platforms/celleb/iommu.c | |||
@@ -72,6 +72,17 @@ static void __init celleb_init_direct_mapping(void) | |||
72 | dma_direct_offset = dma_base; | 72 | dma_direct_offset = dma_base; |
73 | } | 73 | } |
74 | 74 | ||
75 | static void celleb_dma_dev_setup(struct device *dev) | ||
76 | { | ||
77 | dev->archdata.dma_ops = get_pci_dma_ops(); | ||
78 | dev->archdata.dma_data = (void *)dma_direct_offset; | ||
79 | } | ||
80 | |||
81 | static void celleb_pci_dma_dev_setup(struct pci_dev *pdev) | ||
82 | { | ||
83 | celleb_dma_dev_setup(&pdev->dev); | ||
84 | } | ||
85 | |||
75 | static int celleb_of_bus_notify(struct notifier_block *nb, | 86 | static int celleb_of_bus_notify(struct notifier_block *nb, |
76 | unsigned long action, void *data) | 87 | unsigned long action, void *data) |
77 | { | 88 | { |
@@ -81,7 +92,7 @@ static int celleb_of_bus_notify(struct notifier_block *nb, | |||
81 | if (action != BUS_NOTIFY_ADD_DEVICE) | 92 | if (action != BUS_NOTIFY_ADD_DEVICE) |
82 | return 0; | 93 | return 0; |
83 | 94 | ||
84 | dev->archdata.dma_ops = get_pci_dma_ops(); | 95 | celleb_dma_dev_setup(dev); |
85 | 96 | ||
86 | return 0; | 97 | return 0; |
87 | } | 98 | } |
@@ -94,6 +105,7 @@ static int __init celleb_init_iommu(void) | |||
94 | { | 105 | { |
95 | celleb_init_direct_mapping(); | 106 | celleb_init_direct_mapping(); |
96 | set_pci_dma_ops(&dma_direct_ops); | 107 | set_pci_dma_ops(&dma_direct_ops); |
108 | ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup; | ||
97 | bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier); | 109 | bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier); |
98 | 110 | ||
99 | return 0; | 111 | return 0; |