1 #ifndef _ASM_IA64_PCI_H
2 #define _ASM_IA64_PCI_H
4 #include <linux/slab.h>
5 #include <linux/string.h>
6 #include <linux/types.h>
7 #include <linux/spinlock.h>
10 #include <asm/scatterlist.h>
13 * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
14 * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
17 #define pcibios_assign_all_busses() 0
19 #define PCIBIOS_MIN_IO 0x1000
20 #define PCIBIOS_MIN_MEM 0x10000000
22 void pcibios_config_init(void);
23 struct pci_bus *pcibios_scan_root(void *acpi_handle, int segment, int bus);
24 extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
25 extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
30 * The PCI address space does equal the physical memory address space.
31 * The networking and block device layers use this boolean for bounce
34 #define PCI_DMA_BUS_IS_PHYS (1)
37 pcibios_set_master (struct pci_dev *dev)
39 /* No special bus mastering setup handling */
43 pcibios_penalize_isa_irq (int irq)
45 /* We don't do dynamic PCI IRQ allocation */
49 * Dynamic DMA mapping API. See Documentation/DMA-mapping.txt for details.
51 #define pci_alloc_consistent platform_pci_alloc_consistent
52 #define pci_free_consistent platform_pci_free_consistent
53 #define pci_map_single platform_pci_map_single
54 #define pci_unmap_single platform_pci_unmap_single
55 #define pci_map_sg platform_pci_map_sg
56 #define pci_unmap_sg platform_pci_unmap_sg
57 #define pci_dma_sync_single platform_pci_dma_sync_single
58 #define pci_dma_sync_sg platform_pci_dma_sync_sg
59 #define pci_dma_supported platform_pci_dma_supported
61 /* pci_unmap_{single,page} is not a nop, thus... */
62 #define DECLARE_PCI_UNMAP_ADDR(addr_name) dma_addr_t addr_name;
63 #define DECLARE_PCI_UNMAP_LEN(len_name) __u32 len_name;
64 #define pci_unmap_addr(ptr, addr_name) ((ptr)->addr_name)
65 #define pci_unmap_addr_set(ptr, addr_name, val) (((ptr)->addr_name) = (val))
66 #define pci_unmap_len(ptr, len_name) ((ptr)->len_name)
67 #define pci_unmap_len_set(ptr, len_name, val) (((ptr)->len_name) = (val))
69 #define pci_map_page(dev,pg,off,size,dir) \
70 pci_map_single((dev), page_address(pg) + (off), (size), (dir))
71 #define pci_unmap_page(dev,dma_addr,size,dir) \
72 pci_unmap_single((dev), (dma_addr), (size), (dir))
74 /* The ia64 platform always supports 64-bit addressing. */
75 #define pci_dac_dma_supported(pci_dev, mask) (1)
77 #define pci_dac_page_to_dma(dev,pg,off,dir) ((dma_addr_t) page_to_bus(pg) + (off))
78 #define pci_dac_dma_to_page(dev,dma_addr) (virt_to_page(bus_to_virt(dma_addr)))
79 #define pci_dac_dma_to_offset(dev,dma_addr) ((dma_addr) & ~PAGE_MASK)
80 #define pci_dac_dma_sync_single(dev,dma_addr,len,dir) do { /* nothing */ } while (0)
82 /* Return the index of the PCI controller for device PDEV. */
83 #define pci_controller_num(PDEV) (0)
85 #define sg_dma_address(sg) ((sg)->dma_address)
86 #define sg_dma_len(sg) ((sg)->dma_length)
89 extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
90 enum pci_mmap_state mmap_state, int write_combine);
92 struct pci_controller {
102 #define PCI_CONTROLLER(dev) ((struct pci_controller *) dev->sysdata)
103 #define PCI_SEGMENT(dev) (PCI_CONTROLLER(dev)->segment)
105 #endif /* _ASM_IA64_PCI_H */