aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/renesas/hs7751rvoip
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/renesas/hs7751rvoip')
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/Kconfig12
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/Makefile6
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/io.c252
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/irq.c6
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/led.c26
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/mach.c54
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/setup.c94
7 files changed, 190 insertions, 260 deletions
diff --git a/arch/sh/boards/renesas/hs7751rvoip/Kconfig b/arch/sh/boards/renesas/hs7751rvoip/Kconfig
new file mode 100644
index 000000000000..1743be477be5
--- /dev/null
+++ b/arch/sh/boards/renesas/hs7751rvoip/Kconfig
@@ -0,0 +1,12 @@
1if SH_HS7751RVOIP
2
3menu "HS7751RVoIP options"
4
5config HS7751RVOIP_CODEC
6 bool "Support VoIP Codec section"
7 help
8 Selecting this option will support CODEC section.
9
10endmenu
11
12endif
diff --git a/arch/sh/boards/renesas/hs7751rvoip/Makefile b/arch/sh/boards/renesas/hs7751rvoip/Makefile
index e8b4109ace11..e626377c55ee 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/Makefile
+++ b/arch/sh/boards/renesas/hs7751rvoip/Makefile
@@ -1,12 +1,8 @@
1# 1#
2# Makefile for the HS7751RVoIP specific parts of the kernel 2# Makefile for the HS7751RVoIP specific parts of the kernel
3# 3#
4# Note! Dependencies are done automagically by 'make dep', which also
5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file).
7#
8 4
9obj-y := mach.o setup.o io.o irq.o led.o 5obj-y := setup.o io.o irq.o
10 6
11obj-$(CONFIG_PCI) += pci.o 7obj-$(CONFIG_PCI) += pci.o
12 8
diff --git a/arch/sh/boards/renesas/hs7751rvoip/io.c b/arch/sh/boards/renesas/hs7751rvoip/io.c
index 3a1abfa2fefb..9ea1136b219b 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/io.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/io.c
@@ -10,21 +10,16 @@
10 * placeholder code from io_hs7751rvoip.c left in with the 10 * placeholder code from io_hs7751rvoip.c left in with the
11 * expectation of later SuperIO and PCMCIA access. 11 * expectation of later SuperIO and PCMCIA access.
12 */ 12 */
13
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/module.h>
16#include <linux/pci.h>
16#include <asm/io.h> 17#include <asm/io.h>
17#include <asm/hs7751rvoip/hs7751rvoip.h> 18#include <asm/hs7751rvoip/hs7751rvoip.h>
18#include <asm/addrspace.h> 19#include <asm/addrspace.h>
19 20
20#include <linux/module.h>
21#include <linux/pci.h>
22#include "../../../drivers/pci/pci-sh7751.h"
23
24extern void *area5_io8_base; /* Area 5 8bit I/O Base address */
25extern void *area6_io8_base; /* Area 6 8bit I/O Base address */ 21extern void *area6_io8_base; /* Area 6 8bit I/O Base address */
26extern void *area5_io16_base; /* Area 5 16bit I/O Base address */ 22extern void *area5_io16_base; /* Area 5 16bit I/O Base address */
27extern void *area6_io16_base; /* Area 6 16bit I/O Base address */
28 23
29/* 24/*
30 * The 7751R HS7751RVoIP uses the built-in PCI controller (PCIC) 25 * The 7751R HS7751RVoIP uses the built-in PCI controller (PCIC)
@@ -33,25 +28,8 @@ extern void *area6_io16_base; /* Area 6 16bit I/O Base address */
33 * like the other Solution Engine boards. 28 * like the other Solution Engine boards.
34 */ 29 */
35 30
36#define PCIIOBR (volatile long *)PCI_REG(SH7751_PCIIOBR)
37#define PCIMBR (volatile long *)PCI_REG(SH7751_PCIMBR)
38#define PCI_IO_AREA SH7751_PCI_IO_BASE
39#define PCI_MEM_AREA SH7751_PCI_CONFIG_BASE
40
41#define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
42
43#if defined(CONFIG_HS7751RVOIP_CODEC)
44#define CODEC_IO_BASE 0x1000 31#define CODEC_IO_BASE 0x1000
45#endif 32#define CODEC_IOMAP(a) ((unsigned long)area6_io8_base + ((a) - CODEC_IO_BASE))
46
47#define maybebadio(name,port) \
48 printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
49 #name, (port), (__u32) __builtin_return_address(0))
50
51static inline void delay(void)
52{
53 ctrl_inw(0xa0000000);
54}
55 33
56static inline unsigned long port2adr(unsigned int port) 34static inline unsigned long port2adr(unsigned int port)
57{ 35{
@@ -59,9 +37,10 @@ static inline unsigned long port2adr(unsigned int port)
59 if (port == 0x3f6) 37 if (port == 0x3f6)
60 return ((unsigned long)area5_io16_base + 0x0c); 38 return ((unsigned long)area5_io16_base + 0x0c);
61 else 39 else
62 return ((unsigned long)area5_io16_base + 0x800 + ((port-0x1f0) << 1)); 40 return ((unsigned long)area5_io16_base + 0x800 +
41 ((port-0x1f0) << 1));
63 else 42 else
64 maybebadio(port2adr, (unsigned long)port); 43 maybebadio((unsigned long)port);
65 return port; 44 return port;
66} 45}
67 46
@@ -78,25 +57,10 @@ static inline int shifted_port(unsigned long port)
78} 57}
79 58
80#if defined(CONFIG_HS7751RVOIP_CODEC) 59#if defined(CONFIG_HS7751RVOIP_CODEC)
81static inline int 60#define codec_port(port) \
82codec_port(unsigned long port) 61 ((CODEC_IO_BASE <= (port)) && ((port) < (CODEC_IO_BASE + 0x20)))
83{
84 if (CODEC_IO_BASE <= port && port < (CODEC_IO_BASE+0x20))
85 return 1;
86 else
87 return 0;
88}
89#endif
90
91/* In case someone configures the kernel w/o PCI support: in that */
92/* scenario, don't ever bother to check for PCI-window addresses */
93
94/* NOTE: WINDOW CHECK MAY BE A BIT OFF, HIGH PCIBIOS_MIN_IO WRAPS? */
95#if defined(CONFIG_PCI)
96#define CHECK_SH7751_PCIIO(port) \
97 ((port >= PCIBIOS_MIN_IO) && (port < (PCIBIOS_MIN_IO + SH7751_PCI_IO_SIZE)))
98#else 62#else
99#define CHECK_SH7751_PCIIO(port) (0) 63#define codec_port(port) (0)
100#endif 64#endif
101 65
102/* 66/*
@@ -109,15 +73,13 @@ codec_port(unsigned long port)
109unsigned char hs7751rvoip_inb(unsigned long port) 73unsigned char hs7751rvoip_inb(unsigned long port)
110{ 74{
111 if (PXSEG(port)) 75 if (PXSEG(port))
112 return *(volatile unsigned char *)port; 76 return ctrl_inb(port);
113#if defined(CONFIG_HS7751RVOIP_CODEC)
114 else if (codec_port(port)) 77 else if (codec_port(port))
115 return *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)); 78 return ctrl_inb(CODEC_IOMAP(port));
116#endif 79 else if (is_pci_ioaddr(port) || shifted_port(port))
117 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 80 return ctrl_inb(pci_ioaddr(port));
118 return *(volatile unsigned char *)PCI_IOMAP(port);
119 else 81 else
120 return (*(volatile unsigned short *)port2adr(port) & 0xff); 82 return ctrl_inw(port2adr(port)) & 0xff;
121} 83}
122 84
123unsigned char hs7751rvoip_inb_p(unsigned long port) 85unsigned char hs7751rvoip_inb_p(unsigned long port)
@@ -125,38 +87,36 @@ unsigned char hs7751rvoip_inb_p(unsigned long port)
125 unsigned char v; 87 unsigned char v;
126 88
127 if (PXSEG(port)) 89 if (PXSEG(port))
128 v = *(volatile unsigned char *)port; 90 v = ctrl_inb(port);
129#if defined(CONFIG_HS7751RVOIP_CODEC)
130 else if (codec_port(port)) 91 else if (codec_port(port))
131 v = *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)); 92 v = ctrl_inb(CODEC_IOMAP(port));
132#endif 93 else if (is_pci_ioaddr(port) || shifted_port(port))
133 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 94 v = ctrl_inb(pci_ioaddr(port));
134 v = *(volatile unsigned char *)PCI_IOMAP(port);
135 else 95 else
136 v = (*(volatile unsigned short *)port2adr(port) & 0xff); 96 v = ctrl_inw(port2adr(port)) & 0xff;
137 delay(); 97 ctrl_delay();
138 return v; 98 return v;
139} 99}
140 100
141unsigned short hs7751rvoip_inw(unsigned long port) 101unsigned short hs7751rvoip_inw(unsigned long port)
142{ 102{
143 if (PXSEG(port)) 103 if (PXSEG(port))
144 return *(volatile unsigned short *)port; 104 return ctrl_inw(port);
145 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 105 else if (is_pci_ioaddr(port) || shifted_port(port))
146 return *(volatile unsigned short *)PCI_IOMAP(port); 106 return ctrl_inw(pci_ioaddr(port));
147 else 107 else
148 maybebadio(inw, port); 108 maybebadio(port);
149 return 0; 109 return 0;
150} 110}
151 111
152unsigned int hs7751rvoip_inl(unsigned long port) 112unsigned int hs7751rvoip_inl(unsigned long port)
153{ 113{
154 if (PXSEG(port)) 114 if (PXSEG(port))
155 return *(volatile unsigned long *)port; 115 return ctrl_inl(port);
156 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 116 else if (is_pci_ioaddr(port) || shifted_port(port))
157 return *(volatile unsigned long *)PCI_IOMAP(port); 117 return ctrl_inl(pci_ioaddr(port));
158 else 118 else
159 maybebadio(inl, port); 119 maybebadio(port);
160 return 0; 120 return 0;
161} 121}
162 122
@@ -164,146 +124,160 @@ void hs7751rvoip_outb(unsigned char value, unsigned long port)
164{ 124{
165 125
166 if (PXSEG(port)) 126 if (PXSEG(port))
167 *(volatile unsigned char *)port = value; 127 ctrl_outb(value, port);
168#if defined(CONFIG_HS7751RVOIP_CODEC)
169 else if (codec_port(port)) 128 else if (codec_port(port))
170 *(volatile unsigned cjar *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; 129 ctrl_outb(value, CODEC_IOMAP(port));
171#endif 130 else if (is_pci_ioaddr(port) || shifted_port(port))
172 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 131 ctrl_outb(value, pci_ioaddr(port));
173 *(unsigned char *)PCI_IOMAP(port) = value;
174 else 132 else
175 *(volatile unsigned short *)port2adr(port) = value; 133 ctrl_outb(value, port2adr(port));
176} 134}
177 135
178void hs7751rvoip_outb_p(unsigned char value, unsigned long port) 136void hs7751rvoip_outb_p(unsigned char value, unsigned long port)
179{ 137{
180 if (PXSEG(port)) 138 if (PXSEG(port))
181 *(volatile unsigned char *)port = value; 139 ctrl_outb(value, port);
182#if defined(CONFIG_HS7751RVOIP_CODEC)
183 else if (codec_port(port)) 140 else if (codec_port(port))
184 *(volatile unsigned cjar *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; 141 ctrl_outb(value, CODEC_IOMAP(port));
185#endif 142 else if (is_pci_ioaddr(port) || shifted_port(port))
186 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 143 ctrl_outb(value, pci_ioaddr(port));
187 *(unsigned char *)PCI_IOMAP(port) = value;
188 else 144 else
189 *(volatile unsigned short *)port2adr(port) = value; 145 ctrl_outw(value, port2adr(port));
190 delay(); 146
147 ctrl_delay();
191} 148}
192 149
193void hs7751rvoip_outw(unsigned short value, unsigned long port) 150void hs7751rvoip_outw(unsigned short value, unsigned long port)
194{ 151{
195 if (PXSEG(port)) 152 if (PXSEG(port))
196 *(volatile unsigned short *)port = value; 153 ctrl_outw(value, port);
197 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 154 else if (is_pci_ioaddr(port) || shifted_port(port))
198 *(unsigned short *)PCI_IOMAP(port) = value; 155 ctrl_outw(value, pci_ioaddr(port));
199 else 156 else
200 maybebadio(outw, port); 157 maybebadio(port);
201} 158}
202 159
203void hs7751rvoip_outl(unsigned int value, unsigned long port) 160void hs7751rvoip_outl(unsigned int value, unsigned long port)
204{ 161{
205 if (PXSEG(port)) 162 if (PXSEG(port))
206 *(volatile unsigned long *)port = value; 163 ctrl_outl(value, port);
207 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 164 else if (is_pci_ioaddr(port) || shifted_port(port))
208 *((unsigned long *)PCI_IOMAP(port)) = value; 165 ctrl_outl(value, pci_ioaddr(port));
209 else 166 else
210 maybebadio(outl, port); 167 maybebadio(port);
211} 168}
212 169
213void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count) 170void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count)
214{ 171{
172 u8 *buf = addr;
173
215 if (PXSEG(port)) 174 if (PXSEG(port))
216 while (count--) *((unsigned char *) addr)++ = *(volatile unsigned char *)port; 175 while (count--)
217#if defined(CONFIG_HS7751RVOIP_CODEC) 176 *buf++ = ctrl_inb(port);
218 else if (codec_port(port)) 177 else if (codec_port(port))
219 while (count--) *((unsigned char *) addr)++ = *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)); 178 while (count--)
220#endif 179 *buf++ = ctrl_inb(CODEC_IOMAP(port));
221 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 180 else if (is_pci_ioaddr(port) || shifted_port(port)) {
222 volatile __u8 *bp = (__u8 *)PCI_IOMAP(port); 181 volatile u8 *bp = (volatile u8 *)pci_ioaddr(port);
223 182
224 while (count--) *((volatile unsigned char *) addr)++ = *bp; 183 while (count--)
184 *buf++ = *bp;
225 } else { 185 } else {
226 volatile __u16 *p = (volatile unsigned short *)port2adr(port); 186 volatile u16 *p = (volatile u16 *)port2adr(port);
227 187
228 while (count--) *((unsigned char *) addr)++ = *p & 0xff; 188 while (count--)
189 *buf++ = *p & 0xff;
229 } 190 }
230} 191}
231 192
232void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count) 193void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count)
233{ 194{
234 volatile __u16 *p; 195 volatile u16 *p;
196 u16 *buf = addr;
235 197
236 if (PXSEG(port)) 198 if (PXSEG(port))
237 p = (volatile unsigned short *)port; 199 p = (volatile u16 *)port;
238 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 200 else if (is_pci_ioaddr(port) || shifted_port(port))
239 p = (volatile unsigned short *)PCI_IOMAP(port); 201 p = (volatile u16 *)pci_ioaddr(port);
240 else 202 else
241 p = (volatile unsigned short *)port2adr(port); 203 p = (volatile u16 *)port2adr(port);
242 while (count--) *((__u16 *) addr)++ = *p; 204 while (count--)
205 *buf++ = *p;
243} 206}
244 207
245void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count) 208void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count)
246{ 209{
247 if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
248 volatile __u32 *p = (__u32 *)PCI_IOMAP(port);
249 210
250 while (count--) *((__u32 *) addr)++ = *p; 211 if (is_pci_ioaddr(port) || shifted_port(port)) {
212 volatile u32 *p = (volatile u32 *)pci_ioaddr(port);
213 u32 *buf = addr;
214
215 while (count--)
216 *buf++ = *p;
251 } else 217 } else
252 maybebadio(insl, port); 218 maybebadio(port);
253} 219}
254 220
255void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count) 221void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count)
256{ 222{
223 const u8 *buf = addr;
224
257 if (PXSEG(port)) 225 if (PXSEG(port))
258 while (count--) *(volatile unsigned char *)port = *((unsigned char *) addr)++; 226 while (count--)
259#if defined(CONFIG_HS7751RVOIP_CODEC) 227 ctrl_outb(*buf++, port);
260 else if (codec_port(port)) 228 else if (codec_port(port))
261 while (count--) *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = *((unsigned char *) addr)++; 229 while (count--)
262#endif 230 ctrl_outb(*buf++, CODEC_IOMAP(port));
263 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 231 else if (is_pci_ioaddr(port) || shifted_port(port)) {
264 volatile __u8 *bp = (__u8 *)PCI_IOMAP(port); 232 volatile u8 *bp = (volatile u8 *)pci_ioaddr(port);
265 233
266 while (count--) *bp = *((volatile unsigned char *) addr)++; 234 while (count--)
235 *bp = *buf++;
267 } else { 236 } else {
268 volatile __u16 *p = (volatile unsigned short *)port2adr(port); 237 volatile u16 *p = (volatile u16 *)port2adr(port);
269 238
270 while (count--) *p = *((unsigned char *) addr)++; 239 while (count--)
240 *p = *buf++;
271 } 241 }
272} 242}
273 243
274void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count) 244void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count)
275{ 245{
276 volatile __u16 *p; 246 volatile u16 *p;
247 const u16 *buf = addr;
277 248
278 if (PXSEG(port)) 249 if (PXSEG(port))
279 p = (volatile unsigned short *)port; 250 p = (volatile u16 *)port;
280 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 251 else if (is_pci_ioaddr(port) || shifted_port(port))
281 p = (volatile unsigned short *)PCI_IOMAP(port); 252 p = (volatile u16 *)pci_ioaddr(port);
282 else 253 else
283 p = (volatile unsigned short *)port2adr(port); 254 p = (volatile u16 *)port2adr(port);
284 while (count--) *p = *((__u16 *) addr)++; 255
256 while (count--)
257 *p = *buf++;
285} 258}
286 259
287void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count) 260void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count)
288{ 261{
289 if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 262 const u32 *buf = addr;
290 volatile __u32 *p = (__u32 *)PCI_IOMAP(port);
291 263
292 while (count--) *p = *((__u32 *) addr)++; 264 if (is_pci_ioaddr(port) || shifted_port(port)) {
265 volatile u32 *p = (volatile u32 *)pci_ioaddr(port);
266
267 while (count--)
268 *p = *buf++;
293 } else 269 } else
294 maybebadio(outsl, port); 270 maybebadio(port);
295} 271}
296 272
297void *hs7751rvoip_ioremap(unsigned long offset, unsigned long size) 273void __iomem *hs7751rvoip_ioport_map(unsigned long port, unsigned int size)
298{ 274{
299 if (offset >= 0xfd000000) 275 if (PXSEG(port))
300 return (void *)offset; 276 return (void __iomem *)port;
301 else 277 else if (unlikely(codec_port(port) && (size == 1)))
302 return (void *)P2SEGADDR(offset); 278 return (void __iomem *)CODEC_IOMAP(port);
303} 279 else if (is_pci_ioaddr(port))
304EXPORT_SYMBOL(hs7751rvoip_ioremap); 280 return (void __iomem *)pci_ioaddr(port);
305 281
306unsigned long hs7751rvoip_isa_port2addr(unsigned long offset) 282 return (void __iomem *)port2adr(port);
307{
308 return port2adr(offset);
309} 283}
diff --git a/arch/sh/boards/renesas/hs7751rvoip/irq.c b/arch/sh/boards/renesas/hs7751rvoip/irq.c
index 705b7ddcb0d2..c617b188258a 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/irq.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/irq.c
@@ -35,30 +35,24 @@ static unsigned int startup_hs7751rvoip_irq(unsigned int irq)
35 35
36static void disable_hs7751rvoip_irq(unsigned int irq) 36static void disable_hs7751rvoip_irq(unsigned int irq)
37{ 37{
38 unsigned long flags;
39 unsigned short val; 38 unsigned short val;
40 unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]); 39 unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]);
41 40
42 /* Set the priority in IPR to 0 */ 41 /* Set the priority in IPR to 0 */
43 local_irq_save(flags);
44 val = ctrl_inw(IRLCNTR3); 42 val = ctrl_inw(IRLCNTR3);
45 val &= mask; 43 val &= mask;
46 ctrl_outw(val, IRLCNTR3); 44 ctrl_outw(val, IRLCNTR3);
47 local_irq_restore(flags);
48} 45}
49 46
50static void enable_hs7751rvoip_irq(unsigned int irq) 47static void enable_hs7751rvoip_irq(unsigned int irq)
51{ 48{
52 unsigned long flags;
53 unsigned short val; 49 unsigned short val;
54 unsigned short value = (0x0001 << mask_pos[irq]); 50 unsigned short value = (0x0001 << mask_pos[irq]);
55 51
56 /* Set priority in IPR back to original value */ 52 /* Set priority in IPR back to original value */
57 local_irq_save(flags);
58 val = ctrl_inw(IRLCNTR3); 53 val = ctrl_inw(IRLCNTR3);
59 val |= value; 54 val |= value;
60 ctrl_outw(val, IRLCNTR3); 55 ctrl_outw(val, IRLCNTR3);
61 local_irq_restore(flags);
62} 56}
63 57
64static void ack_hs7751rvoip_irq(unsigned int irq) 58static void ack_hs7751rvoip_irq(unsigned int irq)
diff --git a/arch/sh/boards/renesas/hs7751rvoip/led.c b/arch/sh/boards/renesas/hs7751rvoip/led.c
deleted file mode 100644
index b6608fff9f38..000000000000
--- a/arch/sh/boards/renesas/hs7751rvoip/led.c
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * linux/arch/sh/kernel/setup_hs7751rvoip.c
3 *
4 * Copyright (C) 2000 Kazumoto Kojima
5 *
6 * Renesas Technology Sales HS7751RVoIP Support.
7 *
8 * Modified for HS7751RVoIP by
9 * Atom Create Engineering Co., Ltd. 2002.
10 * Lineo uSolutions, Inc. 2003.
11 */
12
13#include <asm/io.h>
14#include <asm/hs7751rvoip/hs7751rvoip.h>
15
16extern unsigned int debug_counter;
17
18void debug_led_disp(void)
19{
20 unsigned short value;
21
22 value = (unsigned char)debug_counter++;
23 ctrl_outb((0xf0|value), PA_OUTPORTR);
24 if (value == 0x0f)
25 debug_counter = 0;
26}
diff --git a/arch/sh/boards/renesas/hs7751rvoip/mach.c b/arch/sh/boards/renesas/hs7751rvoip/mach.c
deleted file mode 100644
index caf967f77c61..000000000000
--- a/arch/sh/boards/renesas/hs7751rvoip/mach.c
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * linux/arch/sh/kernel/mach_hs7751rvoip.c
3 *
4 * Minor tweak of mach_se.c file to reference hs7751rvoip-specific items.
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * Machine vector for the Renesas Technology sales HS7751RVoIP
10 */
11
12#include <linux/init.h>
13
14#include <asm/machvec.h>
15#include <asm/rtc.h>
16#include <asm/irq.h>
17#include <asm/hs7751rvoip/io.h>
18
19extern void init_hs7751rvoip_IRQ(void);
20extern void *hs7751rvoip_ioremap(unsigned long, unsigned long);
21
22/*
23 * The Machine Vector
24 */
25
26struct sh_machine_vector mv_hs7751rvoip __initmv = {
27 .mv_nr_irqs = 72,
28
29 .mv_inb = hs7751rvoip_inb,
30 .mv_inw = hs7751rvoip_inw,
31 .mv_inl = hs7751rvoip_inl,
32 .mv_outb = hs7751rvoip_outb,
33 .mv_outw = hs7751rvoip_outw,
34 .mv_outl = hs7751rvoip_outl,
35
36 .mv_inb_p = hs7751rvoip_inb_p,
37 .mv_inw_p = hs7751rvoip_inw,
38 .mv_inl_p = hs7751rvoip_inl,
39 .mv_outb_p = hs7751rvoip_outb_p,
40 .mv_outw_p = hs7751rvoip_outw,
41 .mv_outl_p = hs7751rvoip_outl,
42
43 .mv_insb = hs7751rvoip_insb,
44 .mv_insw = hs7751rvoip_insw,
45 .mv_insl = hs7751rvoip_insl,
46 .mv_outsb = hs7751rvoip_outsb,
47 .mv_outsw = hs7751rvoip_outsw,
48 .mv_outsl = hs7751rvoip_outsl,
49
50 .mv_ioremap = hs7751rvoip_ioremap,
51 .mv_isa_port2addr = hs7751rvoip_isa_port2addr,
52 .mv_init_irq = init_hs7751rvoip_IRQ,
53};
54ALIAS_MV(hs7751rvoip)
diff --git a/arch/sh/boards/renesas/hs7751rvoip/setup.c b/arch/sh/boards/renesas/hs7751rvoip/setup.c
index 29fb5ff70fb5..0414c15c3458 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/setup.c
+++ b/arch/sh/boards/renesas/hs7751rvoip/setup.c
@@ -1,44 +1,38 @@
1/* 1/*
2 * linux/arch/sh/kernel/setup_hs7751rvoip.c 2 * Renesas Technology Sales HS7751RVoIP Support.
3 * 3 *
4 * Copyright (C) 2000 Kazumoto Kojima 4 * Copyright (C) 2000 Kazumoto Kojima
5 * 5 *
6 * Renesas Technology Sales HS7751RVoIP Support.
7 *
8 * Modified for HS7751RVoIP by 6 * Modified for HS7751RVoIP by
9 * Atom Create Engineering Co., Ltd. 2002. 7 * Atom Create Engineering Co., Ltd. 2002.
10 * Lineo uSolutions, Inc. 2003. 8 * Lineo uSolutions, Inc. 2003.
11 */ 9 */
12
13#include <linux/init.h> 10#include <linux/init.h>
14#include <linux/irq.h> 11#include <linux/irq.h>
15 12#include <linux/mm.h>
13#include <linux/vmalloc.h>
16#include <linux/hdreg.h> 14#include <linux/hdreg.h>
17#include <linux/ide.h> 15#include <linux/ide.h>
16#include <linux/pm.h>
18#include <asm/io.h> 17#include <asm/io.h>
19#include <asm/hs7751rvoip/hs7751rvoip.h> 18#include <asm/hs7751rvoip/hs7751rvoip.h>
19#include <asm/machvec.h>
20#include <asm/rtc.h>
21#include <asm/irq.h>
20 22
21#include <linux/mm.h> 23static void __init hs7751rvoip_init_irq(void)
22#include <linux/vmalloc.h>
23
24/* defined in mm/ioremap.c */
25extern void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags);
26
27unsigned int debug_counter;
28
29const char *get_system_type(void)
30{ 24{
31 return "HS7751RVoIP"; 25#if defined(CONFIG_HS7751RVOIP_CODEC)
26 make_ipr_irq(DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
27 make_ipr_irq(DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
28#endif
29
30 init_hs7751rvoip_IRQ();
32} 31}
33 32
34/* 33static void hs7751rvoip_power_off(void)
35 * Initialize the board
36 */
37void __init platform_setup(void)
38{ 34{
39 printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n"); 35 ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR);
40 ctrl_outb(0xf0, PA_OUTPORTR);
41 debug_counter = 0;
42} 36}
43 37
44void *area5_io8_base; 38void *area5_io8_base;
@@ -46,16 +40,15 @@ void *area6_io8_base;
46void *area5_io16_base; 40void *area5_io16_base;
47void *area6_io16_base; 41void *area6_io16_base;
48 42
49int __init cf_init(void) 43static int __init hs7751rvoip_cf_init(void)
50{ 44{
51 pgprot_t prot; 45 pgprot_t prot;
52 unsigned long paddrbase, psize; 46 unsigned long paddrbase;
53 47
54 /* open I/O area window */ 48 /* open I/O area window */
55 paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800)); 49 paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
56 psize = PAGE_SIZE;
57 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16); 50 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
58 area5_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot); 51 area5_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
59 if (!area5_io16_base) { 52 if (!area5_io16_base) {
60 printk("allocate_cf_area : can't open CF I/O window!\n"); 53 printk("allocate_cf_area : can't open CF I/O window!\n");
61 return -ENOMEM; 54 return -ENOMEM;
@@ -64,19 +57,18 @@ int __init cf_init(void)
64 /* XXX : do we need attribute and common-memory area also? */ 57 /* XXX : do we need attribute and common-memory area also? */
65 58
66 paddrbase = virt_to_phys((void *)PA_AREA6_IO); 59 paddrbase = virt_to_phys((void *)PA_AREA6_IO);
67 psize = PAGE_SIZE;
68#if defined(CONFIG_HS7751RVOIP_CODEC) 60#if defined(CONFIG_HS7751RVOIP_CODEC)
69 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8); 61 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
70#else 62#else
71 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8); 63 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
72#endif 64#endif
73 area6_io8_base = p3_ioremap(paddrbase, psize, prot.pgprot); 65 area6_io8_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
74 if (!area6_io8_base) { 66 if (!area6_io8_base) {
75 printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n"); 67 printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
76 return -ENOMEM; 68 return -ENOMEM;
77 } 69 }
78 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16); 70 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
79 area6_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot); 71 area6_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
80 if (!area6_io16_base) { 72 if (!area6_io16_base) {
81 printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n"); 73 printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
82 return -ENOMEM; 74 return -ENOMEM;
@@ -85,4 +77,46 @@ int __init cf_init(void)
85 return 0; 77 return 0;
86} 78}
87 79
88__initcall (cf_init); 80/*
81 * Initialize the board
82 */
83static void __init hs7751rvoip_setup(char **cmdline_p)
84{
85 device_initcall(hs7751rvoip_cf_init);
86
87 ctrl_outb(0xf0, PA_OUTPORTR);
88 pm_power_off = hs7751rvoip_power_off;
89
90 printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
91}
92
93struct sh_machine_vector mv_hs7751rvoip __initmv = {
94 .mv_name = "HS7751RVoIP",
95 .mv_setup = hs7751rvoip_setup,
96 .mv_nr_irqs = 72,
97
98 .mv_inb = hs7751rvoip_inb,
99 .mv_inw = hs7751rvoip_inw,
100 .mv_inl = hs7751rvoip_inl,
101 .mv_outb = hs7751rvoip_outb,
102 .mv_outw = hs7751rvoip_outw,
103 .mv_outl = hs7751rvoip_outl,
104
105 .mv_inb_p = hs7751rvoip_inb_p,
106 .mv_inw_p = hs7751rvoip_inw,
107 .mv_inl_p = hs7751rvoip_inl,
108 .mv_outb_p = hs7751rvoip_outb_p,
109 .mv_outw_p = hs7751rvoip_outw,
110 .mv_outl_p = hs7751rvoip_outl,
111
112 .mv_insb = hs7751rvoip_insb,
113 .mv_insw = hs7751rvoip_insw,
114 .mv_insl = hs7751rvoip_insl,
115 .mv_outsb = hs7751rvoip_outsb,
116 .mv_outsw = hs7751rvoip_outsw,
117 .mv_outsl = hs7751rvoip_outsl,
118
119 .mv_init_irq = hs7751rvoip_init_irq,
120 .mv_ioport_map = hs7751rvoip_ioport_map,
121};
122ALIAS_MV(hs7751rvoip)