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] MIPS doesn't need compat_sys_getdents.
[MIPS] JMR3927: Fixup another victim of the irq pt_regs cleanup.
[MIPS] EMMA 2 / Markeins: struct resource takes physical addresses.
[MIPS] EMMA 2 / Markeins: Convert to name struct resource initialization.
[MIPS] EMMA 2 / Markeins: Formitting fixes split from actual address fixes.
[MIPS] EMMA 2 / Markeins: Fix build wreckage due to genirq wreckage.
[MIPS] Ocelot G: Fix build error and numerous warnings.
[MIPS] Fix return value of TXX9 SPI interrupt handler
[MIPS] Au1000: Fix warning about unused variable.
[MIPS] Wire up getcpu(2) and epoll_wait(2) syscalls.
[MIPS] Make SB1 cache flushes not to use on_each_cpu
[MIPS] Fix warning about unused definition in c-sb1.c
[MIPS] SMTC: Make 8 the default number of processors.
[MIPS] Oprofile: Fix MIPSxx counter number detection.
[MIPS] Au1xx0 code sets incorrect mips_hpt_frequency
[MIPS] Oprofile: fix on non-VSMP / non-SMTC SMP configurations.

+121 -63
+2 -1
arch/mips/Kconfig
··· 408 408 select SWAP_IO_SPACE 409 409 select SYS_HAS_CPU_RM7000 410 410 select SYS_SUPPORTS_32BIT_KERNEL 411 - select SYS_SUPPORTS_64BIT_KERNEL 411 + select SYS_SUPPORTS_64BIT_KERNEL if BROKEN 412 412 select SYS_SUPPORTS_BIG_ENDIAN 413 413 help 414 414 The Ocelot is a MIPS-based Single Board Computer (SBC) made by ··· 1690 1690 depends on SMP 1691 1691 default "64" if SGI_IP27 1692 1692 default "2" 1693 + default "8" if MIPS_MT_SMTC 1693 1694 help 1694 1695 This allows you to specify the maximum number of CPUs which this 1695 1696 kernel will support. The maximum supported value is 32 for 32-bit
+2 -6
arch/mips/au1000/common/time.c
··· 82 82 void mips_timer_interrupt(void) 83 83 { 84 84 int irq = 63; 85 - unsigned long count; 86 85 87 86 irq_enter(); 88 87 kstat_this_cpu.irqs[irq]++; ··· 230 231 */ 231 232 unsigned long cal_r4koff(void) 232 233 { 233 - unsigned long count; 234 234 unsigned long cpu_speed; 235 235 unsigned long flags; 236 236 unsigned long counter; ··· 256 258 257 259 #if defined(CONFIG_AU1000_USE32K) 258 260 { 259 - unsigned long start, end; 261 + unsigned long start, end, count; 260 262 261 263 start = au_readl(SYS_RTCREAD); 262 264 start += 2; ··· 280 282 #else 281 283 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 282 284 AU1000_SRC_CLK; 283 - count = cpu_speed / 2; 284 285 #endif 285 286 } 286 287 else { ··· 288 291 * NOTE: some old silicon doesn't allow reading the PLL. 289 292 */ 290 293 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; 291 - count = cpu_speed / 2; 292 294 no_au1xxx_32khz = 1; 293 295 } 294 - mips_hpt_frequency = count; 296 + mips_hpt_frequency = cpu_speed; 295 297 // Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) 296 298 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16)); 297 299 spin_unlock_irqrestore(&time_lock, flags);
+1 -1
arch/mips/emma2rh/common/irq_emma2rh.c
··· 97 97 irq_desc[i].status = IRQ_DISABLED; 98 98 irq_desc[i].action = NULL; 99 99 irq_desc[i].depth = 1; 100 - irq_desc[i].handler = &emma2rh_irq_controller; 100 + irq_desc[i].chip = &emma2rh_irq_controller; 101 101 } 102 102 103 103 emma2rh_irq_base = irq_base;
+2 -2
arch/mips/emma2rh/markeins/irq_markeins.c
··· 86 86 irq_desc[i].status = IRQ_DISABLED; 87 87 irq_desc[i].action = NULL; 88 88 irq_desc[i].depth = 2; 89 - irq_desc[i].handler = &emma2rh_sw_irq_controller; 89 + irq_desc[i].chip = &emma2rh_sw_irq_controller; 90 90 } 91 91 92 92 emma2rh_sw_irq_base = irq_base; ··· 166 166 irq_desc[i].status = IRQ_DISABLED; 167 167 irq_desc[i].action = NULL; 168 168 irq_desc[i].depth = 2; 169 - irq_desc[i].handler = &emma2rh_gpio_irq_controller; 169 + irq_desc[i].chip = &emma2rh_gpio_irq_controller; 170 170 } 171 171 172 172 emma2rh_gpio_irq_base = irq_base;
+56 -32
arch/mips/emma2rh/markeins/platform.c
··· 44 44 #define I2C_EMMA2RH "emma2rh-iic" /* must be in sync with IIC driver */ 45 45 46 46 static struct resource i2c_emma_resources_0[] = { 47 - { NULL, EMMA2RH_IRQ_PIIC0, EMMA2RH_IRQ_PIIC0, IORESOURCE_IRQ }, 48 - { NULL, KSEG1ADDR(EMMA2RH_PIIC0_BASE), KSEG1ADDR(EMMA2RH_PIIC0_BASE + 0x1000), 0 }, 47 + { 48 + .name = NULL, 49 + .start = EMMA2RH_IRQ_PIIC0, 50 + .end = EMMA2RH_IRQ_PIIC0, 51 + .flags = IORESOURCE_IRQ 52 + }, { 53 + .name = NULL, 54 + .start = EMMA2RH_PIIC0_BASE, 55 + .end = EMMA2RH_PIIC0_BASE + 0x1000, 56 + .flags = 0 57 + }, 49 58 }; 50 59 51 60 struct resource i2c_emma_resources_1[] = { 52 - { NULL, EMMA2RH_IRQ_PIIC1, EMMA2RH_IRQ_PIIC1, IORESOURCE_IRQ }, 53 - { NULL, KSEG1ADDR(EMMA2RH_PIIC1_BASE), KSEG1ADDR(EMMA2RH_PIIC1_BASE + 0x1000), 0 }, 61 + { 62 + .name = NULL, 63 + .start = EMMA2RH_IRQ_PIIC1, 64 + .end = EMMA2RH_IRQ_PIIC1, 65 + .flags = IORESOURCE_IRQ 66 + }, { 67 + .name = NULL, 68 + .start = EMMA2RH_PIIC1_BASE, 69 + .end = EMMA2RH_PIIC1_BASE + 0x1000, 70 + .flags = 0 71 + }, 54 72 }; 55 73 56 74 struct resource i2c_emma_resources_2[] = { 57 - { NULL, EMMA2RH_IRQ_PIIC2, EMMA2RH_IRQ_PIIC2, IORESOURCE_IRQ }, 58 - { NULL, KSEG1ADDR(EMMA2RH_PIIC2_BASE), KSEG1ADDR(EMMA2RH_PIIC2_BASE + 0x1000), 0 }, 75 + { 76 + .name = NULL, 77 + .start = EMMA2RH_IRQ_PIIC2, 78 + .end = EMMA2RH_IRQ_PIIC2, 79 + .flags = IORESOURCE_IRQ 80 + }, { 81 + .name = NULL, 82 + .start = EMMA2RH_PIIC2_BASE, 83 + .end = EMMA2RH_PIIC2_BASE + 0x1000, 84 + .flags = 0 85 + }, 59 86 }; 60 87 61 88 struct platform_device i2c_emma_devices[] = { ··· 110 83 #define EMMA2RH_SERIAL_FLAGS UPF_BOOT_AUTOCONF | UPF_SKIP_TEST 111 84 112 85 static struct plat_serial8250_port platform_serial_ports[] = { 113 - [0] = { 114 - .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3), 115 - .irq = EMMA2RH_IRQ_PFUR0, 116 - .uartclk = EMMA2RH_SERIAL_CLOCK, 117 - .regshift = 4, 118 - .iotype = UPIO_MEM, 119 - .flags = EMMA2RH_SERIAL_FLAGS, 120 - }, 121 - [1] = { 122 - .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3), 123 - .irq = EMMA2RH_IRQ_PFUR1, 124 - .uartclk = EMMA2RH_SERIAL_CLOCK, 125 - .regshift = 4, 126 - .iotype = UPIO_MEM, 127 - .flags = EMMA2RH_SERIAL_FLAGS, 128 - }, 129 - [2] = { 130 - .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR2_BASE + 3), 131 - .irq = EMMA2RH_IRQ_PFUR2, 132 - .uartclk = EMMA2RH_SERIAL_CLOCK, 133 - .regshift = 4, 134 - .iotype = UPIO_MEM, 135 - .flags = EMMA2RH_SERIAL_FLAGS, 136 - }, 137 - [3] = { 138 - .flags = 0, 86 + [0] = { 87 + .membase= (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3), 88 + .irq = EMMA2RH_IRQ_PFUR0, 89 + .uartclk = EMMA2RH_SERIAL_CLOCK, 90 + .regshift = 4, 91 + .iotype = UPIO_MEM, 92 + .flags = EMMA2RH_SERIAL_FLAGS, 93 + }, [1] = { 94 + .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3), 95 + .irq = EMMA2RH_IRQ_PFUR1, 96 + .uartclk = EMMA2RH_SERIAL_CLOCK, 97 + .regshift = 4, 98 + .iotype = UPIO_MEM, 99 + .flags = EMMA2RH_SERIAL_FLAGS, 100 + }, [2] = { 101 + .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR2_BASE + 3), 102 + .irq = EMMA2RH_IRQ_PFUR2, 103 + .uartclk = EMMA2RH_SERIAL_CLOCK, 104 + .regshift = 4, 105 + .iotype = UPIO_MEM, 106 + .flags = EMMA2RH_SERIAL_FLAGS, 107 + }, [3] = { 108 + .flags = 0, 139 109 }, 140 110 }; 141 111
+3
arch/mips/jmr3927/rbhma3100/irq.c
··· 288 288 289 289 static void jmr3927_spurious(void) 290 290 { 291 + struct pt_regs * regs = get_irq_regs(); 292 + 291 293 #ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND 292 294 tx_branch_likely_bug_fixup(); 293 295 #endif ··· 299 297 300 298 asmlinkage void plat_irq_dispatch(void) 301 299 { 300 + struct pt_regs * regs = get_irq_regs(); 302 301 int irq; 303 302 304 303 #ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND
+2
arch/mips/kernel/scall32-o32.S
··· 654 654 sys sys_set_robust_list 2 655 655 sys sys_get_robust_list 3 /* 4310 */ 656 656 sys sys_ni_syscall 0 657 + sys sys_getcpu 3 658 + sys sys_epoll_pwait 6 657 659 .endm 658 660 659 661 /* We pre-compute the number of _instruction_ bytes needed to
+2
arch/mips/kernel/scall64-64.S
··· 469 469 PTR sys_set_robust_list 470 470 PTR sys_get_robust_list 471 471 PTR sys_ni_syscall /* 5270 */ 472 + PTR sys_getcpu 473 + PTR sys_epoll_pwait
+2
arch/mips/kernel/scall64-n32.S
··· 395 395 PTR compat_sys_set_robust_list 396 396 PTR compat_sys_get_robust_list 397 397 PTR sys_ni_syscall 398 + PTR sys_getcpu 399 + PTR sys_epoll_pwait
+2
arch/mips/kernel/scall64-o32.S
··· 517 517 PTR compat_sys_set_robust_list 518 518 PTR compat_sys_get_robust_list /* 4310 */ 519 519 PTR sys_ni_syscall 520 + PTR sys_getcpu 521 + PTR sys_epoll_pwait 520 522 .size sys_call_table,.-sys_call_table
+13 -5
arch/mips/mm/c-sb1.c
··· 49 49 static unsigned int icache_range_cutoff; 50 50 static unsigned int dcache_range_cutoff; 51 51 52 + static inline void sb1_on_each_cpu(void (*func) (void *info), void *info, 53 + int retry, int wait) 54 + { 55 + preempt_disable(); 56 + smp_call_function(func, info, retry, wait); 57 + func(info); 58 + preempt_enable(); 59 + } 60 + 52 61 /* 53 62 * The dcache is fully coherent to the system, with one 54 63 * big caveat: the instruction stream. In other words, ··· 235 226 args.vma = vma; 236 227 args.addr = addr; 237 228 args.pfn = pfn; 238 - on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1); 229 + sb1_on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1); 239 230 } 240 231 #else 241 232 void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn) ··· 258 249 259 250 static void sb1___flush_cache_all(void) 260 251 { 261 - on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1); 252 + sb1_on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1); 262 253 } 263 254 #else 264 255 void sb1___flush_cache_all(void) ··· 308 299 309 300 args.start = start; 310 301 args.end = end; 311 - on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1); 302 + sb1_on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1); 312 303 } 313 304 #else 314 305 void sb1_flush_icache_range(unsigned long start, unsigned long end) ··· 335 326 336 327 static void sb1_flush_cache_sigtramp(unsigned long addr) 337 328 { 338 - on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1); 329 + sb1_on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1); 339 330 } 340 331 #else 341 332 void sb1_flush_cache_sigtramp(unsigned long addr) ··· 453 444 void sb1_cache_init(void) 454 445 { 455 446 extern char except_vec2_sb1; 456 - extern char handle_vec2_sb1; 457 447 458 448 /* Special cache error handler for SB1 */ 459 449 set_uncached_handler (0x100, &except_vec2_sb1, 0x80);
+3 -3
arch/mips/momentum/ocelot_g/ocelot_pld.h
··· 23 23 #define OCELOT_REG_INTSET (12) 24 24 #define OCELOT_REG_INTCLR (13) 25 25 26 - #define OCELOT_PLD_WRITE(x, y) writeb(x, OCELOT_CS0_ADDR + OCELOT_REG_##y) 27 - #define OCELOT_PLD_READ(x) readb(OCELOT_CS0_ADDR + OCELOT_REG_##x) 28 - 26 + #define __PLD_REG_TO_ADDR(reg) ((void *) OCELOT_CS0_ADDR + OCELOT_REG_##reg) 27 + #define OCELOT_PLD_WRITE(x, reg) writeb(x, __PLD_REG_TO_ADDR(reg)) 28 + #define OCELOT_PLD_READ(reg) readb(__PLD_REG_TO_ADDR(reg)) 29 29 30 30 #endif /* __MOMENCO_OCELOT_PLD_H__ */
+5
arch/mips/momentum/ocelot_g/setup.c
··· 57 57 #include <asm/gt64240.h> 58 58 #include <asm/irq.h> 59 59 #include <asm/pci.h> 60 + #include <asm/pgtable.h> 60 61 #include <asm/processor.h> 61 62 #include <asm/reboot.h> 62 63 #include <linux/bootmem.h> ··· 159 158 rm7k_tcache_enabled = 1; 160 159 161 160 printk("Done\n"); 161 + } 162 + 163 + void __init plat_timer_setup(struct irqaction *irq) 164 + { 162 165 } 163 166 164 167 void __init plat_mem_setup(void)
+7 -5
arch/mips/oprofile/op_model_mipsxx.c
··· 31 31 #define M_COUNTER_OVERFLOW (1UL << 31) 32 32 33 33 #ifdef CONFIG_MIPS_MT_SMP 34 - #define WHAT (M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id())) 34 + #define WHAT (M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id())) 35 + #define vpe_id() smp_processor_id() 35 36 #else 36 - #define WHAT 0 37 + #define WHAT 0 38 + #define vpe_id() smp_processor_id() 37 39 #endif 38 40 39 41 #define __define_perf_accessors(r, n, np) \ 40 42 \ 41 43 static inline unsigned int r_c0_ ## r ## n(void) \ 42 44 { \ 43 - unsigned int cpu = smp_processor_id(); \ 45 + unsigned int cpu = vpe_id(); \ 44 46 \ 45 47 switch (cpu) { \ 46 48 case 0: \ ··· 57 55 \ 58 56 static inline void w_c0_ ## r ## n(unsigned int value) \ 59 57 { \ 60 - unsigned int cpu = smp_processor_id(); \ 58 + unsigned int cpu = vpe_id(); \ 61 59 \ 62 60 switch (cpu) { \ 63 61 case 0: \ ··· 220 218 { 221 219 int counters = __n_counters(); 222 220 223 - #ifndef CONFIG_SMP 221 + #ifdef CONFIG_MIPS_MT_SMP 224 222 if (current_cpu_data.cputype == CPU_34K) 225 223 return counters >> 1; 226 224 #endif
+6 -2
arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c
··· 36 36 37 37 static DECLARE_WAIT_QUEUE_HEAD(txx9_spi_wait); 38 38 39 - static void txx9_spi_interrupt(int irq, void *dev_id) 39 + static irqreturn_t txx9_spi_interrupt(int irq, void *dev_id) 40 40 { 41 41 /* disable rx intr */ 42 42 tx4938_spiptr->cr0 &= ~TXx9_SPCR0_RBSIE; 43 43 wake_up(&txx9_spi_wait); 44 + 45 + return IRQ_HANDLED; 44 46 } 47 + 45 48 static struct irqaction txx9_spi_action = { 46 - txx9_spi_interrupt, 0, 0, "spi", NULL, NULL, 49 + .handler = txx9_spi_interrupt, 50 + .name = "spi", 47 51 }; 48 52 49 53 void __init txx9_spi_irqinit(int irc_irq)
+13 -6
include/asm-mips/unistd.h
··· 332 332 #define __NR_set_robust_list (__NR_Linux + 309) 333 333 #define __NR_get_robust_list (__NR_Linux + 310) 334 334 #define __NR_kexec_load (__NR_Linux + 311) 335 + #define __NR_getcpu (__NR_Linux + 312) 336 + #define __NR_epoll_pwait (__NR_Linux + 313) 335 337 336 338 /* 337 339 * Offset of the last Linux o32 flavoured syscall 338 340 */ 339 - #define __NR_Linux_syscalls 311 341 + #define __NR_Linux_syscalls 313 340 342 341 343 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 342 344 343 345 #define __NR_O32_Linux 4000 344 - #define __NR_O32_Linux_syscalls 311 346 + #define __NR_O32_Linux_syscalls 313 345 347 346 348 #if _MIPS_SIM == _MIPS_SIM_ABI64 347 349 ··· 622 620 #define __NR_set_robust_list (__NR_Linux + 268) 623 621 #define __NR_get_robust_list (__NR_Linux + 269) 624 622 #define __NR_kexec_load (__NR_Linux + 270) 623 + #define __NR_getcpu (__NR_Linux + 271) 624 + #define __NR_epoll_pwait (__NR_Linux + 272) 625 625 626 626 /* 627 627 * Offset of the last Linux 64-bit flavoured syscall 628 628 */ 629 - #define __NR_Linux_syscalls 270 629 + #define __NR_Linux_syscalls 272 630 630 631 631 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 632 632 633 633 #define __NR_64_Linux 5000 634 - #define __NR_64_Linux_syscalls 270 634 + #define __NR_64_Linux_syscalls 272 635 635 636 636 #if _MIPS_SIM == _MIPS_SIM_NABI32 637 637 ··· 916 912 #define __NR_set_robust_list (__NR_Linux + 272) 917 913 #define __NR_get_robust_list (__NR_Linux + 273) 918 914 #define __NR_kexec_load (__NR_Linux + 274) 915 + #define __NR_getcpu (__NR_Linux + 275) 916 + #define __NR_epoll_pwait (__NR_Linux + 276) 919 917 920 918 /* 921 919 * Offset of the last N32 flavoured syscall 922 920 */ 923 - #define __NR_Linux_syscalls 274 921 + #define __NR_Linux_syscalls 276 924 922 925 923 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 926 924 927 925 #define __NR_N32_Linux 6000 928 - #define __NR_N32_Linux_syscalls 274 926 + #define __NR_N32_Linux_syscalls 276 929 927 930 928 #ifdef __KERNEL__ 931 929 ··· 1195 1189 #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ 1196 1190 1197 1191 1192 + #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 1198 1193 #define __ARCH_WANT_IPC_PARSE_VERSION 1199 1194 #define __ARCH_WANT_OLD_READDIR 1200 1195 #define __ARCH_WANT_SYS_ALARM