From 6fec2e1727049ce6a404f4af61461d860594d5db Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 13 Jul 2007 06:33:09 +0100 Subject: [MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_AU1XXX_PSC_SPI Noticed by Robert P. J. Day (rpjday@mindspring.com). Signed-off-by: Ralf Baechle --- arch/mips/au1000/pb1200/board_setup.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/mips/au1000/pb1200/board_setup.c b/arch/mips/au1000/pb1200/board_setup.c index 043302b7fe5..eea2092bde8 100644 --- a/arch/mips/au1000/pb1200/board_setup.c +++ b/arch/mips/au1000/pb1200/board_setup.c @@ -131,14 +131,7 @@ void __init board_setup(void) /* The Pb1200 development board uses external MUX for PSC0 to support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI */ -#if defined(CONFIG_AU1XXX_PSC_SPI) && defined(CONFIG_I2C_AU1550) - #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\ - Refer to Pb1200/Db1200 documentation. -#elif defined( CONFIG_AU1XXX_PSC_SPI ) - bcsr->resets |= BCSR_RESETS_PCS0MUX; - /*Hard Coding Value to enable Temp Sensors [bit 14] Value for SOC Au1200. Pls refer documentation*/ - bcsr->resets =0x900f; -#elif defined( CONFIG_I2C_AU1550 ) +#ifdef CONFIG_I2C_AU1550 bcsr->resets &= (~BCSR_RESETS_PCS0MUX); #endif au_sync(); -- cgit v1.2.3-18-g5258 From 8f597acab2742b7ae9a556613c389ffa914cdbbd Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 13 Jul 2007 06:42:36 +0100 Subject: [MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_AU1000_USE32K Noticed by Robert P. J. Day (rpjday@mindspring.com). Signed-off-by: Ralf Baechle --- arch/mips/au1000/common/time.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'arch') diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index fa1c62f0551..1dba3f7ade8 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -247,33 +247,8 @@ unsigned long cal_r4koff(void) au_writel (0, SYS_TOYWRITE); while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); -#if defined(CONFIG_AU1000_USE32K) - { - unsigned long start, end, count; - - start = au_readl(SYS_RTCREAD); - start += 2; - /* wait for the beginning of a new tick - */ - while (au_readl(SYS_RTCREAD) < start); - - /* Start r4k counter. - */ - write_c0_count(0); - - /* Wait 0.5 seconds. - */ - end = start + (32768 / trim_divide)/2; - - while (end > au_readl(SYS_RTCREAD)); - - count = read_c0_count(); - cpu_speed = count * 2; - } -#else cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; -#endif } else { /* The 32KHz oscillator isn't running, so assume there -- cgit v1.2.3-18-g5258 From 85a882bc3553636930bef7773201955c0e2fcf99 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 13 Jul 2007 06:45:48 +0100 Subject: [MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_AU1000_SRC_CLK Noticed by Robert P. J. Day (rpjday@mindspring.com). Signed-off-by: Ralf Baechle --- arch/mips/au1000/common/time.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch') diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index 1dba3f7ade8..8fc29982d70 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -203,11 +203,7 @@ wakeup_counter0_set(int ticks) /* I haven't found anyone that doesn't use a 12 MHz source clock, * but just in case..... */ -#ifdef CONFIG_AU1000_SRC_CLK -#define AU1000_SRC_CLK CONFIG_AU1000_SRC_CLK -#else #define AU1000_SRC_CLK 12000000 -#endif /* * We read the real processor speed from the PLL. This is important -- cgit v1.2.3-18-g5258 From b58f4b7aaf5ddaf2fdc13dfeb3ce6e61d51c3ac5 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 13 Jul 2007 10:40:23 +0100 Subject: [MIPS] Alchemy: Remove code wrapped by dead symbol CONFIG_FB_XPERT98 Noticed by Robert P. J. Day (rpjday@mindspring.com). Signed-off-by: Ralf Baechle --- arch/mips/au1000/common/setup.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch') diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c index fdf2b85a69c..a95b3777319 100644 --- a/arch/mips/au1000/common/setup.c +++ b/arch/mips/au1000/common/setup.c @@ -103,12 +103,6 @@ void __init plat_mem_setup(void) } #endif -#ifdef CONFIG_FB_XPERT98 - if ((argptr = strstr(argptr, "video=")) == NULL) { - argptr = prom_getcmdline(); - strcat(argptr, " video=atyfb:1024x768-8@70"); - } -#endif #if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) /* au1000 does not support vra, au1500 and au1100 do */ -- cgit v1.2.3-18-g5258 From e50e1c744df20e704441a99eef7c6414e6920712 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Fri, 13 Jul 2007 02:00:26 +0900 Subject: [MIPS] Kill CONFIG_TX4927BUG_WORKAROUND Kill workarounds for very early chip (perhaps pre-TX4927A). Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- .../tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'arch') diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index a0c11efeaee..40c7c3eeafa 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c @@ -138,7 +138,6 @@ extern void toshiba_rbtx4927_irq_setup(void); char *prom_getcmdline(void); #ifdef CONFIG_PCI -#define CONFIG_TX4927BUG_WORKAROUND #undef TX4927_SUPPORT_COMMAND_IO #undef TX4927_SUPPORT_PCI_66 int tx4927_cpu_clock = 100000000; /* 100MHz */ @@ -669,15 +668,7 @@ void tx4927_pci_setup(void) /* PCI->GB mappings (MEM 16MB) -not used */ tx4927_pcicptr->p2gm1plbase = 0xffffffff; -#ifdef CONFIG_TX4927BUG_WORKAROUND - /* - * TX4927-PCIC-BUG: P2GM1PUBASE must be 0 - * if P2GM0PUBASE was 0. - */ - tx4927_pcicptr->p2gm1pubase = 0; -#else tx4927_pcicptr->p2gm1pubase = 0xffffffff; -#endif tx4927_pcicptr->p2gmgbase[1] = 0; /* PCI->GB mappings (MEM 1MB) -not used */ @@ -910,16 +901,6 @@ void __init toshiba_rbtx4927_setup(void) if (tx4927_ccfg_toeon) tx4927_ccfgptr->ccfg |= TX4927_CCFG_TOE; - /* SDRAMC fixup */ -#ifdef CONFIG_TX4927BUG_WORKAROUND - /* - * TX4927-BUG: INF 01-01-18/ BUG 01-01-22 - * G-bus timeout error detection is incorrect - */ - if (tx4927_ccfg_toeon) - tx4927_sdramcptr->tr |= 0x02000000; /* RCD:3tck */ -#endif - tx4927_pci_setup(); if (tx4927_using_backplane == 1) printk("backplane board IS installed\n"); -- cgit v1.2.3-18-g5258 From e70dfc10b99ebffa1f464b1b9290df2589284f70 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Fri, 13 Jul 2007 23:02:29 +0900 Subject: [MIPS] math-emu minor cleanup Declaring emulpc and contpc as "unsigned long" can get rid of some casts. This also get rid of some sparse warnings. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/math-emu/cp1emu.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'arch') diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index d7f05b0abe1..17419e11eca 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c @@ -205,7 +205,7 @@ static int isBranchInstr(mips_instruction * i) static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) { mips_instruction ir; - void * emulpc, *contpc; + unsigned long emulpc, contpc; unsigned int cond; if (get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) { @@ -230,7 +230,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) * Linux MIPS branch emulator operates on context, updating the * cp0_epc. */ - emulpc = (void *) (xcp->cp0_epc + 4); /* Snapshot emulation target */ + emulpc = xcp->cp0_epc + 4; /* Snapshot emulation target */ if (__compute_return_epc(xcp)) { #ifdef CP1DBG @@ -244,12 +244,12 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) return SIGBUS; } /* __compute_return_epc() will have updated cp0_epc */ - contpc = (void *) xcp->cp0_epc; + contpc = xcp->cp0_epc; /* In order not to confuse ptrace() et al, tweak context */ - xcp->cp0_epc = (unsigned long) emulpc - 4; + xcp->cp0_epc = emulpc - 4; } else { - emulpc = (void *) xcp->cp0_epc; - contpc = (void *) (xcp->cp0_epc + 4); + emulpc = xcp->cp0_epc; + contpc = xcp->cp0_epc + 4; } emul: @@ -427,8 +427,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) * instruction */ xcp->cp0_epc += 4; - contpc = (void *) - (xcp->cp0_epc + + contpc = (xcp->cp0_epc + (MIPSInst_SIMM(ir) << 2)); if (get_user(ir, @@ -462,7 +461,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) * Single step the non-cp1 * instruction in the dslot */ - return mips_dsemul(xcp, ir, (unsigned long) contpc); + return mips_dsemul(xcp, ir, contpc); } else { /* branch not taken */ @@ -521,7 +520,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) } /* we did it !! */ - xcp->cp0_epc = (unsigned long) contpc; + xcp->cp0_epc = contpc; xcp->cp0_cause &= ~CAUSEF_BD; return 0; -- cgit v1.2.3-18-g5258 From 5e0373b8e449b0c72495a6d8401c53f678b71988 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Fri, 13 Jul 2007 23:02:42 +0900 Subject: [MIPS] Add some __user tags Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/kernel/branch.c | 5 +++-- arch/mips/kernel/traps.c | 2 +- arch/mips/math-emu/dsemul.c | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'arch') diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c index 76fd3f22c76..6b5df8bfab8 100644 --- a/arch/mips/kernel/branch.c +++ b/arch/mips/kernel/branch.c @@ -22,7 +22,8 @@ */ int __compute_return_epc(struct pt_regs *regs) { - unsigned int *addr, bit, fcr31, dspcontrol; + unsigned int __user *addr; + unsigned int bit, fcr31, dspcontrol; long epc; union mips_instruction insn; @@ -33,7 +34,7 @@ int __compute_return_epc(struct pt_regs *regs) /* * Read the instruction */ - addr = (unsigned int *) epc; + addr = (unsigned int __user *) epc; if (__get_user(insn.word, addr)) { force_sig(SIGSEGV, current); return -EFAULT; diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 5e9fa83c4ef..6f3e5c1424d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -131,7 +131,7 @@ static void show_stacktrace(struct task_struct *task, struct pt_regs *regs) const int field = 2 * sizeof(unsigned long); long stackdata; int i; - unsigned long *sp = (unsigned long *)regs->regs[29]; + unsigned long __user *sp = (unsigned long __user *)regs->regs[29]; printk("Stack :"); i = 0; diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c index ea6ba724848..653e325849e 100644 --- a/arch/mips/math-emu/dsemul.c +++ b/arch/mips/math-emu/dsemul.c @@ -54,8 +54,7 @@ struct emuframe { int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) { extern asmlinkage void handle_dsemulret(void); - mips_instruction *dsemul_insns; - struct emuframe *fr; + struct emuframe __user *fr; int err; if (ir == 0) { /* a nop is easy */ @@ -87,8 +86,8 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) */ /* Ensure that the two instructions are in the same cache line */ - dsemul_insns = (mips_instruction *) ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); - fr = (struct emuframe *) dsemul_insns; + fr = (struct emuframe __user *) + ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); /* Verify that the stack pointer is not competely insane */ if (unlikely(!access_ok(VERIFY_WRITE, fr, sizeof(struct emuframe)))) @@ -113,12 +112,13 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) int do_dsemulret(struct pt_regs *xcp) { - struct emuframe *fr; + struct emuframe __user *fr; unsigned long epc; u32 insn, cookie; int err = 0; - fr = (struct emuframe *) (xcp->cp0_epc - sizeof(mips_instruction)); + fr = (struct emuframe __user *) + (xcp->cp0_epc - sizeof(mips_instruction)); /* * If we can't even access the area, something is very wrong, but we'll -- cgit v1.2.3-18-g5258 From e1bb828906e54ffb7e8b358516158ffdcf9581b8 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Fri, 13 Jul 2007 23:51:46 +0900 Subject: [MIPS] Make show_code static and add __user tag Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/kernel/traps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 6f3e5c1424d..37c562c4c81 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -187,7 +187,7 @@ void dump_stack(void) EXPORT_SYMBOL(dump_stack); -void show_code(unsigned int *pc) +static void show_code(unsigned int __user *pc) { long i; @@ -305,7 +305,7 @@ void show_registers(struct pt_regs *regs) printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", current->comm, current->pid, current_thread_info(), current); show_stacktrace(current, regs); - show_code((unsigned int *) regs->cp0_epc); + show_code((unsigned int __user *) regs->cp0_epc); printk("\n"); } @@ -865,7 +865,7 @@ asmlinkage void do_mcheck(struct pt_regs *regs) dump_tlb_all(); } - show_code((unsigned int *) regs->cp0_epc); + show_code((unsigned int __user *) regs->cp0_epc); /* * Some chips may have other causes of machine check (e.g. SB1 -- cgit v1.2.3-18-g5258