diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-30 22:21:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-30 22:21:03 -0500 |
commit | c00552ebafddfe6abb397d957004f165e010abd2 (patch) | |
tree | b397d6773b545755ffdae7566f8b96b08ee54ebb /arch/mips | |
parent | 842f57baab186417d89810f3dd6147f1ef3009dd (diff) | |
parent | 009d0431c3914de64666bec0d350e54fdd59df6a (diff) |
Merge 3.18-rc7 into usb-next
We need the xhci fixes here and this resolves a merge issue with
drivers/usb/dwc3/ep0.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/Kconfig | 14 | ||||
-rw-r--r-- | arch/mips/include/asm/jump_label.h | 8 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/r4kcache.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/uaccess.h | 18 | ||||
-rw-r--r-- | arch/mips/include/uapi/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/mips/kernel/bmips_vec.S | 3 | ||||
-rw-r--r-- | arch/mips/kernel/cps-vec.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 40 | ||||
-rw-r--r-- | arch/mips/kernel/jump_label.c | 42 | ||||
-rw-r--r-- | arch/mips/kernel/rtlx.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/signal.c | 8 | ||||
-rw-r--r-- | arch/mips/lib/memcpy.S | 1 | ||||
-rw-r--r-- | arch/mips/loongson/common/Makefile | 3 | ||||
-rw-r--r-- | arch/mips/loongson/loongson-3/numa.c | 1 | ||||
-rw-r--r-- | arch/mips/mm/tlb-r4k.c | 4 | ||||
-rw-r--r-- | arch/mips/mm/tlbex.c | 10 | ||||
-rw-r--r-- | arch/mips/mti-sead3/sead3-leds.c | 8 | ||||
-rw-r--r-- | arch/mips/netlogic/xlp/Makefile | 12 | ||||
-rw-r--r-- | arch/mips/oprofile/backtrace.c | 2 | ||||
-rw-r--r-- | arch/mips/sgi-ip27/ip27-memory.c | 1 |
23 files changed, 144 insertions, 51 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index f43aa536c517..9536ef912f59 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -2101,9 +2101,17 @@ config 64BIT_PHYS_ADDR | |||
2101 | config ARCH_PHYS_ADDR_T_64BIT | 2101 | config ARCH_PHYS_ADDR_T_64BIT |
2102 | def_bool 64BIT_PHYS_ADDR | 2102 | def_bool 64BIT_PHYS_ADDR |
2103 | 2103 | ||
2104 | choice | ||
2105 | prompt "SmartMIPS or microMIPS ASE support" | ||
2106 | |||
2107 | config CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS | ||
2108 | bool "None" | ||
2109 | help | ||
2110 | Select this if you want neither microMIPS nor SmartMIPS support | ||
2111 | |||
2104 | config CPU_HAS_SMARTMIPS | 2112 | config CPU_HAS_SMARTMIPS |
2105 | depends on SYS_SUPPORTS_SMARTMIPS | 2113 | depends on SYS_SUPPORTS_SMARTMIPS |
2106 | bool "Support for the SmartMIPS ASE" | 2114 | bool "SmartMIPS" |
2107 | help | 2115 | help |
2108 | SmartMIPS is a extension of the MIPS32 architecture aimed at | 2116 | SmartMIPS is a extension of the MIPS32 architecture aimed at |
2109 | increased security at both hardware and software level for | 2117 | increased security at both hardware and software level for |
@@ -2115,11 +2123,13 @@ config CPU_HAS_SMARTMIPS | |||
2115 | 2123 | ||
2116 | config CPU_MICROMIPS | 2124 | config CPU_MICROMIPS |
2117 | depends on SYS_SUPPORTS_MICROMIPS | 2125 | depends on SYS_SUPPORTS_MICROMIPS |
2118 | bool "Build kernel using microMIPS ISA" | 2126 | bool "microMIPS" |
2119 | help | 2127 | help |
2120 | When this option is enabled the kernel will be built using the | 2128 | When this option is enabled the kernel will be built using the |
2121 | microMIPS ISA | 2129 | microMIPS ISA |
2122 | 2130 | ||
2131 | endchoice | ||
2132 | |||
2123 | config CPU_HAS_MSA | 2133 | config CPU_HAS_MSA |
2124 | bool "Support for the MIPS SIMD Architecture (EXPERIMENTAL)" | 2134 | bool "Support for the MIPS SIMD Architecture (EXPERIMENTAL)" |
2125 | depends on CPU_SUPPORTS_MSA | 2135 | depends on CPU_SUPPORTS_MSA |
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h index e194f957ca8c..fdbff44e5482 100644 --- a/arch/mips/include/asm/jump_label.h +++ b/arch/mips/include/asm/jump_label.h | |||
@@ -20,9 +20,15 @@ | |||
20 | #define WORD_INSN ".word" | 20 | #define WORD_INSN ".word" |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #ifdef CONFIG_CPU_MICROMIPS | ||
24 | #define NOP_INSN "nop32" | ||
25 | #else | ||
26 | #define NOP_INSN "nop" | ||
27 | #endif | ||
28 | |||
23 | static __always_inline bool arch_static_branch(struct static_key *key) | 29 | static __always_inline bool arch_static_branch(struct static_key *key) |
24 | { | 30 | { |
25 | asm_volatile_goto("1:\tnop\n\t" | 31 | asm_volatile_goto("1:\t" NOP_INSN "\n\t" |
26 | "nop\n\t" | 32 | "nop\n\t" |
27 | ".pushsection __jump_table, \"aw\"\n\t" | 33 | ".pushsection __jump_table, \"aw\"\n\t" |
28 | WORD_INSN " 1b, %l[l_yes], %0\n\t" | 34 | WORD_INSN " 1b, %l[l_yes], %0\n\t" |
diff --git a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h index 7d28f95b0512..6d69332f21ec 100644 --- a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h | |||
@@ -41,10 +41,8 @@ | |||
41 | #define cpu_has_mcheck 0 | 41 | #define cpu_has_mcheck 0 |
42 | #define cpu_has_mdmx 0 | 42 | #define cpu_has_mdmx 0 |
43 | #define cpu_has_mips16 0 | 43 | #define cpu_has_mips16 0 |
44 | #define cpu_has_mips32r1 0 | ||
45 | #define cpu_has_mips32r2 0 | 44 | #define cpu_has_mips32r2 0 |
46 | #define cpu_has_mips3d 0 | 45 | #define cpu_has_mips3d 0 |
47 | #define cpu_has_mips64r1 0 | ||
48 | #define cpu_has_mips64r2 0 | 46 | #define cpu_has_mips64r2 0 |
49 | #define cpu_has_mipsmt 0 | 47 | #define cpu_has_mipsmt 0 |
50 | #define cpu_has_prefetch 0 | 48 | #define cpu_has_prefetch 0 |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index b46cd220a018..22a135ac91de 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -661,6 +661,8 @@ | |||
661 | #define MIPS_CONF6_SYND (_ULCAST_(1) << 13) | 661 | #define MIPS_CONF6_SYND (_ULCAST_(1) << 13) |
662 | /* proAptiv FTLB on/off bit */ | 662 | /* proAptiv FTLB on/off bit */ |
663 | #define MIPS_CONF6_FTLBEN (_ULCAST_(1) << 15) | 663 | #define MIPS_CONF6_FTLBEN (_ULCAST_(1) << 15) |
664 | /* FTLB probability bits */ | ||
665 | #define MIPS_CONF6_FTLBP_SHIFT (16) | ||
664 | 666 | ||
665 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) | 667 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) |
666 | 668 | ||
diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h index 4520adc8699b..cd6e0afc6833 100644 --- a/arch/mips/include/asm/r4kcache.h +++ b/arch/mips/include/asm/r4kcache.h | |||
@@ -257,7 +257,11 @@ static inline void protected_flush_icache_line(unsigned long addr) | |||
257 | */ | 257 | */ |
258 | static inline void protected_writeback_dcache_line(unsigned long addr) | 258 | static inline void protected_writeback_dcache_line(unsigned long addr) |
259 | { | 259 | { |
260 | #ifdef CONFIG_EVA | ||
261 | protected_cachee_op(Hit_Writeback_Inv_D, addr); | ||
262 | #else | ||
260 | protected_cache_op(Hit_Writeback_Inv_D, addr); | 263 | protected_cache_op(Hit_Writeback_Inv_D, addr); |
264 | #endif | ||
261 | } | 265 | } |
262 | 266 | ||
263 | static inline void protected_writeback_scache_line(unsigned long addr) | 267 | static inline void protected_writeback_scache_line(unsigned long addr) |
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index a10951090234..22a5624e2fd2 100644 --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h | |||
@@ -301,7 +301,8 @@ do { \ | |||
301 | __get_kernel_common((x), size, __gu_ptr); \ | 301 | __get_kernel_common((x), size, __gu_ptr); \ |
302 | else \ | 302 | else \ |
303 | __get_user_common((x), size, __gu_ptr); \ | 303 | __get_user_common((x), size, __gu_ptr); \ |
304 | } \ | 304 | } else \ |
305 | (x) = 0; \ | ||
305 | \ | 306 | \ |
306 | __gu_err; \ | 307 | __gu_err; \ |
307 | }) | 308 | }) |
@@ -316,6 +317,7 @@ do { \ | |||
316 | " .insn \n" \ | 317 | " .insn \n" \ |
317 | " .section .fixup,\"ax\" \n" \ | 318 | " .section .fixup,\"ax\" \n" \ |
318 | "3: li %0, %4 \n" \ | 319 | "3: li %0, %4 \n" \ |
320 | " move %1, $0 \n" \ | ||
319 | " j 2b \n" \ | 321 | " j 2b \n" \ |
320 | " .previous \n" \ | 322 | " .previous \n" \ |
321 | " .section __ex_table,\"a\" \n" \ | 323 | " .section __ex_table,\"a\" \n" \ |
@@ -630,6 +632,7 @@ do { \ | |||
630 | " .insn \n" \ | 632 | " .insn \n" \ |
631 | " .section .fixup,\"ax\" \n" \ | 633 | " .section .fixup,\"ax\" \n" \ |
632 | "3: li %0, %4 \n" \ | 634 | "3: li %0, %4 \n" \ |
635 | " move %1, $0 \n" \ | ||
633 | " j 2b \n" \ | 636 | " j 2b \n" \ |
634 | " .previous \n" \ | 637 | " .previous \n" \ |
635 | " .section __ex_table,\"a\" \n" \ | 638 | " .section __ex_table,\"a\" \n" \ |
@@ -773,10 +776,11 @@ extern void __put_user_unaligned_unknown(void); | |||
773 | "jal\t" #destination "\n\t" | 776 | "jal\t" #destination "\n\t" |
774 | #endif | 777 | #endif |
775 | 778 | ||
776 | #ifndef CONFIG_CPU_DADDI_WORKAROUNDS | 779 | #if defined(CONFIG_CPU_DADDI_WORKAROUNDS) || (defined(CONFIG_EVA) && \ |
777 | #define DADDI_SCRATCH "$0" | 780 | defined(CONFIG_CPU_HAS_PREFETCH)) |
778 | #else | ||
779 | #define DADDI_SCRATCH "$3" | 781 | #define DADDI_SCRATCH "$3" |
782 | #else | ||
783 | #define DADDI_SCRATCH "$0" | ||
780 | #endif | 784 | #endif |
781 | 785 | ||
782 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); | 786 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); |
@@ -1418,7 +1422,7 @@ static inline long __strnlen_user(const char __user *s, long n) | |||
1418 | } | 1422 | } |
1419 | 1423 | ||
1420 | /* | 1424 | /* |
1421 | * strlen_user: - Get the size of a string in user space. | 1425 | * strnlen_user: - Get the size of a string in user space. |
1422 | * @str: The string to measure. | 1426 | * @str: The string to measure. |
1423 | * | 1427 | * |
1424 | * Context: User context only. This function may sleep. | 1428 | * Context: User context only. This function may sleep. |
@@ -1427,9 +1431,7 @@ static inline long __strnlen_user(const char __user *s, long n) | |||
1427 | * | 1431 | * |
1428 | * Returns the size of the string INCLUDING the terminating NUL. | 1432 | * Returns the size of the string INCLUDING the terminating NUL. |
1429 | * On exception, returns 0. | 1433 | * On exception, returns 0. |
1430 | * | 1434 | * If the string is too long, returns a value greater than @n. |
1431 | * If there is a limit on the length of a valid string, you may wish to | ||
1432 | * consider using strnlen_user() instead. | ||
1433 | */ | 1435 | */ |
1434 | static inline long strnlen_user(const char __user *s, long n) | 1436 | static inline long strnlen_user(const char __user *s, long n) |
1435 | { | 1437 | { |
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index 9dc58568f230..d001bb1ad177 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h | |||
@@ -1045,7 +1045,7 @@ | |||
1045 | #define __NR_seccomp (__NR_Linux + 316) | 1045 | #define __NR_seccomp (__NR_Linux + 316) |
1046 | #define __NR_getrandom (__NR_Linux + 317) | 1046 | #define __NR_getrandom (__NR_Linux + 317) |
1047 | #define __NR_memfd_create (__NR_Linux + 318) | 1047 | #define __NR_memfd_create (__NR_Linux + 318) |
1048 | #define __NR_memfd_create (__NR_Linux + 319) | 1048 | #define __NR_bpf (__NR_Linux + 319) |
1049 | 1049 | ||
1050 | /* | 1050 | /* |
1051 | * Offset of the last N32 flavoured syscall | 1051 | * Offset of the last N32 flavoured syscall |
diff --git a/arch/mips/kernel/bmips_vec.S b/arch/mips/kernel/bmips_vec.S index 290c23b51678..86495072a922 100644 --- a/arch/mips/kernel/bmips_vec.S +++ b/arch/mips/kernel/bmips_vec.S | |||
@@ -208,7 +208,6 @@ bmips_reset_nmi_vec_end: | |||
208 | END(bmips_reset_nmi_vec) | 208 | END(bmips_reset_nmi_vec) |
209 | 209 | ||
210 | .set pop | 210 | .set pop |
211 | .previous | ||
212 | 211 | ||
213 | /*********************************************************************** | 212 | /*********************************************************************** |
214 | * CPU1 warm restart vector (used for second and subsequent boots). | 213 | * CPU1 warm restart vector (used for second and subsequent boots). |
@@ -281,5 +280,3 @@ LEAF(bmips_enable_xks01) | |||
281 | jr ra | 280 | jr ra |
282 | 281 | ||
283 | END(bmips_enable_xks01) | 282 | END(bmips_enable_xks01) |
284 | |||
285 | .previous | ||
diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S index e6e97d2a5c9e..0384b05ab5a0 100644 --- a/arch/mips/kernel/cps-vec.S +++ b/arch/mips/kernel/cps-vec.S | |||
@@ -229,6 +229,7 @@ LEAF(mips_cps_core_init) | |||
229 | nop | 229 | nop |
230 | 230 | ||
231 | .set push | 231 | .set push |
232 | .set mips32r2 | ||
232 | .set mt | 233 | .set mt |
233 | 234 | ||
234 | /* Only allow 1 TC per VPE to execute... */ | 235 | /* Only allow 1 TC per VPE to execute... */ |
@@ -345,6 +346,7 @@ LEAF(mips_cps_boot_vpes) | |||
345 | nop | 346 | nop |
346 | 347 | ||
347 | .set push | 348 | .set push |
349 | .set mips32r2 | ||
348 | .set mt | 350 | .set mt |
349 | 351 | ||
350 | 1: /* Enter VPE configuration state */ | 352 | 1: /* Enter VPE configuration state */ |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 94c4a0c0a577..dc49cf30c2db 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -193,6 +193,32 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa) | |||
193 | static char unknown_isa[] = KERN_ERR \ | 193 | static char unknown_isa[] = KERN_ERR \ |
194 | "Unsupported ISA type, c0.config0: %d."; | 194 | "Unsupported ISA type, c0.config0: %d."; |
195 | 195 | ||
196 | static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c) | ||
197 | { | ||
198 | |||
199 | unsigned int probability = c->tlbsize / c->tlbsizevtlb; | ||
200 | |||
201 | /* | ||
202 | * 0 = All TLBWR instructions go to FTLB | ||
203 | * 1 = 15:1: For every 16 TBLWR instructions, 15 go to the | ||
204 | * FTLB and 1 goes to the VTLB. | ||
205 | * 2 = 7:1: As above with 7:1 ratio. | ||
206 | * 3 = 3:1: As above with 3:1 ratio. | ||
207 | * | ||
208 | * Use the linear midpoint as the probability threshold. | ||
209 | */ | ||
210 | if (probability >= 12) | ||
211 | return 1; | ||
212 | else if (probability >= 6) | ||
213 | return 2; | ||
214 | else | ||
215 | /* | ||
216 | * So FTLB is less than 4 times bigger than VTLB. | ||
217 | * A 3:1 ratio can still be useful though. | ||
218 | */ | ||
219 | return 3; | ||
220 | } | ||
221 | |||
196 | static void set_ftlb_enable(struct cpuinfo_mips *c, int enable) | 222 | static void set_ftlb_enable(struct cpuinfo_mips *c, int enable) |
197 | { | 223 | { |
198 | unsigned int config6; | 224 | unsigned int config6; |
@@ -203,9 +229,14 @@ static void set_ftlb_enable(struct cpuinfo_mips *c, int enable) | |||
203 | case CPU_P5600: | 229 | case CPU_P5600: |
204 | /* proAptiv & related cores use Config6 to enable the FTLB */ | 230 | /* proAptiv & related cores use Config6 to enable the FTLB */ |
205 | config6 = read_c0_config6(); | 231 | config6 = read_c0_config6(); |
232 | /* Clear the old probability value */ | ||
233 | config6 &= ~(3 << MIPS_CONF6_FTLBP_SHIFT); | ||
206 | if (enable) | 234 | if (enable) |
207 | /* Enable FTLB */ | 235 | /* Enable FTLB */ |
208 | write_c0_config6(config6 | MIPS_CONF6_FTLBEN); | 236 | write_c0_config6(config6 | |
237 | (calculate_ftlb_probability(c) | ||
238 | << MIPS_CONF6_FTLBP_SHIFT) | ||
239 | | MIPS_CONF6_FTLBEN); | ||
209 | else | 240 | else |
210 | /* Disable FTLB */ | 241 | /* Disable FTLB */ |
211 | write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN); | 242 | write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN); |
@@ -757,31 +788,34 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
757 | c->cputype = CPU_LOONGSON2; | 788 | c->cputype = CPU_LOONGSON2; |
758 | __cpu_name[cpu] = "ICT Loongson-2"; | 789 | __cpu_name[cpu] = "ICT Loongson-2"; |
759 | set_elf_platform(cpu, "loongson2e"); | 790 | set_elf_platform(cpu, "loongson2e"); |
791 | set_isa(c, MIPS_CPU_ISA_III); | ||
760 | break; | 792 | break; |
761 | case PRID_REV_LOONGSON2F: | 793 | case PRID_REV_LOONGSON2F: |
762 | c->cputype = CPU_LOONGSON2; | 794 | c->cputype = CPU_LOONGSON2; |
763 | __cpu_name[cpu] = "ICT Loongson-2"; | 795 | __cpu_name[cpu] = "ICT Loongson-2"; |
764 | set_elf_platform(cpu, "loongson2f"); | 796 | set_elf_platform(cpu, "loongson2f"); |
797 | set_isa(c, MIPS_CPU_ISA_III); | ||
765 | break; | 798 | break; |
766 | case PRID_REV_LOONGSON3A: | 799 | case PRID_REV_LOONGSON3A: |
767 | c->cputype = CPU_LOONGSON3; | 800 | c->cputype = CPU_LOONGSON3; |
768 | c->writecombine = _CACHE_UNCACHED_ACCELERATED; | ||
769 | __cpu_name[cpu] = "ICT Loongson-3"; | 801 | __cpu_name[cpu] = "ICT Loongson-3"; |
770 | set_elf_platform(cpu, "loongson3a"); | 802 | set_elf_platform(cpu, "loongson3a"); |
803 | set_isa(c, MIPS_CPU_ISA_M64R1); | ||
771 | break; | 804 | break; |
772 | case PRID_REV_LOONGSON3B_R1: | 805 | case PRID_REV_LOONGSON3B_R1: |
773 | case PRID_REV_LOONGSON3B_R2: | 806 | case PRID_REV_LOONGSON3B_R2: |
774 | c->cputype = CPU_LOONGSON3; | 807 | c->cputype = CPU_LOONGSON3; |
775 | __cpu_name[cpu] = "ICT Loongson-3"; | 808 | __cpu_name[cpu] = "ICT Loongson-3"; |
776 | set_elf_platform(cpu, "loongson3b"); | 809 | set_elf_platform(cpu, "loongson3b"); |
810 | set_isa(c, MIPS_CPU_ISA_M64R1); | ||
777 | break; | 811 | break; |
778 | } | 812 | } |
779 | 813 | ||
780 | set_isa(c, MIPS_CPU_ISA_III); | ||
781 | c->options = R4K_OPTS | | 814 | c->options = R4K_OPTS | |
782 | MIPS_CPU_FPU | MIPS_CPU_LLSC | | 815 | MIPS_CPU_FPU | MIPS_CPU_LLSC | |
783 | MIPS_CPU_32FPR; | 816 | MIPS_CPU_32FPR; |
784 | c->tlbsize = 64; | 817 | c->tlbsize = 64; |
818 | c->writecombine = _CACHE_UNCACHED_ACCELERATED; | ||
785 | break; | 819 | break; |
786 | case PRID_IMP_LOONGSON_32: /* Loongson-1 */ | 820 | case PRID_IMP_LOONGSON_32: /* Loongson-1 */ |
787 | decode_configs(c); | 821 | decode_configs(c); |
diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c index 6001610cfe55..dda800e9e731 100644 --- a/arch/mips/kernel/jump_label.c +++ b/arch/mips/kernel/jump_label.c | |||
@@ -18,31 +18,53 @@ | |||
18 | 18 | ||
19 | #ifdef HAVE_JUMP_LABEL | 19 | #ifdef HAVE_JUMP_LABEL |
20 | 20 | ||
21 | #define J_RANGE_MASK ((1ul << 28) - 1) | 21 | /* |
22 | * Define parameters for the standard MIPS and the microMIPS jump | ||
23 | * instruction encoding respectively: | ||
24 | * | ||
25 | * - the ISA bit of the target, either 0 or 1 respectively, | ||
26 | * | ||
27 | * - the amount the jump target address is shifted right to fit in the | ||
28 | * immediate field of the machine instruction, either 2 or 1, | ||
29 | * | ||
30 | * - the mask determining the size of the jump region relative to the | ||
31 | * delay-slot instruction, either 256MB or 128MB, | ||
32 | * | ||
33 | * - the jump target alignment, either 4 or 2 bytes. | ||
34 | */ | ||
35 | #define J_ISA_BIT IS_ENABLED(CONFIG_CPU_MICROMIPS) | ||
36 | #define J_RANGE_SHIFT (2 - J_ISA_BIT) | ||
37 | #define J_RANGE_MASK ((1ul << (26 + J_RANGE_SHIFT)) - 1) | ||
38 | #define J_ALIGN_MASK ((1ul << J_RANGE_SHIFT) - 1) | ||
22 | 39 | ||
23 | void arch_jump_label_transform(struct jump_entry *e, | 40 | void arch_jump_label_transform(struct jump_entry *e, |
24 | enum jump_label_type type) | 41 | enum jump_label_type type) |
25 | { | 42 | { |
43 | union mips_instruction *insn_p; | ||
26 | union mips_instruction insn; | 44 | union mips_instruction insn; |
27 | union mips_instruction *insn_p = | ||
28 | (union mips_instruction *)(unsigned long)e->code; | ||
29 | 45 | ||
30 | /* Jump only works within a 256MB aligned region. */ | 46 | insn_p = (union mips_instruction *)msk_isa16_mode(e->code); |
31 | BUG_ON((e->target & ~J_RANGE_MASK) != (e->code & ~J_RANGE_MASK)); | 47 | |
48 | /* Jump only works within an aligned region its delay slot is in. */ | ||
49 | BUG_ON((e->target & ~J_RANGE_MASK) != ((e->code + 4) & ~J_RANGE_MASK)); | ||
32 | 50 | ||
33 | /* Target must have 4 byte alignment. */ | 51 | /* Target must have the right alignment and ISA must be preserved. */ |
34 | BUG_ON((e->target & 3) != 0); | 52 | BUG_ON((e->target & J_ALIGN_MASK) != J_ISA_BIT); |
35 | 53 | ||
36 | if (type == JUMP_LABEL_ENABLE) { | 54 | if (type == JUMP_LABEL_ENABLE) { |
37 | insn.j_format.opcode = j_op; | 55 | insn.j_format.opcode = J_ISA_BIT ? mm_j32_op : j_op; |
38 | insn.j_format.target = (e->target & J_RANGE_MASK) >> 2; | 56 | insn.j_format.target = e->target >> J_RANGE_SHIFT; |
39 | } else { | 57 | } else { |
40 | insn.word = 0; /* nop */ | 58 | insn.word = 0; /* nop */ |
41 | } | 59 | } |
42 | 60 | ||
43 | get_online_cpus(); | 61 | get_online_cpus(); |
44 | mutex_lock(&text_mutex); | 62 | mutex_lock(&text_mutex); |
45 | *insn_p = insn; | 63 | if (IS_ENABLED(CONFIG_CPU_MICROMIPS)) { |
64 | insn_p->halfword[0] = insn.word >> 16; | ||
65 | insn_p->halfword[1] = insn.word; | ||
66 | } else | ||
67 | *insn_p = insn; | ||
46 | 68 | ||
47 | flush_icache_range((unsigned long)insn_p, | 69 | flush_icache_range((unsigned long)insn_p, |
48 | (unsigned long)insn_p + sizeof(*insn_p)); | 70 | (unsigned long)insn_p + sizeof(*insn_p)); |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 31b1b763cb29..c5c4fd54d797 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -94,12 +94,12 @@ int rtlx_open(int index, int can_sleep) | |||
94 | int ret = 0; | 94 | int ret = 0; |
95 | 95 | ||
96 | if (index >= RTLX_CHANNELS) { | 96 | if (index >= RTLX_CHANNELS) { |
97 | pr_debug(KERN_DEBUG "rtlx_open index out of range\n"); | 97 | pr_debug("rtlx_open index out of range\n"); |
98 | return -ENOSYS; | 98 | return -ENOSYS; |
99 | } | 99 | } |
100 | 100 | ||
101 | if (atomic_inc_return(&channel_wqs[index].in_open) > 1) { | 101 | if (atomic_inc_return(&channel_wqs[index].in_open) > 1) { |
102 | pr_debug(KERN_DEBUG "rtlx_open channel %d already opened\n", index); | 102 | pr_debug("rtlx_open channel %d already opened\n", index); |
103 | ret = -EBUSY; | 103 | ret = -EBUSY; |
104 | goto out_fail; | 104 | goto out_fail; |
105 | } | 105 | } |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index d21ec57b6e95..f3b635f86c39 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -485,7 +485,7 @@ static void __init bootmem_init(void) | |||
485 | * NOTE: historically plat_mem_setup did the entire platform initialization. | 485 | * NOTE: historically plat_mem_setup did the entire platform initialization. |
486 | * This was rather impractical because it meant plat_mem_setup had to | 486 | * This was rather impractical because it meant plat_mem_setup had to |
487 | * get away without any kind of memory allocator. To keep old code from | 487 | * get away without any kind of memory allocator. To keep old code from |
488 | * breaking plat_setup was just renamed to plat_setup and a second platform | 488 | * breaking plat_setup was just renamed to plat_mem_setup and a second platform |
489 | * initialization hook for anything else was introduced. | 489 | * initialization hook for anything else was introduced. |
490 | */ | 490 | */ |
491 | 491 | ||
@@ -493,7 +493,7 @@ static int usermem __initdata; | |||
493 | 493 | ||
494 | static int __init early_parse_mem(char *p) | 494 | static int __init early_parse_mem(char *p) |
495 | { | 495 | { |
496 | unsigned long start, size; | 496 | phys_t start, size; |
497 | 497 | ||
498 | /* | 498 | /* |
499 | * If a user specifies memory size, we | 499 | * If a user specifies memory size, we |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 1d57605e4615..16f1e4f2bf3c 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -658,13 +658,13 @@ static int signal_setup(void) | |||
658 | save_fp_context = _save_fp_context; | 658 | save_fp_context = _save_fp_context; |
659 | restore_fp_context = _restore_fp_context; | 659 | restore_fp_context = _restore_fp_context; |
660 | } else { | 660 | } else { |
661 | save_fp_context = copy_fp_from_sigcontext; | 661 | save_fp_context = copy_fp_to_sigcontext; |
662 | restore_fp_context = copy_fp_to_sigcontext; | 662 | restore_fp_context = copy_fp_from_sigcontext; |
663 | } | 663 | } |
664 | #endif /* CONFIG_SMP */ | 664 | #endif /* CONFIG_SMP */ |
665 | #else | 665 | #else |
666 | save_fp_context = copy_fp_from_sigcontext;; | 666 | save_fp_context = copy_fp_to_sigcontext; |
667 | restore_fp_context = copy_fp_to_sigcontext; | 667 | restore_fp_context = copy_fp_from_sigcontext; |
668 | #endif | 668 | #endif |
669 | 669 | ||
670 | return 0; | 670 | return 0; |
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S index c17ef80cf65a..5d3238af9b5c 100644 --- a/arch/mips/lib/memcpy.S +++ b/arch/mips/lib/memcpy.S | |||
@@ -503,6 +503,7 @@ | |||
503 | STOREB(t0, NBYTES-2(dst), .Ls_exc_p1\@) | 503 | STOREB(t0, NBYTES-2(dst), .Ls_exc_p1\@) |
504 | .Ldone\@: | 504 | .Ldone\@: |
505 | jr ra | 505 | jr ra |
506 | nop | ||
506 | .if __memcpy == 1 | 507 | .if __memcpy == 1 |
507 | END(memcpy) | 508 | END(memcpy) |
508 | .set __memcpy, 0 | 509 | .set __memcpy, 0 |
diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile index 0bb9cc9dc621..d87e03330b29 100644 --- a/arch/mips/loongson/common/Makefile +++ b/arch/mips/loongson/common/Makefile | |||
@@ -11,7 +11,8 @@ obj-$(CONFIG_PCI) += pci.o | |||
11 | # Serial port support | 11 | # Serial port support |
12 | # | 12 | # |
13 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 13 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
14 | obj-$(CONFIG_SERIAL_8250) += serial.o | 14 | loongson-serial-$(CONFIG_SERIAL_8250) := serial.o |
15 | obj-y += $(loongson-serial-m) $(loongson-serial-y) | ||
15 | obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o | 16 | obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o |
16 | obj-$(CONFIG_LOONGSON_MC146818) += rtc.o | 17 | obj-$(CONFIG_LOONGSON_MC146818) += rtc.o |
17 | 18 | ||
diff --git a/arch/mips/loongson/loongson-3/numa.c b/arch/mips/loongson/loongson-3/numa.c index 37ed184398c6..42323bcc5d28 100644 --- a/arch/mips/loongson/loongson-3/numa.c +++ b/arch/mips/loongson/loongson-3/numa.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | static struct node_data prealloc__node_data[MAX_NUMNODES]; | 34 | static struct node_data prealloc__node_data[MAX_NUMNODES]; |
35 | unsigned char __node_distances[MAX_NUMNODES][MAX_NUMNODES]; | 35 | unsigned char __node_distances[MAX_NUMNODES][MAX_NUMNODES]; |
36 | EXPORT_SYMBOL(__node_distances); | ||
36 | struct node_data *__node_data[MAX_NUMNODES]; | 37 | struct node_data *__node_data[MAX_NUMNODES]; |
37 | EXPORT_SYMBOL(__node_data); | 38 | EXPORT_SYMBOL(__node_data); |
38 | 39 | ||
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index fa6ebd4bc9e9..c3917e251f59 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c | |||
@@ -299,6 +299,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte) | |||
299 | 299 | ||
300 | local_irq_save(flags); | 300 | local_irq_save(flags); |
301 | 301 | ||
302 | htw_stop(); | ||
302 | pid = read_c0_entryhi() & ASID_MASK; | 303 | pid = read_c0_entryhi() & ASID_MASK; |
303 | address &= (PAGE_MASK << 1); | 304 | address &= (PAGE_MASK << 1); |
304 | write_c0_entryhi(address | pid); | 305 | write_c0_entryhi(address | pid); |
@@ -346,6 +347,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte) | |||
346 | tlb_write_indexed(); | 347 | tlb_write_indexed(); |
347 | } | 348 | } |
348 | tlbw_use_hazard(); | 349 | tlbw_use_hazard(); |
350 | htw_start(); | ||
349 | flush_itlb_vm(vma); | 351 | flush_itlb_vm(vma); |
350 | local_irq_restore(flags); | 352 | local_irq_restore(flags); |
351 | } | 353 | } |
@@ -422,6 +424,7 @@ __init int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
422 | 424 | ||
423 | local_irq_save(flags); | 425 | local_irq_save(flags); |
424 | /* Save old context and create impossible VPN2 value */ | 426 | /* Save old context and create impossible VPN2 value */ |
427 | htw_stop(); | ||
425 | old_ctx = read_c0_entryhi(); | 428 | old_ctx = read_c0_entryhi(); |
426 | old_pagemask = read_c0_pagemask(); | 429 | old_pagemask = read_c0_pagemask(); |
427 | wired = read_c0_wired(); | 430 | wired = read_c0_wired(); |
@@ -443,6 +446,7 @@ __init int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
443 | 446 | ||
444 | write_c0_entryhi(old_ctx); | 447 | write_c0_entryhi(old_ctx); |
445 | write_c0_pagemask(old_pagemask); | 448 | write_c0_pagemask(old_pagemask); |
449 | htw_start(); | ||
446 | out: | 450 | out: |
447 | local_irq_restore(flags); | 451 | local_irq_restore(flags); |
448 | return ret; | 452 | return ret; |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index b5f228e7eae6..e3328a96e809 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -1872,8 +1872,16 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l, | |||
1872 | uasm_l_smp_pgtable_change(l, *p); | 1872 | uasm_l_smp_pgtable_change(l, *p); |
1873 | #endif | 1873 | #endif |
1874 | iPTE_LW(p, wr.r1, wr.r2); /* get even pte */ | 1874 | iPTE_LW(p, wr.r1, wr.r2); /* get even pte */ |
1875 | if (!m4kc_tlbp_war()) | 1875 | if (!m4kc_tlbp_war()) { |
1876 | build_tlb_probe_entry(p); | 1876 | build_tlb_probe_entry(p); |
1877 | if (cpu_has_htw) { | ||
1878 | /* race condition happens, leaving */ | ||
1879 | uasm_i_ehb(p); | ||
1880 | uasm_i_mfc0(p, wr.r3, C0_INDEX); | ||
1881 | uasm_il_bltz(p, r, wr.r3, label_leave); | ||
1882 | uasm_i_nop(p); | ||
1883 | } | ||
1884 | } | ||
1877 | return wr; | 1885 | return wr; |
1878 | } | 1886 | } |
1879 | 1887 | ||
diff --git a/arch/mips/mti-sead3/sead3-leds.c b/arch/mips/mti-sead3/sead3-leds.c index 20102a6d4141..c427c5778186 100644 --- a/arch/mips/mti-sead3/sead3-leds.c +++ b/arch/mips/mti-sead3/sead3-leds.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. | 6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | #include <linux/module.h> | 8 | #include <linux/init.h> |
9 | #include <linux/leds.h> | 9 | #include <linux/leds.h> |
10 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | 11 | ||
@@ -76,8 +76,4 @@ static int __init led_init(void) | |||
76 | return platform_device_register(&fled_device); | 76 | return platform_device_register(&fled_device); |
77 | } | 77 | } |
78 | 78 | ||
79 | module_init(led_init); | 79 | device_initcall(led_init); |
80 | |||
81 | MODULE_AUTHOR("Chris Dearman <chris@mips.com>"); | ||
82 | MODULE_LICENSE("GPL"); | ||
83 | MODULE_DESCRIPTION("LED probe driver for SEAD-3"); | ||
diff --git a/arch/mips/netlogic/xlp/Makefile b/arch/mips/netlogic/xlp/Makefile index be358a8050c5..6b43af0a34d9 100644 --- a/arch/mips/netlogic/xlp/Makefile +++ b/arch/mips/netlogic/xlp/Makefile | |||
@@ -1,6 +1,10 @@ | |||
1 | obj-y += setup.o nlm_hal.o cop2-ex.o dt.o | 1 | obj-y += setup.o nlm_hal.o cop2-ex.o dt.o |
2 | obj-$(CONFIG_SMP) += wakeup.o | 2 | obj-$(CONFIG_SMP) += wakeup.o |
3 | obj-$(CONFIG_USB) += usb-init.o | 3 | ifdef CONFIG_USB |
4 | obj-$(CONFIG_USB) += usb-init-xlp2.o | 4 | obj-y += usb-init.o |
5 | obj-$(CONFIG_SATA_AHCI) += ahci-init.o | 5 | obj-y += usb-init-xlp2.o |
6 | obj-$(CONFIG_SATA_AHCI) += ahci-init-xlp2.o | 6 | endif |
7 | ifdef CONFIG_SATA_AHCI | ||
8 | obj-y += ahci-init.o | ||
9 | obj-y += ahci-init-xlp2.o | ||
10 | endif | ||
diff --git a/arch/mips/oprofile/backtrace.c b/arch/mips/oprofile/backtrace.c index 6854ed5097d2..83a1dfd8f0e3 100644 --- a/arch/mips/oprofile/backtrace.c +++ b/arch/mips/oprofile/backtrace.c | |||
@@ -92,7 +92,7 @@ static inline int unwind_user_frame(struct stackframe *old_frame, | |||
92 | /* This marks the end of the previous function, | 92 | /* This marks the end of the previous function, |
93 | which means we overran. */ | 93 | which means we overran. */ |
94 | break; | 94 | break; |
95 | stack_size = (unsigned) stack_adjustment; | 95 | stack_size = (unsigned long) stack_adjustment; |
96 | } else if (is_ra_save_ins(&ip)) { | 96 | } else if (is_ra_save_ins(&ip)) { |
97 | int ra_slot = ip.i_format.simmediate; | 97 | int ra_slot = ip.i_format.simmediate; |
98 | if (ra_slot < 0) | 98 | if (ra_slot < 0) |
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c index a95c00f5fb96..a304bcc37e4f 100644 --- a/arch/mips/sgi-ip27/ip27-memory.c +++ b/arch/mips/sgi-ip27/ip27-memory.c | |||
@@ -107,6 +107,7 @@ static void router_recurse(klrou_t *router_a, klrou_t *router_b, int depth) | |||
107 | } | 107 | } |
108 | 108 | ||
109 | unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; | 109 | unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; |
110 | EXPORT_SYMBOL(__node_distances); | ||
110 | 111 | ||
111 | static int __init compute_node_distance(nasid_t nasid_a, nasid_t nasid_b) | 112 | static int __init compute_node_distance(nasid_t nasid_a, nasid_t nasid_b) |
112 | { | 113 | { |