Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef __x8664_PCI_H |
2 | #define __x8664_PCI_H | |
3 | ||
1da177e4 LT |
4 | #include <asm/io.h> |
5 | ||
6 | #ifdef __KERNEL__ | |
7 | ||
8 | #include <linux/mm.h> /* for struct page */ | |
9 | ||
10 | /* Can be used to override the logic in pci_scan_bus for skipping | |
11 | already-configured bus numbers - to be used for buggy BIOSes | |
12 | or architectures with incomplete PCI setup by the loader */ | |
13 | ||
14 | #ifdef CONFIG_PCI | |
15 | extern unsigned int pcibios_assign_all_busses(void); | |
16 | #else | |
17 | #define pcibios_assign_all_busses() 0 | |
18 | #endif | |
19 | #define pcibios_scan_all_fns(a, b) 0 | |
20 | ||
1da177e4 | 21 | extern unsigned long pci_mem_start; |
2ba84684 | 22 | #define PCIBIOS_MIN_IO 0x1000 |
1da177e4 LT |
23 | #define PCIBIOS_MIN_MEM (pci_mem_start) |
24 | ||
2ba84684 LT |
25 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 |
26 | ||
1da177e4 LT |
27 | void pcibios_config_init(void); |
28 | struct pci_bus * pcibios_scan_root(int bus); | |
29 | extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); | |
30 | extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); | |
31 | ||
32 | void pcibios_set_master(struct pci_dev *dev); | |
c9c3e457 | 33 | void pcibios_penalize_isa_irq(int irq, int active); |
1da177e4 LT |
34 | struct irq_routing_table *pcibios_get_irq_routing_table(void); |
35 | int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | |
36 | ||
37 | #include <linux/types.h> | |
38 | #include <linux/slab.h> | |
39 | #include <asm/scatterlist.h> | |
40 | #include <linux/string.h> | |
41 | #include <asm/page.h> | |
42 | ||
0dc243ae | 43 | extern void pci_iommu_alloc(void); |
1da177e4 LT |
44 | extern int iommu_setup(char *opt); |
45 | ||
1da177e4 LT |
46 | /* The PCI address space does equal the physical memory |
47 | * address space. The networking and block device layers use | |
48 | * this boolean for bounce buffer decisions | |
49 | * | |
17a941d8 MBY |
50 | * On AMD64 it mostly equals, but we set it to zero if a hardware |
51 | * IOMMU (gart) of sotware IOMMU (swiotlb) is available. | |
1da177e4 | 52 | */ |
17a941d8 MBY |
53 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
54 | ||
e465058d | 55 | #if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU) |
1da177e4 | 56 | |
1da177e4 LT |
57 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ |
58 | dma_addr_t ADDR_NAME; | |
59 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | |
60 | __u32 LEN_NAME; | |
61 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | |
62 | ((PTR)->ADDR_NAME) | |
63 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | |
64 | (((PTR)->ADDR_NAME) = (VAL)) | |
65 | #define pci_unmap_len(PTR, LEN_NAME) \ | |
66 | ((PTR)->LEN_NAME) | |
67 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | |
68 | (((PTR)->LEN_NAME) = (VAL)) | |
69 | ||
70 | #else | |
71 | /* No IOMMU */ | |
72 | ||
1da177e4 LT |
73 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) |
74 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | |
75 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | |
76 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | |
77 | #define pci_unmap_len(PTR, LEN_NAME) (0) | |
78 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | |
79 | ||
80 | #endif | |
81 | ||
82 | #include <asm-generic/pci-dma-compat.h> | |
83 | ||
bb4a61b6 | 84 | #ifdef CONFIG_PCI |
e24c2d96 DM |
85 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, |
86 | enum pci_dma_burst_strategy *strat, | |
87 | unsigned long *strategy_parameter) | |
88 | { | |
89 | *strat = PCI_DMA_BURST_INFINITY; | |
90 | *strategy_parameter = ~0UL; | |
91 | } | |
bb4a61b6 | 92 | #endif |
e24c2d96 | 93 | |
1da177e4 LT |
94 | #define HAVE_PCI_MMAP |
95 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |
96 | enum pci_mmap_state mmap_state, int write_combine); | |
97 | ||
1da177e4 LT |
98 | #endif /* __KERNEL__ */ |
99 | ||
100 | /* generic pci stuff */ | |
101 | #ifdef CONFIG_PCI | |
102 | #include <asm-generic/pci.h> | |
103 | #endif | |
104 | ||
105 | #endif /* __x8664_PCI_H */ |