Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] Workaround for a sparse warning in include/asm-mips/mach-tx4927/ioremap.h
[MIPS] Make show_code static and add __user tag
[MIPS] Workaround for a sparse warning in include/asm-mips/compat.h
[MIPS] Add some __user tags
[MIPS] math-emu minor cleanup
[MIPS] Kill CONFIG_TX4927BUG_WORKAROUND
[MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_FB_XPERT98
[MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_AU1000_SRC_CLK
[MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_AU1000_USE32K
[MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_AU1XXX_PSC_SPI
[CHAR] Delete leftovers of old Alchemy UART driver

+27 -100
-6
arch/mips/au1000/common/setup.c
··· 103 103 } 104 104 #endif 105 105 106 - #ifdef CONFIG_FB_XPERT98 107 - if ((argptr = strstr(argptr, "video=")) == NULL) { 108 - argptr = prom_getcmdline(); 109 - strcat(argptr, " video=atyfb:1024x768-8@70"); 110 - } 111 - #endif 112 106 113 107 #if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) 114 108 /* au1000 does not support vra, au1500 and au1100 do */
-29
arch/mips/au1000/common/time.c
··· 203 203 /* I haven't found anyone that doesn't use a 12 MHz source clock, 204 204 * but just in case..... 205 205 */ 206 - #ifdef CONFIG_AU1000_SRC_CLK 207 - #define AU1000_SRC_CLK CONFIG_AU1000_SRC_CLK 208 - #else 209 206 #define AU1000_SRC_CLK 12000000 210 - #endif 211 207 212 208 /* 213 209 * We read the real processor speed from the PLL. This is important ··· 243 247 au_writel (0, SYS_TOYWRITE); 244 248 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); 245 249 246 - #if defined(CONFIG_AU1000_USE32K) 247 - { 248 - unsigned long start, end, count; 249 - 250 - start = au_readl(SYS_RTCREAD); 251 - start += 2; 252 - /* wait for the beginning of a new tick 253 - */ 254 - while (au_readl(SYS_RTCREAD) < start); 255 - 256 - /* Start r4k counter. 257 - */ 258 - write_c0_count(0); 259 - 260 - /* Wait 0.5 seconds. 261 - */ 262 - end = start + (32768 / trim_divide)/2; 263 - 264 - while (end > au_readl(SYS_RTCREAD)); 265 - 266 - count = read_c0_count(); 267 - cpu_speed = count * 2; 268 - } 269 - #else 270 250 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 271 251 AU1000_SRC_CLK; 272 - #endif 273 252 } 274 253 else { 275 254 /* The 32KHz oscillator isn't running, so assume there
+1 -8
arch/mips/au1000/pb1200/board_setup.c
··· 131 131 /* The Pb1200 development board uses external MUX for PSC0 to 132 132 support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI 133 133 */ 134 - #if defined(CONFIG_AU1XXX_PSC_SPI) && defined(CONFIG_I2C_AU1550) 135 - #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\ 136 - Refer to Pb1200/Db1200 documentation. 137 - #elif defined( CONFIG_AU1XXX_PSC_SPI ) 138 - bcsr->resets |= BCSR_RESETS_PCS0MUX; 139 - /*Hard Coding Value to enable Temp Sensors [bit 14] Value for SOC Au1200. Pls refer documentation*/ 140 - bcsr->resets =0x900f; 141 - #elif defined( CONFIG_I2C_AU1550 ) 134 + #ifdef CONFIG_I2C_AU1550 142 135 bcsr->resets &= (~BCSR_RESETS_PCS0MUX); 143 136 #endif 144 137 au_sync();
+3 -2
arch/mips/kernel/branch.c
··· 22 22 */ 23 23 int __compute_return_epc(struct pt_regs *regs) 24 24 { 25 - unsigned int *addr, bit, fcr31, dspcontrol; 25 + unsigned int __user *addr; 26 + unsigned int bit, fcr31, dspcontrol; 26 27 long epc; 27 28 union mips_instruction insn; 28 29 ··· 34 33 /* 35 34 * Read the instruction 36 35 */ 37 - addr = (unsigned int *) epc; 36 + addr = (unsigned int __user *) epc; 38 37 if (__get_user(insn.word, addr)) { 39 38 force_sig(SIGSEGV, current); 40 39 return -EFAULT;
+4 -4
arch/mips/kernel/traps.c
··· 131 131 const int field = 2 * sizeof(unsigned long); 132 132 long stackdata; 133 133 int i; 134 - unsigned long *sp = (unsigned long *)regs->regs[29]; 134 + unsigned long __user *sp = (unsigned long __user *)regs->regs[29]; 135 135 136 136 printk("Stack :"); 137 137 i = 0; ··· 187 187 188 188 EXPORT_SYMBOL(dump_stack); 189 189 190 - void show_code(unsigned int *pc) 190 + static void show_code(unsigned int __user *pc) 191 191 { 192 192 long i; 193 193 ··· 305 305 printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", 306 306 current->comm, current->pid, current_thread_info(), current); 307 307 show_stacktrace(current, regs); 308 - show_code((unsigned int *) regs->cp0_epc); 308 + show_code((unsigned int __user *) regs->cp0_epc); 309 309 printk("\n"); 310 310 } 311 311 ··· 865 865 dump_tlb_all(); 866 866 } 867 867 868 - show_code((unsigned int *) regs->cp0_epc); 868 + show_code((unsigned int __user *) regs->cp0_epc); 869 869 870 870 /* 871 871 * Some chips may have other causes of machine check (e.g. SB1
+9 -10
arch/mips/math-emu/cp1emu.c
··· 205 205 static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) 206 206 { 207 207 mips_instruction ir; 208 - void * emulpc, *contpc; 208 + unsigned long emulpc, contpc; 209 209 unsigned int cond; 210 210 211 211 if (get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) { ··· 230 230 * Linux MIPS branch emulator operates on context, updating the 231 231 * cp0_epc. 232 232 */ 233 - emulpc = (void *) (xcp->cp0_epc + 4); /* Snapshot emulation target */ 233 + emulpc = xcp->cp0_epc + 4; /* Snapshot emulation target */ 234 234 235 235 if (__compute_return_epc(xcp)) { 236 236 #ifdef CP1DBG ··· 244 244 return SIGBUS; 245 245 } 246 246 /* __compute_return_epc() will have updated cp0_epc */ 247 - contpc = (void *) xcp->cp0_epc; 247 + contpc = xcp->cp0_epc; 248 248 /* In order not to confuse ptrace() et al, tweak context */ 249 - xcp->cp0_epc = (unsigned long) emulpc - 4; 249 + xcp->cp0_epc = emulpc - 4; 250 250 } else { 251 - emulpc = (void *) xcp->cp0_epc; 252 - contpc = (void *) (xcp->cp0_epc + 4); 251 + emulpc = xcp->cp0_epc; 252 + contpc = xcp->cp0_epc + 4; 253 253 } 254 254 255 255 emul: ··· 427 427 * instruction 428 428 */ 429 429 xcp->cp0_epc += 4; 430 - contpc = (void *) 431 - (xcp->cp0_epc + 430 + contpc = (xcp->cp0_epc + 432 431 (MIPSInst_SIMM(ir) << 2)); 433 432 434 433 if (get_user(ir, ··· 461 462 * Single step the non-cp1 462 463 * instruction in the dslot 463 464 */ 464 - return mips_dsemul(xcp, ir, (unsigned long) contpc); 465 + return mips_dsemul(xcp, ir, contpc); 465 466 } 466 467 else { 467 468 /* branch not taken */ ··· 520 521 } 521 522 522 523 /* we did it !! */ 523 - xcp->cp0_epc = (unsigned long) contpc; 524 + xcp->cp0_epc = contpc; 524 525 xcp->cp0_cause &= ~CAUSEF_BD; 525 526 526 527 return 0;
+6 -6
arch/mips/math-emu/dsemul.c
··· 54 54 int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) 55 55 { 56 56 extern asmlinkage void handle_dsemulret(void); 57 - mips_instruction *dsemul_insns; 58 - struct emuframe *fr; 57 + struct emuframe __user *fr; 59 58 int err; 60 59 61 60 if (ir == 0) { /* a nop is easy */ ··· 86 87 */ 87 88 88 89 /* Ensure that the two instructions are in the same cache line */ 89 - dsemul_insns = (mips_instruction *) ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); 90 - fr = (struct emuframe *) dsemul_insns; 90 + fr = (struct emuframe __user *) 91 + ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); 91 92 92 93 /* Verify that the stack pointer is not competely insane */ 93 94 if (unlikely(!access_ok(VERIFY_WRITE, fr, sizeof(struct emuframe)))) ··· 112 113 113 114 int do_dsemulret(struct pt_regs *xcp) 114 115 { 115 - struct emuframe *fr; 116 + struct emuframe __user *fr; 116 117 unsigned long epc; 117 118 u32 insn, cookie; 118 119 int err = 0; 119 120 120 - fr = (struct emuframe *) (xcp->cp0_epc - sizeof(mips_instruction)); 121 + fr = (struct emuframe __user *) 122 + (xcp->cp0_epc - sizeof(mips_instruction)); 121 123 122 124 /* 123 125 * If we can't even access the area, something is very wrong, but we'll
-19
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
··· 138 138 char *prom_getcmdline(void); 139 139 140 140 #ifdef CONFIG_PCI 141 - #define CONFIG_TX4927BUG_WORKAROUND 142 141 #undef TX4927_SUPPORT_COMMAND_IO 143 142 #undef TX4927_SUPPORT_PCI_66 144 143 int tx4927_cpu_clock = 100000000; /* 100MHz */ ··· 668 669 669 670 /* PCI->GB mappings (MEM 16MB) -not used */ 670 671 tx4927_pcicptr->p2gm1plbase = 0xffffffff; 671 - #ifdef CONFIG_TX4927BUG_WORKAROUND 672 - /* 673 - * TX4927-PCIC-BUG: P2GM1PUBASE must be 0 674 - * if P2GM0PUBASE was 0. 675 - */ 676 - tx4927_pcicptr->p2gm1pubase = 0; 677 - #else 678 672 tx4927_pcicptr->p2gm1pubase = 0xffffffff; 679 - #endif 680 673 tx4927_pcicptr->p2gmgbase[1] = 0; 681 674 682 675 /* PCI->GB mappings (MEM 1MB) -not used */ ··· 900 909 /* enable Timeout BusError */ 901 910 if (tx4927_ccfg_toeon) 902 911 tx4927_ccfgptr->ccfg |= TX4927_CCFG_TOE; 903 - 904 - /* SDRAMC fixup */ 905 - #ifdef CONFIG_TX4927BUG_WORKAROUND 906 - /* 907 - * TX4927-BUG: INF 01-01-18/ BUG 01-01-22 908 - * G-bus timeout error detection is incorrect 909 - */ 910 - if (tx4927_ccfg_toeon) 911 - tx4927_sdramcptr->tr |= 0x02000000; /* RCD:3tck */ 912 - #endif 913 912 914 913 tx4927_pci_setup(); 915 914 if (tx4927_using_backplane == 1)
-14
drivers/char/Kconfig
··· 374 374 To compile this driver as a module, choose M here: the 375 375 module will be called istallion. 376 376 377 - config AU1000_UART 378 - bool "Enable Au1000 UART Support" 379 - depends on SERIAL_NONSTANDARD && MIPS 380 - help 381 - If you have an Alchemy AU1000 processor (MIPS based) and you want 382 - to use serial ports, say Y. Otherwise, say N. 383 - 384 - config AU1000_SERIAL_CONSOLE 385 - bool "Enable Au1000 serial console" 386 - depends on AU1000_UART 387 - help 388 - If you have an Alchemy AU1000 processor (MIPS based) and you want 389 - to use a console on a serial port, say Y. Otherwise, say N. 390 - 391 377 config SERIAL_DEC 392 378 bool "DECstation serial support" 393 379 depends on MACH_DECSTATION
+2 -1
include/asm-mips/compat.h
··· 132 132 133 133 static inline void __user *compat_ptr(compat_uptr_t uptr) 134 134 { 135 - return (void __user *)(long)uptr; 135 + /* cast to a __user pointer via "unsigned long" makes sparse happy */ 136 + return (void __user *)(unsigned long)(long)uptr; 136 137 } 137 138 138 139 static inline compat_uptr_t ptr_to_compat(void __user *uptr)
+2 -1
include/asm-mips/mach-tx49xx/ioremap.h
··· 36 36 37 37 static inline int plat_iounmap(const volatile void __iomem *addr) 38 38 { 39 - return (unsigned long)addr >= (unsigned long)(int)TXX9_DIRECTMAP_BASE; 39 + return (unsigned long)addr >= 40 + (unsigned long)(int)(TXX9_DIRECTMAP_BASE & 0xffffffff); 40 41 } 41 42 42 43 #endif /* __ASM_MACH_TX49XX_IOREMAP_H */