diff options
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 26a067122a5..fc46fcac392 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -1159,6 +1159,26 @@ static int __init setup_iommu_fixed(char *str) | |||
1159 | } | 1159 | } |
1160 | __setup("iommu_fixed=", setup_iommu_fixed); | 1160 | __setup("iommu_fixed=", setup_iommu_fixed); |
1161 | 1161 | ||
1162 | static u64 cell_dma_get_required_mask(struct device *dev) | ||
1163 | { | ||
1164 | struct dma_map_ops *dma_ops; | ||
1165 | |||
1166 | if (!dev->dma_mask) | ||
1167 | return 0; | ||
1168 | |||
1169 | if (!iommu_fixed_disabled && | ||
1170 | cell_iommu_get_fixed_address(dev) != OF_BAD_ADDR) | ||
1171 | return DMA_BIT_MASK(64); | ||
1172 | |||
1173 | dma_ops = get_dma_ops(dev); | ||
1174 | if (dma_ops->get_required_mask) | ||
1175 | return dma_ops->get_required_mask(dev); | ||
1176 | |||
1177 | WARN_ONCE(1, "no get_required_mask in %p ops", dma_ops); | ||
1178 | |||
1179 | return DMA_BIT_MASK(64); | ||
1180 | } | ||
1181 | |||
1162 | static int __init cell_iommu_init(void) | 1182 | static int __init cell_iommu_init(void) |
1163 | { | 1183 | { |
1164 | struct device_node *np; | 1184 | struct device_node *np; |
@@ -1175,6 +1195,7 @@ static int __init cell_iommu_init(void) | |||
1175 | 1195 | ||
1176 | /* Setup various ppc_md. callbacks */ | 1196 | /* Setup various ppc_md. callbacks */ |
1177 | ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; | 1197 | ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; |
1198 | ppc_md.dma_get_required_mask = cell_dma_get_required_mask; | ||
1178 | ppc_md.tce_build = tce_build_cell; | 1199 | ppc_md.tce_build = tce_build_cell; |
1179 | ppc_md.tce_free = tce_free_cell; | 1200 | ppc_md.tce_free = tce_free_cell; |
1180 | 1201 | ||