aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 01:02:09 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 01:02:09 -0400
commit36efc35447154317f9ffc5163a1793b5f7ff3de1 (patch)
treee90017bb7caffa93994c05897e4cb1bbcc278de1 /arch
parente8fb67f8e05bb1f4c07c3585967cfc6d44822ab0 (diff)
sh: RTS7751R2D board updates.
More of the same, trivial cleanups, and moving options to their own board-specific Kconfig. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/Kconfig2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/Makefile2
-rw-r--r--arch/sh/boards/renesas/hs7751rvoip/led.c26
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/Kconfig12
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/io.c95
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/led.c9
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/mach.c3
7 files changed, 68 insertions, 81 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index cbf0d527e991..a66b9c44075f 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -402,7 +402,7 @@ endmenu
402 402
403source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" 403source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
404 404
405#source "arch/sh/boards/renesas/rts7751r2d/Kconfig" 405source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
406 406
407config SH_PCLK_FREQ 407config SH_PCLK_FREQ
408 int "Peripheral clock frequency (in Hz)" 408 int "Peripheral clock frequency (in Hz)"
diff --git a/arch/sh/boards/renesas/hs7751rvoip/Makefile b/arch/sh/boards/renesas/hs7751rvoip/Makefile
index bede2d54fd6c..e626377c55ee 100644
--- a/arch/sh/boards/renesas/hs7751rvoip/Makefile
+++ b/arch/sh/boards/renesas/hs7751rvoip/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the HS7751RVoIP specific parts of the kernel 2# Makefile for the HS7751RVoIP specific parts of the kernel
3# 3#
4 4
5obj-y := setup.o io.o irq.o led.o 5obj-y := setup.o io.o irq.o
6 6
7obj-$(CONFIG_PCI) += pci.o 7obj-$(CONFIG_PCI) += pci.o
8 8
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/rts7751r2d/Kconfig b/arch/sh/boards/renesas/rts7751r2d/Kconfig
new file mode 100644
index 000000000000..7780d1fb13ff
--- /dev/null
+++ b/arch/sh/boards/renesas/rts7751r2d/Kconfig
@@ -0,0 +1,12 @@
1if SH_RTS7751R2D
2
3menu "RTS7751R2D options"
4
5config RTS7751R2D_REV11
6 bool "RTS7751R2D Rev. 1.1 board support"
7 help
8 Selecting this option will support version rev. 1.1.
9endmenu
10
11endif
12
diff --git a/arch/sh/boards/renesas/rts7751r2d/io.c b/arch/sh/boards/renesas/rts7751r2d/io.c
index 123abbbc91e0..9e7fa726a86d 100644
--- a/arch/sh/boards/renesas/rts7751r2d/io.c
+++ b/arch/sh/boards/renesas/rts7751r2d/io.c
@@ -13,13 +13,11 @@
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <asm/io.h>
17#include <asm/rts7751r2d/rts7751r2d.h>
18#include <asm/addrspace.h>
19
20#include <linux/module.h>
21#include <linux/pci.h> 16#include <linux/pci.h>
22#include "../../../drivers/pci/pci-sh7751.h" 17#include "../../../drivers/pci/pci-sh7751.h"
18#include <asm/rts7751r2d/rts7751r2d.h>
19#include <asm/io.h>
20#include <asm/addrspace.h>
23 21
24/* 22/*
25 * The 7751R RTS7751R2D uses the built-in PCI controller (PCIC) 23 * The 7751R RTS7751R2D uses the built-in PCI controller (PCIC)
@@ -35,10 +33,6 @@
35 33
36#define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK)) 34#define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
37 35
38#define maybebadio(name,port) \
39 printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
40 #name, (port), (__u32) __builtin_return_address(0))
41
42static inline void delay(void) 36static inline void delay(void)
43{ 37{
44 ctrl_inw(0xa0000000); 38 ctrl_inw(0xa0000000);
@@ -52,7 +46,7 @@ static inline unsigned long port2adr(unsigned int port)
52 else 46 else
53 return (PA_AREA5_IO + 0x1000 + ((port-0x1f0) << 1)); 47 return (PA_AREA5_IO + 0x1000 + ((port-0x1f0) << 1));
54 else 48 else
55 maybebadio(port2adr, (unsigned long)port); 49 maybebadio((unsigned long)port);
56 50
57 return port; 51 return port;
58} 52}
@@ -138,13 +132,13 @@ unsigned char rts7751r2d_inb_p(unsigned long port)
138unsigned short rts7751r2d_inw(unsigned long port) 132unsigned short rts7751r2d_inw(unsigned long port)
139{ 133{
140 if (CHECK_AX88796L_PORT(port)) 134 if (CHECK_AX88796L_PORT(port))
141 maybebadio(inw, port); 135 maybebadio(port);
142 else if (PXSEG(port)) 136 else if (PXSEG(port))
143 return *(volatile unsigned short *)port; 137 return *(volatile unsigned short *)port;
144 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 138 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
145 return *(volatile unsigned short *)PCI_IOMAP(port); 139 return *(volatile unsigned short *)PCI_IOMAP(port);
146 else 140 else
147 maybebadio(inw, port); 141 maybebadio(port);
148 142
149 return 0; 143 return 0;
150} 144}
@@ -152,13 +146,13 @@ unsigned short rts7751r2d_inw(unsigned long port)
152unsigned int rts7751r2d_inl(unsigned long port) 146unsigned int rts7751r2d_inl(unsigned long port)
153{ 147{
154 if (CHECK_AX88796L_PORT(port)) 148 if (CHECK_AX88796L_PORT(port))
155 maybebadio(inl, port); 149 maybebadio(port);
156 else if (PXSEG(port)) 150 else if (PXSEG(port))
157 return *(volatile unsigned long *)port; 151 return *(volatile unsigned long *)port;
158 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 152 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
159 return *(volatile unsigned long *)PCI_IOMAP(port); 153 return *(volatile unsigned long *)PCI_IOMAP(port);
160 else 154 else
161 maybebadio(inl, port); 155 maybebadio(port);
162 156
163 return 0; 157 return 0;
164} 158}
@@ -191,51 +185,55 @@ void rts7751r2d_outb_p(unsigned char value, unsigned long port)
191void rts7751r2d_outw(unsigned short value, unsigned long port) 185void rts7751r2d_outw(unsigned short value, unsigned long port)
192{ 186{
193 if (CHECK_AX88796L_PORT(port)) 187 if (CHECK_AX88796L_PORT(port))
194 maybebadio(outw, port); 188 maybebadio(port);
195 else if (PXSEG(port)) 189 else if (PXSEG(port))
196 *(volatile unsigned short *)port = value; 190 *(volatile unsigned short *)port = value;
197 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 191 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
198 *(volatile unsigned short *)PCI_IOMAP(port) = value; 192 *(volatile unsigned short *)PCI_IOMAP(port) = value;
199 else 193 else
200 maybebadio(outw, port); 194 maybebadio(port);
201} 195}
202 196
203void rts7751r2d_outl(unsigned int value, unsigned long port) 197void rts7751r2d_outl(unsigned int value, unsigned long port)
204{ 198{
205 if (CHECK_AX88796L_PORT(port)) 199 if (CHECK_AX88796L_PORT(port))
206 maybebadio(outl, port); 200 maybebadio(port);
207 else if (PXSEG(port)) 201 else if (PXSEG(port))
208 *(volatile unsigned long *)port = value; 202 *(volatile unsigned long *)port = value;
209 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 203 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
210 *(volatile unsigned long *)PCI_IOMAP(port) = value; 204 *(volatile unsigned long *)PCI_IOMAP(port) = value;
211 else 205 else
212 maybebadio(outl, port); 206 maybebadio(port);
213} 207}
214 208
215void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count) 209void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count)
216{ 210{
211 unsigned long a = (unsigned long)addr;
217 volatile __u8 *bp; 212 volatile __u8 *bp;
218 volatile __u16 *p; 213 volatile __u16 *p;
219 unsigned char *s = addr;
220 214
221 if (CHECK_AX88796L_PORT(port)) { 215 if (CHECK_AX88796L_PORT(port)) {
222 p = (volatile unsigned short *)port88796l(port, 0); 216 p = (volatile unsigned short *)port88796l(port, 0);
223 while (count--) *s++ = *p & 0xff; 217 while (count--)
218 ctrl_outb(*p & 0xff, a++);
224 } else if (PXSEG(port)) 219 } else if (PXSEG(port))
225 while (count--) *s++ = *(volatile unsigned char *)port; 220 while (count--)
221 ctrl_outb(ctrl_inb(port), a++);
226 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 222 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
227 bp = (__u8 *)PCI_IOMAP(port); 223 bp = (__u8 *)PCI_IOMAP(port);
228 while (count--) *s++ = *bp; 224 while (count--)
225 ctrl_outb(*bp, a++);
229 } else { 226 } else {
230 p = (volatile unsigned short *)port2adr(port); 227 p = (volatile unsigned short *)port2adr(port);
231 while (count--) *s++ = *p & 0xff; 228 while (count--)
229 ctrl_outb(*p & 0xff, a++);
232 } 230 }
233} 231}
234 232
235void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count) 233void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count)
236{ 234{
235 unsigned long a = (unsigned long)addr;
237 volatile __u16 *p; 236 volatile __u16 *p;
238 __u16 *s = addr;
239 237
240 if (CHECK_AX88796L_PORT(port)) 238 if (CHECK_AX88796L_PORT(port))
241 p = (volatile unsigned short *)port88796l(port, 1); 239 p = (volatile unsigned short *)port88796l(port, 1);
@@ -245,46 +243,53 @@ void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count)
245 p = (volatile unsigned short *)PCI_IOMAP(port); 243 p = (volatile unsigned short *)PCI_IOMAP(port);
246 else 244 else
247 p = (volatile unsigned short *)port2adr(port); 245 p = (volatile unsigned short *)port2adr(port);
248 while (count--) *s++ = *p; 246 while (count--)
247 ctrl_outw(*p, a++);
249} 248}
250 249
251void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count) 250void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count)
252{ 251{
253 if (CHECK_AX88796L_PORT(port)) 252 if (CHECK_AX88796L_PORT(port))
254 maybebadio(insl, port); 253 maybebadio(port);
255 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 254 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
256 volatile __u32 *p = (__u32 *)PCI_IOMAP(port); 255 unsigned long a = (unsigned long)addr;
257 __u32 *s = addr;
258 256
259 while (count--) *s++ = *p; 257 while (count--) {
258 ctrl_outl(ctrl_inl(PCI_IOMAP(port)), a);
259 a += 4;
260 }
260 } else 261 } else
261 maybebadio(insl, port); 262 maybebadio(port);
262} 263}
263 264
264void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count) 265void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count)
265{ 266{
267 unsigned long a = (unsigned long)addr;
266 volatile __u8 *bp; 268 volatile __u8 *bp;
267 volatile __u16 *p; 269 volatile __u16 *p;
268 const __u8 *s = addr;
269 270
270 if (CHECK_AX88796L_PORT(port)) { 271 if (CHECK_AX88796L_PORT(port)) {
271 p = (volatile unsigned short *)port88796l(port, 0); 272 p = (volatile unsigned short *)port88796l(port, 0);
272 while (count--) *p = *s++; 273 while (count--)
274 *p = ctrl_inb(a++);
273 } else if (PXSEG(port)) 275 } else if (PXSEG(port))
274 while (count--) *(volatile unsigned char *)port = *s++; 276 while (count--)
277 ctrl_outb(a++, port);
275 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 278 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
276 bp = (__u8 *)PCI_IOMAP(port); 279 bp = (__u8 *)PCI_IOMAP(port);
277 while (count--) *bp = *s++; 280 while (count--)
281 *bp = ctrl_inb(a++);
278 } else { 282 } else {
279 p = (volatile unsigned short *)port2adr(port); 283 p = (volatile unsigned short *)port2adr(port);
280 while (count--) *p = *s++; 284 while (count--)
285 *p = ctrl_inb(a++);
281 } 286 }
282} 287}
283 288
284void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count) 289void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count)
285{ 290{
291 unsigned long a = (unsigned long)addr;
286 volatile __u16 *p; 292 volatile __u16 *p;
287 const __u16 *s = addr;
288 293
289 if (CHECK_AX88796L_PORT(port)) 294 if (CHECK_AX88796L_PORT(port))
290 p = (volatile unsigned short *)port88796l(port, 1); 295 p = (volatile unsigned short *)port88796l(port, 1);
@@ -294,20 +299,26 @@ void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count)
294 p = (volatile unsigned short *)PCI_IOMAP(port); 299 p = (volatile unsigned short *)PCI_IOMAP(port);
295 else 300 else
296 p = (volatile unsigned short *)port2adr(port); 301 p = (volatile unsigned short *)port2adr(port);
297 while (count--) *p = *s++; 302
303 while (count--) {
304 ctrl_outw(*p, a);
305 a += 2;
306 }
298} 307}
299 308
300void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count) 309void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count)
301{ 310{
302 if (CHECK_AX88796L_PORT(port)) 311 if (CHECK_AX88796L_PORT(port))
303 maybebadio(outsl, port); 312 maybebadio(port);
304 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 313 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
305 volatile __u32 *p = (__u32 *)PCI_IOMAP(port); 314 unsigned long a = (unsigned long)addr;
306 const __u32 *s = addr;
307 315
308 while (count--) *p = *s++; 316 while (count--) {
317 ctrl_outl(ctrl_inl(a), PCI_IOMAP(port));
318 a += 4;
319 }
309 } else 320 } else
310 maybebadio(outsl, port); 321 maybebadio(port);
311} 322}
312 323
313void *rts7751r2d_ioremap(unsigned long offset, unsigned long size) 324void *rts7751r2d_ioremap(unsigned long offset, unsigned long size)
diff --git a/arch/sh/boards/renesas/rts7751r2d/led.c b/arch/sh/boards/renesas/rts7751r2d/led.c
index cf35f90dfe03..e14a13d12d4a 100644
--- a/arch/sh/boards/renesas/rts7751r2d/led.c
+++ b/arch/sh/boards/renesas/rts7751r2d/led.c
@@ -53,12 +53,3 @@ void rts7751r2d_led(unsigned short value)
53 ctrl_outw(value, PA_OUTPORT); 53 ctrl_outw(value, PA_OUTPORT);
54} 54}
55 55
56void debug_led_disp(void)
57{
58 unsigned short value;
59
60 value = (unsigned short)debug_counter++;
61 rts7751r2d_led(value);
62 if (value == 0xff)
63 debug_counter = 0;
64}
diff --git a/arch/sh/boards/renesas/rts7751r2d/mach.c b/arch/sh/boards/renesas/rts7751r2d/mach.c
index 5ed9e97ea197..175a93d726e8 100644
--- a/arch/sh/boards/renesas/rts7751r2d/mach.c
+++ b/arch/sh/boards/renesas/rts7751r2d/mach.c
@@ -15,7 +15,7 @@
15#include <asm/machvec.h> 15#include <asm/machvec.h>
16#include <asm/rtc.h> 16#include <asm/rtc.h>
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/rts7751r2d/io.h> 18#include <asm/mach/rts7751r2d.h>
19 19
20extern void heartbeat_rts7751r2d(void); 20extern void heartbeat_rts7751r2d(void);
21extern void init_rts7751r2d_IRQ(void); 21extern void init_rts7751r2d_IRQ(void);
@@ -54,7 +54,6 @@ struct sh_machine_vector mv_rts7751r2d __initmv = {
54 .mv_outsl = rts7751r2d_outsl, 54 .mv_outsl = rts7751r2d_outsl,
55 55
56 .mv_ioremap = rts7751r2d_ioremap, 56 .mv_ioremap = rts7751r2d_ioremap,
57 .mv_isa_port2addr = rts7751r2d_isa_port2addr,
58 .mv_init_irq = init_rts7751r2d_IRQ, 57 .mv_init_irq = init_rts7751r2d_IRQ,
59#ifdef CONFIG_HEARTBEAT 58#ifdef CONFIG_HEARTBEAT
60 .mv_heartbeat = heartbeat_rts7751r2d, 59 .mv_heartbeat = heartbeat_rts7751r2d,