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

Pull MIPS fixes from Ralf Baechle:
"A fair number of 4.2 fixes also because Markos opened the flood gates.

- Patch up the math used calculate the location for the page bitmap.

- The FDC (Not what you think, FDC stands for Fast Debug Channel) IRQ
around was causing issues on non-Malta platforms, so move the code
to a Malta specific location.

- A spelling fix replicated through several files.

- Fix to the emulation of an R2 instruction for R6 cores.

- Fix the JR emulation for R6.

- Further patching of mindless 64 bit issues.

- Ensure the kernel won't crash on CPUs with L2 caches with >= 8
ways.

- Use compat_sys_getsockopt for O32 ABI on 64 bit kernels.

- Fix cache flushing for multithreaded cores.

- A build fix"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MIPS: O32: Use compat_sys_getsockopt.
MIPS: c-r4k: Extend way_string array
MIPS: Pistachio: Support CDMM & Fast Debug Channel
MIPS: Malta: Make GIC FDC IRQ workaround Malta specific
MIPS: c-r4k: Fix cache flushing for MT cores
Revert "MIPS: Kconfig: Disable SMP/CPS for 64-bit"
MIPS: cps-vec: Use macros for various arithmetics and memory operations
MIPS: kernel: cps-vec: Replace KSEG0 with CKSEG0
MIPS: kernel: cps-vec: Use ta0-ta3 pseudo-registers for 64-bit
MIPS: kernel: cps-vec: Replace mips32r2 ISA level with mips64r2
MIPS: kernel: cps-vec: Replace 'la' macro with PTR_LA
MIPS: kernel: smp-cps: Fix 64-bit compatibility errors due to pointer casting
MIPS: Fix erroneous JR emulation for MIPS R6
MIPS: Fix branch emulation for BLTC and BGEC instructions
MIPS: kernel: traps: Fix broken indentation
MIPS: bootmem: Don't use memory holes for page bitmap
MIPS: O32: Do not handle require 32 bytes from the stack to be readable.
MIPS, CPUFREQ: Fix spelling of Institute.
MIPS: Lemote 2F: Fix build caused by recent mass rename.

Changed files
+214 -123
arch
mips
include
asm
mach-loongson64
kernel
loongson64
common
fuloong-2e
lemote-2f
loongson-3
math-emu
mm
mti-malta
pistachio
drivers
+1 -1
arch/mips/Kconfig
··· 2231 2231 2232 2232 config MIPS_CPS 2233 2233 bool "MIPS Coherent Processing System support" 2234 - depends on SYS_SUPPORTS_MIPS_CPS && !64BIT 2234 + depends on SYS_SUPPORTS_MIPS_CPS 2235 2235 select MIPS_CM 2236 2236 select MIPS_CPC 2237 2237 select MIPS_CPS_PM if HOTPLUG_CPU
+1 -1
arch/mips/include/asm/mach-loongson64/mmzone.h
··· 1 1 /* 2 2 * Copyright (C) 2010 Loongson Inc. & Lemote Inc. & 3 - * Insititute of Computing Technology 3 + * Institute of Computing Technology 4 4 * Author: Xiang Gao, gaoxiang@ict.ac.cn 5 5 * Huacai Chen, chenhc@lemote.com 6 6 * Xiaofu Meng, Shuangshuang Zhang
+1
arch/mips/include/asm/smp.h
··· 23 23 extern int smp_num_siblings; 24 24 extern cpumask_t cpu_sibling_map[]; 25 25 extern cpumask_t cpu_core_map[]; 26 + extern cpumask_t cpu_foreign_map; 26 27 27 28 #define raw_smp_processor_id() (current_thread_info()->cpu) 28 29
+2 -2
arch/mips/kernel/branch.c
··· 600 600 break; 601 601 602 602 case blezl_op: /* not really i_format */ 603 - if (NO_R6EMU) 603 + if (!insn.i_format.rt && NO_R6EMU) 604 604 goto sigill_r6; 605 605 case blez_op: 606 606 /* ··· 635 635 break; 636 636 637 637 case bgtzl_op: 638 - if (NO_R6EMU) 638 + if (!insn.i_format.rt && NO_R6EMU) 639 639 goto sigill_r6; 640 640 case bgtz_op: 641 641 /*
+48 -48
arch/mips/kernel/cps-vec.S
··· 60 60 nop 61 61 62 62 /* This is an NMI */ 63 - la k0, nmi_handler 63 + PTR_LA k0, nmi_handler 64 64 jr k0 65 65 nop 66 66 ··· 107 107 mul t1, t1, t0 108 108 mul t1, t1, t2 109 109 110 - li a0, KSEG0 111 - add a1, a0, t1 110 + li a0, CKSEG0 111 + PTR_ADD a1, a0, t1 112 112 1: cache Index_Store_Tag_I, 0(a0) 113 - add a0, a0, t0 113 + PTR_ADD a0, a0, t0 114 114 bne a0, a1, 1b 115 115 nop 116 116 icache_done: ··· 134 134 mul t1, t1, t0 135 135 mul t1, t1, t2 136 136 137 - li a0, KSEG0 138 - addu a1, a0, t1 139 - subu a1, a1, t0 137 + li a0, CKSEG0 138 + PTR_ADDU a1, a0, t1 139 + PTR_SUBU a1, a1, t0 140 140 1: cache Index_Store_Tag_D, 0(a0) 141 141 bne a0, a1, 1b 142 - add a0, a0, t0 142 + PTR_ADD a0, a0, t0 143 143 dcache_done: 144 144 145 145 /* Set Kseg0 CCA to that in s0 */ ··· 152 152 153 153 /* Enter the coherent domain */ 154 154 li t0, 0xff 155 - sw t0, GCR_CL_COHERENCE_OFS(v1) 155 + PTR_S t0, GCR_CL_COHERENCE_OFS(v1) 156 156 ehb 157 157 158 158 /* Jump to kseg0 */ 159 - la t0, 1f 159 + PTR_LA t0, 1f 160 160 jr t0 161 161 nop 162 162 ··· 178 178 nop 179 179 180 180 /* Off we go! */ 181 - lw t1, VPEBOOTCFG_PC(v0) 182 - lw gp, VPEBOOTCFG_GP(v0) 183 - lw sp, VPEBOOTCFG_SP(v0) 181 + PTR_L t1, VPEBOOTCFG_PC(v0) 182 + PTR_L gp, VPEBOOTCFG_GP(v0) 183 + PTR_L sp, VPEBOOTCFG_SP(v0) 184 184 jr t1 185 185 nop 186 186 END(mips_cps_core_entry) ··· 217 217 218 218 .org 0x480 219 219 LEAF(excep_ejtag) 220 - la k0, ejtag_debug_handler 220 + PTR_LA k0, ejtag_debug_handler 221 221 jr k0 222 222 nop 223 223 END(excep_ejtag) ··· 229 229 nop 230 230 231 231 .set push 232 - .set mips32r2 232 + .set mips64r2 233 233 .set mt 234 234 235 235 /* Only allow 1 TC per VPE to execute... */ ··· 237 237 238 238 /* ...and for the moment only 1 VPE */ 239 239 dvpe 240 - la t1, 1f 240 + PTR_LA t1, 1f 241 241 jr.hb t1 242 242 nop 243 243 ··· 250 250 mfc0 t0, CP0_MVPCONF0 251 251 srl t0, t0, MVPCONF0_PVPE_SHIFT 252 252 andi t0, t0, (MVPCONF0_PVPE >> MVPCONF0_PVPE_SHIFT) 253 - addiu t7, t0, 1 253 + addiu ta3, t0, 1 254 254 255 255 /* If there's only 1, we're done */ 256 256 beqz t0, 2f 257 257 nop 258 258 259 259 /* Loop through each VPE within this core */ 260 - li t5, 1 260 + li ta1, 1 261 261 262 262 1: /* Operate on the appropriate TC */ 263 - mtc0 t5, CP0_VPECONTROL 263 + mtc0 ta1, CP0_VPECONTROL 264 264 ehb 265 265 266 266 /* Bind TC to VPE (1:1 TC:VPE mapping) */ 267 - mttc0 t5, CP0_TCBIND 267 + mttc0 ta1, CP0_TCBIND 268 268 269 269 /* Set exclusive TC, non-active, master */ 270 270 li t0, VPECONF0_MVP 271 - sll t1, t5, VPECONF0_XTC_SHIFT 271 + sll t1, ta1, VPECONF0_XTC_SHIFT 272 272 or t0, t0, t1 273 273 mttc0 t0, CP0_VPECONF0 274 274 ··· 280 280 mttc0 t0, CP0_TCHALT 281 281 282 282 /* Next VPE */ 283 - addiu t5, t5, 1 284 - slt t0, t5, t7 283 + addiu ta1, ta1, 1 284 + slt t0, ta1, ta3 285 285 bnez t0, 1b 286 286 nop 287 287 ··· 298 298 299 299 LEAF(mips_cps_boot_vpes) 300 300 /* Retrieve CM base address */ 301 - la t0, mips_cm_base 302 - lw t0, 0(t0) 301 + PTR_LA t0, mips_cm_base 302 + PTR_L t0, 0(t0) 303 303 304 304 /* Calculate a pointer to this cores struct core_boot_config */ 305 - lw t0, GCR_CL_ID_OFS(t0) 305 + PTR_L t0, GCR_CL_ID_OFS(t0) 306 306 li t1, COREBOOTCFG_SIZE 307 307 mul t0, t0, t1 308 - la t1, mips_cps_core_bootcfg 309 - lw t1, 0(t1) 310 - addu t0, t0, t1 308 + PTR_LA t1, mips_cps_core_bootcfg 309 + PTR_L t1, 0(t1) 310 + PTR_ADDU t0, t0, t1 311 311 312 312 /* Calculate this VPEs ID. If the core doesn't support MT use 0 */ 313 - has_mt t6, 1f 313 + has_mt ta2, 1f 314 314 li t9, 0 315 315 316 316 /* Find the number of VPEs present in the core */ ··· 334 334 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */ 335 335 li t1, VPEBOOTCFG_SIZE 336 336 mul v0, t9, t1 337 - lw t7, COREBOOTCFG_VPECONFIG(t0) 338 - addu v0, v0, t7 337 + PTR_L ta3, COREBOOTCFG_VPECONFIG(t0) 338 + PTR_ADDU v0, v0, ta3 339 339 340 340 #ifdef CONFIG_MIPS_MT 341 341 342 342 /* If the core doesn't support MT then return */ 343 - bnez t6, 1f 343 + bnez ta2, 1f 344 344 nop 345 345 jr ra 346 346 nop 347 347 348 348 .set push 349 - .set mips32r2 349 + .set mips64r2 350 350 .set mt 351 351 352 352 1: /* Enter VPE configuration state */ 353 353 dvpe 354 - la t1, 1f 354 + PTR_LA t1, 1f 355 355 jr.hb t1 356 356 nop 357 357 1: mfc0 t1, CP0_MVPCONTROL ··· 360 360 ehb 361 361 362 362 /* Loop through each VPE */ 363 - lw t6, COREBOOTCFG_VPEMASK(t0) 364 - move t8, t6 365 - li t5, 0 363 + PTR_L ta2, COREBOOTCFG_VPEMASK(t0) 364 + move t8, ta2 365 + li ta1, 0 366 366 367 367 /* Check whether the VPE should be running. If not, skip it */ 368 - 1: andi t0, t6, 1 368 + 1: andi t0, ta2, 1 369 369 beqz t0, 2f 370 370 nop 371 371 ··· 373 373 mfc0 t0, CP0_VPECONTROL 374 374 ori t0, t0, VPECONTROL_TARGTC 375 375 xori t0, t0, VPECONTROL_TARGTC 376 - or t0, t0, t5 376 + or t0, t0, ta1 377 377 mtc0 t0, CP0_VPECONTROL 378 378 ehb 379 379 ··· 384 384 385 385 /* Calculate a pointer to the VPEs struct vpe_boot_config */ 386 386 li t0, VPEBOOTCFG_SIZE 387 - mul t0, t0, t5 388 - addu t0, t0, t7 387 + mul t0, t0, ta1 388 + addu t0, t0, ta3 389 389 390 390 /* Set the TC restart PC */ 391 391 lw t1, VPEBOOTCFG_PC(t0) ··· 423 423 mttc0 t0, CP0_VPECONF0 424 424 425 425 /* Next VPE */ 426 - 2: srl t6, t6, 1 427 - addiu t5, t5, 1 428 - bnez t6, 1b 426 + 2: srl ta2, ta2, 1 427 + addiu ta1, ta1, 1 428 + bnez ta2, 1b 429 429 nop 430 430 431 431 /* Leave VPE configuration state */ ··· 445 445 /* This VPE should be offline, halt the TC */ 446 446 li t0, TCHALT_H 447 447 mtc0 t0, CP0_TCHALT 448 - la t0, 1f 448 + PTR_LA t0, 1f 449 449 1: jr.hb t0 450 450 nop 451 451 ··· 466 466 .set noat 467 467 lw $1, TI_CPU(gp) 468 468 sll $1, $1, LONGLOG 469 - la \dest, __per_cpu_offset 469 + PTR_LA \dest, __per_cpu_offset 470 470 addu $1, $1, \dest 471 471 lw $1, 0($1) 472 - la \dest, cps_cpu_state 472 + PTR_LA \dest, cps_cpu_state 473 473 addu \dest, \dest, $1 474 474 .set pop 475 475 .endm
+27 -10
arch/mips/kernel/scall32-o32.S
··· 73 73 .set noreorder 74 74 .set nomacro 75 75 76 - 1: user_lw(t5, 16(t0)) # argument #5 from usp 77 - 4: user_lw(t6, 20(t0)) # argument #6 from usp 78 - 3: user_lw(t7, 24(t0)) # argument #7 from usp 79 - 2: user_lw(t8, 28(t0)) # argument #8 from usp 76 + load_a4: user_lw(t5, 16(t0)) # argument #5 from usp 77 + load_a5: user_lw(t6, 20(t0)) # argument #6 from usp 78 + load_a6: user_lw(t7, 24(t0)) # argument #7 from usp 79 + load_a7: user_lw(t8, 28(t0)) # argument #8 from usp 80 + loads_done: 80 81 81 82 sw t5, 16(sp) # argument #5 to ksp 82 83 sw t6, 20(sp) # argument #6 to ksp ··· 86 85 .set pop 87 86 88 87 .section __ex_table,"a" 89 - PTR 1b,bad_stack 90 - PTR 2b,bad_stack 91 - PTR 3b,bad_stack 92 - PTR 4b,bad_stack 88 + PTR load_a4, bad_stack_a4 89 + PTR load_a5, bad_stack_a5 90 + PTR load_a6, bad_stack_a6 91 + PTR load_a7, bad_stack_a7 93 92 .previous 94 93 95 94 lw t0, TI_FLAGS($28) # syscall tracing enabled? ··· 154 153 /* ------------------------------------------------------------------------ */ 155 154 156 155 /* 157 - * The stackpointer for a call with more than 4 arguments is bad. 158 - * We probably should handle this case a bit more drastic. 156 + * Our open-coded access area sanity test for the stack pointer 157 + * failed. We probably should handle this case a bit more drastic. 159 158 */ 160 159 bad_stack: 161 160 li v0, EFAULT ··· 163 162 li t0, 1 # set error flag 164 163 sw t0, PT_R7(sp) 165 164 j o32_syscall_exit 165 + 166 + bad_stack_a4: 167 + li t5, 0 168 + b load_a5 169 + 170 + bad_stack_a5: 171 + li t6, 0 172 + b load_a6 173 + 174 + bad_stack_a6: 175 + li t7, 0 176 + b load_a7 177 + 178 + bad_stack_a7: 179 + li t8, 0 180 + b loads_done 166 181 167 182 /* 168 183 * The system call does not exist in this kernel
+26 -9
arch/mips/kernel/scall64-o32.S
··· 69 69 daddu t1, t0, 32 70 70 bltz t1, bad_stack 71 71 72 - 1: lw a4, 16(t0) # argument #5 from usp 73 - 2: lw a5, 20(t0) # argument #6 from usp 74 - 3: lw a6, 24(t0) # argument #7 from usp 75 - 4: lw a7, 28(t0) # argument #8 from usp (for indirect syscalls) 72 + load_a4: lw a4, 16(t0) # argument #5 from usp 73 + load_a5: lw a5, 20(t0) # argument #6 from usp 74 + load_a6: lw a6, 24(t0) # argument #7 from usp 75 + load_a7: lw a7, 28(t0) # argument #8 from usp 76 + loads_done: 76 77 77 78 .section __ex_table,"a" 78 - PTR 1b, bad_stack 79 - PTR 2b, bad_stack 80 - PTR 3b, bad_stack 81 - PTR 4b, bad_stack 79 + PTR load_a4, bad_stack_a4 80 + PTR load_a5, bad_stack_a5 81 + PTR load_a6, bad_stack_a6 82 + PTR load_a7, bad_stack_a7 82 83 .previous 83 84 84 85 li t1, _TIF_WORK_SYSCALL_ENTRY ··· 167 166 li t0, 1 # set error flag 168 167 sd t0, PT_R7(sp) 169 168 j o32_syscall_exit 169 + 170 + bad_stack_a4: 171 + li a4, 0 172 + b load_a5 173 + 174 + bad_stack_a5: 175 + li a5, 0 176 + b load_a6 177 + 178 + bad_stack_a6: 179 + li a6, 0 180 + b load_a7 181 + 182 + bad_stack_a7: 183 + li a7, 0 184 + b loads_done 170 185 171 186 not_o32_scall: 172 187 /* ··· 400 383 PTR sys_connect /* 4170 */ 401 384 PTR sys_getpeername 402 385 PTR sys_getsockname 403 - PTR sys_getsockopt 386 + PTR compat_sys_getsockopt 404 387 PTR sys_listen 405 388 PTR compat_sys_recv /* 4175 */ 406 389 PTR compat_sys_recvfrom
+5 -8
arch/mips/kernel/setup.c
··· 337 337 min_low_pfn = start; 338 338 if (end <= reserved_end) 339 339 continue; 340 + #ifdef CONFIG_BLK_DEV_INITRD 341 + /* mapstart should be after initrd_end */ 342 + if (initrd_end && end <= (unsigned long)PFN_UP(__pa(initrd_end))) 343 + continue; 344 + #endif 340 345 if (start >= mapstart) 341 346 continue; 342 347 mapstart = max(reserved_end, start); ··· 370 365 #endif 371 366 max_low_pfn = PFN_DOWN(HIGHMEM_START); 372 367 } 373 - 374 - #ifdef CONFIG_BLK_DEV_INITRD 375 - /* 376 - * mapstart should be after initrd_end 377 - */ 378 - if (initrd_end) 379 - mapstart = max(mapstart, (unsigned long)PFN_UP(__pa(initrd_end))); 380 - #endif 381 368 382 369 /* 383 370 * Initialize the boot-time allocator with low memory only.
+3 -3
arch/mips/kernel/smp-cps.c
··· 133 133 /* 134 134 * Patch the start of mips_cps_core_entry to provide: 135 135 * 136 - * v0 = CM base address 136 + * v1 = CM base address 137 137 * s0 = kseg0 CCA 138 138 */ 139 139 entry_code = (u32 *)&mips_cps_core_entry; ··· 369 369 370 370 static void wait_for_sibling_halt(void *ptr_cpu) 371 371 { 372 - unsigned cpu = (unsigned)ptr_cpu; 372 + unsigned cpu = (unsigned long)ptr_cpu; 373 373 unsigned vpe_id = cpu_vpe_id(&cpu_data[cpu]); 374 374 unsigned halted; 375 375 unsigned long flags; ··· 430 430 */ 431 431 err = smp_call_function_single(cpu_death_sibling, 432 432 wait_for_sibling_halt, 433 - (void *)cpu, 1); 433 + (void *)(unsigned long)cpu, 1); 434 434 if (err) 435 435 panic("Failed to call remote sibling CPU\n"); 436 436 }
+43 -1
arch/mips/kernel/smp.c
··· 63 63 cpumask_t cpu_core_map[NR_CPUS] __read_mostly; 64 64 EXPORT_SYMBOL(cpu_core_map); 65 65 66 + /* 67 + * A logcal cpu mask containing only one VPE per core to 68 + * reduce the number of IPIs on large MT systems. 69 + */ 70 + cpumask_t cpu_foreign_map __read_mostly; 71 + EXPORT_SYMBOL(cpu_foreign_map); 72 + 66 73 /* representing cpus for which sibling maps can be computed */ 67 74 static cpumask_t cpu_sibling_setup_map; 68 75 ··· 108 101 cpumask_set_cpu(cpu, &cpu_core_map[i]); 109 102 } 110 103 } 104 + } 105 + 106 + /* 107 + * Calculate a new cpu_foreign_map mask whenever a 108 + * new cpu appears or disappears. 109 + */ 110 + static inline void calculate_cpu_foreign_map(void) 111 + { 112 + int i, k, core_present; 113 + cpumask_t temp_foreign_map; 114 + 115 + /* Re-calculate the mask */ 116 + for_each_online_cpu(i) { 117 + core_present = 0; 118 + for_each_cpu(k, &temp_foreign_map) 119 + if (cpu_data[i].package == cpu_data[k].package && 120 + cpu_data[i].core == cpu_data[k].core) 121 + core_present = 1; 122 + if (!core_present) 123 + cpumask_set_cpu(i, &temp_foreign_map); 124 + } 125 + 126 + cpumask_copy(&cpu_foreign_map, &temp_foreign_map); 111 127 } 112 128 113 129 struct plat_smp_ops *mp_ops; ··· 176 146 set_cpu_sibling_map(cpu); 177 147 set_cpu_core_map(cpu); 178 148 149 + calculate_cpu_foreign_map(); 150 + 179 151 cpumask_set_cpu(cpu, &cpu_callin_map); 180 152 181 153 synchronise_count_slave(cpu); ··· 205 173 static void stop_this_cpu(void *dummy) 206 174 { 207 175 /* 208 - * Remove this CPU: 176 + * Remove this CPU. Be a bit slow here and 177 + * set the bits for every online CPU so we don't miss 178 + * any IPI whilst taking this VPE down. 209 179 */ 180 + 181 + cpumask_copy(&cpu_foreign_map, cpu_online_mask); 182 + 183 + /* Make it visible to every other CPU */ 184 + smp_mb(); 185 + 210 186 set_cpu_online(smp_processor_id(), false); 187 + calculate_cpu_foreign_map(); 211 188 local_irq_disable(); 212 189 while (1); 213 190 } ··· 238 197 mp_ops->prepare_cpus(max_cpus); 239 198 set_cpu_sibling_map(0); 240 199 set_cpu_core_map(0); 200 + calculate_cpu_foreign_map(); 241 201 #ifndef CONFIG_HOTPLUG_CPU 242 202 init_cpu_present(cpu_possible_mask); 243 203 #endif
+4 -4
arch/mips/kernel/traps.c
··· 2130 2130 BUG_ON(current->mm); 2131 2131 enter_lazy_tlb(&init_mm, current); 2132 2132 2133 - /* Boot CPU's cache setup in setup_arch(). */ 2134 - if (!is_boot_cpu) 2135 - cpu_cache_init(); 2136 - tlb_init(); 2133 + /* Boot CPU's cache setup in setup_arch(). */ 2134 + if (!is_boot_cpu) 2135 + cpu_cache_init(); 2136 + tlb_init(); 2137 2137 TLBMISS_HANDLER_SETUP(); 2138 2138 } 2139 2139
+1 -1
arch/mips/loongson64/common/bonito-irq.c
··· 3 3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net 4 4 * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org) 5 5 * 6 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 6 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 7 7 * Author: Fuxin Zhang, zhangfx@lemote.com 8 8 * 9 9 * This program is free software; you can redistribute it and/or modify it
+1 -1
arch/mips/loongson64/common/cmdline.c
··· 6 6 * Copyright 2003 ICT CAS 7 7 * Author: Michael Guo <guoyi@ict.ac.cn> 8 8 * 9 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 9 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 10 10 * Author: Fuxin Zhang, zhangfx@lemote.com 11 11 * 12 12 * Copyright (C) 2009 Lemote Inc.
+1 -1
arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
··· 1 1 /* 2 2 * CS5536 General timer functions 3 3 * 4 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 4 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 5 5 * Author: Yanhua, yanh@lemote.com 6 6 * 7 7 * Copyright (C) 2009 Lemote Inc.
+1 -1
arch/mips/loongson64/common/env.c
··· 6 6 * Copyright 2003 ICT CAS 7 7 * Author: Michael Guo <guoyi@ict.ac.cn> 8 8 * 9 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 9 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 10 10 * Author: Fuxin Zhang, zhangfx@lemote.com 11 11 * 12 12 * Copyright (C) 2009 Lemote Inc.
+1 -1
arch/mips/loongson64/common/irq.c
··· 1 1 /* 2 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 2 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 3 3 * Author: Fuxin Zhang, zhangfx@lemote.com 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify it
+1 -1
arch/mips/loongson64/common/setup.c
··· 1 1 /* 2 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 2 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 3 3 * Author: Fuxin Zhang, zhangfx@lemote.com 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify it
+1 -1
arch/mips/loongson64/fuloong-2e/irq.c
··· 1 1 /* 2 - * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 2 + * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology 3 3 * Author: Fuxin Zhang, zhangfx@lemote.com 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify it
+2 -2
arch/mips/loongson64/lemote-2f/clock.c
··· 1 1 /* 2 - * Copyright (C) 2006 - 2008 Lemote Inc. & Insititute of Computing Technology 2 + * Copyright (C) 2006 - 2008 Lemote Inc. & Institute of Computing Technology 3 3 * Author: Yanhua, yanh@lemote.com 4 4 * 5 5 * This file is subject to the terms and conditions of the GNU General Public ··· 15 15 #include <linux/spinlock.h> 16 16 17 17 #include <asm/clock.h> 18 - #include <asm/mach-loongson/loongson.h> 18 + #include <asm/mach-loongson64/loongson.h> 19 19 20 20 static LIST_HEAD(clock_list); 21 21 static DEFINE_SPINLOCK(clock_lock);
+1 -1
arch/mips/loongson64/loongson-3/numa.c
··· 1 1 /* 2 2 * Copyright (C) 2010 Loongson Inc. & Lemote Inc. & 3 - * Insititute of Computing Technology 3 + * Institute of Computing Technology 4 4 * Author: Xiang Gao, gaoxiang@ict.ac.cn 5 5 * Huacai Chen, chenhc@lemote.com 6 6 * Xiaofu Meng, Shuangshuang Zhang
+3 -3
arch/mips/math-emu/cp1emu.c
··· 451 451 /* Fall through */ 452 452 case jr_op: 453 453 /* For R6, JR already emulated in jalr_op */ 454 - if (NO_R6EMU && insn.r_format.opcode == jr_op) 454 + if (NO_R6EMU && insn.r_format.func == jr_op) 455 455 break; 456 456 *contpc = regs->regs[insn.r_format.rs]; 457 457 return 1; ··· 551 551 dec_insn.next_pc_inc; 552 552 return 1; 553 553 case blezl_op: 554 - if (NO_R6EMU) 554 + if (!insn.i_format.rt && NO_R6EMU) 555 555 break; 556 556 case blez_op: 557 557 ··· 588 588 dec_insn.next_pc_inc; 589 589 return 1; 590 590 case bgtzl_op: 591 - if (NO_R6EMU) 591 + if (!insn.i_format.rt && NO_R6EMU) 592 592 break; 593 593 case bgtz_op: 594 594 /*
+14 -4
arch/mips/mm/c-r4k.c
··· 37 37 #include <asm/cacheflush.h> /* for run_uncached() */ 38 38 #include <asm/traps.h> 39 39 #include <asm/dma-coherence.h> 40 + #include <asm/mips-cm.h> 40 41 41 42 /* 42 43 * Special Variant of smp_call_function for use by cache functions: ··· 52 51 { 53 52 preempt_disable(); 54 53 55 - #ifndef CONFIG_MIPS_MT_SMP 56 - smp_call_function(func, info, 1); 57 - #endif 54 + /* 55 + * The Coherent Manager propagates address-based cache ops to other 56 + * cores but not index-based ops. However, r4k_on_each_cpu is used 57 + * in both cases so there is no easy way to tell what kind of op is 58 + * executed to the other cores. The best we can probably do is 59 + * to restrict that call when a CM is not present because both 60 + * CM-based SMP protocols (CMP & CPS) restrict index-based cache ops. 61 + */ 62 + if (!mips_cm_present()) 63 + smp_call_function_many(&cpu_foreign_map, func, info, 1); 58 64 func(info); 59 65 preempt_enable(); 60 66 } ··· 945 937 } 946 938 947 939 static char *way_string[] = { NULL, "direct mapped", "2-way", 948 - "3-way", "4-way", "5-way", "6-way", "7-way", "8-way" 940 + "3-way", "4-way", "5-way", "6-way", "7-way", "8-way", 941 + "9-way", "10-way", "11-way", "12-way", 942 + "13-way", "14-way", "15-way", "16-way", 949 943 }; 950 944 951 945 static void probe_pcache(void)
+13 -7
arch/mips/mti-malta/malta-time.c
··· 119 119 120 120 int get_c0_fdc_int(void) 121 121 { 122 - int mips_cpu_fdc_irq; 122 + /* 123 + * Some cores claim the FDC is routable through the GIC, but it doesn't 124 + * actually seem to be connected for those Malta bitstreams. 125 + */ 126 + switch (current_cpu_type()) { 127 + case CPU_INTERAPTIV: 128 + case CPU_PROAPTIV: 129 + return -1; 130 + }; 123 131 124 132 if (cpu_has_veic) 125 - mips_cpu_fdc_irq = -1; 133 + return -1; 126 134 else if (gic_present) 127 - mips_cpu_fdc_irq = gic_get_c0_fdc_int(); 135 + return gic_get_c0_fdc_int(); 128 136 else if (cp0_fdc_irq >= 0) 129 - mips_cpu_fdc_irq = MIPS_CPU_IRQ_BASE + cp0_fdc_irq; 137 + return MIPS_CPU_IRQ_BASE + cp0_fdc_irq; 130 138 else 131 - mips_cpu_fdc_irq = -1; 132 - 133 - return mips_cpu_fdc_irq; 139 + return -1; 134 140 } 135 141 136 142 int get_c0_perfcount_int(void)
+7 -1
arch/mips/pistachio/init.c
··· 63 63 plat_setup_iocoherency(); 64 64 } 65 65 66 - #define DEFAULT_CPC_BASE_ADDR 0x1bde0000 66 + #define DEFAULT_CPC_BASE_ADDR 0x1bde0000 67 + #define DEFAULT_CDMM_BASE_ADDR 0x1bdd0000 67 68 68 69 phys_addr_t mips_cpc_default_phys_base(void) 69 70 { 70 71 return DEFAULT_CPC_BASE_ADDR; 72 + } 73 + 74 + phys_addr_t mips_cdmm_phys_base(void) 75 + { 76 + return DEFAULT_CDMM_BASE_ADDR; 71 77 } 72 78 73 79 static void __init mips_nmi_setup(void)
+5
arch/mips/pistachio/time.c
··· 27 27 return gic_get_c0_perfcount_int(); 28 28 } 29 29 30 + int get_c0_fdc_int(void) 31 + { 32 + return gic_get_c0_fdc_int(); 33 + } 34 + 30 35 void __init plat_time_init(void) 31 36 { 32 37 struct device_node *np;
+1 -1
drivers/cpufreq/loongson2_cpufreq.c
··· 3 3 * 4 4 * The 2E revision of loongson processor not support this feature. 5 5 * 6 - * Copyright (C) 2006 - 2008 Lemote Inc. & Insititute of Computing Technology 6 + * Copyright (C) 2006 - 2008 Lemote Inc. & Institute of Computing Technology 7 7 * Author: Yanhua, yanh@lemote.com 8 8 * 9 9 * This file is subject to the terms and conditions of the GNU General Public
-10
drivers/irqchip/irq-mips-gic.c
··· 257 257 return MIPS_CPU_IRQ_BASE + cp0_fdc_irq; 258 258 } 259 259 260 - /* 261 - * Some cores claim the FDC is routable but it doesn't actually seem to 262 - * be connected. 263 - */ 264 - switch (current_cpu_type()) { 265 - case CPU_INTERAPTIV: 266 - case CPU_PROAPTIV: 267 - return -1; 268 - } 269 - 270 260 return irq_create_mapping(gic_irq_domain, 271 261 GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_FDC)); 272 262 }