MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / asm-mips / pci.h
blob1af4e5b600c6b354d50f1e54bdc540463eecc5a8
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 */
6 #ifndef _ASM_PCI_H
7 #define _ASM_PCI_H
9 #include <linux/config.h>
10 #include <linux/mm.h>
12 #ifdef __KERNEL__
14 /* Can be used to override the logic in pci_scan_bus for skipping
15 already-configured bus numbers - to be used for buggy BIOSes
16 or architectures with incomplete PCI setup by the loader */
18 extern unsigned int pcibios_assign_all_busses(void);
20 #define pcibios_scan_all_fns(a, b) 0
22 extern unsigned long PCIBIOS_MIN_IO;
23 extern unsigned long PCIBIOS_MIN_MEM;
25 #define PCIBIOS_MIN_CARDBUS_IO 0x4000
27 extern void pcibios_set_master(struct pci_dev *dev);
29 static inline void pcibios_penalize_isa_irq(int irq)
31 /* We don't do dynamic PCI IRQ allocation */
35 * Dynamic DMA mapping stuff.
36 * MIPS has everything mapped statically.
39 #include <linux/types.h>
40 #include <linux/slab.h>
41 #include <asm/scatterlist.h>
42 #include <linux/string.h>
43 #include <asm/io.h>
45 struct pci_dev;
48 * The PCI address space does equal the physical memory address space. The
49 * networking and block device layers use this boolean for bounce buffer
50 * decisions. This is set if any hose does not have an IOMMU.
52 extern unsigned int PCI_DMA_BUS_IS_PHYS;
54 #ifdef CONFIG_MAPPED_DMA_IO
56 /* pci_unmap_{single,page} is not a nop, thus... */
57 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
58 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
59 #define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
60 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
61 #define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
62 #define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
64 #else /* CONFIG_MAPPED_DMA_IO */
66 /* pci_unmap_{page,single} is a nop so... */
67 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
68 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
69 #define pci_unmap_addr(PTR, ADDR_NAME) (0)
70 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
71 #define pci_unmap_len(PTR, LEN_NAME) (0)
72 #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
74 #endif /* CONFIG_MAPPED_DMA_IO */
76 /* This is always fine. */
77 #define pci_dac_dma_supported(pci_dev, mask) (1)
79 extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *pdev,
80 struct page *page, unsigned long offset, int direction);
81 extern struct page *pci_dac_dma_to_page(struct pci_dev *pdev,
82 dma64_addr_t dma_addr);
83 extern unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
84 dma64_addr_t dma_addr);
85 extern void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev,
86 dma64_addr_t dma_addr, size_t len, int direction);
87 extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
88 dma64_addr_t dma_addr, size_t len, int direction);
90 extern void pcibios_resource_to_bus(struct pci_dev *dev,
91 struct pci_bus_region *region, struct resource *res);
93 #endif /* __KERNEL__ */
95 /* implement the pci_ DMA API in terms of the generic device dma_ one */
96 #include <asm-generic/pci-dma-compat.h>
98 static inline void pcibios_add_platform_entries(struct pci_dev *dev)
102 #endif /* _ASM_PCI_H */