diff options
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index ea0c61e09b76..52ccfed416ad 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -56,6 +56,34 @@ resource_size_t isa_mem_base; | |||
56 | /* Default PCI flags is 0 */ | 56 | /* Default PCI flags is 0 */ |
57 | unsigned int ppc_pci_flags; | 57 | unsigned int ppc_pci_flags; |
58 | 58 | ||
59 | static struct dma_mapping_ops *pci_dma_ops; | ||
60 | |||
61 | void set_pci_dma_ops(struct dma_mapping_ops *dma_ops) | ||
62 | { | ||
63 | pci_dma_ops = dma_ops; | ||
64 | } | ||
65 | |||
66 | struct dma_mapping_ops *get_pci_dma_ops(void) | ||
67 | { | ||
68 | return pci_dma_ops; | ||
69 | } | ||
70 | EXPORT_SYMBOL(get_pci_dma_ops); | ||
71 | |||
72 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | ||
73 | { | ||
74 | return dma_set_mask(&dev->dev, mask); | ||
75 | } | ||
76 | |||
77 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | ||
78 | { | ||
79 | int rc; | ||
80 | |||
81 | rc = dma_set_mask(&dev->dev, mask); | ||
82 | dev->dev.coherent_dma_mask = dev->dma_mask; | ||
83 | |||
84 | return rc; | ||
85 | } | ||
86 | |||
59 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) | 87 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) |
60 | { | 88 | { |
61 | struct pci_controller *phb; | 89 | struct pci_controller *phb; |
@@ -180,6 +208,26 @@ char __devinit *pcibios_setup(char *str) | |||
180 | return str; | 208 | return str; |
181 | } | 209 | } |
182 | 210 | ||
211 | void __devinit pcibios_setup_new_device(struct pci_dev *dev) | ||
212 | { | ||
213 | struct dev_archdata *sd = &dev->dev.archdata; | ||
214 | |||
215 | sd->of_node = pci_device_to_OF_node(dev); | ||
216 | |||
217 | DBG("PCI: device %s OF node: %s\n", pci_name(dev), | ||
218 | sd->of_node ? sd->of_node->full_name : "<none>"); | ||
219 | |||
220 | sd->dma_ops = pci_dma_ops; | ||
221 | #ifdef CONFIG_PPC32 | ||
222 | sd->dma_data = (void *)PCI_DRAM_OFFSET; | ||
223 | #endif | ||
224 | set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); | ||
225 | |||
226 | if (ppc_md.pci_dma_dev_setup) | ||
227 | ppc_md.pci_dma_dev_setup(dev); | ||
228 | } | ||
229 | EXPORT_SYMBOL(pcibios_setup_new_device); | ||
230 | |||
183 | /* | 231 | /* |
184 | * Reads the interrupt pin to determine if interrupt is use by card. | 232 | * Reads the interrupt pin to determine if interrupt is use by card. |
185 | * If the interrupt is used, then gets the interrupt line from the | 233 | * If the interrupt is used, then gets the interrupt line from the |