aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r--arch/powerpc/kernel/pci_64.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 384d2752fe60..3b0f49ea4756 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -59,9 +59,6 @@ LIST_HEAD(hose_list);
59 59
60static struct dma_mapping_ops *pci_dma_ops; 60static struct dma_mapping_ops *pci_dma_ops;
61 61
62/* XXX kill that some day ... */
63int global_phb_number; /* Global phb counter */
64
65void set_pci_dma_ops(struct dma_mapping_ops *dma_ops) 62void set_pci_dma_ops(struct dma_mapping_ops *dma_ops)
66{ 63{
67 pci_dma_ops = dma_ops; 64 pci_dma_ops = dma_ops;
@@ -172,55 +169,6 @@ void pcibios_align_resource(void *data, struct resource *res,
172 res->start = start; 169 res->start = start;
173} 170}
174 171
175static DEFINE_SPINLOCK(hose_spinlock);
176
177/*
178 * pci_controller(phb) initialized common variables.
179 */
180static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
181{
182 memset(hose, 0, sizeof(struct pci_controller));
183
184 spin_lock(&hose_spinlock);
185 hose->global_number = global_phb_number++;
186 list_add_tail(&hose->list_node, &hose_list);
187 spin_unlock(&hose_spinlock);
188}
189
190struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
191{
192 struct pci_controller *phb;
193
194 if (mem_init_done)
195 phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
196 else
197 phb = alloc_bootmem(sizeof (struct pci_controller));
198 if (phb == NULL)
199 return NULL;
200 pci_setup_pci_controller(phb);
201 phb->arch_data = dev;
202 phb->is_dynamic = mem_init_done;
203 if (dev) {
204 int nid = of_node_to_nid(dev);
205
206 if (nid < 0 || !node_online(nid))
207 nid = -1;
208
209 PHB_SET_NODE(phb, nid);
210 }
211 return phb;
212}
213
214void pcibios_free_controller(struct pci_controller *phb)
215{
216 spin_lock(&hose_spinlock);
217 list_del(&phb->list_node);
218 spin_unlock(&hose_spinlock);
219
220 if (phb->is_dynamic)
221 kfree(phb);
222}
223
224void __devinit pcibios_claim_one_bus(struct pci_bus *b) 172void __devinit pcibios_claim_one_bus(struct pci_bus *b)
225{ 173{
226 struct pci_dev *dev; 174 struct pci_dev *dev;
@@ -957,20 +905,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
957} 905}
958EXPORT_SYMBOL(pcibios_fixup_bus); 906EXPORT_SYMBOL(pcibios_fixup_bus);
959 907
960struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
961{
962 if (!have_of)
963 return NULL;
964 while(node) {
965 struct pci_controller *hose, *tmp;
966 list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
967 if (hose->arch_data == node)
968 return hose;
969 node = node->parent;
970 }
971 return NULL;
972}
973
974unsigned long pci_address_to_pio(phys_addr_t address) 908unsigned long pci_address_to_pio(phys_addr_t address)
975{ 909{
976 struct pci_controller *hose, *tmp; 910 struct pci_controller *hose, *tmp;