pci-common.c (e6aa0f07cb5e81a7cbeaf3be6e2101234c2f0d30) pci-common.c (4fc665b88a79a45bae8bbf3a05563c27c7337c3d)
1/*
2 * Contains common pci routines for ALL ppc platform
3 * (based on pci_32.c and pci_64.c)
4 *
5 * Port for PPC64 David Engebretsen, IBM Corp.
6 * Contains common pci routines for ppc64 platform, pSeries and iSeries brands.
7 *
8 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM

--- 42 unchanged lines hidden (view full) ---

51static int global_phb_number; /* Global phb counter */
52
53/* ISA Memory physical address */
54resource_size_t isa_mem_base;
55
56/* Default PCI flags is 0 */
57unsigned int ppc_pci_flags;
58
1/*
2 * Contains common pci routines for ALL ppc platform
3 * (based on pci_32.c and pci_64.c)
4 *
5 * Port for PPC64 David Engebretsen, IBM Corp.
6 * Contains common pci routines for ppc64 platform, pSeries and iSeries brands.
7 *
8 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM

--- 42 unchanged lines hidden (view full) ---

51static int global_phb_number; /* Global phb counter */
52
53/* ISA Memory physical address */
54resource_size_t isa_mem_base;
55
56/* Default PCI flags is 0 */
57unsigned int ppc_pci_flags;
58
59static struct dma_mapping_ops *pci_dma_ops;
60
61void set_pci_dma_ops(struct dma_mapping_ops *dma_ops)
62{
63 pci_dma_ops = dma_ops;
64}
65
66struct dma_mapping_ops *get_pci_dma_ops(void)
67{
68 return pci_dma_ops;
69}
70EXPORT_SYMBOL(get_pci_dma_ops);
71
72int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
73{
74 return dma_set_mask(&dev->dev, mask);
75}
76
77int 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
59struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
60{
61 struct pci_controller *phb;
62
63 phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
64 if (phb == NULL)
65 return NULL;
66 spin_lock(&hose_spinlock);

--- 108 unchanged lines hidden (view full) ---

175
176}
177
178char __devinit *pcibios_setup(char *str)
179{
180 return str;
181}
182
87struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
88{
89 struct pci_controller *phb;
90
91 phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
92 if (phb == NULL)
93 return NULL;
94 spin_lock(&hose_spinlock);

--- 108 unchanged lines hidden (view full) ---

203
204}
205
206char __devinit *pcibios_setup(char *str)
207{
208 return str;
209}
210
211void __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}
229EXPORT_SYMBOL(pcibios_setup_new_device);
230
183/*
184 * 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
186 * openfirmware and sets it in the pci_dev and pci_config line.
187 */
188int pci_read_irq_line(struct pci_dev *pci_dev)
189{
190 struct of_irq oirq;

--- 987 unchanged lines hidden ---
231/*
232 * Reads the interrupt pin to determine if interrupt is use by card.
233 * If the interrupt is used, then gets the interrupt line from the
234 * openfirmware and sets it in the pci_dev and pci_config line.
235 */
236int pci_read_irq_line(struct pci_dev *pci_dev)
237{
238 struct of_irq oirq;

--- 987 unchanged lines hidden ---