X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-mips%2Fpci.h;h=987090e07a65fceb7e0bf71d379d65dd9f1f4518;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=1af4e5b600c6b354d50f1e54bdc540463eecc5a8;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 1af4e5b60..987090e07 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -11,6 +11,49 @@ #ifdef __KERNEL__ +/* + * This file essentially defines the interface between board + * specific PCI code and MIPS common PCI code. Should potentially put + * into include/asm/pci.h file. + */ + +#include + +/* + * Each pci channel is a top-level PCI bus seem by CPU. A machine with + * multiple PCI channels may have multiple PCI host controllers or a + * single controller supporting multiple channels. + */ +struct pci_controller { + struct pci_controller *next; + struct pci_bus *bus; + + struct pci_ops *pci_ops; + struct resource *mem_resource; + unsigned long mem_offset; + struct resource *io_resource; + unsigned long io_offset; + + unsigned int index; + /* For compatibility with current (as of July 2003) pciutils + and XFree86. Eventually will be removed. */ + unsigned int need_domain_info; + + int iommu; +}; + +/* + * Used by boards to register their PCI busses before the actual scanning. + */ +extern struct pci_controller * alloc_pci_controller(void); +extern void register_pci_controller(struct pci_controller *hose); + +/* + * board supplied pci irq fixup routine + */ +extern int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin); + + /* Can be used to override the logic in pci_scan_bus for skipping already-configured bus numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the loader */ @@ -90,6 +133,25 @@ extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, extern void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res); +#ifdef CONFIG_PCI_DOMAINS + +#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index + +static inline int +pci_name_bus(char *name, struct pci_bus *bus) +{ + struct pci_controller *hose = bus->sysdata; + + if (likely(hose->need_domain_info == 0)) { + sprintf(name, "%02x", bus->number); + } else { + sprintf(name, "%04x:%02x", hose->index, bus->number); + } + return 0; +} + +#endif /* CONFIG_PCI_DOMAINS */ + #endif /* __KERNEL__ */ /* implement the pci_ DMA API in terms of the generic device dma_ one */ @@ -99,4 +161,7 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) { } +/* Do platform specific device initialization at pci_enable_device() time */ +extern int pcibios_plat_dev_init(struct pci_dev *dev); + #endif /* _ASM_PCI_H */