diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/pci.h | 90 | ||||
-rw-r--r-- | include/asm-x86/pci_32.h | 58 | ||||
-rw-r--r-- | include/asm-x86/pci_64.h | 56 |
3 files changed, 90 insertions, 114 deletions
diff --git a/include/asm-x86/pci.h b/include/asm-x86/pci.h index a8cac8c2cde7..e88361966347 100644 --- a/include/asm-x86/pci.h +++ b/include/asm-x86/pci.h | |||
@@ -1,5 +1,95 @@ | |||
1 | #ifndef __x86_PCI_H | ||
2 | #define __x86_PCI_H | ||
3 | |||
4 | #include <linux/mm.h> /* for struct page */ | ||
5 | #include <linux/types.h> | ||
6 | #include <linux/slab.h> | ||
7 | #include <linux/string.h> | ||
8 | #include <asm/scatterlist.h> | ||
9 | #include <asm/io.h> | ||
10 | |||
11 | |||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | struct pci_sysdata { | ||
15 | int domain; /* PCI domain */ | ||
16 | int node; /* NUMA node */ | ||
17 | #ifdef CONFIG_X86_64 | ||
18 | void* iommu; /* IOMMU private data */ | ||
19 | #endif | ||
20 | }; | ||
21 | |||
22 | /* scan a bus after allocating a pci_sysdata for it */ | ||
23 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); | ||
24 | |||
25 | static inline int pci_domain_nr(struct pci_bus *bus) | ||
26 | { | ||
27 | struct pci_sysdata *sd = bus->sysdata; | ||
28 | return sd->domain; | ||
29 | } | ||
30 | |||
31 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
32 | { | ||
33 | return pci_domain_nr(bus); | ||
34 | } | ||
35 | |||
36 | |||
37 | /* Can be used to override the logic in pci_scan_bus for skipping | ||
38 | already-configured bus numbers - to be used for buggy BIOSes | ||
39 | or architectures with incomplete PCI setup by the loader */ | ||
40 | |||
41 | #ifdef CONFIG_PCI | ||
42 | extern unsigned int pcibios_assign_all_busses(void); | ||
43 | #else | ||
44 | #define pcibios_assign_all_busses() 0 | ||
45 | #endif | ||
46 | #define pcibios_scan_all_fns(a, b) 0 | ||
47 | |||
48 | extern unsigned long pci_mem_start; | ||
49 | #define PCIBIOS_MIN_IO 0x1000 | ||
50 | #define PCIBIOS_MIN_MEM (pci_mem_start) | ||
51 | |||
52 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 | ||
53 | |||
54 | void pcibios_config_init(void); | ||
55 | struct pci_bus * pcibios_scan_root(int bus); | ||
56 | |||
57 | void pcibios_set_master(struct pci_dev *dev); | ||
58 | void pcibios_penalize_isa_irq(int irq, int active); | ||
59 | struct irq_routing_table *pcibios_get_irq_routing_table(void); | ||
60 | int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | ||
61 | |||
62 | |||
63 | #define HAVE_PCI_MMAP | ||
64 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
65 | enum pci_mmap_state mmap_state, int write_combine); | ||
66 | |||
67 | |||
68 | #ifdef CONFIG_PCI | ||
69 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
70 | enum pci_dma_burst_strategy *strat, | ||
71 | unsigned long *strategy_parameter) | ||
72 | { | ||
73 | *strat = PCI_DMA_BURST_INFINITY; | ||
74 | *strategy_parameter = ~0UL; | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | |||
79 | #endif /* __KERNEL__ */ | ||
80 | |||
1 | #ifdef CONFIG_X86_32 | 81 | #ifdef CONFIG_X86_32 |
2 | # include "pci_32.h" | 82 | # include "pci_32.h" |
3 | #else | 83 | #else |
4 | # include "pci_64.h" | 84 | # include "pci_64.h" |
5 | #endif | 85 | #endif |
86 | |||
87 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ | ||
88 | #include <asm-generic/pci-dma-compat.h> | ||
89 | |||
90 | /* generic pci stuff */ | ||
91 | #include <asm-generic/pci.h> | ||
92 | |||
93 | |||
94 | |||
95 | #endif | ||
diff --git a/include/asm-x86/pci_32.h b/include/asm-x86/pci_32.h index 4fcacc711385..8c4c3a0368e2 100644 --- a/include/asm-x86/pci_32.h +++ b/include/asm-x86/pci_32.h | |||
@@ -4,50 +4,11 @@ | |||
4 | 4 | ||
5 | #ifdef __KERNEL__ | 5 | #ifdef __KERNEL__ |
6 | 6 | ||
7 | struct pci_sysdata { | ||
8 | int node; /* NUMA node */ | ||
9 | }; | ||
10 | |||
11 | /* scan a bus after allocating a pci_sysdata for it */ | ||
12 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); | ||
13 | |||
14 | #include <linux/mm.h> /* for struct page */ | ||
15 | |||
16 | /* Can be used to override the logic in pci_scan_bus for skipping | ||
17 | already-configured bus numbers - to be used for buggy BIOSes | ||
18 | or architectures with incomplete PCI setup by the loader */ | ||
19 | |||
20 | #ifdef CONFIG_PCI | ||
21 | extern unsigned int pcibios_assign_all_busses(void); | ||
22 | #else | ||
23 | #define pcibios_assign_all_busses() 0 | ||
24 | #endif | ||
25 | #define pcibios_scan_all_fns(a, b) 0 | ||
26 | |||
27 | extern unsigned long pci_mem_start; | ||
28 | #define PCIBIOS_MIN_IO 0x1000 | ||
29 | #define PCIBIOS_MIN_MEM (pci_mem_start) | ||
30 | |||
31 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 | ||
32 | |||
33 | void pcibios_config_init(void); | ||
34 | struct pci_bus * pcibios_scan_root(int bus); | ||
35 | |||
36 | void pcibios_set_master(struct pci_dev *dev); | ||
37 | void pcibios_penalize_isa_irq(int irq, int active); | ||
38 | struct irq_routing_table *pcibios_get_irq_routing_table(void); | ||
39 | int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | ||
40 | 7 | ||
41 | /* Dynamic DMA mapping stuff. | 8 | /* Dynamic DMA mapping stuff. |
42 | * i386 has everything mapped statically. | 9 | * i386 has everything mapped statically. |
43 | */ | 10 | */ |
44 | 11 | ||
45 | #include <linux/types.h> | ||
46 | #include <linux/slab.h> | ||
47 | #include <asm/scatterlist.h> | ||
48 | #include <linux/string.h> | ||
49 | #include <asm/io.h> | ||
50 | |||
51 | struct pci_dev; | 12 | struct pci_dev; |
52 | 13 | ||
53 | /* The PCI address space does equal the physical memory | 14 | /* The PCI address space does equal the physical memory |
@@ -64,27 +25,8 @@ struct pci_dev; | |||
64 | #define pci_unmap_len(PTR, LEN_NAME) (0) | 25 | #define pci_unmap_len(PTR, LEN_NAME) (0) |
65 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | 26 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) |
66 | 27 | ||
67 | #define HAVE_PCI_MMAP | ||
68 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
69 | enum pci_mmap_state mmap_state, int write_combine); | ||
70 | |||
71 | |||
72 | #ifdef CONFIG_PCI | ||
73 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
74 | enum pci_dma_burst_strategy *strat, | ||
75 | unsigned long *strategy_parameter) | ||
76 | { | ||
77 | *strat = PCI_DMA_BURST_INFINITY; | ||
78 | *strategy_parameter = ~0UL; | ||
79 | } | ||
80 | #endif | ||
81 | 28 | ||
82 | #endif /* __KERNEL__ */ | 29 | #endif /* __KERNEL__ */ |
83 | 30 | ||
84 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ | ||
85 | #include <asm-generic/pci-dma-compat.h> | ||
86 | |||
87 | /* generic pci stuff */ | ||
88 | #include <asm-generic/pci.h> | ||
89 | 31 | ||
90 | #endif /* __i386_PCI_H */ | 32 | #endif /* __i386_PCI_H */ |
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h index 5da8cb0c0599..9baa46d9f594 100644 --- a/include/asm-x86/pci_64.h +++ b/include/asm-x86/pci_64.h | |||
@@ -1,16 +1,9 @@ | |||
1 | #ifndef __x8664_PCI_H | 1 | #ifndef __x8664_PCI_H |
2 | #define __x8664_PCI_H | 2 | #define __x8664_PCI_H |
3 | 3 | ||
4 | #include <asm/io.h> | ||
5 | 4 | ||
6 | #ifdef __KERNEL__ | 5 | #ifdef __KERNEL__ |
7 | 6 | ||
8 | struct pci_sysdata { | ||
9 | int node; /* NUMA node */ | ||
10 | void* iommu; /* IOMMU private data */ | ||
11 | }; | ||
12 | |||
13 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); | ||
14 | 7 | ||
15 | #ifdef CONFIG_CALGARY_IOMMU | 8 | #ifdef CONFIG_CALGARY_IOMMU |
16 | static inline void* pci_iommu(struct pci_bus *bus) | 9 | static inline void* pci_iommu(struct pci_bus *bus) |
@@ -26,40 +19,11 @@ static inline void set_pci_iommu(struct pci_bus *bus, void *val) | |||
26 | } | 19 | } |
27 | #endif /* CONFIG_CALGARY_IOMMU */ | 20 | #endif /* CONFIG_CALGARY_IOMMU */ |
28 | 21 | ||
29 | #include <linux/mm.h> /* for struct page */ | ||
30 | |||
31 | /* Can be used to override the logic in pci_scan_bus for skipping | ||
32 | already-configured bus numbers - to be used for buggy BIOSes | ||
33 | or architectures with incomplete PCI setup by the loader */ | ||
34 | |||
35 | #ifdef CONFIG_PCI | ||
36 | extern unsigned int pcibios_assign_all_busses(void); | ||
37 | #else | ||
38 | #define pcibios_assign_all_busses() 0 | ||
39 | #endif | ||
40 | #define pcibios_scan_all_fns(a, b) 0 | ||
41 | |||
42 | extern unsigned long pci_mem_start; | ||
43 | #define PCIBIOS_MIN_IO 0x1000 | ||
44 | #define PCIBIOS_MIN_MEM (pci_mem_start) | ||
45 | |||
46 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 | ||
47 | 22 | ||
48 | void pcibios_config_init(void); | ||
49 | struct pci_bus * pcibios_scan_root(int bus); | ||
50 | extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); | 23 | extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); |
51 | extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); | 24 | extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); |
52 | 25 | ||
53 | void pcibios_set_master(struct pci_dev *dev); | ||
54 | void pcibios_penalize_isa_irq(int irq, int active); | ||
55 | struct irq_routing_table *pcibios_get_irq_routing_table(void); | ||
56 | int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | ||
57 | 26 | ||
58 | #include <linux/types.h> | ||
59 | #include <linux/slab.h> | ||
60 | #include <asm/scatterlist.h> | ||
61 | #include <linux/string.h> | ||
62 | #include <asm/page.h> | ||
63 | 27 | ||
64 | extern void pci_iommu_alloc(void); | 28 | extern void pci_iommu_alloc(void); |
65 | extern int iommu_setup(char *opt); | 29 | extern int iommu_setup(char *opt); |
@@ -100,27 +64,7 @@ extern int iommu_setup(char *opt); | |||
100 | 64 | ||
101 | #endif | 65 | #endif |
102 | 66 | ||
103 | #include <asm-generic/pci-dma-compat.h> | ||
104 | |||
105 | #ifdef CONFIG_PCI | ||
106 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
107 | enum pci_dma_burst_strategy *strat, | ||
108 | unsigned long *strategy_parameter) | ||
109 | { | ||
110 | *strat = PCI_DMA_BURST_INFINITY; | ||
111 | *strategy_parameter = ~0UL; | ||
112 | } | ||
113 | #endif | ||
114 | |||
115 | #define HAVE_PCI_MMAP | ||
116 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
117 | enum pci_mmap_state mmap_state, int write_combine); | ||
118 | |||
119 | #endif /* __KERNEL__ */ | 67 | #endif /* __KERNEL__ */ |
120 | 68 | ||
121 | /* generic pci stuff */ | ||
122 | #ifdef CONFIG_PCI | ||
123 | #include <asm-generic/pci.h> | ||
124 | #endif | ||
125 | 69 | ||
126 | #endif /* __x8664_PCI_H */ | 70 | #endif /* __x8664_PCI_H */ |