Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+68 -81
+1 -1
arch/sh/Kconfig
··· 402 402 403 403 source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" 404 404 405 - #source "arch/sh/boards/renesas/rts7751r2d/Kconfig" 405 + source "arch/sh/boards/renesas/rts7751r2d/Kconfig" 406 406 407 407 config SH_PCLK_FREQ 408 408 int "Peripheral clock frequency (in Hz)"
+1 -1
arch/sh/boards/renesas/hs7751rvoip/Makefile
··· 2 2 # Makefile for the HS7751RVoIP specific parts of the kernel 3 3 # 4 4 5 - obj-y := setup.o io.o irq.o led.o 5 + obj-y := setup.o io.o irq.o 6 6 7 7 obj-$(CONFIG_PCI) += pci.o 8 8
-26
arch/sh/boards/renesas/hs7751rvoip/led.c
··· 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 - 16 - extern unsigned int debug_counter; 17 - 18 - void 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 - }
+12
arch/sh/boards/renesas/rts7751r2d/Kconfig
··· 1 + if SH_RTS7751R2D 2 + 3 + menu "RTS7751R2D options" 4 + 5 + config RTS7751R2D_REV11 6 + bool "RTS7751R2D Rev. 1.1 board support" 7 + help 8 + Selecting this option will support version rev. 1.1. 9 + endmenu 10 + 11 + endif 12 +
+53 -42
arch/sh/boards/renesas/rts7751r2d/io.c
··· 13 13 14 14 #include <linux/kernel.h> 15 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 16 #include <linux/pci.h> 22 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 23 * The 7751R RTS7751R2D uses the built-in PCI controller (PCIC) ··· 33 35 34 36 #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK)) 35 37 36 - #define maybebadio(name,port) \ 37 - printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \ 38 - #name, (port), (__u32) __builtin_return_address(0)) 39 - 40 38 static inline void delay(void) 41 39 { 42 40 ctrl_inw(0xa0000000); ··· 46 52 else 47 53 return (PA_AREA5_IO + 0x1000 + ((port-0x1f0) << 1)); 48 54 else 49 - maybebadio(port2adr, (unsigned long)port); 55 + maybebadio((unsigned long)port); 50 56 51 57 return port; 52 58 } ··· 132 138 unsigned short rts7751r2d_inw(unsigned long port) 133 139 { 134 140 if (CHECK_AX88796L_PORT(port)) 135 - maybebadio(inw, port); 141 + maybebadio(port); 136 142 else if (PXSEG(port)) 137 143 return *(volatile unsigned short *)port; 138 144 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 139 145 return *(volatile unsigned short *)PCI_IOMAP(port); 140 146 else 141 - maybebadio(inw, port); 147 + maybebadio(port); 142 148 143 149 return 0; 144 150 } ··· 146 152 unsigned int rts7751r2d_inl(unsigned long port) 147 153 { 148 154 if (CHECK_AX88796L_PORT(port)) 149 - maybebadio(inl, port); 155 + maybebadio(port); 150 156 else if (PXSEG(port)) 151 157 return *(volatile unsigned long *)port; 152 158 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 153 159 return *(volatile unsigned long *)PCI_IOMAP(port); 154 160 else 155 - maybebadio(inl, port); 161 + maybebadio(port); 156 162 157 163 return 0; 158 164 } ··· 185 191 void rts7751r2d_outw(unsigned short value, unsigned long port) 186 192 { 187 193 if (CHECK_AX88796L_PORT(port)) 188 - maybebadio(outw, port); 194 + maybebadio(port); 189 195 else if (PXSEG(port)) 190 196 *(volatile unsigned short *)port = value; 191 197 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 192 198 *(volatile unsigned short *)PCI_IOMAP(port) = value; 193 199 else 194 - maybebadio(outw, port); 200 + maybebadio(port); 195 201 } 196 202 197 203 void rts7751r2d_outl(unsigned int value, unsigned long port) 198 204 { 199 205 if (CHECK_AX88796L_PORT(port)) 200 - maybebadio(outl, port); 206 + maybebadio(port); 201 207 else if (PXSEG(port)) 202 208 *(volatile unsigned long *)port = value; 203 209 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 204 210 *(volatile unsigned long *)PCI_IOMAP(port) = value; 205 211 else 206 - maybebadio(outl, port); 212 + maybebadio(port); 207 213 } 208 214 209 215 void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count) 210 216 { 217 + unsigned long a = (unsigned long)addr; 211 218 volatile __u8 *bp; 212 219 volatile __u16 *p; 213 - unsigned char *s = addr; 214 220 215 221 if (CHECK_AX88796L_PORT(port)) { 216 222 p = (volatile unsigned short *)port88796l(port, 0); 217 - while (count--) *s++ = *p & 0xff; 223 + while (count--) 224 + ctrl_outb(*p & 0xff, a++); 218 225 } else if (PXSEG(port)) 219 - while (count--) *s++ = *(volatile unsigned char *)port; 226 + while (count--) 227 + ctrl_outb(ctrl_inb(port), a++); 220 228 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 221 229 bp = (__u8 *)PCI_IOMAP(port); 222 - while (count--) *s++ = *bp; 230 + while (count--) 231 + ctrl_outb(*bp, a++); 223 232 } else { 224 233 p = (volatile unsigned short *)port2adr(port); 225 - while (count--) *s++ = *p & 0xff; 234 + while (count--) 235 + ctrl_outb(*p & 0xff, a++); 226 236 } 227 237 } 228 238 229 239 void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count) 230 240 { 241 + unsigned long a = (unsigned long)addr; 231 242 volatile __u16 *p; 232 - __u16 *s = addr; 233 243 234 244 if (CHECK_AX88796L_PORT(port)) 235 245 p = (volatile unsigned short *)port88796l(port, 1); ··· 243 245 p = (volatile unsigned short *)PCI_IOMAP(port); 244 246 else 245 247 p = (volatile unsigned short *)port2adr(port); 246 - while (count--) *s++ = *p; 248 + while (count--) 249 + ctrl_outw(*p, a++); 247 250 } 248 251 249 252 void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count) 250 253 { 251 254 if (CHECK_AX88796L_PORT(port)) 252 - maybebadio(insl, port); 255 + maybebadio(port); 253 256 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 254 - volatile __u32 *p = (__u32 *)PCI_IOMAP(port); 255 - __u32 *s = addr; 257 + unsigned long a = (unsigned long)addr; 256 258 257 - while (count--) *s++ = *p; 259 + while (count--) { 260 + ctrl_outl(ctrl_inl(PCI_IOMAP(port)), a); 261 + a += 4; 262 + } 258 263 } else 259 - maybebadio(insl, port); 264 + maybebadio(port); 260 265 } 261 266 262 267 void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count) 263 268 { 269 + unsigned long a = (unsigned long)addr; 264 270 volatile __u8 *bp; 265 271 volatile __u16 *p; 266 - const __u8 *s = addr; 267 272 268 273 if (CHECK_AX88796L_PORT(port)) { 269 274 p = (volatile unsigned short *)port88796l(port, 0); 270 - while (count--) *p = *s++; 275 + while (count--) 276 + *p = ctrl_inb(a++); 271 277 } else if (PXSEG(port)) 272 - while (count--) *(volatile unsigned char *)port = *s++; 278 + while (count--) 279 + ctrl_outb(a++, port); 273 280 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 274 281 bp = (__u8 *)PCI_IOMAP(port); 275 - while (count--) *bp = *s++; 282 + while (count--) 283 + *bp = ctrl_inb(a++); 276 284 } else { 277 285 p = (volatile unsigned short *)port2adr(port); 278 - while (count--) *p = *s++; 286 + while (count--) 287 + *p = ctrl_inb(a++); 279 288 } 280 289 } 281 290 282 291 void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count) 283 292 { 293 + unsigned long a = (unsigned long)addr; 284 294 volatile __u16 *p; 285 - const __u16 *s = addr; 286 295 287 296 if (CHECK_AX88796L_PORT(port)) 288 297 p = (volatile unsigned short *)port88796l(port, 1); ··· 299 294 p = (volatile unsigned short *)PCI_IOMAP(port); 300 295 else 301 296 p = (volatile unsigned short *)port2adr(port); 302 - while (count--) *p = *s++; 297 + 298 + while (count--) { 299 + ctrl_outw(*p, a); 300 + a += 2; 301 + } 303 302 } 304 303 305 304 void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count) 306 305 { 307 306 if (CHECK_AX88796L_PORT(port)) 308 - maybebadio(outsl, port); 307 + maybebadio(port); 309 308 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { 310 - volatile __u32 *p = (__u32 *)PCI_IOMAP(port); 311 - const __u32 *s = addr; 309 + unsigned long a = (unsigned long)addr; 312 310 313 - while (count--) *p = *s++; 311 + while (count--) { 312 + ctrl_outl(ctrl_inl(a), PCI_IOMAP(port)); 313 + a += 4; 314 + } 314 315 } else 315 - maybebadio(outsl, port); 316 + maybebadio(port); 316 317 } 317 318 318 319 void *rts7751r2d_ioremap(unsigned long offset, unsigned long size)
-9
arch/sh/boards/renesas/rts7751r2d/led.c
··· 53 53 ctrl_outw(value, PA_OUTPORT); 54 54 } 55 55 56 - void 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 - }
+1 -2
arch/sh/boards/renesas/rts7751r2d/mach.c
··· 15 15 #include <asm/machvec.h> 16 16 #include <asm/rtc.h> 17 17 #include <asm/irq.h> 18 - #include <asm/rts7751r2d/io.h> 18 + #include <asm/mach/rts7751r2d.h> 19 19 20 20 extern void heartbeat_rts7751r2d(void); 21 21 extern void init_rts7751r2d_IRQ(void); ··· 54 54 .mv_outsl = rts7751r2d_outsl, 55 55 56 56 .mv_ioremap = rts7751r2d_ioremap, 57 - .mv_isa_port2addr = rts7751r2d_isa_port2addr, 58 57 .mv_init_irq = init_rts7751r2d_IRQ, 59 58 #ifdef CONFIG_HEARTBEAT 60 59 .mv_heartbeat = heartbeat_rts7751r2d,