3c94af4617617cf6b162a88d594e903f0cf7f94a
[linux-flexiantxendom0-3.2.10.git] / include / asm-ia64 / pci.h
1 #ifndef _ASM_IA64_PCI_H
2 #define _ASM_IA64_PCI_H
3
4 #include <linux/mm.h>
5 #include <linux/slab.h>
6 #include <linux/spinlock.h>
7 #include <linux/string.h>
8 #include <linux/types.h>
9
10 #include <asm/io.h>
11 #include <asm/scatterlist.h>
12
13 /*
14  * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
15  * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
16  * loader.
17  */
18 #define pcibios_assign_all_busses()     0
19
20 #define PCIBIOS_MIN_IO          0x1000
21 #define PCIBIOS_MIN_MEM         0x10000000
22
23 void pcibios_config_init(void);
24 struct pci_bus * pcibios_scan_root(void *acpi_handle, int segment, int bus);
25
26 struct pci_dev;
27
28 /*
29  * The PCI address space does equal the physical memory address space.
30  * The networking and block device layers use this boolean for bounce
31  * buffer decisions.
32  */
33 #define PCI_DMA_BUS_IS_PHYS     (1)
34
35 static inline void
36 pcibios_set_master (struct pci_dev *dev)
37 {
38         /* No special bus mastering setup handling */
39 }
40
41 static inline void
42 pcibios_penalize_isa_irq (int irq)
43 {
44         /* We don't do dynamic PCI IRQ allocation */
45 }
46
47 #define HAVE_ARCH_PCI_MWI 1
48 extern int pcibios_prep_mwi (struct pci_dev *);
49
50 #include <asm-generic/pci-dma-compat.h>
51
52 /* pci_unmap_{single,page} is not a nop, thus... */
53 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)       \
54         dma_addr_t ADDR_NAME;
55 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)         \
56         __u32 LEN_NAME;
57 #define pci_unmap_addr(PTR, ADDR_NAME)                  \
58         ((PTR)->ADDR_NAME)
59 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)         \
60         (((PTR)->ADDR_NAME) = (VAL))
61 #define pci_unmap_len(PTR, LEN_NAME)                    \
62         ((PTR)->LEN_NAME)
63 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)           \
64         (((PTR)->LEN_NAME) = (VAL))
65
66 /* The ia64 platform always supports 64-bit addressing. */
67 #define pci_dac_dma_supported(pci_dev, mask)            (1)
68 #define pci_dac_page_to_dma(dev,pg,off,dir)             ((dma_addr_t) page_to_bus(pg) + (off))
69 #define pci_dac_dma_to_page(dev,dma_addr)               (virt_to_page(bus_to_virt(dma_addr)))
70 #define pci_dac_dma_to_offset(dev,dma_addr)             ((dma_addr) & ~PAGE_MASK)
71 #define pci_dac_dma_sync_single(dev,dma_addr,len,dir)   do { mb(); } while (0)
72
73 /* Return the index of the PCI controller for device PDEV. */
74 #define pci_controller_num(PDEV)        (0)
75
76 #define sg_dma_len(sg)          ((sg)->dma_length)
77 #define sg_dma_address(sg)      ((sg)->dma_address)
78
79 #define HAVE_PCI_MMAP
80 extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
81                                 enum pci_mmap_state mmap_state, int write_combine);
82
83 struct pci_window {
84         struct resource resource;
85         u64 offset;
86 };
87
88 struct pci_controller {
89         void *acpi_handle;
90         void *iommu;
91         int segment;
92
93         unsigned int windows;
94         struct pci_window *window;
95 };
96
97 #define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
98 #define PCI_SEGMENT(busdev)    (PCI_CONTROLLER(busdev)->segment)
99
100 /* generic pci stuff */
101 #include <asm-generic/pci.h>
102
103 #endif /* _ASM_IA64_PCI_H */