aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@linux-m68k.org>2018-03-25 08:50:00 -0400
committerGreg Ungerer <gerg@linux-m68k.org>2018-05-27 19:45:26 -0400
commitde25cfcb6404a0370067bbadaf13122f15464459 (patch)
treed9431de4bb9f21cce125daea8fb40ddac303ce78
parentdfbc5cb39928c872c299f4718674e3f1215b07ae (diff)
m68k: remove old ColdFire IO access support code
All the ColdFire IO access support code has been moved to io_no.h. This means that all ColdFire support is at least now consistent no matter whether the MMU is enabled or not for them. Now that io_mm.h has reverted to only support the traditional m68k MMU enabled processors we can remove the ColdFire specific definitions. We can also remove the old ColdFire PCI bus IO access functions. The new io_no.h uses asm-generic/io.h to provide all the basic support. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org> Reviewed-by: Angelo Dureghello <angelo@sysam.it> Tested-by: Angelo Dureghello <angelo@sysam.it>
-rw-r--r--arch/m68k/coldfire/pci.c99
-rw-r--r--arch/m68k/include/asm/io_mm.h51
2 files changed, 5 insertions, 145 deletions
diff --git a/arch/m68k/coldfire/pci.c b/arch/m68k/coldfire/pci.c
index 3097fa2ca746..db709ad30f88 100644
--- a/arch/m68k/coldfire/pci.c
+++ b/arch/m68k/coldfire/pci.c
@@ -23,20 +23,10 @@
23 23
24/* 24/*
25 * Memory and IO mappings. We use a 1:1 mapping for local host memory to 25 * Memory and IO mappings. We use a 1:1 mapping for local host memory to
26 * PCI bus memory (no reason not to really). IO space doesn't matter, we 26 * PCI bus memory (no reason not to really). IO space is mapped in its own
27 * always use access functions for that. The device configuration space is 27 * separate address region. The device configuration space is mapped over
28 * mapped over the IO map space when we enable it in the PCICAR register. 28 * the IO map space when we enable it in the PCICAR register.
29 */ 29 */
30#define PCI_MEM_PA 0xf0000000 /* Host physical address */
31#define PCI_MEM_BA 0xf0000000 /* Bus physical address */
32#define PCI_MEM_SIZE 0x08000000 /* 128 MB */
33#define PCI_MEM_MASK (PCI_MEM_SIZE - 1)
34
35#define PCI_IO_PA 0xf8000000 /* Host physical address */
36#define PCI_IO_BA 0x00000000 /* Bus physical address */
37#define PCI_IO_SIZE 0x00010000 /* 64k */
38#define PCI_IO_MASK (PCI_IO_SIZE - 1)
39
40static struct pci_bus *rootbus; 30static struct pci_bus *rootbus;
41static unsigned long iospace; 31static unsigned long iospace;
42 32
@@ -144,89 +134,6 @@ static struct pci_ops mcf_pci_ops = {
144}; 134};
145 135
146/* 136/*
147 * IO address space access functions. Pretty strait forward, these are
148 * directly mapped in to the IO mapping window. And that is mapped into
149 * virtual address space.
150 */
151u8 mcf_pci_inb(u32 addr)
152{
153 return __raw_readb(iospace + (addr & PCI_IO_MASK));
154}
155EXPORT_SYMBOL(mcf_pci_inb);
156
157u16 mcf_pci_inw(u32 addr)
158{
159 return le16_to_cpu(__raw_readw(iospace + (addr & PCI_IO_MASK)));
160}
161EXPORT_SYMBOL(mcf_pci_inw);
162
163u32 mcf_pci_inl(u32 addr)
164{
165 return le32_to_cpu(__raw_readl(iospace + (addr & PCI_IO_MASK)));
166}
167EXPORT_SYMBOL(mcf_pci_inl);
168
169void mcf_pci_insb(u32 addr, u8 *buf, u32 len)
170{
171 for (; len; len--)
172 *buf++ = mcf_pci_inb(addr);
173}
174EXPORT_SYMBOL(mcf_pci_insb);
175
176void mcf_pci_insw(u32 addr, u16 *buf, u32 len)
177{
178 for (; len; len--)
179 *buf++ = mcf_pci_inw(addr);
180}
181EXPORT_SYMBOL(mcf_pci_insw);
182
183void mcf_pci_insl(u32 addr, u32 *buf, u32 len)
184{
185 for (; len; len--)
186 *buf++ = mcf_pci_inl(addr);
187}
188EXPORT_SYMBOL(mcf_pci_insl);
189
190void mcf_pci_outb(u8 v, u32 addr)
191{
192 __raw_writeb(v, iospace + (addr & PCI_IO_MASK));
193}
194EXPORT_SYMBOL(mcf_pci_outb);
195
196void mcf_pci_outw(u16 v, u32 addr)
197{
198 __raw_writew(cpu_to_le16(v), iospace + (addr & PCI_IO_MASK));
199}
200EXPORT_SYMBOL(mcf_pci_outw);
201
202void mcf_pci_outl(u32 v, u32 addr)
203{
204 __raw_writel(cpu_to_le32(v), iospace + (addr & PCI_IO_MASK));
205}
206EXPORT_SYMBOL(mcf_pci_outl);
207
208void mcf_pci_outsb(u32 addr, const u8 *buf, u32 len)
209{
210 for (; len; len--)
211 mcf_pci_outb(*buf++, addr);
212}
213EXPORT_SYMBOL(mcf_pci_outsb);
214
215void mcf_pci_outsw(u32 addr, const u16 *buf, u32 len)
216{
217 for (; len; len--)
218 mcf_pci_outw(*buf++, addr);
219}
220EXPORT_SYMBOL(mcf_pci_outsw);
221
222void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len)
223{
224 for (; len; len--)
225 mcf_pci_outl(*buf++, addr);
226}
227EXPORT_SYMBOL(mcf_pci_outsl);
228
229/*
230 * Initialize the PCI bus registers, and scan the bus. 137 * Initialize the PCI bus registers, and scan the bus.
231 */ 138 */
232static struct resource mcf_pci_mem = { 139static struct resource mcf_pci_mem = {
diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h
index 21fba26f57f4..fe485f4f5fac 100644
--- a/arch/m68k/include/asm/io_mm.h
+++ b/arch/m68k/include/asm/io_mm.h
@@ -86,53 +86,7 @@
86#endif /* ATARI_ROM_ISA */ 86#endif /* ATARI_ROM_ISA */
87 87
88 88
89#if defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE) 89#if defined(CONFIG_ISA) || defined(CONFIG_ATARI_ROM_ISA)
90
91#define HAVE_ARCH_PIO_SIZE
92#define PIO_OFFSET 0
93#define PIO_MASK 0xffff
94#define PIO_RESERVED 0x10000
95
96u8 mcf_pci_inb(u32 addr);
97u16 mcf_pci_inw(u32 addr);
98u32 mcf_pci_inl(u32 addr);
99void mcf_pci_insb(u32 addr, u8 *buf, u32 len);
100void mcf_pci_insw(u32 addr, u16 *buf, u32 len);
101void mcf_pci_insl(u32 addr, u32 *buf, u32 len);
102
103void mcf_pci_outb(u8 v, u32 addr);
104void mcf_pci_outw(u16 v, u32 addr);
105void mcf_pci_outl(u32 v, u32 addr);
106void mcf_pci_outsb(u32 addr, const u8 *buf, u32 len);
107void mcf_pci_outsw(u32 addr, const u16 *buf, u32 len);
108void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len);
109
110#define inb mcf_pci_inb
111#define inb_p mcf_pci_inb
112#define inw mcf_pci_inw
113#define inw_p mcf_pci_inw
114#define inl mcf_pci_inl
115#define inl_p mcf_pci_inl
116#define insb mcf_pci_insb
117#define insw mcf_pci_insw
118#define insl mcf_pci_insl
119
120#define outb mcf_pci_outb
121#define outb_p mcf_pci_outb
122#define outw mcf_pci_outw
123#define outw_p mcf_pci_outw
124#define outl mcf_pci_outl
125#define outl_p mcf_pci_outl
126#define outsb mcf_pci_outsb
127#define outsw mcf_pci_outsw
128#define outsl mcf_pci_outsl
129
130#define readb(addr) in_8(addr)
131#define writeb(v, addr) out_8((addr), (v))
132#define readw(addr) in_le16(addr)
133#define writew(v, addr) out_le16((addr), (v))
134
135#elif defined(CONFIG_ISA) || defined(CONFIG_ATARI_ROM_ISA)
136 90
137#if MULTI_ISA == 0 91#if MULTI_ISA == 0
138#undef MULTI_ISA 92#undef MULTI_ISA
@@ -415,8 +369,7 @@ static inline void isa_delay(void)
415#define writew(val, addr) out_le16((addr), (val)) 369#define writew(val, addr) out_le16((addr), (val))
416#endif /* CONFIG_ATARI_ROM_ISA */ 370#endif /* CONFIG_ATARI_ROM_ISA */
417 371
418#if !defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA) && \ 372#if !defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA)
419 !(defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE))
420/* 373/*
421 * We need to define dummy functions for GENERIC_IOMAP support. 374 * We need to define dummy functions for GENERIC_IOMAP support.
422 */ 375 */