pci-bridge.h (2e483528cebad089d0bb3f9aebb0ada22d968ffa) pci-bridge.h (98d9f30c820d509145757e6ecbc36013aa02f7bc)
1#ifndef _ASM_POWERPC_PCI_BRIDGE_H
2#define _ASM_POWERPC_PCI_BRIDGE_H
3#ifdef __KERNEL__
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

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

164 resource_size_t cfg_addr,
165 resource_size_t cfg_data, u32 flags);
166
167static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
168{
169 return bus->sysdata;
170}
171
1#ifndef _ASM_POWERPC_PCI_BRIDGE_H
2#define _ASM_POWERPC_PCI_BRIDGE_H
3#ifdef __KERNEL__
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

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

164 resource_size_t cfg_addr,
165 resource_size_t cfg_data, u32 flags);
166
167static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
168{
169 return bus->sysdata;
170}
171
172#ifndef CONFIG_PPC64
172static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
173{
174 return dev->dev.of_node;
175}
173
174static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
175{
176
177static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
178{
176 struct pci_controller *host;
177
178 if (bus->self)
179 return pci_device_to_OF_node(bus->self);
180 host = pci_bus_to_host(bus);
181 return host ? host->dn : NULL;
179 return bus->dev.of_node;
182}
183
180}
181
182#ifndef CONFIG_PPC64
183
184extern int pci_device_from_OF_node(struct device_node *node,
185 u8 *bus, u8 *devfn);
186extern void pci_create_OF_bus_map(void);
187
184static inline int isa_vaddr_is_ioport(void __iomem *address)
185{
186 /* No specific ISA handling on ppc32 at this stage, it
187 * all goes through PCI
188 */
189 return 0;
190}
191

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

218 int eeh_false_positives; /* # times this device reported #ff's */
219 u32 config_space[16]; /* saved PCI config space */
220#endif
221};
222
223/* Get the pointer to a device_node's pci_dn */
224#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
225
188static inline int isa_vaddr_is_ioport(void __iomem *address)
189{
190 /* No specific ISA handling on ppc32 at this stage, it
191 * all goes through PCI
192 */
193 return 0;
194}
195

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

222 int eeh_false_positives; /* # times this device reported #ff's */
223 u32 config_space[16]; /* saved PCI config space */
224#endif
225};
226
227/* Get the pointer to a device_node's pci_dn */
228#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
229
226extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
227extern void * update_dn_pci_info(struct device_node *dn, void *data);
228
230extern void * update_dn_pci_info(struct device_node *dn, void *data);
231
229/* Get a device_node from a pci_dev. This code must be fast except
230 * in the case where the sysdata is incorrect and needs to be fixed
231 * up (this will only happen once). */
232static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
233{
234 return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev);
235}
236
237static inline int pci_device_from_OF_node(struct device_node *np,
238 u8 *bus, u8 *devfn)
239{
240 if (!PCI_DN(np))
241 return -ENODEV;
242 *bus = PCI_DN(np)->busno;
243 *devfn = PCI_DN(np)->devfn;
244 return 0;
245}
246
232static inline int pci_device_from_OF_node(struct device_node *np,
233 u8 *bus, u8 *devfn)
234{
235 if (!PCI_DN(np))
236 return -ENODEV;
237 *bus = PCI_DN(np)->busno;
238 *devfn = PCI_DN(np)->devfn;
239 return 0;
240}
241
247static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
248{
249 if (bus->self)
250 return pci_device_to_OF_node(bus->self);
251 else
252 return bus->dev.of_node; /* Must be root bus (PHB) */
253}
254
255/** Find the bus corresponding to the indicated device node */
256extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
257
258/** Remove all of the PCI devices under this bus */
259extern void pcibios_remove_pci_devices(struct pci_bus *bus);
260
261/** Discover new pci devices under this bus, and add them */
262extern void pcibios_add_pci_devices(struct pci_bus *bus);

--- 46 unchanged lines hidden ---
242/** Find the bus corresponding to the indicated device node */
243extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
244
245/** Remove all of the PCI devices under this bus */
246extern void pcibios_remove_pci_devices(struct pci_bus *bus);
247
248/** Discover new pci devices under this bus, and add them */
249extern void pcibios_add_pci_devices(struct pci_bus *bus);

--- 46 unchanged lines hidden ---