aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 03:43:28 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 03:43:28 -0400
commit959f85f8a3223c116bbe95dd8a9b207790b5d4d3 (patch)
treee7da9ccf292f860bfa0ff9cc8b2682cd1d6bad4d /include/asm-sh
parente108b2ca2349f510ce7d7f910eda89f71d710d84 (diff)
sh: Consolidated SH7751/SH7780 PCI support.
This cleans up quite a lot of the PCI mess that we currently have, and attempts to consolidate the duplication in the SH7780 and SH7751 PCI controllers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r--include/asm-sh/io.h5
-rw-r--r--include/asm-sh/pci.h35
2 files changed, 37 insertions, 3 deletions
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index 894e64b2d5f0..27dba653cbe7 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -209,6 +209,11 @@ static inline void ctrl_outl(unsigned int b, unsigned long addr)
209 *(volatile unsigned long*)addr = b; 209 *(volatile unsigned long*)addr = b;
210} 210}
211 211
212static inline void ctrl_delay(void)
213{
214 ctrl_inw(P2SEG);
215}
216
212#define IO_SPACE_LIMIT 0xffffffff 217#define IO_SPACE_LIMIT 0xffffffff
213 218
214/* 219/*
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index 18a109de0f2e..6ccc948fe216 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -32,6 +32,34 @@ extern struct pci_channel board_pci_channels[];
32#define PCIBIOS_MIN_IO board_pci_channels->io_resource->start 32#define PCIBIOS_MIN_IO board_pci_channels->io_resource->start
33#define PCIBIOS_MIN_MEM board_pci_channels->mem_resource->start 33#define PCIBIOS_MIN_MEM board_pci_channels->mem_resource->start
34 34
35/*
36 * I/O routine helpers
37 */
38#ifdef CONFIG_CPU_SUBTYPE_SH7780
39#define PCI_IO_AREA 0xFE400000
40#define PCI_IO_SIZE 0x00400000
41#else
42#define PCI_IO_AREA 0xFE240000
43#define PCI_IO_SIZE 0X00040000
44#endif
45
46#define PCI_MEM_SIZE 0x01000000
47
48#define SH4_PCIIOBR_MASK 0xFFFC0000
49#define pci_ioaddr(addr) (PCI_IO_AREA + (addr & ~SH4_PCIIOBR_MASK))
50
51#if defined(CONFIG_PCI)
52#define is_pci_ioaddr(port) \
53 (((port) >= PCIBIOS_MIN_IO) && \
54 ((port) < (PCIBIOS_MIN_IO + PCI_IO_SIZE)))
55#define is_pci_memaddr(port) \
56 (((port) >= PCIBIOS_MIN_MEM) && \
57 ((port) < (PCIBIOS_MIN_MEM + PCI_MEM_SIZE)))
58#else
59#define is_pci_ioaddr(port) (0)
60#define is_pci_memaddr(port) (0)
61#endif
62
35struct pci_dev; 63struct pci_dev;
36 64
37extern void pcibios_set_master(struct pci_dev *dev); 65extern void pcibios_set_master(struct pci_dev *dev);
@@ -98,11 +126,12 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
98#endif 126#endif
99 127
100/* Board-specific fixup routines. */ 128/* Board-specific fixup routines. */
101extern void pcibios_fixup(void); 129void pcibios_fixup(void);
102extern void pcibios_fixup_irqs(void); 130int pcibios_init_platform(void);
131int pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin);
103 132
104#ifdef CONFIG_PCI_AUTO 133#ifdef CONFIG_PCI_AUTO
105extern int pciauto_assign_resources(int busno, struct pci_channel *hose); 134int pciauto_assign_resources(int busno, struct pci_channel *hose);
106#endif 135#endif
107 136
108static inline void pcibios_add_platform_entries(struct pci_dev *dev) 137static inline void pcibios_add_platform_entries(struct pci_dev *dev)