Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver...
[linux-2.6/verdex.git] / include / asm-sh64 / pci.h
blob8cc14e139750d7833b00b134c4f03b1bfb7ffe62
1 #ifndef __ASM_SH64_PCI_H
2 #define __ASM_SH64_PCI_H
4 #ifdef __KERNEL__
6 #include <linux/dma-mapping.h>
8 /* Can be used to override the logic in pci_scan_bus for skipping
9 already-configured bus numbers - to be used for buggy BIOSes
10 or architectures with incomplete PCI setup by the loader */
12 #define pcibios_assign_all_busses() 1
15 * These are currently the correct values for the STM overdrive board
16 * We need some way of setting this on a board specific way, it will
17 * not be the same on other boards I think
19 #if defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
20 #define PCIBIOS_MIN_IO 0x2000
21 #define PCIBIOS_MIN_MEM 0x40000000
22 #endif
24 extern void pcibios_set_master(struct pci_dev *dev);
27 * Set penalize isa irq function
29 static inline void pcibios_penalize_isa_irq(int irq)
31 /* We don't do dynamic PCI IRQ allocation */
34 /* Dynamic DMA mapping stuff.
35 * SuperH has everything mapped statically like x86.
38 /* The PCI address space does equal the physical memory
39 * address space. The networking and block device layers use
40 * this boolean for bounce buffer decisions.
42 #define PCI_DMA_BUS_IS_PHYS (1)
44 #include <linux/types.h>
45 #include <linux/slab.h>
46 #include <asm/scatterlist.h>
47 #include <linux/string.h>
48 #include <asm/io.h>
50 /* pci_unmap_{single,page} being a nop depends upon the
51 * configuration.
53 #ifdef CONFIG_SH_PCIDMA_NONCOHERENT
54 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
55 dma_addr_t ADDR_NAME;
56 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
57 __u32 LEN_NAME;
58 #define pci_unmap_addr(PTR, ADDR_NAME) \
59 ((PTR)->ADDR_NAME)
60 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
61 (((PTR)->ADDR_NAME) = (VAL))
62 #define pci_unmap_len(PTR, LEN_NAME) \
63 ((PTR)->LEN_NAME)
64 #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
65 (((PTR)->LEN_NAME) = (VAL))
66 #else
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)
73 #endif
75 /* Not supporting more than 32-bit PCI bus addresses now, but
76 * must satisfy references to this function. Change if needed.
78 #define pci_dac_dma_supported(pci_dev, mask) (0)
80 /* These macros should be used after a pci_map_sg call has been done
81 * to get bus addresses of each of the SG entries and their lengths.
82 * You should only work with the number of sg entries pci_map_sg
83 * returns, or alternatively stop on the first sg_dma_len(sg) which
84 * is 0.
86 #define sg_dma_address(sg) ((sg)->dma_address)
87 #define sg_dma_len(sg) ((sg)->length)
89 /* Board-specific fixup routines. */
90 extern void pcibios_fixup(void);
91 extern void pcibios_fixup_irqs(void);
93 #ifdef CONFIG_PCI_AUTO
94 extern int pciauto_assign_resources(int busno, struct pci_channel *hose);
95 #endif
97 static inline void pcibios_add_platform_entries(struct pci_dev *dev)
101 #endif /* __KERNEL__ */
103 /* generic pci stuff */
104 #include <asm-generic/pci.h>
106 /* generic DMA-mapping stuff */
107 #include <asm-generic/pci-dma-compat.h>
109 #endif /* __ASM_SH64_PCI_H */