0001
0002
0003
0004
0005
0006 #ifndef _ASM_PCI_H
0007 #define _ASM_PCI_H
0008
0009 #include <linux/mm.h>
0010
0011 #ifdef __KERNEL__
0012
0013
0014
0015
0016
0017
0018
0019 #include <linux/ioport.h>
0020 #include <linux/list.h>
0021 #include <linux/of.h>
0022
0023 #ifdef CONFIG_PCI_DRIVERS_LEGACY
0024
0025
0026
0027
0028
0029
0030 struct pci_controller {
0031 struct list_head list;
0032 struct pci_bus *bus;
0033 struct device_node *of_node;
0034
0035 struct pci_ops *pci_ops;
0036 struct resource *mem_resource;
0037 unsigned long mem_offset;
0038 struct resource *io_resource;
0039 unsigned long io_offset;
0040 unsigned long io_map_base;
0041
0042 #ifndef CONFIG_PCI_DOMAINS_GENERIC
0043 unsigned int index;
0044
0045
0046 unsigned int need_domain_info;
0047 #endif
0048
0049
0050
0051 int (*get_busno)(void);
0052 void (*set_busno)(int busno);
0053 };
0054
0055
0056
0057
0058 extern void register_pci_controller(struct pci_controller *hose);
0059
0060
0061
0062
0063 extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
0064
0065
0066 extern int pcibios_plat_dev_init(struct pci_dev *dev);
0067
0068 extern char * (*pcibios_plat_setup)(char *str);
0069
0070 #ifdef CONFIG_OF
0071
0072 extern void pci_load_of_ranges(struct pci_controller *hose,
0073 struct device_node *node);
0074 #else
0075 static inline void pci_load_of_ranges(struct pci_controller *hose,
0076 struct device_node *node) {}
0077 #endif
0078
0079 #ifdef CONFIG_PCI_DOMAINS_GENERIC
0080 static inline void set_pci_need_domain_info(struct pci_controller *hose,
0081 int need_domain_info)
0082 {
0083
0084 }
0085 #elif defined(CONFIG_PCI_DOMAINS)
0086 static inline void set_pci_need_domain_info(struct pci_controller *hose,
0087 int need_domain_info)
0088 {
0089 hose->need_domain_info = need_domain_info;
0090 }
0091 #endif
0092
0093 #endif
0094
0095
0096
0097
0098 static inline unsigned int pcibios_assign_all_busses(void)
0099 {
0100 return 1;
0101 }
0102
0103 extern unsigned long PCIBIOS_MIN_IO;
0104 extern unsigned long PCIBIOS_MIN_MEM;
0105
0106 #define PCIBIOS_MIN_CARDBUS_IO 0x4000
0107
0108 #define HAVE_PCI_MMAP
0109 #define ARCH_GENERIC_PCI_MMAP_RESOURCE
0110
0111
0112
0113
0114
0115
0116 #include <linux/types.h>
0117 #include <linux/slab.h>
0118 #include <linux/scatterlist.h>
0119 #include <linux/string.h>
0120 #include <asm/io.h>
0121
0122 #ifdef CONFIG_PCI_DOMAINS_GENERIC
0123 static inline int pci_proc_domain(struct pci_bus *bus)
0124 {
0125 return pci_domain_nr(bus);
0126 }
0127 #elif defined(CONFIG_PCI_DOMAINS)
0128 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
0129
0130 static inline int pci_proc_domain(struct pci_bus *bus)
0131 {
0132 struct pci_controller *hose = bus->sysdata;
0133 return hose->need_domain_info;
0134 }
0135 #endif
0136
0137 #endif
0138
0139
0140 extern int pcibios_plat_dev_init(struct pci_dev *dev);
0141
0142 #endif