aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 13:59:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 13:59:54 -0400
commit568d135d337d3114688fef9fdbce7fb6dbbd04c7 (patch)
treeb9355b94182a51eec5cfc69dd335e39a2e97ac7d
parent4ecd4ff55ac5c7fe9e232f34a41c4d54f2d825c1 (diff)
parentd40e0d4fb5613099a58c95a9403f51b03e40e861 (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "Boston platform support: - Document DT bindings - Add CLK driver for board clocks CM: - Avoid per-core locking with CM3 & higher - WARN on attempt to lock invalid VP, not BUG CPS: - Select CONFIG_SYS_SUPPORTS_SCHED_SMT for MIPSr6 - Prevent multi-core with dcache aliasing - Handle cores not powering down more gracefully - Handle spurious VP starts more gracefully DSP: - Add lwx & lhx missaligned access support eBPF: - Add MIPS support along with many supporting change to add the required infrastructure Generic arch code: - Misc sysmips MIPS_ATOMIC_SET fixes - Drop duplicate HAVE_SYSCALL_TRACEPOINTS - Negate error syscall return in trace - Correct forced syscall errors - Traced negative syscalls should return -ENOSYS - Allow samples/bpf/tracex5 to access syscall arguments for sane traces - Cleanup from old Kconfig options in defconfigs - Fix PREF instruction usage by memcpy for MIPS R6 - Fix various special cases in the FPU eulation - Fix some special cases in MIPS16e2 support - Fix MIPS I ISA /proc/cpuinfo reporting - Sort MIPS Kconfig alphabetically - Fix minimum alignment requirement of IRQ stack as required by ABI / GCC - Fix special cases in the module loader - Perform post-DMA cache flushes on systems with MAARs - Probe the I6500 CPU - Cleanup cmpxchg and add support for 1 and 2 byte operations - Use queued read/write locks (qrwlock) - Use queued spinlocks (qspinlock) - Add CPU shared FTLB feature detection - Handle tlbex-tlbp race condition - Allow storing pgd in C0_CONTEXT for MIPSr6 - Use current_cpu_type() in m4kc_tlbp_war() - Support Boston in the generic kernel Generic platform: - yamon-dt: Pull YAMON DT shim code out of SEAD-3 board - yamon-dt: Support > 256MB of RAM - yamon-dt: Use serial* rather than uart* aliases - Abstract FDT fixup application - Set RTC_ALWAYS_BCD to 0 - Add a MAINTAINERS entry core kernel: - qspinlock.c: include linux/prefetch.h Loongson 3: - Add support Perf: - Add I6500 support SEAD-3: - Remove GIC timer from DT - Set interrupt-parent per-device, not at root node - Fix GIC interrupt specifiers SMP: - Skip IPI setup if we only have a single CPU VDSO: - Make comment match reality - Improvements to time code in VDSO" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (86 commits) locking/qspinlock: Include linux/prefetch.h MIPS: Fix MIPS I ISA /proc/cpuinfo reporting MIPS: Fix minimum alignment requirement of IRQ stack MIPS: generic: Support MIPS Boston development boards MIPS: DTS: img: Don't attempt to build-in all .dtb files clk: boston: Add a driver for MIPS Boston board clocks dt-bindings: Document img,boston-clock binding MIPS: Traced negative syscalls should return -ENOSYS MIPS: Correct forced syscall errors MIPS: Negate error syscall return in trace MIPS: Drop duplicate HAVE_SYSCALL_TRACEPOINTS select MIPS16e2: Provide feature overrides for non-MIPS16 systems MIPS: MIPS16e2: Report ASE presence in /proc/cpuinfo MIPS: MIPS16e2: Subdecode extended LWSP/SWSP instructions MIPS: MIPS16e2: Identify ASE presence MIPS: VDSO: Fix a mismatch between comment and preprocessor constant MIPS: VDSO: Add implementation of gettimeofday() fallback MIPS: VDSO: Add implementation of clock_gettime() fallback MIPS: VDSO: Fix conversions in do_monotonic()/do_monotonic_coarse() MIPS: Use current_cpu_type() in m4kc_tlbp_war() ...
-rw-r--r--Documentation/devicetree/bindings/clock/img,boston-clock.txt31
-rw-r--r--MAINTAINERS16
-rw-r--r--arch/mips/Kconfig114
-rw-r--r--arch/mips/Makefile2
-rw-r--r--arch/mips/boot/dts/img/Makefile5
-rw-r--r--arch/mips/boot/dts/img/boston.dts224
-rw-r--r--arch/mips/boot/dts/mti/sead3.dts24
-rw-r--r--arch/mips/configs/ar7_defconfig6
-rw-r--r--arch/mips/configs/ath79_defconfig2
-rw-r--r--arch/mips/configs/bcm63xx_defconfig7
-rw-r--r--arch/mips/configs/bigsur_defconfig4
-rw-r--r--arch/mips/configs/bmips_be_defconfig1
-rw-r--r--arch/mips/configs/capcella_defconfig4
-rw-r--r--arch/mips/configs/cavium_octeon_defconfig1
-rw-r--r--arch/mips/configs/ci20_defconfig1
-rw-r--r--arch/mips/configs/cobalt_defconfig8
-rw-r--r--arch/mips/configs/decstation_defconfig1
-rw-r--r--arch/mips/configs/e55_defconfig2
-rw-r--r--arch/mips/configs/fuloong2e_defconfig11
-rw-r--r--arch/mips/configs/generic/board-boston.config48
-rw-r--r--arch/mips/configs/gpr_defconfig8
-rw-r--r--arch/mips/configs/ip22_defconfig11
-rw-r--r--arch/mips/configs/ip27_defconfig5
-rw-r--r--arch/mips/configs/ip28_defconfig5
-rw-r--r--arch/mips/configs/ip32_defconfig8
-rw-r--r--arch/mips/configs/jazz_defconfig6
-rw-r--r--arch/mips/configs/jmr3927_defconfig7
-rw-r--r--arch/mips/configs/lasat_defconfig5
-rw-r--r--arch/mips/configs/lemote2f_defconfig12
-rw-r--r--arch/mips/configs/loongson3_defconfig3
-rw-r--r--arch/mips/configs/malta_kvm_defconfig1
-rw-r--r--arch/mips/configs/malta_kvm_guest_defconfig1
-rw-r--r--arch/mips/configs/malta_qemu_32r6_defconfig1
-rw-r--r--arch/mips/configs/maltaaprp_defconfig2
-rw-r--r--arch/mips/configs/maltasmvp_defconfig1
-rw-r--r--arch/mips/configs/maltasmvp_eva_defconfig2
-rw-r--r--arch/mips/configs/maltaup_defconfig2
-rw-r--r--arch/mips/configs/markeins_defconfig4
-rw-r--r--arch/mips/configs/mips_paravirt_defconfig1
-rw-r--r--arch/mips/configs/mpc30x_defconfig5
-rw-r--r--arch/mips/configs/msp71xx_defconfig2
-rw-r--r--arch/mips/configs/mtx1_defconfig11
-rw-r--r--arch/mips/configs/nlm_xlp_defconfig5
-rw-r--r--arch/mips/configs/nlm_xlr_defconfig9
-rw-r--r--arch/mips/configs/pnx8335_stb225_defconfig7
-rw-r--r--arch/mips/configs/qi_lb60_defconfig3
-rw-r--r--arch/mips/configs/rb532_defconfig6
-rw-r--r--arch/mips/configs/rbtx49xx_defconfig7
-rw-r--r--arch/mips/configs/rm200_defconfig8
-rw-r--r--arch/mips/configs/rt305x_defconfig2
-rw-r--r--arch/mips/configs/sb1250_swarm_defconfig1
-rw-r--r--arch/mips/configs/tb0219_defconfig6
-rw-r--r--arch/mips/configs/tb0226_defconfig7
-rw-r--r--arch/mips/configs/tb0287_defconfig5
-rw-r--r--arch/mips/configs/workpad_defconfig4
-rw-r--r--arch/mips/generic/Kconfig20
-rw-r--r--arch/mips/generic/Makefile1
-rw-r--r--arch/mips/generic/board-sead3.c234
-rw-r--r--arch/mips/generic/init.c27
-rw-r--r--arch/mips/generic/vmlinux.its.S25
-rw-r--r--arch/mips/generic/yamon-dt.c240
-rw-r--r--arch/mips/include/asm/Kbuild2
-rw-r--r--arch/mips/include/asm/branch.h5
-rw-r--r--arch/mips/include/asm/cmpxchg.h280
-rw-r--r--arch/mips/include/asm/cpu-features.h44
-rw-r--r--arch/mips/include/asm/cpu-type.h1
-rw-r--r--arch/mips/include/asm/cpu.h9
-rw-r--r--arch/mips/include/asm/irq.h2
-rw-r--r--arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-dec/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-generic/mc146818rtc.h2
-rw-r--r--arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-loongson64/boot_param.h22
-rw-r--r--arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-rm/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/machine.h31
-rw-r--r--arch/mips/include/asm/mipsregs.h1
-rw-r--r--arch/mips/include/asm/module.h8
-rw-r--r--arch/mips/include/asm/spinlock.h426
-rw-r--r--arch/mips/include/asm/spinlock_types.h34
-rw-r--r--arch/mips/include/asm/syscall.h2
-rw-r--r--arch/mips/include/asm/uasm.h30
-rw-r--r--arch/mips/include/asm/vdso.h4
-rw-r--r--arch/mips/include/asm/yamon-dt.h64
-rw-r--r--arch/mips/include/uapi/asm/inst.h20
-rw-r--r--arch/mips/kernel/Makefile3
-rw-r--r--arch/mips/kernel/branch.c73
-rw-r--r--arch/mips/kernel/cmpxchg.c109
-rw-r--r--arch/mips/kernel/cps-vec.S7
-rw-r--r--arch/mips/kernel/cpu-probe.c24
-rw-r--r--arch/mips/kernel/mips-cm.c40
-rw-r--r--arch/mips/kernel/module-rela.c202
-rw-r--r--arch/mips/kernel/module.c221
-rw-r--r--arch/mips/kernel/perf_event_mipsxx.c14
-rw-r--r--arch/mips/kernel/proc.c3
-rw-r--r--arch/mips/kernel/ptrace.c31
-rw-r--r--arch/mips/kernel/scall32-o32.S2
-rw-r--r--arch/mips/kernel/scall64-64.S2
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/kernel/setup.c40
-rw-r--r--arch/mips/kernel/smp-cps.c35
-rw-r--r--arch/mips/kernel/smp.c3
-rw-r--r--arch/mips/kernel/syscall.c19
-rw-r--r--arch/mips/kernel/unaligned.c213
-rw-r--r--arch/mips/lib/memcpy.S3
-rw-r--r--arch/mips/loongson64/common/env.c12
-rw-r--r--arch/mips/loongson64/common/init.c13
-rw-r--r--arch/mips/loongson64/loongson-3/irq.c58
-rw-r--r--arch/mips/loongson64/loongson-3/smp.c23
-rw-r--r--arch/mips/math-emu/cp1emu.c43
-rw-r--r--arch/mips/mm/c-r4k.c2
-rw-r--r--arch/mips/mm/tlbex.c41
-rw-r--r--arch/mips/mm/uasm-micromips.c188
-rw-r--r--arch/mips/mm/uasm-mips.c238
-rw-r--r--arch/mips/mm/uasm.c61
-rw-r--r--arch/mips/net/Makefile3
-rw-r--r--arch/mips/vdso/gettimeofday.c59
-rw-r--r--drivers/clk/Kconfig1
-rw-r--r--drivers/clk/Makefile1
-rw-r--r--drivers/clk/imgtec/Kconfig9
-rw-r--r--drivers/clk/imgtec/Makefile1
-rw-r--r--drivers/clk/imgtec/clk-boston.c103
-rw-r--r--drivers/platform/mips/cpu_hwmon.c136
-rw-r--r--include/dt-bindings/clock/boston-clock.h14
136 files changed, 2453 insertions, 1836 deletions
diff --git a/Documentation/devicetree/bindings/clock/img,boston-clock.txt b/Documentation/devicetree/bindings/clock/img,boston-clock.txt
new file mode 100644
index 000000000000..7bc5e9ffb624
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/img,boston-clock.txt
@@ -0,0 +1,31 @@
1Binding for Imagination Technologies MIPS Boston clock sources.
2
3This binding uses the common clock binding[1].
4
5[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
6
7The device node must be a child node of the syscon node corresponding to the
8Boston system's platform registers.
9
10Required properties:
11- compatible : Should be "img,boston-clock".
12- #clock-cells : Should be set to 1.
13 Values available for clock consumers can be found in the header file:
14 <dt-bindings/clock/boston-clock.h>
15
16Example:
17
18 system-controller@17ffd000 {
19 compatible = "img,boston-platform-regs", "syscon";
20 reg = <0x17ffd000 0x1000>;
21
22 clk_boston: clock {
23 compatible = "img,boston-clock";
24 #clock-cells = <1>;
25 };
26 };
27
28 uart0: uart@17ffe000 {
29 /* ... */
30 clocks = <&clk_boston BOSTON_CLK_SYS>;
31 };
diff --git a/MAINTAINERS b/MAINTAINERS
index 428e042dcd21..205d3977ac46 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8732,6 +8732,12 @@ F: Documentation/devicetree/bindings/mips/
8732F: Documentation/mips/ 8732F: Documentation/mips/
8733F: arch/mips/ 8733F: arch/mips/
8734 8734
8735MIPS GENERIC PLATFORM
8736M: Paul Burton <paul.burton@imgtec.com>
8737L: linux-mips@linux-mips.org
8738S: Supported
8739F: arch/mips/generic/
8740
8735MIPS/LOONGSON1 ARCHITECTURE 8741MIPS/LOONGSON1 ARCHITECTURE
8736M: Keguang Zhang <keguang.zhang@gmail.com> 8742M: Keguang Zhang <keguang.zhang@gmail.com>
8737L: linux-mips@linux-mips.org 8743L: linux-mips@linux-mips.org
@@ -8741,6 +8747,16 @@ F: arch/mips/include/asm/mach-loongson32/
8741F: drivers/*/*loongson1* 8747F: drivers/*/*loongson1*
8742F: drivers/*/*/*loongson1* 8748F: drivers/*/*/*loongson1*
8743 8749
8750MIPS BOSTON DEVELOPMENT BOARD
8751M: Paul Burton <paul.burton@imgtec.com>
8752L: linux-mips@linux-mips.org
8753S: Maintained
8754F: Documentation/devicetree/bindings/clock/img,boston-clock.txt
8755F: arch/mips/boot/dts/img/boston.dts
8756F: arch/mips/configs/generic/board-boston.config
8757F: drivers/clk/imgtec/clk-boston.c
8758F: include/dt-bindings/clock/boston-clock.h
8759
8744MIROSOUND PCM20 FM RADIO RECEIVER DRIVER 8760MIROSOUND PCM20 FM RADIO RECEIVER DRIVER
8745M: Hans Verkuil <hverkuil@xs4all.nl> 8761M: Hans Verkuil <hverkuil@xs4all.nl>
8746L: linux-media@vger.kernel.org 8762L: linux-media@vger.kernel.org
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 45bcd1cfcec0..8dd20358464f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1,75 +1,77 @@
1config MIPS 1config MIPS
2 bool 2 bool
3 default y 3 default y
4 select ARCH_SUPPORTS_UPROBES 4 select ARCH_BINFMT_ELF_STATE
5 select ARCH_CLOCKSOURCE_DATA
6 select ARCH_DISCARD_MEMBLOCK
7 select ARCH_HAS_ELF_RANDOMIZE
8 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
5 select ARCH_MIGHT_HAVE_PC_PARPORT 9 select ARCH_MIGHT_HAVE_PC_PARPORT
6 select ARCH_MIGHT_HAVE_PC_SERIO 10 select ARCH_MIGHT_HAVE_PC_SERIO
7 select ARCH_USE_CMPXCHG_LOCKREF if 64BIT 11 select ARCH_SUPPORTS_UPROBES
8 select ARCH_USE_BUILTIN_BSWAP 12 select ARCH_USE_BUILTIN_BSWAP
9 select HAVE_CONTEXT_TRACKING 13 select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
10 select HAVE_GENERIC_DMA_COHERENT 14 select ARCH_USE_QUEUED_RWLOCKS
11 select HAVE_IDE 15 select ARCH_USE_QUEUED_SPINLOCKS
12 select HAVE_IRQ_EXIT_ON_IRQ_STACK 16 select ARCH_WANT_IPC_PARSE_VERSION
13 select HAVE_OPROFILE 17 select BUILDTIME_EXTABLE_SORT
14 select HAVE_PERF_EVENTS 18 select CLONE_BACKWARDS
15 select PERF_USE_VMALLOC 19 select CPU_PM if CPU_IDLE
20 select GENERIC_ATOMIC64 if !64BIT
21 select GENERIC_CLOCKEVENTS
22 select GENERIC_CMOS_UPDATE
23 select GENERIC_CPU_AUTOPROBE
24 select GENERIC_IRQ_PROBE
25 select GENERIC_IRQ_SHOW
26 select GENERIC_PCI_IOMAP
27 select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
28 select GENERIC_SMP_IDLE_THREAD
29 select GENERIC_TIME_VSYSCALL
30 select HANDLE_DOMAIN_IRQ
31 select HAVE_ARCH_JUMP_LABEL
16 select HAVE_ARCH_KGDB 32 select HAVE_ARCH_KGDB
17 select HAVE_ARCH_MMAP_RND_BITS if MMU 33 select HAVE_ARCH_MMAP_RND_BITS if MMU
18 select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT 34 select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
19 select HAVE_ARCH_SECCOMP_FILTER 35 select HAVE_ARCH_SECCOMP_FILTER
20 select HAVE_ARCH_TRACEHOOK 36 select HAVE_ARCH_TRACEHOOK
21 select HAVE_CBPF_JIT if !CPU_MICROMIPS 37 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
22 select HAVE_FUNCTION_TRACER 38 select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS)
39 select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS)
40 select HAVE_CC_STACKPROTECTOR
41 select HAVE_CONTEXT_TRACKING
42 select HAVE_COPY_THREAD_TLS
43 select HAVE_C_RECORDMCOUNT
44 select HAVE_DEBUG_KMEMLEAK
45 select HAVE_DEBUG_STACKOVERFLOW
46 select HAVE_DMA_API_DEBUG
47 select HAVE_DMA_CONTIGUOUS
23 select HAVE_DYNAMIC_FTRACE 48 select HAVE_DYNAMIC_FTRACE
49 select HAVE_EXIT_THREAD
24 select HAVE_FTRACE_MCOUNT_RECORD 50 select HAVE_FTRACE_MCOUNT_RECORD
25 select HAVE_C_RECORDMCOUNT
26 select HAVE_FUNCTION_GRAPH_TRACER 51 select HAVE_FUNCTION_GRAPH_TRACER
52 select HAVE_FUNCTION_TRACER
53 select HAVE_GENERIC_DMA_COHERENT
54 select HAVE_IDE
55 select HAVE_IRQ_EXIT_ON_IRQ_STACK
56 select HAVE_IRQ_TIME_ACCOUNTING
27 select HAVE_KPROBES 57 select HAVE_KPROBES
28 select HAVE_KRETPROBES 58 select HAVE_KRETPROBES
29 select HAVE_SYSCALL_TRACEPOINTS
30 select HAVE_DEBUG_KMEMLEAK
31 select HAVE_SYSCALL_TRACEPOINTS
32 select ARCH_HAS_ELF_RANDOMIZE
33 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
34 select RTC_LIB if !MACH_LOONGSON64
35 select GENERIC_ATOMIC64 if !64BIT
36 select HAVE_DMA_CONTIGUOUS
37 select HAVE_DMA_API_DEBUG
38 select GENERIC_IRQ_PROBE
39 select GENERIC_IRQ_SHOW
40 select GENERIC_PCI_IOMAP
41 select HAVE_ARCH_JUMP_LABEL
42 select ARCH_WANT_IPC_PARSE_VERSION
43 select IRQ_FORCED_THREADING
44 select HAVE_MEMBLOCK 59 select HAVE_MEMBLOCK
45 select HAVE_MEMBLOCK_NODE_MAP 60 select HAVE_MEMBLOCK_NODE_MAP
46 select ARCH_DISCARD_MEMBLOCK
47 select GENERIC_SMP_IDLE_THREAD
48 select BUILDTIME_EXTABLE_SORT
49 select GENERIC_CPU_AUTOPROBE
50 select GENERIC_CLOCKEVENTS
51 select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
52 select GENERIC_CMOS_UPDATE
53 select HAVE_MOD_ARCH_SPECIFIC 61 select HAVE_MOD_ARCH_SPECIFIC
54 select HAVE_NMI 62 select HAVE_NMI
55 select VIRT_TO_BUS 63 select HAVE_OPROFILE
56 select MODULES_USE_ELF_REL if MODULES 64 select HAVE_PERF_EVENTS
65 select HAVE_REGS_AND_STACK_ACCESS_API
66 select HAVE_SYSCALL_TRACEPOINTS
67 select HAVE_VIRT_CPU_ACCOUNTING_GEN
68 select IRQ_FORCED_THREADING
57 select MODULES_USE_ELF_RELA if MODULES && 64BIT 69 select MODULES_USE_ELF_RELA if MODULES && 64BIT
58 select CLONE_BACKWARDS 70 select MODULES_USE_ELF_REL if MODULES
59 select HAVE_DEBUG_STACKOVERFLOW 71 select PERF_USE_VMALLOC
60 select HAVE_CC_STACKPROTECTOR 72 select RTC_LIB if !MACH_LOONGSON64
61 select CPU_PM if CPU_IDLE
62 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
63 select ARCH_BINFMT_ELF_STATE
64 select SYSCTL_EXCEPTION_TRACE 73 select SYSCTL_EXCEPTION_TRACE
65 select HAVE_VIRT_CPU_ACCOUNTING_GEN 74 select VIRT_TO_BUS
66 select HAVE_IRQ_TIME_ACCOUNTING
67 select GENERIC_TIME_VSYSCALL
68 select ARCH_CLOCKSOURCE_DATA
69 select HANDLE_DOMAIN_IRQ
70 select HAVE_EXIT_THREAD
71 select HAVE_REGS_AND_STACK_ACCESS_API
72 select HAVE_COPY_THREAD_TLS
73 75
74menu "Machine selection" 76menu "Machine selection"
75 77
@@ -1179,6 +1181,15 @@ config SYS_SUPPORTS_RELOCATABLE
1179 The platform must provide plat_get_fdt() if it selects CONFIG_USE_OF 1181 The platform must provide plat_get_fdt() if it selects CONFIG_USE_OF
1180 to allow access to command line and entropy sources. 1182 to allow access to command line and entropy sources.
1181 1183
1184config MIPS_CBPF_JIT
1185 def_bool y
1186 depends on BPF_JIT && HAVE_CBPF_JIT
1187
1188config MIPS_EBPF_JIT
1189 def_bool y
1190 depends on BPF_JIT && HAVE_EBPF_JIT
1191
1192
1182# 1193#
1183# Endianness selection. Sufficiently obscure so many users don't know what to 1194# Endianness selection. Sufficiently obscure so many users don't know what to
1184# answer,so we try hard to limit the available choices. Also the use of a 1195# answer,so we try hard to limit the available choices. Also the use of a
@@ -2062,7 +2073,7 @@ config CPU_SUPPORTS_UNCACHED_ACCELERATED
2062 bool 2073 bool
2063config MIPS_PGD_C0_CONTEXT 2074config MIPS_PGD_C0_CONTEXT
2064 bool 2075 bool
2065 default y if 64BIT && CPU_MIPSR2 && !CPU_XLP 2076 default y if 64BIT && (CPU_MIPSR2 || CPU_MIPSR6) && !CPU_XLP
2066 2077
2067# 2078#
2068# Set to y for ptrace access to watch registers. 2079# Set to y for ptrace access to watch registers.
@@ -2370,6 +2381,7 @@ config MIPS_CPS
2370 select SMP 2381 select SMP
2371 select SYNC_R4K if (CEVT_R4K || CSRC_R4K) 2382 select SYNC_R4K if (CEVT_R4K || CSRC_R4K)
2372 select SYS_SUPPORTS_HOTPLUG_CPU 2383 select SYS_SUPPORTS_HOTPLUG_CPU
2384 select SYS_SUPPORTS_SCHED_SMT if CPU_MIPSR6
2373 select SYS_SUPPORTS_SMP 2385 select SYS_SUPPORTS_SMP
2374 select WEAK_ORDERING 2386 select WEAK_ORDERING
2375 help 2387 help
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 02a1787c888c..04343625b929 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -160,7 +160,7 @@ cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS
160 -Wa,-mips32 -Wa,--trap 160 -Wa,-mips32 -Wa,--trap
161cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ 161cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
162 -Wa,-mips32r2 -Wa,--trap 162 -Wa,-mips32r2 -Wa,--trap
163cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap 163cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg
164cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ 164cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
165 -Wa,-mips64 -Wa,--trap 165 -Wa,-mips64 -Wa,--trap
166cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ 166cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
diff --git a/arch/mips/boot/dts/img/Makefile b/arch/mips/boot/dts/img/Makefile
index 69a65f0f82d2..3d70958d0f5a 100644
--- a/arch/mips/boot/dts/img/Makefile
+++ b/arch/mips/boot/dts/img/Makefile
@@ -1,6 +1,7 @@
1dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb 1dtb-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += boston.dtb
2 2
3obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 3dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb
4obj-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb.o
4 5
5# Force kbuild to make empty built-in.o if necessary 6# Force kbuild to make empty built-in.o if necessary
6obj- += dummy.o 7obj- += dummy.o
diff --git a/arch/mips/boot/dts/img/boston.dts b/arch/mips/boot/dts/img/boston.dts
new file mode 100644
index 000000000000..53bfa29a7093
--- /dev/null
+++ b/arch/mips/boot/dts/img/boston.dts
@@ -0,0 +1,224 @@
1/dts-v1/;
2
3#include <dt-bindings/clock/boston-clock.h>
4#include <dt-bindings/gpio/gpio.h>
5#include <dt-bindings/interrupt-controller/irq.h>
6#include <dt-bindings/interrupt-controller/mips-gic.h>
7
8/ {
9 #address-cells = <1>;
10 #size-cells = <1>;
11 compatible = "img,boston";
12
13 chosen {
14 stdout-path = "uart0:115200";
15 };
16
17 aliases {
18 uart0 = &uart0;
19 };
20
21 cpus {
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 cpu@0 {
26 device_type = "cpu";
27 compatible = "img,mips";
28 reg = <0>;
29 clocks = <&clk_boston BOSTON_CLK_CPU>;
30 };
31 };
32
33 memory@0 {
34 device_type = "memory";
35 reg = <0x00000000 0x10000000>;
36 };
37
38 pci0: pci@10000000 {
39 compatible = "xlnx,axi-pcie-host-1.00.a";
40 device_type = "pci";
41 reg = <0x10000000 0x2000000>;
42
43 #address-cells = <3>;
44 #size-cells = <2>;
45 #interrupt-cells = <1>;
46
47 interrupt-parent = <&gic>;
48 interrupts = <GIC_SHARED 2 IRQ_TYPE_LEVEL_HIGH>;
49
50 ranges = <0x02000000 0 0x40000000
51 0x40000000 0 0x40000000>;
52
53 interrupt-map-mask = <0 0 0 7>;
54 interrupt-map = <0 0 0 1 &pci0_intc 1>,
55 <0 0 0 2 &pci0_intc 2>,
56 <0 0 0 3 &pci0_intc 3>,
57 <0 0 0 4 &pci0_intc 4>;
58
59 pci0_intc: interrupt-controller {
60 interrupt-controller;
61 #address-cells = <0>;
62 #interrupt-cells = <1>;
63 };
64 };
65
66 pci1: pci@12000000 {
67 compatible = "xlnx,axi-pcie-host-1.00.a";
68 device_type = "pci";
69 reg = <0x12000000 0x2000000>;
70
71 #address-cells = <3>;
72 #size-cells = <2>;
73 #interrupt-cells = <1>;
74
75 interrupt-parent = <&gic>;
76 interrupts = <GIC_SHARED 1 IRQ_TYPE_LEVEL_HIGH>;
77
78 ranges = <0x02000000 0 0x20000000
79 0x20000000 0 0x20000000>;
80
81 interrupt-map-mask = <0 0 0 7>;
82 interrupt-map = <0 0 0 1 &pci1_intc 1>,
83 <0 0 0 2 &pci1_intc 2>,
84 <0 0 0 3 &pci1_intc 3>,
85 <0 0 0 4 &pci1_intc 4>;
86
87 pci1_intc: interrupt-controller {
88 interrupt-controller;
89 #address-cells = <0>;
90 #interrupt-cells = <1>;
91 };
92 };
93
94 pci2: pci@14000000 {
95 compatible = "xlnx,axi-pcie-host-1.00.a";
96 device_type = "pci";
97 reg = <0x14000000 0x2000000>;
98
99 #address-cells = <3>;
100 #size-cells = <2>;
101 #interrupt-cells = <1>;
102
103 interrupt-parent = <&gic>;
104 interrupts = <GIC_SHARED 0 IRQ_TYPE_LEVEL_HIGH>;
105
106 ranges = <0x02000000 0 0x16000000
107 0x16000000 0 0x100000>;
108
109 interrupt-map-mask = <0 0 0 7>;
110 interrupt-map = <0 0 0 1 &pci2_intc 1>,
111 <0 0 0 2 &pci2_intc 2>,
112 <0 0 0 3 &pci2_intc 3>,
113 <0 0 0 4 &pci2_intc 4>;
114
115 pci2_intc: interrupt-controller {
116 interrupt-controller;
117 #address-cells = <0>;
118 #interrupt-cells = <1>;
119 };
120
121 pci2_root@0,0,0 {
122 compatible = "pci10ee,7021";
123 reg = <0x00000000 0 0 0 0>;
124
125 #address-cells = <3>;
126 #size-cells = <2>;
127 #interrupt-cells = <1>;
128
129 eg20t_bridge@1,0,0 {
130 compatible = "pci8086,8800";
131 reg = <0x00010000 0 0 0 0>;
132
133 #address-cells = <3>;
134 #size-cells = <2>;
135 #interrupt-cells = <1>;
136
137 eg20t_mac@2,0,1 {
138 compatible = "pci8086,8802";
139 reg = <0x00020100 0 0 0 0>;
140 phy-reset-gpios = <&eg20t_gpio 6
141 GPIO_ACTIVE_LOW>;
142 };
143
144 eg20t_gpio: eg20t_gpio@2,0,2 {
145 compatible = "pci8086,8803";
146 reg = <0x00020200 0 0 0 0>;
147
148 gpio-controller;
149 #gpio-cells = <2>;
150 };
151
152 eg20t_i2c@2,12,2 {
153 compatible = "pci8086,8817";
154 reg = <0x00026200 0 0 0 0>;
155
156 #address-cells = <1>;
157 #size-cells = <0>;
158
159 rtc@0x68 {
160 compatible = "st,m41t81s";
161 reg = <0x68>;
162 };
163 };
164 };
165 };
166 };
167
168 gic: interrupt-controller@16120000 {
169 compatible = "mti,gic";
170 reg = <0x16120000 0x20000>;
171
172 interrupt-controller;
173 #interrupt-cells = <3>;
174
175 timer {
176 compatible = "mti,gic-timer";
177 interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
178 clocks = <&clk_boston BOSTON_CLK_CPU>;
179 };
180 };
181
182 cdmm@16140000 {
183 compatible = "mti,mips-cdmm";
184 reg = <0x16140000 0x8000>;
185 };
186
187 cpc@16200000 {
188 compatible = "mti,mips-cpc";
189 reg = <0x16200000 0x8000>;
190 };
191
192 plat_regs: system-controller@17ffd000 {
193 compatible = "img,boston-platform-regs", "syscon";
194 reg = <0x17ffd000 0x1000>;
195
196 clk_boston: clock {
197 compatible = "img,boston-clock";
198 #clock-cells = <1>;
199 };
200 };
201
202 reboot: syscon-reboot {
203 compatible = "syscon-reboot";
204 regmap = <&plat_regs>;
205 offset = <0x10>;
206 mask = <0x10>;
207 };
208
209 uart0: uart@17ffe000 {
210 compatible = "ns16550a";
211 reg = <0x17ffe000 0x1000>;
212 reg-shift = <2>;
213
214 interrupt-parent = <&gic>;
215 interrupts = <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>;
216
217 clocks = <&clk_boston BOSTON_CLK_SYS>;
218 };
219
220 lcd: lcd@17fff000 {
221 compatible = "img,boston-lcd";
222 reg = <0x17fff000 0x8>;
223 };
224};
diff --git a/arch/mips/boot/dts/mti/sead3.dts b/arch/mips/boot/dts/mti/sead3.dts
index b112879a5d9d..4f8bc83c2960 100644
--- a/arch/mips/boot/dts/mti/sead3.dts
+++ b/arch/mips/boot/dts/mti/sead3.dts
@@ -11,15 +11,14 @@
11 #size-cells = <1>; 11 #size-cells = <1>;
12 compatible = "mti,sead-3"; 12 compatible = "mti,sead-3";
13 model = "MIPS SEAD-3"; 13 model = "MIPS SEAD-3";
14 interrupt-parent = <&gic>;
15 14
16 chosen { 15 chosen {
17 stdout-path = "uart1:115200"; 16 stdout-path = "serial1:115200";
18 }; 17 };
19 18
20 aliases { 19 aliases {
21 uart0 = &uart0; 20 serial0 = &uart0;
22 uart1 = &uart1; 21 serial1 = &uart1;
23 }; 22 };
24 23
25 cpus { 24 cpus {
@@ -54,18 +53,14 @@
54 * controller & should be probed first. 53 * controller & should be probed first.
55 */ 54 */
56 interrupt-parent = <&cpu_intc>; 55 interrupt-parent = <&cpu_intc>;
57
58 timer {
59 compatible = "mti,gic-timer";
60 interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
61 };
62 }; 56 };
63 57
64 ehci@1b200000 { 58 ehci@1b200000 {
65 compatible = "generic-ehci"; 59 compatible = "generic-ehci";
66 reg = <0x1b200000 0x1000>; 60 reg = <0x1b200000 0x1000>;
67 61
68 interrupts = <0>; /* GIC 0 or CPU 6 */ 62 interrupt-parent = <&gic>;
63 interrupts = <GIC_SHARED 0 IRQ_TYPE_LEVEL_HIGH>; /* GIC 0 or CPU 6 */
69 64
70 has-transaction-translator; 65 has-transaction-translator;
71 }; 66 };
@@ -227,7 +222,8 @@
227 222
228 clock-frequency = <14745600>; 223 clock-frequency = <14745600>;
229 224
230 interrupts = <3>; /* GIC 3 or CPU 4 */ 225 interrupt-parent = <&gic>;
226 interrupts = <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>; /* GIC 3 or CPU 4 */
231 227
232 no-loopback-test; 228 no-loopback-test;
233 }; 229 };
@@ -241,7 +237,8 @@
241 237
242 clock-frequency = <14745600>; 238 clock-frequency = <14745600>;
243 239
244 interrupts = <2>; /* GIC 2 or CPU 4 */ 240 interrupt-parent = <&gic>;
241 interrupts = <GIC_SHARED 2 IRQ_TYPE_LEVEL_HIGH>; /* GIC 2 or CPU 4 */
245 242
246 no-loopback-test; 243 no-loopback-test;
247 }; 244 };
@@ -251,7 +248,8 @@
251 reg = <0x1f010000 0x10000>; 248 reg = <0x1f010000 0x10000>;
252 reg-io-width = <4>; 249 reg-io-width = <4>;
253 250
254 interrupts = <0>; /* GIC 0 or CPU 6 */ 251 interrupt-parent = <&gic>;
252 interrupts = <GIC_SHARED 0 IRQ_TYPE_LEVEL_HIGH>; /* GIC 0 or CPU 6 */
255 253
256 phy-mode = "mii"; 254 phy-mode = "mii";
257 smsc,irq-push-pull; 255 smsc,irq-push-pull;
diff --git a/arch/mips/configs/ar7_defconfig b/arch/mips/configs/ar7_defconfig
index 320772caf054..92fca3c42eac 100644
--- a/arch/mips/configs/ar7_defconfig
+++ b/arch/mips/configs/ar7_defconfig
@@ -3,7 +3,6 @@ CONFIG_HIGH_RES_TIMERS=y
3CONFIG_HZ_100=y 3CONFIG_HZ_100=y
4CONFIG_KEXEC=y 4CONFIG_KEXEC=y
5# CONFIG_SECCOMP is not set 5# CONFIG_SECCOMP is not set
6CONFIG_EXPERIMENTAL=y
7# CONFIG_LOCALVERSION_AUTO is not set 6# CONFIG_LOCALVERSION_AUTO is not set
8CONFIG_KERNEL_LZMA=y 7CONFIG_KERNEL_LZMA=y
9CONFIG_SYSVIPC=y 8CONFIG_SYSVIPC=y
@@ -41,7 +40,6 @@ CONFIG_SYN_COOKIES=y
41# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 40# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
42# CONFIG_INET_XFRM_MODE_TUNNEL is not set 41# CONFIG_INET_XFRM_MODE_TUNNEL is not set
43# CONFIG_INET_XFRM_MODE_BEET is not set 42# CONFIG_INET_XFRM_MODE_BEET is not set
44# CONFIG_INET_LRO is not set
45# CONFIG_INET_DIAG is not set 43# CONFIG_INET_DIAG is not set
46CONFIG_TCP_CONG_ADVANCED=y 44CONFIG_TCP_CONG_ADVANCED=y
47# CONFIG_TCP_CONG_BIC is not set 45# CONFIG_TCP_CONG_BIC is not set
@@ -86,7 +84,6 @@ CONFIG_MAC80211_RC_DEFAULT_PID=y
86CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 84CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
87# CONFIG_FIRMWARE_IN_KERNEL is not set 85# CONFIG_FIRMWARE_IN_KERNEL is not set
88CONFIG_MTD=y 86CONFIG_MTD=y
89CONFIG_MTD_CHAR=y
90CONFIG_MTD_BLOCK=y 87CONFIG_MTD_BLOCK=y
91CONFIG_MTD_CFI=y 88CONFIG_MTD_CFI=y
92CONFIG_MTD_CFI_INTELEXT=y 89CONFIG_MTD_CFI_INTELEXT=y
@@ -99,8 +96,6 @@ CONFIG_FIXED_PHY=y
99CONFIG_NET_ETHERNET=y 96CONFIG_NET_ETHERNET=y
100CONFIG_MII=y 97CONFIG_MII=y
101CONFIG_CPMAC=y 98CONFIG_CPMAC=y
102# CONFIG_NETDEV_1000 is not set
103# CONFIG_NETDEV_10000 is not set
104CONFIG_PPP=m 99CONFIG_PPP=m
105CONFIG_PPP_MULTILINK=y 100CONFIG_PPP_MULTILINK=y
106CONFIG_PPP_FILTER=y 101CONFIG_PPP_FILTER=y
@@ -142,7 +137,6 @@ CONFIG_BSD_DISKLABEL=y
142# CONFIG_ENABLE_MUST_CHECK is not set 137# CONFIG_ENABLE_MUST_CHECK is not set
143CONFIG_STRIP_ASM_SYMS=y 138CONFIG_STRIP_ASM_SYMS=y
144CONFIG_DEBUG_FS=y 139CONFIG_DEBUG_FS=y
145CONFIG_SYSCTL_SYSCALL_CHECK=y
146CONFIG_CMDLINE_BOOL=y 140CONFIG_CMDLINE_BOOL=y
147CONFIG_CMDLINE="rootfstype=squashfs,jffs2" 141CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
148CONFIG_CRYPTO=y 142CONFIG_CRYPTO=y
diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig
index 134879c1310a..25ed914933e5 100644
--- a/arch/mips/configs/ath79_defconfig
+++ b/arch/mips/configs/ath79_defconfig
@@ -7,7 +7,6 @@ CONFIG_ATH79_MACH_PB44=y
7CONFIG_ATH79_MACH_UBNT_XM=y 7CONFIG_ATH79_MACH_UBNT_XM=y
8CONFIG_HZ_100=y 8CONFIG_HZ_100=y
9# CONFIG_SECCOMP is not set 9# CONFIG_SECCOMP is not set
10CONFIG_EXPERIMENTAL=y
11# CONFIG_LOCALVERSION_AUTO is not set 10# CONFIG_LOCALVERSION_AUTO is not set
12CONFIG_SYSVIPC=y 11CONFIG_SYSVIPC=y
13CONFIG_HIGH_RES_TIMERS=y 12CONFIG_HIGH_RES_TIMERS=y
@@ -35,7 +34,6 @@ CONFIG_IP_ADVANCED_ROUTER=y
35# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 34# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
36# CONFIG_INET_XFRM_MODE_TUNNEL is not set 35# CONFIG_INET_XFRM_MODE_TUNNEL is not set
37# CONFIG_INET_XFRM_MODE_BEET is not set 36# CONFIG_INET_XFRM_MODE_BEET is not set
38# CONFIG_INET_LRO is not set
39# CONFIG_IPV6 is not set 37# CONFIG_IPV6 is not set
40CONFIG_CFG80211=m 38CONFIG_CFG80211=m
41CONFIG_MAC80211=m 39CONFIG_MAC80211=m
diff --git a/arch/mips/configs/bcm63xx_defconfig b/arch/mips/configs/bcm63xx_defconfig
index 5599a9f1e3c6..131b350f014f 100644
--- a/arch/mips/configs/bcm63xx_defconfig
+++ b/arch/mips/configs/bcm63xx_defconfig
@@ -5,7 +5,6 @@ CONFIG_BCM63XX_CPU_6348=y
5CONFIG_BCM63XX_CPU_6358=y 5CONFIG_BCM63XX_CPU_6358=y
6CONFIG_NO_HZ=y 6CONFIG_NO_HZ=y
7# CONFIG_SECCOMP is not set 7# CONFIG_SECCOMP is not set
8CONFIG_EXPERIMENTAL=y
9# CONFIG_LOCALVERSION_AUTO is not set 8# CONFIG_LOCALVERSION_AUTO is not set
10# CONFIG_SWAP is not set 9# CONFIG_SWAP is not set
11CONFIG_TINY_RCU=y 10CONFIG_TINY_RCU=y
@@ -33,7 +32,6 @@ CONFIG_INET=y
33# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 32# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
34# CONFIG_INET_XFRM_MODE_TUNNEL is not set 33# CONFIG_INET_XFRM_MODE_TUNNEL is not set
35# CONFIG_INET_XFRM_MODE_BEET is not set 34# CONFIG_INET_XFRM_MODE_BEET is not set
36# CONFIG_INET_LRO is not set
37# CONFIG_INET_DIAG is not set 35# CONFIG_INET_DIAG is not set
38# CONFIG_IPV6 is not set 36# CONFIG_IPV6 is not set
39CONFIG_CFG80211=y 37CONFIG_CFG80211=y
@@ -50,13 +48,10 @@ CONFIG_MTD_CFI_INTELEXT=y
50CONFIG_MTD_CFI_AMDSTD=y 48CONFIG_MTD_CFI_AMDSTD=y
51CONFIG_MTD_PHYSMAP=y 49CONFIG_MTD_PHYSMAP=y
52# CONFIG_BLK_DEV is not set 50# CONFIG_BLK_DEV is not set
53# CONFIG_MISC_DEVICES is not set
54CONFIG_NETDEVICES=y 51CONFIG_NETDEVICES=y
55CONFIG_BCM63XX_PHY=y 52CONFIG_BCM63XX_PHY=y
56CONFIG_NET_ETHERNET=y 53CONFIG_NET_ETHERNET=y
57CONFIG_BCM63XX_ENET=y 54CONFIG_BCM63XX_ENET=y
58# CONFIG_NETDEV_1000 is not set
59# CONFIG_NETDEV_10000 is not set
60CONFIG_B43=y 55CONFIG_B43=y
61# CONFIG_B43_PHY_LP is not set 56# CONFIG_B43_PHY_LP is not set
62# CONFIG_INPUT is not set 57# CONFIG_INPUT is not set
@@ -70,7 +65,6 @@ CONFIG_SERIAL_BCM63XX_CONSOLE=y
70# CONFIG_HWMON is not set 65# CONFIG_HWMON is not set
71# CONFIG_VGA_ARB is not set 66# CONFIG_VGA_ARB is not set
72CONFIG_USB=y 67CONFIG_USB=y
73# CONFIG_USB_DEVICE_CLASS is not set
74CONFIG_USB_EHCI_HCD=y 68CONFIG_USB_EHCI_HCD=y
75# CONFIG_USB_EHCI_TT_NEWSCHED is not set 69# CONFIG_USB_EHCI_TT_NEWSCHED is not set
76CONFIG_USB_OHCI_HCD=y 70CONFIG_USB_OHCI_HCD=y
@@ -84,7 +78,6 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
84CONFIG_PROC_KCORE=y 78CONFIG_PROC_KCORE=y
85# CONFIG_NETWORK_FILESYSTEMS is not set 79# CONFIG_NETWORK_FILESYSTEMS is not set
86CONFIG_MAGIC_SYSRQ=y 80CONFIG_MAGIC_SYSRQ=y
87CONFIG_SYSCTL_SYSCALL_CHECK=y
88CONFIG_CMDLINE_BOOL=y 81CONFIG_CMDLINE_BOOL=y
89CONFIG_CMDLINE="console=ttyS0,115200" 82CONFIG_CMDLINE="console=ttyS0,115200"
90# CONFIG_CRYPTO_HW is not set 83# CONFIG_CRYPTO_HW is not set
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index d20b09d77b53..a55009edbb29 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -4,7 +4,6 @@ CONFIG_SMP=y
4CONFIG_NO_HZ=y 4CONFIG_NO_HZ=y
5CONFIG_HIGH_RES_TIMERS=y 5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_HZ_1000=y 6CONFIG_HZ_1000=y
7CONFIG_EXPERIMENTAL=y
8CONFIG_SYSVIPC=y 7CONFIG_SYSVIPC=y
9CONFIG_POSIX_MQUEUE=y 8CONFIG_POSIX_MQUEUE=y
10CONFIG_BSD_PROCESS_ACCT=y 9CONFIG_BSD_PROCESS_ACCT=y
@@ -60,7 +59,6 @@ CONFIG_INET_ESP=m
60CONFIG_INET_IPCOMP=m 59CONFIG_INET_IPCOMP=m
61CONFIG_INET_XFRM_MODE_TRANSPORT=m 60CONFIG_INET_XFRM_MODE_TRANSPORT=m
62CONFIG_INET_XFRM_MODE_TUNNEL=m 61CONFIG_INET_XFRM_MODE_TUNNEL=m
63# CONFIG_INET_LRO is not set
64CONFIG_TCP_MD5SIG=y 62CONFIG_TCP_MD5SIG=y
65CONFIG_IPV6_ROUTER_PREF=y 63CONFIG_IPV6_ROUTER_PREF=y
66CONFIG_IPV6_ROUTE_INFO=y 64CONFIG_IPV6_ROUTE_INFO=y
@@ -182,7 +180,6 @@ CONFIG_QUOTA=y
182CONFIG_QUOTA_NETLINK_INTERFACE=y 180CONFIG_QUOTA_NETLINK_INTERFACE=y
183# CONFIG_PRINT_QUOTA_WARNING is not set 181# CONFIG_PRINT_QUOTA_WARNING is not set
184CONFIG_QFMT_V2=m 182CONFIG_QFMT_V2=m
185CONFIG_AUTOFS_FS=m
186CONFIG_AUTOFS4_FS=m 183CONFIG_AUTOFS4_FS=m
187CONFIG_FUSE_FS=m 184CONFIG_FUSE_FS=m
188CONFIG_ISO9660_FS=m 185CONFIG_ISO9660_FS=m
@@ -284,7 +281,6 @@ CONFIG_CRYPTO_SEED=m
284CONFIG_CRYPTO_SERPENT=m 281CONFIG_CRYPTO_SERPENT=m
285CONFIG_CRYPTO_TEA=m 282CONFIG_CRYPTO_TEA=m
286CONFIG_CRYPTO_TWOFISH=m 283CONFIG_CRYPTO_TWOFISH=m
287CONFIG_CRYPTO_ZLIB=m
288CONFIG_CRYPTO_LZO=m 284CONFIG_CRYPTO_LZO=m
289CONFIG_CRC_T10DIF=m 285CONFIG_CRC_T10DIF=m
290CONFIG_CRC7=m 286CONFIG_CRC7=m
diff --git a/arch/mips/configs/bmips_be_defconfig b/arch/mips/configs/bmips_be_defconfig
index acf7785c4cdb..a7072a14d396 100644
--- a/arch/mips/configs/bmips_be_defconfig
+++ b/arch/mips/configs/bmips_be_defconfig
@@ -23,7 +23,6 @@ CONFIG_INET=y
23# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 23# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
24# CONFIG_INET_XFRM_MODE_TUNNEL is not set 24# CONFIG_INET_XFRM_MODE_TUNNEL is not set
25# CONFIG_INET_XFRM_MODE_BEET is not set 25# CONFIG_INET_XFRM_MODE_BEET is not set
26# CONFIG_INET_LRO is not set
27# CONFIG_INET_DIAG is not set 26# CONFIG_INET_DIAG is not set
28CONFIG_CFG80211=y 27CONFIG_CFG80211=y
29CONFIG_NL80211_TESTMODE=y 28CONFIG_NL80211_TESTMODE=y
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 2924ba34a01b..bd80b5c852dd 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_ZAO_CAPCELLA=y 2CONFIG_ZAO_CAPCELLA=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -46,8 +45,6 @@ CONFIG_SMSC_PHY=m
46CONFIG_NET_ETHERNET=y 45CONFIG_NET_ETHERNET=y
47CONFIG_NET_PCI=y 46CONFIG_NET_PCI=y
48CONFIG_8139TOO=y 47CONFIG_8139TOO=y
49# CONFIG_NETDEV_1000 is not set
50# CONFIG_NETDEV_10000 is not set
51# CONFIG_INPUT_MOUSEDEV is not set 48# CONFIG_INPUT_MOUSEDEV is not set
52# CONFIG_INPUT_KEYBOARD is not set 49# CONFIG_INPUT_KEYBOARD is not set
53# CONFIG_INPUT_MOUSE is not set 50# CONFIG_INPUT_MOUSE is not set
@@ -59,7 +56,6 @@ CONFIG_SERIAL_VR41XX_CONSOLE=y
59CONFIG_GPIO_VR41XX=y 56CONFIG_GPIO_VR41XX=y
60# CONFIG_HWMON is not set 57# CONFIG_HWMON is not set
61# CONFIG_VGA_CONSOLE is not set 58# CONFIG_VGA_CONSOLE is not set
62# CONFIG_HID_SUPPORT is not set
63# CONFIG_USB_SUPPORT is not set 59# CONFIG_USB_SUPPORT is not set
64CONFIG_RTC_CLASS=y 60CONFIG_RTC_CLASS=y
65CONFIG_RTC_DRV_VR41XX=y 61CONFIG_RTC_DRV_VR41XX=y
diff --git a/arch/mips/configs/cavium_octeon_defconfig b/arch/mips/configs/cavium_octeon_defconfig
index d4fda41f00ba..e5b18f1a31a0 100644
--- a/arch/mips/configs/cavium_octeon_defconfig
+++ b/arch/mips/configs/cavium_octeon_defconfig
@@ -42,7 +42,6 @@ CONFIG_IP_MROUTE=y
42CONFIG_IP_PIMSM_V1=y 42CONFIG_IP_PIMSM_V1=y
43CONFIG_IP_PIMSM_V2=y 43CONFIG_IP_PIMSM_V2=y
44CONFIG_SYN_COOKIES=y 44CONFIG_SYN_COOKIES=y
45# CONFIG_INET_LRO is not set
46CONFIG_IPV6=y 45CONFIG_IPV6=y
47CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
48CONFIG_DEVTMPFS=y 47CONFIG_DEVTMPFS=y
diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index 43e0ba24470c..b42cfa7865f9 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -41,7 +41,6 @@ CONFIG_INET=y
41# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 41# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
42# CONFIG_INET_XFRM_MODE_TUNNEL is not set 42# CONFIG_INET_XFRM_MODE_TUNNEL is not set
43# CONFIG_INET_XFRM_MODE_BEET is not set 43# CONFIG_INET_XFRM_MODE_BEET is not set
44# CONFIG_INET_LRO is not set
45# CONFIG_INET_DIAG is not set 44# CONFIG_INET_DIAG is not set
46# CONFIG_IPV6 is not set 45# CONFIG_IPV6 is not set
47# CONFIG_WIRELESS is not set 46# CONFIG_WIRELESS is not set
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 23b66934e18d..a9066f300665 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -1,5 +1,4 @@
1CONFIG_MIPS_COBALT=y 1CONFIG_MIPS_COBALT=y
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
4CONFIG_LOG_BUF_SHIFT=14 3CONFIG_LOG_BUF_SHIFT=14
5CONFIG_RELAY=y 4CONFIG_RELAY=y
@@ -15,17 +14,14 @@ CONFIG_XFRM_USER=y
15CONFIG_NET_KEY=y 14CONFIG_NET_KEY=y
16CONFIG_NET_KEY_MIGRATE=y 15CONFIG_NET_KEY_MIGRATE=y
17CONFIG_INET=y 16CONFIG_INET=y
18# CONFIG_INET_LRO is not set
19# CONFIG_IPV6 is not set 17# CONFIG_IPV6 is not set
20CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 18CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
21CONFIG_MTD=y 19CONFIG_MTD=y
22CONFIG_MTD_CHAR=y
23CONFIG_MTD_BLKDEVS=y 20CONFIG_MTD_BLKDEVS=y
24CONFIG_MTD_JEDECPROBE=y 21CONFIG_MTD_JEDECPROBE=y
25CONFIG_MTD_CFI_AMDSTD=y 22CONFIG_MTD_CFI_AMDSTD=y
26CONFIG_MTD_PHYSMAP=y 23CONFIG_MTD_PHYSMAP=y
27CONFIG_BLK_DEV_LOOP=y 24CONFIG_BLK_DEV_LOOP=y
28# CONFIG_MISC_DEVICES is not set
29CONFIG_RAID_ATTRS=y 25CONFIG_RAID_ATTRS=y
30CONFIG_BLK_DEV_SD=y 26CONFIG_BLK_DEV_SD=y
31# CONFIG_SCSI_LOWLEVEL is not set 27# CONFIG_SCSI_LOWLEVEL is not set
@@ -36,8 +32,6 @@ CONFIG_NET_ETHERNET=y
36CONFIG_NET_TULIP=y 32CONFIG_NET_TULIP=y
37CONFIG_DE2104X=y 33CONFIG_DE2104X=y
38CONFIG_TULIP=y 34CONFIG_TULIP=y
39# CONFIG_NETDEV_1000 is not set
40# CONFIG_NETDEV_10000 is not set
41# CONFIG_INPUT_MOUSEDEV is not set 35# CONFIG_INPUT_MOUSEDEV is not set
42CONFIG_INPUT_EVDEV=y 36CONFIG_INPUT_EVDEV=y
43# CONFIG_INPUT_KEYBOARD is not set 37# CONFIG_INPUT_KEYBOARD is not set
@@ -56,7 +50,6 @@ CONFIG_FB_COBALT=y
56# CONFIG_VGA_CONSOLE is not set 50# CONFIG_VGA_CONSOLE is not set
57CONFIG_HID=m 51CONFIG_HID=m
58CONFIG_USB=m 52CONFIG_USB=m
59# CONFIG_USB_DEVICE_CLASS is not set
60CONFIG_USB_EHCI_HCD=m 53CONFIG_USB_EHCI_HCD=m
61# CONFIG_USB_EHCI_TT_NEWSCHED is not set 54# CONFIG_USB_EHCI_TT_NEWSCHED is not set
62CONFIG_USB_OHCI_HCD=m 55CONFIG_USB_OHCI_HCD=m
@@ -84,6 +77,5 @@ CONFIG_NFS_V3_ACL=y
84CONFIG_NFSD=y 77CONFIG_NFSD=y
85CONFIG_NFSD_V3=y 78CONFIG_NFSD_V3=y
86CONFIG_NFSD_V3_ACL=y 79CONFIG_NFSD_V3_ACL=y
87CONFIG_SYSCTL_SYSCALL_CHECK=y
88CONFIG_CRC16=y 80CONFIG_CRC16=y
89CONFIG_LIBCRC32C=y 81CONFIG_LIBCRC32C=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 2b6cb41d5715..e149f78901f8 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_DECSTATION=y 1CONFIG_MACH_DECSTATION=y
2CONFIG_CPU_R3000=y 2CONFIG_CPU_R3000=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index e94d266c4b97..c3ac0209457c 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_CASIO_E55=y 2CONFIG_CASIO_E55=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -28,7 +27,6 @@ CONFIG_SERIAL_VR41XX_CONSOLE=y
28CONFIG_GPIO_VR41XX=y 27CONFIG_GPIO_VR41XX=y
29# CONFIG_HWMON is not set 28# CONFIG_HWMON is not set
30# CONFIG_VGA_CONSOLE is not set 29# CONFIG_VGA_CONSOLE is not set
31# CONFIG_HID_SUPPORT is not set
32# CONFIG_USB_SUPPORT is not set 30# CONFIG_USB_SUPPORT is not set
33CONFIG_RTC_CLASS=y 31CONFIG_RTC_CLASS=y
34CONFIG_RTC_DRV_VR41XX=y 32CONFIG_RTC_DRV_VR41XX=y
diff --git a/arch/mips/configs/fuloong2e_defconfig b/arch/mips/configs/fuloong2e_defconfig
index 87435897fd50..499f51498ecb 100644
--- a/arch/mips/configs/fuloong2e_defconfig
+++ b/arch/mips/configs/fuloong2e_defconfig
@@ -3,7 +3,6 @@ CONFIG_64BIT=y
3CONFIG_NO_HZ=y 3CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y 4CONFIG_HIGH_RES_TIMERS=y
5CONFIG_PREEMPT_VOLUNTARY=y 5CONFIG_PREEMPT_VOLUNTARY=y
6CONFIG_EXPERIMENTAL=y
7CONFIG_LOCALVERSION="-fuloong2e" 6CONFIG_LOCALVERSION="-fuloong2e"
8# CONFIG_LOCALVERSION_AUTO is not set 7# CONFIG_LOCALVERSION_AUTO is not set
9CONFIG_SYSVIPC=y 8CONFIG_SYSVIPC=y
@@ -47,7 +46,6 @@ CONFIG_NET_IPGRE=m
47CONFIG_NET_IPGRE_BROADCAST=y 46CONFIG_NET_IPGRE_BROADCAST=y
48# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 47# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
49# CONFIG_INET_XFRM_MODE_TUNNEL is not set 48# CONFIG_INET_XFRM_MODE_TUNNEL is not set
50# CONFIG_INET_LRO is not set
51# CONFIG_INET_DIAG is not set 49# CONFIG_INET_DIAG is not set
52# CONFIG_IPV6 is not set 50# CONFIG_IPV6 is not set
53CONFIG_NETFILTER=y 51CONFIG_NETFILTER=y
@@ -79,7 +77,6 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
79CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 77CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
80CONFIG_NETFILTER_XT_MATCH_TIME=m 78CONFIG_NETFILTER_XT_MATCH_TIME=m
81CONFIG_NETFILTER_XT_MATCH_U32=m 79CONFIG_NETFILTER_XT_MATCH_U32=m
82CONFIG_IP_NF_QUEUE=m
83CONFIG_IP_NF_IPTABLES=m 80CONFIG_IP_NF_IPTABLES=m
84CONFIG_IP_NF_MATCH_ADDRTYPE=m 81CONFIG_IP_NF_MATCH_ADDRTYPE=m
85CONFIG_IP_NF_MATCH_AH=m 82CONFIG_IP_NF_MATCH_AH=m
@@ -88,7 +85,6 @@ CONFIG_IP_NF_MATCH_TTL=m
88CONFIG_IP_NF_FILTER=m 85CONFIG_IP_NF_FILTER=m
89CONFIG_IP_NF_TARGET_REJECT=m 86CONFIG_IP_NF_TARGET_REJECT=m
90CONFIG_IP_NF_TARGET_LOG=m 87CONFIG_IP_NF_TARGET_LOG=m
91CONFIG_IP_NF_TARGET_ULOG=m
92CONFIG_IP_NF_MANGLE=m 88CONFIG_IP_NF_MANGLE=m
93CONFIG_IP_NF_TARGET_ECN=m 89CONFIG_IP_NF_TARGET_ECN=m
94CONFIG_IP_NF_TARGET_TTL=m 90CONFIG_IP_NF_TARGET_TTL=m
@@ -101,7 +97,6 @@ CONFIG_NET_9P=m
101CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 97CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
102CONFIG_FW_LOADER=m 98CONFIG_FW_LOADER=m
103CONFIG_MTD=m 99CONFIG_MTD=m
104CONFIG_MTD_CHAR=m
105CONFIG_MTD_BLOCK=m 100CONFIG_MTD_BLOCK=m
106CONFIG_MTD_CFI=m 101CONFIG_MTD_CFI=m
107CONFIG_MTD_JEDECPROBE=m 102CONFIG_MTD_JEDECPROBE=m
@@ -163,7 +158,6 @@ CONFIG_I2C=m
163CONFIG_I2C_CHARDEV=m 158CONFIG_I2C_CHARDEV=m
164CONFIG_I2C_VIAPRO=m 159CONFIG_I2C_VIAPRO=m
165# CONFIG_HWMON is not set 160# CONFIG_HWMON is not set
166CONFIG_VIDEO_OUTPUT_CONTROL=m
167CONFIG_FB=y 161CONFIG_FB=y
168CONFIG_FB_RADEON=y 162CONFIG_FB_RADEON=y
169# CONFIG_FB_RADEON_I2C is not set 163# CONFIG_FB_RADEON_I2C is not set
@@ -184,7 +178,6 @@ CONFIG_USB_KBD=y
184CONFIG_USB_MOUSE=y 178CONFIG_USB_MOUSE=y
185CONFIG_USB=y 179CONFIG_USB=y
186CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 180CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
187# CONFIG_USB_DEVICE_CLASS is not set
188CONFIG_USB_OTG_WHITELIST=y 181CONFIG_USB_OTG_WHITELIST=y
189CONFIG_USB_WUSB_CBAF=m 182CONFIG_USB_WUSB_CBAF=m
190CONFIG_USB_C67X00_HCD=m 183CONFIG_USB_C67X00_HCD=m
@@ -201,7 +194,6 @@ CONFIG_USB_TMC=m
201CONFIG_USB_STORAGE=y 194CONFIG_USB_STORAGE=y
202CONFIG_USB_STORAGE_ONETOUCH=y 195CONFIG_USB_STORAGE_ONETOUCH=y
203CONFIG_USB_STORAGE_CYPRESS_ATACB=y 196CONFIG_USB_STORAGE_CYPRESS_ATACB=y
204CONFIG_USB_LIBUSUAL=y
205CONFIG_USB_SEVSEG=m 197CONFIG_USB_SEVSEG=m
206CONFIG_USB_ISIGHTFW=m 198CONFIG_USB_ISIGHTFW=m
207CONFIG_UIO=m 199CONFIG_UIO=m
@@ -215,7 +207,6 @@ CONFIG_EXT4_FS=m
215CONFIG_EXT4_FS_POSIX_ACL=y 207CONFIG_EXT4_FS_POSIX_ACL=y
216CONFIG_EXT4_FS_SECURITY=y 208CONFIG_EXT4_FS_SECURITY=y
217CONFIG_REISERFS_FS=m 209CONFIG_REISERFS_FS=m
218CONFIG_AUTOFS_FS=y
219CONFIG_AUTOFS4_FS=y 210CONFIG_AUTOFS4_FS=y
220CONFIG_FUSE_FS=y 211CONFIG_FUSE_FS=y
221CONFIG_ISO9660_FS=m 212CONFIG_ISO9660_FS=m
@@ -256,8 +247,6 @@ CONFIG_NLS_ISO8859_1=y
256CONFIG_NLS_UTF8=y 247CONFIG_NLS_UTF8=y
257# CONFIG_ENABLE_MUST_CHECK is not set 248# CONFIG_ENABLE_MUST_CHECK is not set
258CONFIG_DEBUG_FS=y 249CONFIG_DEBUG_FS=y
259# CONFIG_RCU_CPU_STALL_DETECTOR is not set
260CONFIG_SYSCTL_SYSCALL_CHECK=y
261CONFIG_CRYPTO_FIPS=y 250CONFIG_CRYPTO_FIPS=y
262CONFIG_CRYPTO_AUTHENC=m 251CONFIG_CRYPTO_AUTHENC=m
263CONFIG_CRYPTO_CCM=m 252CONFIG_CRYPTO_CCM=m
diff --git a/arch/mips/configs/generic/board-boston.config b/arch/mips/configs/generic/board-boston.config
new file mode 100644
index 000000000000..19560a45b683
--- /dev/null
+++ b/arch/mips/configs/generic/board-boston.config
@@ -0,0 +1,48 @@
1CONFIG_FIT_IMAGE_FDT_BOSTON=y
2
3CONFIG_ATA=y
4CONFIG_SATA_AHCI=y
5CONFIG_SCSI=y
6CONFIG_BLK_DEV_SD=y
7
8CONFIG_AUXDISPLAY=y
9CONFIG_IMG_ASCII_LCD=y
10
11CONFIG_COMMON_CLK_BOSTON=y
12
13CONFIG_DMADEVICES=y
14CONFIG_PCH_DMA=y
15
16CONFIG_GPIOLIB=y
17CONFIG_GPIO_SYSFS=y
18CONFIG_GPIO_PCH=y
19
20CONFIG_I2C=y
21CONFIG_I2C_EG20T=y
22
23CONFIG_MMC=y
24CONFIG_MMC_SDHCI=y
25CONFIG_MMC_SDHCI_PCI=y
26
27CONFIG_NETDEVICES=y
28CONFIG_PCH_GBE=y
29
30CONFIG_PCI=y
31CONFIG_PCI_MSI=y
32CONFIG_PCIE_XILINX=y
33
34CONFIG_PCH_PHUB=y
35
36CONFIG_RTC_CLASS=y
37CONFIG_RTC_DRV_M41T80=y
38
39CONFIG_SERIAL_8250=y
40CONFIG_SERIAL_8250_CONSOLE=y
41CONFIG_SERIAL_OF_PLATFORM=y
42
43CONFIG_SPI=y
44CONFIG_SPI_TOPCLIFF_PCH=y
45
46CONFIG_USB=y
47CONFIG_USB_EHCI_HCD=y
48CONFIG_USB_OHCI_HCD=y
diff --git a/arch/mips/configs/gpr_defconfig b/arch/mips/configs/gpr_defconfig
index e24feb0633aa..b1911816337c 100644
--- a/arch/mips/configs/gpr_defconfig
+++ b/arch/mips/configs/gpr_defconfig
@@ -2,7 +2,6 @@ CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_GPR=y 2CONFIG_MIPS_GPR=y
3CONFIG_HIGH_RES_TIMERS=y 3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_PREEMPT_VOLUNTARY=y 4CONFIG_PREEMPT_VOLUNTARY=y
5CONFIG_EXPERIMENTAL=y
6# CONFIG_LOCALVERSION_AUTO is not set 5# CONFIG_LOCALVERSION_AUTO is not set
7CONFIG_SYSVIPC=y 6CONFIG_SYSVIPC=y
8CONFIG_POSIX_MQUEUE=y 7CONFIG_POSIX_MQUEUE=y
@@ -59,7 +58,6 @@ CONFIG_NETFILTER_XT_MATCH_REALM=m
59CONFIG_NETFILTER_XT_MATCH_STATISTIC=m 58CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
60CONFIG_NETFILTER_XT_MATCH_STRING=m 59CONFIG_NETFILTER_XT_MATCH_STRING=m
61CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 60CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
62CONFIG_IP_NF_QUEUE=m
63CONFIG_IP_NF_IPTABLES=m 61CONFIG_IP_NF_IPTABLES=m
64CONFIG_IP_NF_MATCH_ADDRTYPE=m 62CONFIG_IP_NF_MATCH_ADDRTYPE=m
65CONFIG_IP_NF_MATCH_AH=m 63CONFIG_IP_NF_MATCH_AH=m
@@ -68,7 +66,6 @@ CONFIG_IP_NF_MATCH_TTL=m
68CONFIG_IP_NF_FILTER=m 66CONFIG_IP_NF_FILTER=m
69CONFIG_IP_NF_TARGET_REJECT=m 67CONFIG_IP_NF_TARGET_REJECT=m
70CONFIG_IP_NF_TARGET_LOG=m 68CONFIG_IP_NF_TARGET_LOG=m
71CONFIG_IP_NF_TARGET_ULOG=m
72CONFIG_IP_NF_MANGLE=m 69CONFIG_IP_NF_MANGLE=m
73CONFIG_IP_NF_TARGET_ECN=m 70CONFIG_IP_NF_TARGET_ECN=m
74CONFIG_IP_NF_TARGET_TTL=m 71CONFIG_IP_NF_TARGET_TTL=m
@@ -166,7 +163,6 @@ CONFIG_YAM=m
166CONFIG_CFG80211=y 163CONFIG_CFG80211=y
167CONFIG_MAC80211=y 164CONFIG_MAC80211=y
168CONFIG_MTD=y 165CONFIG_MTD=y
169CONFIG_MTD_CHAR=y
170CONFIG_MTD_BLOCK=y 166CONFIG_MTD_BLOCK=y
171CONFIG_MTD_CFI=y 167CONFIG_MTD_CFI=y
172CONFIG_MTD_CFI_INTELEXT=y 168CONFIG_MTD_CFI_INTELEXT=y
@@ -200,8 +196,6 @@ CONFIG_SMSC_PHY=m
200CONFIG_NET_ETHERNET=y 196CONFIG_NET_ETHERNET=y
201CONFIG_MII=y 197CONFIG_MII=y
202CONFIG_MIPS_AU1X00_ENET=y 198CONFIG_MIPS_AU1X00_ENET=y
203# CONFIG_NETDEV_1000 is not set
204# CONFIG_NETDEV_10000 is not set
205CONFIG_ATH_COMMON=y 199CONFIG_ATH_COMMON=y
206CONFIG_ATH_DEBUG=y 200CONFIG_ATH_DEBUG=y
207CONFIG_ATH5K=y 201CONFIG_ATH5K=y
@@ -286,14 +280,12 @@ CONFIG_USB_HIDDEV=y
286CONFIG_USB_KBD=m 280CONFIG_USB_KBD=m
287CONFIG_USB_MOUSE=m 281CONFIG_USB_MOUSE=m
288CONFIG_USB=y 282CONFIG_USB=y
289# CONFIG_USB_DEVICE_CLASS is not set
290CONFIG_USB_MON=y 283CONFIG_USB_MON=y
291CONFIG_USB_EHCI_HCD=y 284CONFIG_USB_EHCI_HCD=y
292CONFIG_USB_EHCI_ROOT_HUB_TT=y 285CONFIG_USB_EHCI_ROOT_HUB_TT=y
293CONFIG_USB_OHCI_HCD=y 286CONFIG_USB_OHCI_HCD=y
294CONFIG_USB_OHCI_HCD_PLATFORM=y 287CONFIG_USB_OHCI_HCD_PLATFORM=y
295CONFIG_USB_STORAGE=m 288CONFIG_USB_STORAGE=m
296CONFIG_USB_LIBUSUAL=y
297CONFIG_USB_SERIAL=y 289CONFIG_USB_SERIAL=y
298CONFIG_USB_EZUSB=y 290CONFIG_USB_EZUSB=y
299CONFIG_USB_SERIAL_GENERIC=y 291CONFIG_USB_SERIAL_GENERIC=y
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index ec8e9684296d..83e8fe2064aa 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -4,7 +4,6 @@ CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y 4CONFIG_HIGH_RES_TIMERS=y
5CONFIG_HZ_1000=y 5CONFIG_HZ_1000=y
6CONFIG_PREEMPT_VOLUNTARY=y 6CONFIG_PREEMPT_VOLUNTARY=y
7CONFIG_EXPERIMENTAL=y
8CONFIG_SYSVIPC=y 7CONFIG_SYSVIPC=y
9CONFIG_IKCONFIG=y 8CONFIG_IKCONFIG=y
10CONFIG_IKCONFIG_PROC=y 9CONFIG_IKCONFIG_PROC=y
@@ -46,7 +45,6 @@ CONFIG_INET_IPCOMP=m
46CONFIG_INET_XFRM_MODE_TRANSPORT=m 45CONFIG_INET_XFRM_MODE_TRANSPORT=m
47CONFIG_INET_XFRM_MODE_TUNNEL=m 46CONFIG_INET_XFRM_MODE_TUNNEL=m
48CONFIG_INET_XFRM_MODE_BEET=m 47CONFIG_INET_XFRM_MODE_BEET=m
49# CONFIG_INET_LRO is not set
50CONFIG_TCP_MD5SIG=y 48CONFIG_TCP_MD5SIG=y
51CONFIG_IPV6_ROUTER_PREF=y 49CONFIG_IPV6_ROUTER_PREF=y
52CONFIG_IPV6_ROUTE_INFO=y 50CONFIG_IPV6_ROUTE_INFO=y
@@ -139,7 +137,6 @@ CONFIG_IP_VS_SED=m
139CONFIG_IP_VS_NQ=m 137CONFIG_IP_VS_NQ=m
140CONFIG_IP_VS_FTP=m 138CONFIG_IP_VS_FTP=m
141CONFIG_NF_CONNTRACK_IPV4=m 139CONFIG_NF_CONNTRACK_IPV4=m
142CONFIG_IP_NF_QUEUE=m
143CONFIG_IP_NF_IPTABLES=m 140CONFIG_IP_NF_IPTABLES=m
144CONFIG_IP_NF_MATCH_ADDRTYPE=m 141CONFIG_IP_NF_MATCH_ADDRTYPE=m
145CONFIG_IP_NF_MATCH_AH=m 142CONFIG_IP_NF_MATCH_AH=m
@@ -148,7 +145,6 @@ CONFIG_IP_NF_MATCH_TTL=m
148CONFIG_IP_NF_FILTER=m 145CONFIG_IP_NF_FILTER=m
149CONFIG_IP_NF_TARGET_REJECT=m 146CONFIG_IP_NF_TARGET_REJECT=m
150CONFIG_IP_NF_TARGET_LOG=m 147CONFIG_IP_NF_TARGET_LOG=m
151CONFIG_IP_NF_TARGET_ULOG=m
152CONFIG_NF_NAT=m 148CONFIG_NF_NAT=m
153CONFIG_IP_NF_TARGET_MASQUERADE=m 149CONFIG_IP_NF_TARGET_MASQUERADE=m
154CONFIG_IP_NF_TARGET_NETMAP=m 150CONFIG_IP_NF_TARGET_NETMAP=m
@@ -163,7 +159,6 @@ CONFIG_IP_NF_ARPTABLES=m
163CONFIG_IP_NF_ARPFILTER=m 159CONFIG_IP_NF_ARPFILTER=m
164CONFIG_IP_NF_ARP_MANGLE=m 160CONFIG_IP_NF_ARP_MANGLE=m
165CONFIG_NF_CONNTRACK_IPV6=m 161CONFIG_NF_CONNTRACK_IPV6=m
166CONFIG_IP6_NF_QUEUE=m
167CONFIG_IP6_NF_IPTABLES=m 162CONFIG_IP6_NF_IPTABLES=m
168CONFIG_IP6_NF_MATCH_AH=m 163CONFIG_IP6_NF_MATCH_AH=m
169CONFIG_IP6_NF_MATCH_EUI64=m 164CONFIG_IP6_NF_MATCH_EUI64=m
@@ -174,7 +169,6 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m
174CONFIG_IP6_NF_MATCH_MH=m 169CONFIG_IP6_NF_MATCH_MH=m
175CONFIG_IP6_NF_MATCH_RT=m 170CONFIG_IP6_NF_MATCH_RT=m
176CONFIG_IP6_NF_TARGET_HL=m 171CONFIG_IP6_NF_TARGET_HL=m
177CONFIG_IP6_NF_TARGET_LOG=m
178CONFIG_IP6_NF_FILTER=m 172CONFIG_IP6_NF_FILTER=m
179CONFIG_IP6_NF_TARGET_REJECT=m 173CONFIG_IP6_NF_TARGET_REJECT=m
180CONFIG_IP6_NF_MANGLE=m 174CONFIG_IP6_NF_MANGLE=m
@@ -215,7 +209,6 @@ CONFIG_RFKILL=m
215CONFIG_CONNECTOR=m 209CONFIG_CONNECTOR=m
216CONFIG_CDROM_PKTCDVD=m 210CONFIG_CDROM_PKTCDVD=m
217CONFIG_ATA_OVER_ETH=m 211CONFIG_ATA_OVER_ETH=m
218# CONFIG_MISC_DEVICES is not set
219CONFIG_RAID_ATTRS=m 212CONFIG_RAID_ATTRS=m
220CONFIG_SCSI=y 213CONFIG_SCSI=y
221CONFIG_BLK_DEV_SD=y 214CONFIG_BLK_DEV_SD=y
@@ -245,8 +238,6 @@ CONFIG_MDIO_BITBANG=m
245CONFIG_NET_ETHERNET=y 238CONFIG_NET_ETHERNET=y
246CONFIG_SMC91X=m 239CONFIG_SMC91X=m
247CONFIG_SGISEEQ=y 240CONFIG_SGISEEQ=y
248# CONFIG_NETDEV_1000 is not set
249# CONFIG_NETDEV_10000 is not set
250CONFIG_HOSTAP=m 241CONFIG_HOSTAP=m
251CONFIG_INPUT_MOUSEDEV=m 242CONFIG_INPUT_MOUSEDEV=m
252CONFIG_MOUSE_PS2=m 243CONFIG_MOUSE_PS2=m
@@ -286,7 +277,6 @@ CONFIG_QUOTA=y
286CONFIG_QUOTA_NETLINK_INTERFACE=y 277CONFIG_QUOTA_NETLINK_INTERFACE=y
287# CONFIG_PRINT_QUOTA_WARNING is not set 278# CONFIG_PRINT_QUOTA_WARNING is not set
288CONFIG_QFMT_V2=m 279CONFIG_QFMT_V2=m
289CONFIG_AUTOFS_FS=m
290CONFIG_AUTOFS4_FS=m 280CONFIG_AUTOFS4_FS=m
291CONFIG_FUSE_FS=m 281CONFIG_FUSE_FS=m
292CONFIG_ISO9660_FS=m 282CONFIG_ISO9660_FS=m
@@ -355,7 +345,6 @@ CONFIG_NLS_KOI8_U=m
355CONFIG_NLS_UTF8=m 345CONFIG_NLS_UTF8=m
356CONFIG_DLM=m 346CONFIG_DLM=m
357CONFIG_DEBUG_MEMORY_INIT=y 347CONFIG_DEBUG_MEMORY_INIT=y
358# CONFIG_RCU_CPU_STALL_DETECTOR is not set
359CONFIG_KEYS=y 348CONFIG_KEYS=y
360CONFIG_CRYPTO_FIPS=y 349CONFIG_CRYPTO_FIPS=y
361CONFIG_CRYPTO_NULL=m 350CONFIG_CRYPTO_NULL=m
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index e582069b44fd..a0d593248668 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -5,7 +5,6 @@ CONFIG_SMP=y
5CONFIG_NO_HZ=y 5CONFIG_NO_HZ=y
6CONFIG_HIGH_RES_TIMERS=y 6CONFIG_HIGH_RES_TIMERS=y
7CONFIG_HZ_1000=y 7CONFIG_HZ_1000=y
8CONFIG_EXPERIMENTAL=y
9CONFIG_SYSVIPC=y 8CONFIG_SYSVIPC=y
10CONFIG_POSIX_MQUEUE=y 9CONFIG_POSIX_MQUEUE=y
11CONFIG_IKCONFIG=y 10CONFIG_IKCONFIG=y
@@ -104,7 +103,6 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
104CONFIG_BLK_DEV_OSD=m 103CONFIG_BLK_DEV_OSD=m
105CONFIG_CDROM_PKTCDVD=m 104CONFIG_CDROM_PKTCDVD=m
106CONFIG_ATA_OVER_ETH=m 105CONFIG_ATA_OVER_ETH=m
107# CONFIG_MISC_DEVICES is not set
108CONFIG_SCSI=y 106CONFIG_SCSI=y
109CONFIG_BLK_DEV_SD=y 107CONFIG_BLK_DEV_SD=y
110CONFIG_CHR_DEV_ST=y 108CONFIG_CHR_DEV_ST=y
@@ -325,7 +323,6 @@ CONFIG_XFS_POSIX_ACL=y
325CONFIG_BTRFS_FS=m 323CONFIG_BTRFS_FS=m
326CONFIG_BTRFS_FS_POSIX_ACL=y 324CONFIG_BTRFS_FS_POSIX_ACL=y
327CONFIG_QUOTA_NETLINK_INTERFACE=y 325CONFIG_QUOTA_NETLINK_INTERFACE=y
328CONFIG_AUTOFS_FS=m
329CONFIG_FUSE_FS=m 326CONFIG_FUSE_FS=m
330CONFIG_CUSE=m 327CONFIG_CUSE=m
331CONFIG_FSCACHE=m 328CONFIG_FSCACHE=m
@@ -342,7 +339,6 @@ CONFIG_NFS_V3=y
342CONFIG_RPCSEC_GSS_KRB5=y 339CONFIG_RPCSEC_GSS_KRB5=y
343CONFIG_PARTITION_ADVANCED=y 340CONFIG_PARTITION_ADVANCED=y
344CONFIG_DLM=m 341CONFIG_DLM=m
345# CONFIG_RCU_CPU_STALL_DETECTOR is not set
346CONFIG_KEYS=y 342CONFIG_KEYS=y
347CONFIG_SECURITYFS=y 343CONFIG_SECURITYFS=y
348CONFIG_CRYPTO_FIPS=y 344CONFIG_CRYPTO_FIPS=y
@@ -378,7 +374,6 @@ CONFIG_CRYPTO_SEED=m
378CONFIG_CRYPTO_SERPENT=m 374CONFIG_CRYPTO_SERPENT=m
379CONFIG_CRYPTO_TEA=m 375CONFIG_CRYPTO_TEA=m
380CONFIG_CRYPTO_TWOFISH=m 376CONFIG_CRYPTO_TWOFISH=m
381CONFIG_CRYPTO_ZLIB=m
382CONFIG_CRYPTO_LZO=m 377CONFIG_CRYPTO_LZO=m
383CONFIG_CRYPTO_DEV_HIFN_795X=m 378CONFIG_CRYPTO_DEV_HIFN_795X=m
384CONFIG_CRC_T10DIF=m 379CONFIG_CRC_T10DIF=m
diff --git a/arch/mips/configs/ip28_defconfig b/arch/mips/configs/ip28_defconfig
index 4dbf6269b3f9..d0a4c2cfacf8 100644
--- a/arch/mips/configs/ip28_defconfig
+++ b/arch/mips/configs/ip28_defconfig
@@ -1,7 +1,6 @@
1CONFIG_SGI_IP28=y 1CONFIG_SGI_IP28=y
2CONFIG_ARC_CONSOLE=y 2CONFIG_ARC_CONSOLE=y
3CONFIG_PREEMPT_VOLUNTARY=y 3CONFIG_PREEMPT_VOLUNTARY=y
4CONFIG_EXPERIMENTAL=y
5CONFIG_SYSVIPC=y 4CONFIG_SYSVIPC=y
6CONFIG_IKCONFIG=y 5CONFIG_IKCONFIG=y
7CONFIG_IKCONFIG_PROC=y 6CONFIG_IKCONFIG_PROC=y
@@ -35,10 +34,8 @@ CONFIG_IP_PNP_BOOTP=y
35# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 34# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
36# CONFIG_INET_XFRM_MODE_TUNNEL is not set 35# CONFIG_INET_XFRM_MODE_TUNNEL is not set
37# CONFIG_INET_XFRM_MODE_BEET is not set 36# CONFIG_INET_XFRM_MODE_BEET is not set
38# CONFIG_INET_LRO is not set
39CONFIG_TCP_MD5SIG=y 37CONFIG_TCP_MD5SIG=y
40# CONFIG_IPV6 is not set 38# CONFIG_IPV6 is not set
41# CONFIG_MISC_DEVICES is not set
42CONFIG_SCSI=y 39CONFIG_SCSI=y
43CONFIG_BLK_DEV_SD=y 40CONFIG_BLK_DEV_SD=y
44CONFIG_BLK_DEV_SR=y 41CONFIG_BLK_DEV_SR=y
@@ -48,8 +45,6 @@ CONFIG_NETDEVICES=y
48CONFIG_DUMMY=m 45CONFIG_DUMMY=m
49CONFIG_NET_ETHERNET=y 46CONFIG_NET_ETHERNET=y
50CONFIG_SGISEEQ=y 47CONFIG_SGISEEQ=y
51# CONFIG_NETDEV_1000 is not set
52# CONFIG_NETDEV_10000 is not set
53# CONFIG_MOUSE_PS2_ALPS is not set 48# CONFIG_MOUSE_PS2_ALPS is not set
54# CONFIG_MOUSE_PS2_SYNAPTICS is not set 49# CONFIG_MOUSE_PS2_SYNAPTICS is not set
55CONFIG_VT_HW_CONSOLE_BINDING=y 50CONFIG_VT_HW_CONSOLE_BINDING=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index f9af98f63cff..1e26e58b9dc3 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -1,6 +1,5 @@
1CONFIG_SGI_IP32=y 1CONFIG_SGI_IP32=y
2# CONFIG_SECCOMP is not set 2# CONFIG_SECCOMP is not set
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
6CONFIG_BSD_PROCESS_ACCT=y 5CONFIG_BSD_PROCESS_ACCT=y
@@ -38,7 +37,6 @@ CONFIG_NET_IPGRE=m
38CONFIG_INET_AH=m 37CONFIG_INET_AH=m
39CONFIG_INET_ESP=m 38CONFIG_INET_ESP=m
40CONFIG_INET_IPCOMP=m 39CONFIG_INET_IPCOMP=m
41# CONFIG_INET_LRO is not set
42CONFIG_TCP_CONG_ADVANCED=y 40CONFIG_TCP_CONG_ADVANCED=y
43CONFIG_TCP_MD5SIG=y 41CONFIG_TCP_MD5SIG=y
44CONFIG_INET6_AH=m 42CONFIG_INET6_AH=m
@@ -76,8 +74,6 @@ CONFIG_NET_TULIP=y
76CONFIG_DE2104X=m 74CONFIG_DE2104X=m
77CONFIG_TULIP=m 75CONFIG_TULIP=m
78CONFIG_TULIP_MMIO=y 76CONFIG_TULIP_MMIO=y
79# CONFIG_NETDEV_1000 is not set
80# CONFIG_NETDEV_10000 is not set
81CONFIG_INPUT_EVDEV=m 77CONFIG_INPUT_EVDEV=m
82# CONFIG_SERIO_I8042 is not set 78# CONFIG_SERIO_I8042 is not set
83CONFIG_SERIO_MACEPS2=y 79CONFIG_SERIO_MACEPS2=y
@@ -87,7 +83,6 @@ CONFIG_SERIAL_8250=y
87CONFIG_SERIAL_8250_CONSOLE=y 83CONFIG_SERIAL_8250_CONSOLE=y
88CONFIG_HW_RANDOM=y 84CONFIG_HW_RANDOM=y
89CONFIG_WATCHDOG=y 85CONFIG_WATCHDOG=y
90CONFIG_VIDEO_OUTPUT_CONTROL=y
91CONFIG_FB=y 86CONFIG_FB=y
92CONFIG_FIRMWARE_EDID=y 87CONFIG_FIRMWARE_EDID=y
93CONFIG_FB_GBE=y 88CONFIG_FB_GBE=y
@@ -117,7 +112,6 @@ CONFIG_EXT3_FS_SECURITY=y
117CONFIG_QUOTA=y 112CONFIG_QUOTA=y
118CONFIG_QFMT_V1=m 113CONFIG_QFMT_V1=m
119CONFIG_QFMT_V2=m 114CONFIG_QFMT_V2=m
120CONFIG_AUTOFS_FS=m
121CONFIG_AUTOFS4_FS=m 115CONFIG_AUTOFS4_FS=m
122CONFIG_FUSE_FS=m 116CONFIG_FUSE_FS=m
123CONFIG_ISO9660_FS=m 117CONFIG_ISO9660_FS=m
@@ -178,8 +172,6 @@ CONFIG_NLS_KOI8_R=m
178CONFIG_NLS_KOI8_U=m 172CONFIG_NLS_KOI8_U=m
179CONFIG_NLS_UTF8=m 173CONFIG_NLS_UTF8=m
180CONFIG_MAGIC_SYSRQ=y 174CONFIG_MAGIC_SYSRQ=y
181# CONFIG_RCU_CPU_STALL_DETECTOR is not set
182CONFIG_SYSCTL_SYSCALL_CHECK=y
183CONFIG_KEYS=y 175CONFIG_KEYS=y
184CONFIG_CRYPTO_NULL=y 176CONFIG_CRYPTO_NULL=y
185CONFIG_CRYPTO_CBC=y 177CONFIG_CRYPTO_CBC=y
diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig
index 3019fce63cd3..9ad1c94376c8 100644
--- a/arch/mips/configs/jazz_defconfig
+++ b/arch/mips/configs/jazz_defconfig
@@ -1,7 +1,6 @@
1CONFIG_MACH_JAZZ=y 1CONFIG_MACH_JAZZ=y
2CONFIG_OLIVETTI_M700=y 2CONFIG_OLIVETTI_M700=y
3CONFIG_PREEMPT_VOLUNTARY=y 3CONFIG_PREEMPT_VOLUNTARY=y
4CONFIG_EXPERIMENTAL=y
5CONFIG_SYSVIPC=y 4CONFIG_SYSVIPC=y
6CONFIG_POSIX_MQUEUE=y 5CONFIG_POSIX_MQUEUE=y
7CONFIG_BSD_PROCESS_ACCT=y 6CONFIG_BSD_PROCESS_ACCT=y
@@ -85,7 +84,6 @@ CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
85CONFIG_NETFILTER_XT_MATCH_STRING=m 84CONFIG_NETFILTER_XT_MATCH_STRING=m
86CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 85CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
87CONFIG_NF_CONNTRACK_IPV4=m 86CONFIG_NF_CONNTRACK_IPV4=m
88CONFIG_IP_NF_QUEUE=m
89CONFIG_IP_NF_IPTABLES=m 87CONFIG_IP_NF_IPTABLES=m
90CONFIG_IP_NF_MATCH_ADDRTYPE=m 88CONFIG_IP_NF_MATCH_ADDRTYPE=m
91CONFIG_IP_NF_MATCH_AH=m 89CONFIG_IP_NF_MATCH_AH=m
@@ -94,7 +92,6 @@ CONFIG_IP_NF_MATCH_TTL=m
94CONFIG_IP_NF_FILTER=m 92CONFIG_IP_NF_FILTER=m
95CONFIG_IP_NF_TARGET_REJECT=m 93CONFIG_IP_NF_TARGET_REJECT=m
96CONFIG_IP_NF_TARGET_LOG=m 94CONFIG_IP_NF_TARGET_LOG=m
97CONFIG_IP_NF_TARGET_ULOG=m
98CONFIG_NF_NAT=m 95CONFIG_NF_NAT=m
99CONFIG_IP_NF_TARGET_MASQUERADE=m 96CONFIG_IP_NF_TARGET_MASQUERADE=m
100CONFIG_IP_NF_TARGET_NETMAP=m 97CONFIG_IP_NF_TARGET_NETMAP=m
@@ -109,7 +106,6 @@ CONFIG_IP_NF_ARPTABLES=m
109CONFIG_IP_NF_ARPFILTER=m 106CONFIG_IP_NF_ARPFILTER=m
110CONFIG_IP_NF_ARP_MANGLE=m 107CONFIG_IP_NF_ARP_MANGLE=m
111CONFIG_NF_CONNTRACK_IPV6=m 108CONFIG_NF_CONNTRACK_IPV6=m
112CONFIG_IP6_NF_QUEUE=m
113CONFIG_IP6_NF_IPTABLES=m 109CONFIG_IP6_NF_IPTABLES=m
114CONFIG_IP6_NF_MATCH_AH=m 110CONFIG_IP6_NF_MATCH_AH=m
115CONFIG_IP6_NF_MATCH_EUI64=m 111CONFIG_IP6_NF_MATCH_EUI64=m
@@ -120,7 +116,6 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m
120CONFIG_IP6_NF_MATCH_MH=m 116CONFIG_IP6_NF_MATCH_MH=m
121CONFIG_IP6_NF_MATCH_RT=m 117CONFIG_IP6_NF_MATCH_RT=m
122CONFIG_IP6_NF_TARGET_HL=m 118CONFIG_IP6_NF_TARGET_HL=m
123CONFIG_IP6_NF_TARGET_LOG=m
124CONFIG_IP6_NF_FILTER=m 119CONFIG_IP6_NF_FILTER=m
125CONFIG_IP6_NF_TARGET_REJECT=m 120CONFIG_IP6_NF_TARGET_REJECT=m
126CONFIG_IP6_NF_MANGLE=m 121CONFIG_IP6_NF_MANGLE=m
@@ -276,7 +271,6 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
276CONFIG_REISERFS_FS_SECURITY=y 271CONFIG_REISERFS_FS_SECURITY=y
277CONFIG_XFS_FS=m 272CONFIG_XFS_FS=m
278CONFIG_XFS_QUOTA=y 273CONFIG_XFS_QUOTA=y
279CONFIG_AUTOFS_FS=m
280CONFIG_AUTOFS4_FS=m 274CONFIG_AUTOFS4_FS=m
281CONFIG_FUSE_FS=m 275CONFIG_FUSE_FS=m
282CONFIG_ISO9660_FS=m 276CONFIG_ISO9660_FS=m
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 9bc08f275120..af12281a5c33 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -18,23 +18,18 @@ CONFIG_IP_PNP_BOOTP=y
18# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 18# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
19# CONFIG_INET_XFRM_MODE_TUNNEL is not set 19# CONFIG_INET_XFRM_MODE_TUNNEL is not set
20# CONFIG_INET_XFRM_MODE_BEET is not set 20# CONFIG_INET_XFRM_MODE_BEET is not set
21# CONFIG_INET_LRO is not set
22# CONFIG_INET_DIAG is not set 21# CONFIG_INET_DIAG is not set
23# CONFIG_IPV6 is not set 22# CONFIG_IPV6 is not set
24CONFIG_MTD=y 23CONFIG_MTD=y
25CONFIG_MTD_CMDLINE_PARTS=y 24CONFIG_MTD_CMDLINE_PARTS=y
26CONFIG_MTD_CHAR=y
27CONFIG_MTD_CFI=y 25CONFIG_MTD_CFI=y
28CONFIG_MTD_JEDECPROBE=y 26CONFIG_MTD_JEDECPROBE=y
29CONFIG_MTD_CFI_AMDSTD=y 27CONFIG_MTD_CFI_AMDSTD=y
30CONFIG_MTD_PHYSMAP=y 28CONFIG_MTD_PHYSMAP=y
31# CONFIG_MISC_DEVICES is not set
32CONFIG_NETDEVICES=y 29CONFIG_NETDEVICES=y
33CONFIG_NET_ETHERNET=y 30CONFIG_NET_ETHERNET=y
34CONFIG_NET_PCI=y 31CONFIG_NET_PCI=y
35CONFIG_TC35815=y 32CONFIG_TC35815=y
36# CONFIG_NETDEV_1000 is not set
37# CONFIG_NETDEV_10000 is not set
38# CONFIG_INPUT is not set 33# CONFIG_INPUT is not set
39# CONFIG_SERIO is not set 34# CONFIG_SERIO is not set
40# CONFIG_VT is not set 35# CONFIG_VT is not set
@@ -58,5 +53,3 @@ CONFIG_PROC_KCORE=y
58# CONFIG_MISC_FILESYSTEMS is not set 53# CONFIG_MISC_FILESYSTEMS is not set
59CONFIG_NFS_FS=y 54CONFIG_NFS_FS=y
60CONFIG_ROOT_NFS=y 55CONFIG_ROOT_NFS=y
61# CONFIG_RCU_CPU_STALL_DETECTOR is not set
62CONFIG_SYSCTL_SYSCALL_CHECK=y
diff --git a/arch/mips/configs/lasat_defconfig b/arch/mips/configs/lasat_defconfig
index e620a2c3eba4..947a35c7c46c 100644
--- a/arch/mips/configs/lasat_defconfig
+++ b/arch/mips/configs/lasat_defconfig
@@ -5,7 +5,6 @@ CONFIG_DS1603=y
5CONFIG_LASAT_SYSCTL=y 5CONFIG_LASAT_SYSCTL=y
6CONFIG_HZ_1000=y 6CONFIG_HZ_1000=y
7# CONFIG_SECCOMP is not set 7# CONFIG_SECCOMP is not set
8CONFIG_EXPERIMENTAL=y
9CONFIG_SYSVIPC=y 8CONFIG_SYSVIPC=y
10CONFIG_LOG_BUF_SHIFT=14 9CONFIG_LOG_BUF_SHIFT=14
11CONFIG_EXPERT=y 10CONFIG_EXPERT=y
@@ -31,7 +30,6 @@ CONFIG_INET=y
31# CONFIG_INET_DIAG is not set 30# CONFIG_INET_DIAG is not set
32# CONFIG_IPV6 is not set 31# CONFIG_IPV6 is not set
33CONFIG_MTD=y 32CONFIG_MTD=y
34CONFIG_MTD_CHAR=y
35CONFIG_MTD_BLOCK=y 33CONFIG_MTD_BLOCK=y
36CONFIG_MTD_CFI=y 34CONFIG_MTD_CFI=y
37CONFIG_MTD_CFI_AMDSTD=y 35CONFIG_MTD_CFI_AMDSTD=y
@@ -44,8 +42,6 @@ CONFIG_NETDEVICES=y
44CONFIG_NET_ETHERNET=y 42CONFIG_NET_ETHERNET=y
45CONFIG_NET_PCI=y 43CONFIG_NET_PCI=y
46CONFIG_PCNET32=y 44CONFIG_PCNET32=y
47# CONFIG_NETDEV_1000 is not set
48# CONFIG_NETDEV_10000 is not set
49# CONFIG_INPUT_MOUSEDEV is not set 45# CONFIG_INPUT_MOUSEDEV is not set
50# CONFIG_INPUT_KEYBOARD is not set 46# CONFIG_INPUT_KEYBOARD is not set
51# CONFIG_INPUT_MOUSE is not set 47# CONFIG_INPUT_MOUSE is not set
@@ -56,7 +52,6 @@ CONFIG_SERIAL_8250_CONSOLE=y
56# CONFIG_SERIAL_8250_PCI is not set 52# CONFIG_SERIAL_8250_PCI is not set
57# CONFIG_HW_RANDOM is not set 53# CONFIG_HW_RANDOM is not set
58# CONFIG_HWMON is not set 54# CONFIG_HWMON is not set
59# CONFIG_HID_SUPPORT is not set
60# CONFIG_USB_SUPPORT is not set 55# CONFIG_USB_SUPPORT is not set
61CONFIG_EXT2_FS=y 56CONFIG_EXT2_FS=y
62CONFIG_EXT3_FS=y 57CONFIG_EXT3_FS=y
diff --git a/arch/mips/configs/lemote2f_defconfig b/arch/mips/configs/lemote2f_defconfig
index 8df80c6383f2..1ec8ed8d05d1 100644
--- a/arch/mips/configs/lemote2f_defconfig
+++ b/arch/mips/configs/lemote2f_defconfig
@@ -7,7 +7,6 @@ CONFIG_HIGH_RES_TIMERS=y
7CONFIG_PREEMPT=y 7CONFIG_PREEMPT=y
8CONFIG_KEXEC=y 8CONFIG_KEXEC=y
9# CONFIG_SECCOMP is not set 9# CONFIG_SECCOMP is not set
10CONFIG_EXPERIMENTAL=y
11# CONFIG_LOCALVERSION_AUTO is not set 10# CONFIG_LOCALVERSION_AUTO is not set
12CONFIG_SYSVIPC=y 11CONFIG_SYSVIPC=y
13CONFIG_BSD_PROCESS_ACCT=y 12CONFIG_BSD_PROCESS_ACCT=y
@@ -83,8 +82,6 @@ CONFIG_NET_SCHED=y
83CONFIG_NET_EMATCH=y 82CONFIG_NET_EMATCH=y
84CONFIG_NET_CLS_ACT=y 83CONFIG_NET_CLS_ACT=y
85CONFIG_BT=m 84CONFIG_BT=m
86CONFIG_BT_L2CAP=y
87CONFIG_BT_SCO=y
88CONFIG_BT_RFCOMM=m 85CONFIG_BT_RFCOMM=m
89CONFIG_BT_RFCOMM_TTY=y 86CONFIG_BT_RFCOMM_TTY=y
90CONFIG_BT_BNEP=m 87CONFIG_BT_BNEP=m
@@ -142,7 +139,6 @@ CONFIG_8139TOO=y
142# CONFIG_8139TOO_PIO is not set 139# CONFIG_8139TOO_PIO is not set
143CONFIG_R8169=y 140CONFIG_R8169=y
144CONFIG_R8169_VLAN=y 141CONFIG_R8169_VLAN=y
145# CONFIG_NETDEV_10000 is not set
146CONFIG_USB_USBNET=m 142CONFIG_USB_USBNET=m
147CONFIG_USB_NET_CDC_EEM=m 143CONFIG_USB_NET_CDC_EEM=m
148CONFIG_NETCONSOLE=m 144CONFIG_NETCONSOLE=m
@@ -205,7 +201,6 @@ CONFIG_USB_ZR364XX=m
205CONFIG_USB_STKWEBCAM=m 201CONFIG_USB_STKWEBCAM=m
206CONFIG_USB_S2255=m 202CONFIG_USB_S2255=m
207# CONFIG_RADIO_ADAPTERS is not set 203# CONFIG_RADIO_ADAPTERS is not set
208CONFIG_VIDEO_OUTPUT_CONTROL=y
209CONFIG_FB=y 204CONFIG_FB=y
210CONFIG_FIRMWARE_EDID=y 205CONFIG_FIRMWARE_EDID=y
211CONFIG_FB_MODE_HELPERS=y 206CONFIG_FB_MODE_HELPERS=y
@@ -290,7 +285,6 @@ CONFIG_HID_WACOM=m
290CONFIG_HID_ZEROPLUS=m 285CONFIG_HID_ZEROPLUS=m
291CONFIG_ZEROPLUS_FF=y 286CONFIG_ZEROPLUS_FF=y
292CONFIG_USB=y 287CONFIG_USB=y
293# CONFIG_USB_DEVICE_CLASS is not set
294CONFIG_USB_DYNAMIC_MINORS=y 288CONFIG_USB_DYNAMIC_MINORS=y
295CONFIG_USB_OTG_WHITELIST=y 289CONFIG_USB_OTG_WHITELIST=y
296CONFIG_USB_MON=y 290CONFIG_USB_MON=y
@@ -313,10 +307,8 @@ CONFIG_USB_STORAGE_SDDR09=m
313CONFIG_USB_STORAGE_SDDR55=m 307CONFIG_USB_STORAGE_SDDR55=m
314CONFIG_USB_STORAGE_JUMPSHOT=m 308CONFIG_USB_STORAGE_JUMPSHOT=m
315CONFIG_USB_STORAGE_ALAUDA=m 309CONFIG_USB_STORAGE_ALAUDA=m
316CONFIG_USB_LIBUSUAL=y
317CONFIG_USB_SERIAL=m 310CONFIG_USB_SERIAL=m
318CONFIG_USB_SERIAL_GENERIC=y 311CONFIG_USB_SERIAL_GENERIC=y
319CONFIG_USB_LED=m
320CONFIG_USB_GADGET=m 312CONFIG_USB_GADGET=m
321CONFIG_USB_GADGET_M66592=y 313CONFIG_USB_GADGET_M66592=y
322CONFIG_MMC=m 314CONFIG_MMC=m
@@ -341,7 +333,6 @@ CONFIG_XFS_POSIX_ACL=y
341CONFIG_BTRFS_FS=m 333CONFIG_BTRFS_FS=m
342CONFIG_QUOTA=y 334CONFIG_QUOTA=y
343CONFIG_QFMT_V2=m 335CONFIG_QFMT_V2=m
344CONFIG_AUTOFS_FS=m
345CONFIG_AUTOFS4_FS=m 336CONFIG_AUTOFS4_FS=m
346CONFIG_FSCACHE=m 337CONFIG_FSCACHE=m
347CONFIG_CACHEFILES=m 338CONFIG_CACHEFILES=m
@@ -407,8 +398,6 @@ CONFIG_PRINTK_TIME=y
407CONFIG_FRAME_WARN=1024 398CONFIG_FRAME_WARN=1024
408CONFIG_STRIP_ASM_SYMS=y 399CONFIG_STRIP_ASM_SYMS=y
409CONFIG_DEBUG_FS=y 400CONFIG_DEBUG_FS=y
410# CONFIG_RCU_CPU_STALL_DETECTOR is not set
411CONFIG_SYSCTL_SYSCALL_CHECK=y
412CONFIG_KEYS=y 401CONFIG_KEYS=y
413CONFIG_CRYPTO_FIPS=y 402CONFIG_CRYPTO_FIPS=y
414CONFIG_CRYPTO_NULL=m 403CONFIG_CRYPTO_NULL=m
@@ -446,6 +435,5 @@ CONFIG_CRYPTO_SERPENT=m
446CONFIG_CRYPTO_TEA=m 435CONFIG_CRYPTO_TEA=m
447CONFIG_CRYPTO_TWOFISH=m 436CONFIG_CRYPTO_TWOFISH=m
448CONFIG_CRYPTO_DEFLATE=m 437CONFIG_CRYPTO_DEFLATE=m
449CONFIG_CRYPTO_ZLIB=m
450CONFIG_CRYPTO_LZO=m 438CONFIG_CRYPTO_LZO=m
451CONFIG_CRC_T10DIF=y 439CONFIG_CRC_T10DIF=y
diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
index 7f95c4b3ab2c..324dfee23dfb 100644
--- a/arch/mips/configs/loongson3_defconfig
+++ b/arch/mips/configs/loongson3_defconfig
@@ -95,7 +95,6 @@ CONFIG_IP_NF_MATCH_ECN=m
95CONFIG_IP_NF_MATCH_TTL=m 95CONFIG_IP_NF_MATCH_TTL=m
96CONFIG_IP_NF_FILTER=m 96CONFIG_IP_NF_FILTER=m
97CONFIG_IP_NF_TARGET_REJECT=m 97CONFIG_IP_NF_TARGET_REJECT=m
98CONFIG_IP_NF_TARGET_ULOG=m
99CONFIG_IP_NF_MANGLE=m 98CONFIG_IP_NF_MANGLE=m
100CONFIG_IP_NF_TARGET_ECN=m 99CONFIG_IP_NF_TARGET_ECN=m
101CONFIG_IP_NF_TARGET_TTL=m 100CONFIG_IP_NF_TARGET_TTL=m
@@ -252,7 +251,6 @@ CONFIG_MEDIA_USB_SUPPORT=y
252CONFIG_USB_VIDEO_CLASS=m 251CONFIG_USB_VIDEO_CLASS=m
253CONFIG_DRM=y 252CONFIG_DRM=y
254CONFIG_DRM_RADEON=y 253CONFIG_DRM_RADEON=y
255CONFIG_VIDEO_OUTPUT_CONTROL=y
256CONFIG_FB_RADEON=y 254CONFIG_FB_RADEON=y
257CONFIG_LCD_CLASS_DEVICE=y 255CONFIG_LCD_CLASS_DEVICE=y
258CONFIG_LCD_PLATFORM=m 256CONFIG_LCD_PLATFORM=m
@@ -335,7 +333,6 @@ CONFIG_STRIP_ASM_SYMS=y
335CONFIG_MAGIC_SYSRQ=y 333CONFIG_MAGIC_SYSRQ=y
336# CONFIG_SCHED_DEBUG is not set 334# CONFIG_SCHED_DEBUG is not set
337# CONFIG_DEBUG_PREEMPT is not set 335# CONFIG_DEBUG_PREEMPT is not set
338# CONFIG_RCU_CPU_STALL_VERBOSE is not set
339# CONFIG_FTRACE is not set 336# CONFIG_FTRACE is not set
340CONFIG_SECURITY=y 337CONFIG_SECURITY=y
341CONFIG_SECURITYFS=y 338CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig
index e233f878afef..80ecd94ed126 100644
--- a/arch/mips/configs/malta_kvm_defconfig
+++ b/arch/mips/configs/malta_kvm_defconfig
@@ -133,7 +133,6 @@ CONFIG_IP_NF_MATCH_ECN=m
133CONFIG_IP_NF_MATCH_TTL=m 133CONFIG_IP_NF_MATCH_TTL=m
134CONFIG_IP_NF_FILTER=m 134CONFIG_IP_NF_FILTER=m
135CONFIG_IP_NF_TARGET_REJECT=m 135CONFIG_IP_NF_TARGET_REJECT=m
136CONFIG_IP_NF_TARGET_ULOG=m
137CONFIG_IP_NF_MANGLE=m 136CONFIG_IP_NF_MANGLE=m
138CONFIG_IP_NF_TARGET_CLUSTERIP=m 137CONFIG_IP_NF_TARGET_CLUSTERIP=m
139CONFIG_IP_NF_TARGET_ECN=m 138CONFIG_IP_NF_TARGET_ECN=m
diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig
index fbe085c328ab..35ad1f8d1a79 100644
--- a/arch/mips/configs/malta_kvm_guest_defconfig
+++ b/arch/mips/configs/malta_kvm_guest_defconfig
@@ -132,7 +132,6 @@ CONFIG_IP_NF_MATCH_ECN=m
132CONFIG_IP_NF_MATCH_TTL=m 132CONFIG_IP_NF_MATCH_TTL=m
133CONFIG_IP_NF_FILTER=m 133CONFIG_IP_NF_FILTER=m
134CONFIG_IP_NF_TARGET_REJECT=m 134CONFIG_IP_NF_TARGET_REJECT=m
135CONFIG_IP_NF_TARGET_ULOG=m
136CONFIG_IP_NF_MANGLE=m 135CONFIG_IP_NF_MANGLE=m
137CONFIG_IP_NF_TARGET_CLUSTERIP=m 136CONFIG_IP_NF_TARGET_CLUSTERIP=m
138CONFIG_IP_NF_TARGET_ECN=m 137CONFIG_IP_NF_TARGET_ECN=m
diff --git a/arch/mips/configs/malta_qemu_32r6_defconfig b/arch/mips/configs/malta_qemu_32r6_defconfig
index cbf37dd0c490..77145ecaa23b 100644
--- a/arch/mips/configs/malta_qemu_32r6_defconfig
+++ b/arch/mips/configs/malta_qemu_32r6_defconfig
@@ -42,7 +42,6 @@ CONFIG_SYN_COOKIES=y
42CONFIG_INET_AH=m 42CONFIG_INET_AH=m
43CONFIG_INET_ESP=m 43CONFIG_INET_ESP=m
44CONFIG_INET_IPCOMP=m 44CONFIG_INET_IPCOMP=m
45# CONFIG_INET_LRO is not set
46CONFIG_INET6_AH=m 45CONFIG_INET6_AH=m
47CONFIG_INET6_ESP=m 46CONFIG_INET6_ESP=m
48CONFIG_INET6_IPCOMP=m 47CONFIG_INET6_IPCOMP=m
diff --git a/arch/mips/configs/maltaaprp_defconfig b/arch/mips/configs/maltaaprp_defconfig
index 35f6ba260df8..cc2687cfdc13 100644
--- a/arch/mips/configs/maltaaprp_defconfig
+++ b/arch/mips/configs/maltaaprp_defconfig
@@ -43,7 +43,6 @@ CONFIG_SYN_COOKIES=y
43CONFIG_INET_AH=m 43CONFIG_INET_AH=m
44CONFIG_INET_ESP=m 44CONFIG_INET_ESP=m
45CONFIG_INET_IPCOMP=m 45CONFIG_INET_IPCOMP=m
46# CONFIG_INET_LRO is not set
47CONFIG_INET6_AH=m 46CONFIG_INET6_AH=m
48CONFIG_INET6_ESP=m 47CONFIG_INET6_ESP=m
49CONFIG_INET6_IPCOMP=m 48CONFIG_INET6_IPCOMP=m
@@ -135,7 +134,6 @@ CONFIG_HW_RANDOM=y
135CONFIG_POWER_RESET=y 134CONFIG_POWER_RESET=y
136CONFIG_POWER_RESET_SYSCON=y 135CONFIG_POWER_RESET_SYSCON=y
137# CONFIG_HWMON is not set 136# CONFIG_HWMON is not set
138CONFIG_VIDEO_OUTPUT_CONTROL=m
139CONFIG_FB=y 137CONFIG_FB=y
140CONFIG_FIRMWARE_EDID=y 138CONFIG_FIRMWARE_EDID=y
141CONFIG_FB_MATROX=y 139CONFIG_FB_MATROX=y
diff --git a/arch/mips/configs/maltasmvp_defconfig b/arch/mips/configs/maltasmvp_defconfig
index 900f14543eeb..55b68b981b05 100644
--- a/arch/mips/configs/maltasmvp_defconfig
+++ b/arch/mips/configs/maltasmvp_defconfig
@@ -46,7 +46,6 @@ CONFIG_SYN_COOKIES=y
46CONFIG_INET_AH=m 46CONFIG_INET_AH=m
47CONFIG_INET_ESP=m 47CONFIG_INET_ESP=m
48CONFIG_INET_IPCOMP=m 48CONFIG_INET_IPCOMP=m
49# CONFIG_INET_LRO is not set
50CONFIG_INET6_AH=m 49CONFIG_INET6_AH=m
51CONFIG_INET6_ESP=m 50CONFIG_INET6_ESP=m
52CONFIG_INET6_IPCOMP=m 51CONFIG_INET6_IPCOMP=m
diff --git a/arch/mips/configs/maltasmvp_eva_defconfig b/arch/mips/configs/maltasmvp_eva_defconfig
index 8e2738b5e180..5ca590cf1635 100644
--- a/arch/mips/configs/maltasmvp_eva_defconfig
+++ b/arch/mips/configs/maltasmvp_eva_defconfig
@@ -47,7 +47,6 @@ CONFIG_SYN_COOKIES=y
47CONFIG_INET_AH=m 47CONFIG_INET_AH=m
48CONFIG_INET_ESP=m 48CONFIG_INET_ESP=m
49CONFIG_INET_IPCOMP=m 49CONFIG_INET_IPCOMP=m
50# CONFIG_INET_LRO is not set
51CONFIG_INET6_AH=m 50CONFIG_INET6_AH=m
52CONFIG_INET6_ESP=m 51CONFIG_INET6_ESP=m
53CONFIG_INET6_IPCOMP=m 52CONFIG_INET6_IPCOMP=m
@@ -140,7 +139,6 @@ CONFIG_HW_RANDOM=y
140CONFIG_POWER_RESET=y 139CONFIG_POWER_RESET=y
141CONFIG_POWER_RESET_SYSCON=y 140CONFIG_POWER_RESET_SYSCON=y
142# CONFIG_HWMON is not set 141# CONFIG_HWMON is not set
143CONFIG_VIDEO_OUTPUT_CONTROL=m
144CONFIG_FB=y 142CONFIG_FB=y
145CONFIG_FIRMWARE_EDID=y 143CONFIG_FIRMWARE_EDID=y
146CONFIG_FB_MATROX=y 144CONFIG_FB_MATROX=y
diff --git a/arch/mips/configs/maltaup_defconfig b/arch/mips/configs/maltaup_defconfig
index 6dc4e309a691..7ea7c0ba2666 100644
--- a/arch/mips/configs/maltaup_defconfig
+++ b/arch/mips/configs/maltaup_defconfig
@@ -42,7 +42,6 @@ CONFIG_SYN_COOKIES=y
42CONFIG_INET_AH=m 42CONFIG_INET_AH=m
43CONFIG_INET_ESP=m 43CONFIG_INET_ESP=m
44CONFIG_INET_IPCOMP=m 44CONFIG_INET_IPCOMP=m
45# CONFIG_INET_LRO is not set
46CONFIG_INET6_AH=m 45CONFIG_INET6_AH=m
47CONFIG_INET6_ESP=m 46CONFIG_INET6_ESP=m
48CONFIG_INET6_IPCOMP=m 47CONFIG_INET6_IPCOMP=m
@@ -134,7 +133,6 @@ CONFIG_HW_RANDOM=y
134CONFIG_POWER_RESET=y 133CONFIG_POWER_RESET=y
135CONFIG_POWER_RESET_SYSCON=y 134CONFIG_POWER_RESET_SYSCON=y
136# CONFIG_HWMON is not set 135# CONFIG_HWMON is not set
137CONFIG_VIDEO_OUTPUT_CONTROL=m
138CONFIG_FB=y 136CONFIG_FB=y
139CONFIG_FIRMWARE_EDID=y 137CONFIG_FIRMWARE_EDID=y
140CONFIG_FB_MATROX=y 138CONFIG_FB_MATROX=y
diff --git a/arch/mips/configs/markeins_defconfig b/arch/mips/configs/markeins_defconfig
index 0f08e4623ee4..43ce6576ab1c 100644
--- a/arch/mips/configs/markeins_defconfig
+++ b/arch/mips/configs/markeins_defconfig
@@ -1,7 +1,6 @@
1CONFIG_NEC_MARKEINS=y 1CONFIG_NEC_MARKEINS=y
2CONFIG_HZ_1000=y 2CONFIG_HZ_1000=y
3CONFIG_PREEMPT=y 3CONFIG_PREEMPT=y
4CONFIG_EXPERIMENTAL=y
5CONFIG_SYSVIPC=y 4CONFIG_SYSVIPC=y
6CONFIG_POSIX_MQUEUE=y 5CONFIG_POSIX_MQUEUE=y
7CONFIG_BSD_PROCESS_ACCT=y 6CONFIG_BSD_PROCESS_ACCT=y
@@ -92,7 +91,6 @@ CONFIG_IP_NF_MATCH_TTL=m
92CONFIG_IP_NF_FILTER=m 91CONFIG_IP_NF_FILTER=m
93CONFIG_IP_NF_TARGET_REJECT=m 92CONFIG_IP_NF_TARGET_REJECT=m
94CONFIG_IP_NF_TARGET_LOG=m 93CONFIG_IP_NF_TARGET_LOG=m
95CONFIG_IP_NF_TARGET_ULOG=m
96CONFIG_NF_NAT=m 94CONFIG_NF_NAT=m
97CONFIG_IP_NF_TARGET_MASQUERADE=m 95CONFIG_IP_NF_TARGET_MASQUERADE=m
98CONFIG_IP_NF_TARGET_NETMAP=m 96CONFIG_IP_NF_TARGET_NETMAP=m
@@ -117,7 +115,6 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m
117CONFIG_IP6_NF_MATCH_MH=m 115CONFIG_IP6_NF_MATCH_MH=m
118CONFIG_IP6_NF_MATCH_RT=m 116CONFIG_IP6_NF_MATCH_RT=m
119CONFIG_IP6_NF_TARGET_HL=m 117CONFIG_IP6_NF_TARGET_HL=m
120CONFIG_IP6_NF_TARGET_LOG=m
121CONFIG_IP6_NF_FILTER=m 118CONFIG_IP6_NF_FILTER=m
122CONFIG_IP6_NF_TARGET_REJECT=m 119CONFIG_IP6_NF_TARGET_REJECT=m
123CONFIG_IP6_NF_MANGLE=m 120CONFIG_IP6_NF_MANGLE=m
@@ -125,7 +122,6 @@ CONFIG_IP6_NF_RAW=m
125CONFIG_FW_LOADER=m 122CONFIG_FW_LOADER=m
126CONFIG_MTD=y 123CONFIG_MTD=y
127CONFIG_MTD_CMDLINE_PARTS=y 124CONFIG_MTD_CMDLINE_PARTS=y
128CONFIG_MTD_CHAR=y
129CONFIG_MTD_BLOCK=y 125CONFIG_MTD_BLOCK=y
130CONFIG_MTD_CFI=y 126CONFIG_MTD_CFI=y
131CONFIG_MTD_CFI_AMDSTD=y 127CONFIG_MTD_CFI_AMDSTD=y
diff --git a/arch/mips/configs/mips_paravirt_defconfig b/arch/mips/configs/mips_paravirt_defconfig
index 84cfcb4bf2ea..accf0db1dc6f 100644
--- a/arch/mips/configs/mips_paravirt_defconfig
+++ b/arch/mips/configs/mips_paravirt_defconfig
@@ -39,7 +39,6 @@ CONFIG_IP_MROUTE=y
39CONFIG_IP_PIMSM_V1=y 39CONFIG_IP_PIMSM_V1=y
40CONFIG_IP_PIMSM_V2=y 40CONFIG_IP_PIMSM_V2=y
41CONFIG_SYN_COOKIES=y 41CONFIG_SYN_COOKIES=y
42# CONFIG_INET_LRO is not set
43CONFIG_IPV6=y 42CONFIG_IPV6=y
44# CONFIG_WIRELESS is not set 43# CONFIG_WIRELESS is not set
45CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index a2c045fab6c5..3486b034f726 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_VICTOR_MPC30X=y 2CONFIG_VICTOR_MPC30X=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6CONFIG_RELAY=y 5CONFIG_RELAY=y
@@ -31,8 +30,6 @@ CONFIG_BLK_DEV_SD=y
31CONFIG_ATA=y 30CONFIG_ATA=y
32CONFIG_PATA_LEGACY=y 31CONFIG_PATA_LEGACY=y
33CONFIG_NETDEVICES=y 32CONFIG_NETDEVICES=y
34# CONFIG_NETDEV_1000 is not set
35# CONFIG_NETDEV_10000 is not set
36CONFIG_USB_PEGASUS=m 33CONFIG_USB_PEGASUS=m
37# CONFIG_INPUT_MOUSEDEV is not set 34# CONFIG_INPUT_MOUSEDEV is not set
38# CONFIG_INPUT_KEYBOARD is not set 35# CONFIG_INPUT_KEYBOARD is not set
@@ -45,13 +42,11 @@ CONFIG_SERIAL_VR41XX_CONSOLE=y
45CONFIG_GPIO_VR41XX=y 42CONFIG_GPIO_VR41XX=y
46# CONFIG_HWMON is not set 43# CONFIG_HWMON is not set
47# CONFIG_VGA_CONSOLE is not set 44# CONFIG_VGA_CONSOLE is not set
48# CONFIG_HID_SUPPORT is not set
49CONFIG_USB=m 45CONFIG_USB=m
50CONFIG_USB_OHCI_HCD=m 46CONFIG_USB_OHCI_HCD=m
51CONFIG_RTC_CLASS=y 47CONFIG_RTC_CLASS=y
52CONFIG_RTC_DRV_VR41XX=y 48CONFIG_RTC_DRV_VR41XX=y
53CONFIG_EXT2_FS=y 49CONFIG_EXT2_FS=y
54CONFIG_AUTOFS_FS=y
55CONFIG_AUTOFS4_FS=y 50CONFIG_AUTOFS4_FS=y
56CONFIG_PROC_KCORE=y 51CONFIG_PROC_KCORE=y
57CONFIG_CONFIGFS_FS=m 52CONFIG_CONFIGFS_FS=m
diff --git a/arch/mips/configs/msp71xx_defconfig b/arch/mips/configs/msp71xx_defconfig
index 201edfb2637d..3c8c16b10732 100644
--- a/arch/mips/configs/msp71xx_defconfig
+++ b/arch/mips/configs/msp71xx_defconfig
@@ -2,7 +2,6 @@ CONFIG_PMC_MSP=y
2CONFIG_PMC_MSP7120_GW=y 2CONFIG_PMC_MSP7120_GW=y
3CONFIG_CPU_MIPS32_R2=y 3CONFIG_CPU_MIPS32_R2=y
4CONFIG_PREEMPT=y 4CONFIG_PREEMPT=y
5CONFIG_EXPERIMENTAL=y
6CONFIG_LOCALVERSION="-pmc" 5CONFIG_LOCALVERSION="-pmc"
7# CONFIG_SWAP is not set 6# CONFIG_SWAP is not set
8CONFIG_SYSVIPC=y 7CONFIG_SYSVIPC=y
@@ -38,7 +37,6 @@ CONFIG_BRIDGE=y
38# CONFIG_PREVENT_FIRMWARE_BUILD is not set 37# CONFIG_PREVENT_FIRMWARE_BUILD is not set
39# CONFIG_FW_LOADER is not set 38# CONFIG_FW_LOADER is not set
40CONFIG_MTD=y 39CONFIG_MTD=y
41CONFIG_MTD_CHAR=y
42CONFIG_MTD_BLOCK=y 40CONFIG_MTD_BLOCK=y
43CONFIG_MTD_CFI=y 41CONFIG_MTD_CFI=y
44CONFIG_MTD_CFI_AMDSTD=y 42CONFIG_MTD_CFI_AMDSTD=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index f3f60056bc27..4011f1869e72 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -1,7 +1,6 @@
1CONFIG_MIPS_ALCHEMY=y 1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_MTX1=y 2CONFIG_MIPS_MTX1=y
3CONFIG_PREEMPT_VOLUNTARY=y 3CONFIG_PREEMPT_VOLUNTARY=y
4CONFIG_EXPERIMENTAL=y
5# CONFIG_LOCALVERSION_AUTO is not set 4# CONFIG_LOCALVERSION_AUTO is not set
6CONFIG_SYSVIPC=y 5CONFIG_SYSVIPC=y
7CONFIG_POSIX_MQUEUE=y 6CONFIG_POSIX_MQUEUE=y
@@ -81,7 +80,6 @@ CONFIG_NETFILTER_XT_MATCH_REALM=m
81CONFIG_NETFILTER_XT_MATCH_STATISTIC=m 80CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
82CONFIG_NETFILTER_XT_MATCH_STRING=m 81CONFIG_NETFILTER_XT_MATCH_STRING=m
83CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 82CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
84CONFIG_IP_NF_QUEUE=m
85CONFIG_IP_NF_IPTABLES=m 83CONFIG_IP_NF_IPTABLES=m
86CONFIG_IP_NF_MATCH_ADDRTYPE=m 84CONFIG_IP_NF_MATCH_ADDRTYPE=m
87CONFIG_IP_NF_MATCH_AH=m 85CONFIG_IP_NF_MATCH_AH=m
@@ -90,7 +88,6 @@ CONFIG_IP_NF_MATCH_TTL=m
90CONFIG_IP_NF_FILTER=m 88CONFIG_IP_NF_FILTER=m
91CONFIG_IP_NF_TARGET_REJECT=m 89CONFIG_IP_NF_TARGET_REJECT=m
92CONFIG_IP_NF_TARGET_LOG=m 90CONFIG_IP_NF_TARGET_LOG=m
93CONFIG_IP_NF_TARGET_ULOG=m
94CONFIG_IP_NF_MANGLE=m 91CONFIG_IP_NF_MANGLE=m
95CONFIG_IP_NF_TARGET_ECN=m 92CONFIG_IP_NF_TARGET_ECN=m
96CONFIG_IP_NF_TARGET_TTL=m 93CONFIG_IP_NF_TARGET_TTL=m
@@ -98,7 +95,6 @@ CONFIG_IP_NF_RAW=m
98CONFIG_IP_NF_ARPTABLES=m 95CONFIG_IP_NF_ARPTABLES=m
99CONFIG_IP_NF_ARPFILTER=m 96CONFIG_IP_NF_ARPFILTER=m
100CONFIG_IP_NF_ARP_MANGLE=m 97CONFIG_IP_NF_ARP_MANGLE=m
101CONFIG_IP6_NF_QUEUE=m
102CONFIG_IP6_NF_IPTABLES=m 98CONFIG_IP6_NF_IPTABLES=m
103CONFIG_IP6_NF_MATCH_AH=m 99CONFIG_IP6_NF_MATCH_AH=m
104CONFIG_IP6_NF_MATCH_EUI64=m 100CONFIG_IP6_NF_MATCH_EUI64=m
@@ -108,7 +104,6 @@ CONFIG_IP6_NF_MATCH_HL=m
108CONFIG_IP6_NF_MATCH_IPV6HEADER=m 104CONFIG_IP6_NF_MATCH_IPV6HEADER=m
109CONFIG_IP6_NF_MATCH_RT=m 105CONFIG_IP6_NF_MATCH_RT=m
110CONFIG_IP6_NF_TARGET_HL=m 106CONFIG_IP6_NF_TARGET_HL=m
111CONFIG_IP6_NF_TARGET_LOG=m
112CONFIG_IP6_NF_FILTER=m 107CONFIG_IP6_NF_FILTER=m
113CONFIG_IP6_NF_TARGET_REJECT=m 108CONFIG_IP6_NF_TARGET_REJECT=m
114CONFIG_IP6_NF_MANGLE=m 109CONFIG_IP6_NF_MANGLE=m
@@ -225,8 +220,6 @@ CONFIG_TOSHIBA_FIR=m
225CONFIG_VLSI_FIR=m 220CONFIG_VLSI_FIR=m
226CONFIG_MCS_FIR=m 221CONFIG_MCS_FIR=m
227CONFIG_BT=m 222CONFIG_BT=m
228CONFIG_BT_L2CAP=y
229CONFIG_BT_SCO=y
230CONFIG_BT_RFCOMM=m 223CONFIG_BT_RFCOMM=m
231CONFIG_BT_RFCOMM_TTY=y 224CONFIG_BT_RFCOMM_TTY=y
232CONFIG_BT_BNEP=m 225CONFIG_BT_BNEP=m
@@ -246,7 +239,6 @@ CONFIG_BT_HCIBTUART=m
246CONFIG_BT_HCIVHCI=m 239CONFIG_BT_HCIVHCI=m
247CONFIG_CONNECTOR=m 240CONFIG_CONNECTOR=m
248CONFIG_MTD=y 241CONFIG_MTD=y
249CONFIG_MTD_CHAR=y
250CONFIG_MTD_BLOCK=y 242CONFIG_MTD_BLOCK=y
251CONFIG_MTD_CFI=y 243CONFIG_MTD_CFI=y
252CONFIG_MTD_CFI_INTELEXT=y 244CONFIG_MTD_CFI_INTELEXT=y
@@ -257,7 +249,6 @@ CONFIG_MTD_PHYSMAP=y
257CONFIG_BLK_DEV_NBD=m 249CONFIG_BLK_DEV_NBD=m
258CONFIG_BLK_DEV_RAM=y 250CONFIG_BLK_DEV_RAM=y
259CONFIG_BLK_DEV_RAM_SIZE=65536 251CONFIG_BLK_DEV_RAM_SIZE=65536
260# CONFIG_MISC_DEVICES is not set
261CONFIG_SCSI=m 252CONFIG_SCSI=m
262CONFIG_BLK_DEV_SD=m 253CONFIG_BLK_DEV_SD=m
263CONFIG_CHR_DEV_SG=m 254CONFIG_CHR_DEV_SG=m
@@ -596,7 +587,6 @@ CONFIG_USB_STORAGE_SDDR55=m
596CONFIG_USB_STORAGE_JUMPSHOT=m 587CONFIG_USB_STORAGE_JUMPSHOT=m
597CONFIG_USB_STORAGE_ALAUDA=m 588CONFIG_USB_STORAGE_ALAUDA=m
598CONFIG_USB_STORAGE_KARMA=m 589CONFIG_USB_STORAGE_KARMA=m
599CONFIG_USB_LIBUSUAL=y
600CONFIG_USB_MDC800=m 590CONFIG_USB_MDC800=m
601CONFIG_USB_MICROTEK=m 591CONFIG_USB_MICROTEK=m
602CONFIG_USB_SERIAL=m 592CONFIG_USB_SERIAL=m
@@ -640,7 +630,6 @@ CONFIG_USB_ADUTUX=m
640CONFIG_USB_RIO500=m 630CONFIG_USB_RIO500=m
641CONFIG_USB_LEGOTOWER=m 631CONFIG_USB_LEGOTOWER=m
642CONFIG_USB_LCD=m 632CONFIG_USB_LCD=m
643CONFIG_USB_LED=m
644CONFIG_USB_CYPRESS_CY7C63=m 633CONFIG_USB_CYPRESS_CY7C63=m
645CONFIG_USB_CYTHERM=m 634CONFIG_USB_CYTHERM=m
646CONFIG_USB_IDMOUSE=m 635CONFIG_USB_IDMOUSE=m
diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
index 07d01827a973..5720ce23e9aa 100644
--- a/arch/mips/configs/nlm_xlp_defconfig
+++ b/arch/mips/configs/nlm_xlp_defconfig
@@ -6,7 +6,6 @@ CONFIG_KSM=y
6CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 6CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
7CONFIG_SMP=y 7CONFIG_SMP=y
8# CONFIG_SECCOMP is not set 8# CONFIG_SECCOMP is not set
9CONFIG_EXPERIMENTAL=y
10# CONFIG_LOCALVERSION_AUTO is not set 9# CONFIG_LOCALVERSION_AUTO is not set
11CONFIG_SYSVIPC=y 10CONFIG_SYSVIPC=y
12CONFIG_POSIX_MQUEUE=y 11CONFIG_POSIX_MQUEUE=y
@@ -183,14 +182,12 @@ CONFIG_IP_VS_SED=m
183CONFIG_IP_VS_NQ=m 182CONFIG_IP_VS_NQ=m
184CONFIG_IP_VS_FTP=m 183CONFIG_IP_VS_FTP=m
185CONFIG_NF_CONNTRACK_IPV4=m 184CONFIG_NF_CONNTRACK_IPV4=m
186CONFIG_IP_NF_QUEUE=m
187CONFIG_IP_NF_IPTABLES=m 185CONFIG_IP_NF_IPTABLES=m
188CONFIG_IP_NF_MATCH_AH=m 186CONFIG_IP_NF_MATCH_AH=m
189CONFIG_IP_NF_MATCH_ECN=m 187CONFIG_IP_NF_MATCH_ECN=m
190CONFIG_IP_NF_MATCH_TTL=m 188CONFIG_IP_NF_MATCH_TTL=m
191CONFIG_IP_NF_FILTER=m 189CONFIG_IP_NF_FILTER=m
192CONFIG_IP_NF_TARGET_REJECT=m 190CONFIG_IP_NF_TARGET_REJECT=m
193CONFIG_IP_NF_TARGET_ULOG=m
194CONFIG_NF_NAT=m 191CONFIG_NF_NAT=m
195CONFIG_IP_NF_TARGET_MASQUERADE=m 192CONFIG_IP_NF_TARGET_MASQUERADE=m
196CONFIG_IP_NF_TARGET_NETMAP=m 193CONFIG_IP_NF_TARGET_NETMAP=m
@@ -317,7 +314,6 @@ CONFIG_DEVTMPFS_MOUNT=y
317CONFIG_CONNECTOR=y 314CONFIG_CONNECTOR=y
318CONFIG_MTD=y 315CONFIG_MTD=y
319CONFIG_MTD_CMDLINE_PARTS=y 316CONFIG_MTD_CMDLINE_PARTS=y
320CONFIG_MTD_CHAR=y
321CONFIG_MTD_BLOCK=y 317CONFIG_MTD_BLOCK=y
322CONFIG_MTD_CFI=y 318CONFIG_MTD_CFI=y
323CONFIG_MTD_CFI_ADV_OPTIONS=y 319CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -607,7 +603,6 @@ CONFIG_CRYPTO_SEED=m
607CONFIG_CRYPTO_SERPENT=m 603CONFIG_CRYPTO_SERPENT=m
608CONFIG_CRYPTO_TEA=m 604CONFIG_CRYPTO_TEA=m
609CONFIG_CRYPTO_TWOFISH=m 605CONFIG_CRYPTO_TWOFISH=m
610CONFIG_CRYPTO_ZLIB=m
611CONFIG_CRYPTO_LZO=m 606CONFIG_CRYPTO_LZO=m
612CONFIG_CRC_CCITT=m 607CONFIG_CRC_CCITT=m
613CONFIG_CRC7=m 608CONFIG_CRC7=m
diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
index f59969acb724..fea56c535d92 100644
--- a/arch/mips/configs/nlm_xlr_defconfig
+++ b/arch/mips/configs/nlm_xlr_defconfig
@@ -7,7 +7,6 @@ CONFIG_NO_HZ=y
7CONFIG_HIGH_RES_TIMERS=y 7CONFIG_HIGH_RES_TIMERS=y
8CONFIG_PREEMPT_VOLUNTARY=y 8CONFIG_PREEMPT_VOLUNTARY=y
9CONFIG_KEXEC=y 9CONFIG_KEXEC=y
10CONFIG_EXPERIMENTAL=y
11CONFIG_CROSS_COMPILE="" 10CONFIG_CROSS_COMPILE=""
12# CONFIG_LOCALVERSION_AUTO is not set 11# CONFIG_LOCALVERSION_AUTO is not set
13CONFIG_SYSVIPC=y 12CONFIG_SYSVIPC=y
@@ -163,7 +162,6 @@ CONFIG_IP_VS_SED=m
163CONFIG_IP_VS_NQ=m 162CONFIG_IP_VS_NQ=m
164CONFIG_IP_VS_FTP=m 163CONFIG_IP_VS_FTP=m
165CONFIG_NF_CONNTRACK_IPV4=m 164CONFIG_NF_CONNTRACK_IPV4=m
166CONFIG_IP_NF_QUEUE=m
167CONFIG_IP_NF_IPTABLES=m 165CONFIG_IP_NF_IPTABLES=m
168CONFIG_IP_NF_MATCH_AH=m 166CONFIG_IP_NF_MATCH_AH=m
169CONFIG_IP_NF_MATCH_ECN=m 167CONFIG_IP_NF_MATCH_ECN=m
@@ -171,7 +169,6 @@ CONFIG_IP_NF_MATCH_TTL=m
171CONFIG_IP_NF_FILTER=m 169CONFIG_IP_NF_FILTER=m
172CONFIG_IP_NF_TARGET_REJECT=m 170CONFIG_IP_NF_TARGET_REJECT=m
173CONFIG_IP_NF_TARGET_LOG=m 171CONFIG_IP_NF_TARGET_LOG=m
174CONFIG_IP_NF_TARGET_ULOG=m
175CONFIG_NF_NAT=m 172CONFIG_NF_NAT=m
176CONFIG_IP_NF_TARGET_MASQUERADE=m 173CONFIG_IP_NF_TARGET_MASQUERADE=m
177CONFIG_IP_NF_TARGET_NETMAP=m 174CONFIG_IP_NF_TARGET_NETMAP=m
@@ -186,7 +183,6 @@ CONFIG_IP_NF_ARPTABLES=m
186CONFIG_IP_NF_ARPFILTER=m 183CONFIG_IP_NF_ARPFILTER=m
187CONFIG_IP_NF_ARP_MANGLE=m 184CONFIG_IP_NF_ARP_MANGLE=m
188CONFIG_NF_CONNTRACK_IPV6=m 185CONFIG_NF_CONNTRACK_IPV6=m
189CONFIG_IP6_NF_QUEUE=m
190CONFIG_IP6_NF_IPTABLES=m 186CONFIG_IP6_NF_IPTABLES=m
191CONFIG_IP6_NF_MATCH_AH=m 187CONFIG_IP6_NF_MATCH_AH=m
192CONFIG_IP6_NF_MATCH_EUI64=m 188CONFIG_IP6_NF_MATCH_EUI64=m
@@ -197,7 +193,6 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m
197CONFIG_IP6_NF_MATCH_MH=m 193CONFIG_IP6_NF_MATCH_MH=m
198CONFIG_IP6_NF_MATCH_RT=m 194CONFIG_IP6_NF_MATCH_RT=m
199CONFIG_IP6_NF_TARGET_HL=m 195CONFIG_IP6_NF_TARGET_HL=m
200CONFIG_IP6_NF_TARGET_LOG=m
201CONFIG_IP6_NF_FILTER=m 196CONFIG_IP6_NF_FILTER=m
202CONFIG_IP6_NF_TARGET_REJECT=m 197CONFIG_IP6_NF_TARGET_REJECT=m
203CONFIG_IP6_NF_MANGLE=m 198CONFIG_IP6_NF_MANGLE=m
@@ -308,7 +303,6 @@ CONFIG_BLK_DEV_OSD=m
308CONFIG_BLK_DEV_RAM=y 303CONFIG_BLK_DEV_RAM=y
309CONFIG_BLK_DEV_RAM_SIZE=65536 304CONFIG_BLK_DEV_RAM_SIZE=65536
310CONFIG_CDROM_PKTCDVD=y 305CONFIG_CDROM_PKTCDVD=y
311CONFIG_MISC_DEVICES=y
312CONFIG_RAID_ATTRS=m 306CONFIG_RAID_ATTRS=m
313CONFIG_SCSI=y 307CONFIG_SCSI=y
314CONFIG_BLK_DEV_SD=y 308CONFIG_BLK_DEV_SD=y
@@ -369,7 +363,6 @@ CONFIG_RTC_CLASS=y
369CONFIG_RTC_DRV_DS1374=y 363CONFIG_RTC_DRV_DS1374=y
370# CONFIG_HWMON is not set 364# CONFIG_HWMON is not set
371# CONFIG_VGA_CONSOLE is not set 365# CONFIG_VGA_CONSOLE is not set
372# CONFIG_HID_SUPPORT is not set
373# CONFIG_USB_SUPPORT is not set 366# CONFIG_USB_SUPPORT is not set
374CONFIG_UIO=y 367CONFIG_UIO=y
375CONFIG_UIO_PDRV=m 368CONFIG_UIO_PDRV=m
@@ -522,7 +515,6 @@ CONFIG_SCHEDSTATS=y
522CONFIG_TIMER_STATS=y 515CONFIG_TIMER_STATS=y
523CONFIG_DEBUG_INFO=y 516CONFIG_DEBUG_INFO=y
524CONFIG_DEBUG_MEMORY_INIT=y 517CONFIG_DEBUG_MEMORY_INIT=y
525CONFIG_SYSCTL_SYSCALL_CHECK=y
526CONFIG_SCHED_TRACER=y 518CONFIG_SCHED_TRACER=y
527CONFIG_BLK_DEV_IO_TRACE=y 519CONFIG_BLK_DEV_IO_TRACE=y
528CONFIG_KGDB=y 520CONFIG_KGDB=y
@@ -568,7 +560,6 @@ CONFIG_CRYPTO_SEED=m
568CONFIG_CRYPTO_SERPENT=m 560CONFIG_CRYPTO_SERPENT=m
569CONFIG_CRYPTO_TEA=m 561CONFIG_CRYPTO_TEA=m
570CONFIG_CRYPTO_TWOFISH=m 562CONFIG_CRYPTO_TWOFISH=m
571CONFIG_CRYPTO_ZLIB=m
572CONFIG_CRYPTO_LZO=m 563CONFIG_CRYPTO_LZO=m
573CONFIG_CRC_CCITT=m 564CONFIG_CRC_CCITT=m
574CONFIG_CRC7=m 565CONFIG_CRC7=m
diff --git a/arch/mips/configs/pnx8335_stb225_defconfig b/arch/mips/configs/pnx8335_stb225_defconfig
index c887066ecc2a..81b5eb89446c 100644
--- a/arch/mips/configs/pnx8335_stb225_defconfig
+++ b/arch/mips/configs/pnx8335_stb225_defconfig
@@ -5,7 +5,6 @@ CONFIG_HIGH_RES_TIMERS=y
5CONFIG_HZ_128=y 5CONFIG_HZ_128=y
6CONFIG_PREEMPT_VOLUNTARY=y 6CONFIG_PREEMPT_VOLUNTARY=y
7# CONFIG_SECCOMP is not set 7# CONFIG_SECCOMP is not set
8CONFIG_EXPERIMENTAL=y
9# CONFIG_LOCALVERSION_AUTO is not set 8# CONFIG_LOCALVERSION_AUTO is not set
10# CONFIG_SWAP is not set 9# CONFIG_SWAP is not set
11CONFIG_SYSVIPC=y 10CONFIG_SYSVIPC=y
@@ -27,12 +26,10 @@ CONFIG_IP_MULTICAST=y
27CONFIG_IP_PNP=y 26CONFIG_IP_PNP=y
28CONFIG_IP_PNP_DHCP=y 27CONFIG_IP_PNP_DHCP=y
29CONFIG_INET_AH=y 28CONFIG_INET_AH=y
30# CONFIG_INET_LRO is not set
31# CONFIG_IPV6 is not set 29# CONFIG_IPV6 is not set
32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33CONFIG_MTD=y 31CONFIG_MTD=y
34CONFIG_MTD_CMDLINE_PARTS=y 32CONFIG_MTD_CMDLINE_PARTS=y
35CONFIG_MTD_CHAR=y
36CONFIG_MTD_BLOCK=y 33CONFIG_MTD_BLOCK=y
37CONFIG_MTD_CFI=y 34CONFIG_MTD_CFI=y
38CONFIG_MTD_CFI_ADV_OPTIONS=y 35CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -41,15 +38,12 @@ CONFIG_MTD_CFI_GEOMETRY=y
41CONFIG_MTD_CFI_AMDSTD=y 38CONFIG_MTD_CFI_AMDSTD=y
42CONFIG_MTD_PHYSMAP=y 39CONFIG_MTD_PHYSMAP=y
43CONFIG_BLK_DEV_LOOP=y 40CONFIG_BLK_DEV_LOOP=y
44# CONFIG_MISC_DEVICES is not set
45CONFIG_BLK_DEV_SD=y 41CONFIG_BLK_DEV_SD=y
46# CONFIG_SCSI_LOWLEVEL is not set 42# CONFIG_SCSI_LOWLEVEL is not set
47CONFIG_ATA=y 43CONFIG_ATA=y
48CONFIG_NETDEVICES=y 44CONFIG_NETDEVICES=y
49CONFIG_NET_ETHERNET=y 45CONFIG_NET_ETHERNET=y
50CONFIG_MII=y 46CONFIG_MII=y
51# CONFIG_NETDEV_1000 is not set
52# CONFIG_NETDEV_10000 is not set
53# CONFIG_INPUT_MOUSEDEV is not set 47# CONFIG_INPUT_MOUSEDEV is not set
54CONFIG_INPUT_EVDEV=m 48CONFIG_INPUT_EVDEV=m
55CONFIG_INPUT_EVBUG=m 49CONFIG_INPUT_EVBUG=m
@@ -94,4 +88,3 @@ CONFIG_NLS_ASCII=m
94CONFIG_NLS_ISO8859_1=m 88CONFIG_NLS_ISO8859_1=m
95CONFIG_NLS_ISO8859_15=m 89CONFIG_NLS_ISO8859_15=m
96CONFIG_NLS_UTF8=m 90CONFIG_NLS_UTF8=m
97CONFIG_SYSCTL_SYSCALL_CHECK=y
diff --git a/arch/mips/configs/qi_lb60_defconfig b/arch/mips/configs/qi_lb60_defconfig
index d7bb8cce1068..3f1333517405 100644
--- a/arch/mips/configs/qi_lb60_defconfig
+++ b/arch/mips/configs/qi_lb60_defconfig
@@ -34,7 +34,6 @@ CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
34# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 34# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
35# CONFIG_INET_XFRM_MODE_TUNNEL is not set 35# CONFIG_INET_XFRM_MODE_TUNNEL is not set
36# CONFIG_INET_XFRM_MODE_BEET is not set 36# CONFIG_INET_XFRM_MODE_BEET is not set
37# CONFIG_INET_LRO is not set
38# CONFIG_INET_DIAG is not set 37# CONFIG_INET_DIAG is not set
39CONFIG_TCP_CONG_ADVANCED=y 38CONFIG_TCP_CONG_ADVANCED=y
40# CONFIG_TCP_CONG_BIC is not set 39# CONFIG_TCP_CONG_BIC is not set
@@ -109,7 +108,6 @@ CONFIG_USB_GADGET_DEBUG=y
109CONFIG_USB_ETH=y 108CONFIG_USB_ETH=y
110# CONFIG_USB_ETH_RNDIS is not set 109# CONFIG_USB_ETH_RNDIS is not set
111CONFIG_MMC=y 110CONFIG_MMC=y
112CONFIG_MMC_UNSAFE_RESUME=y
113# CONFIG_MMC_BLOCK_BOUNCE is not set 111# CONFIG_MMC_BLOCK_BOUNCE is not set
114CONFIG_MMC_JZ4740=y 112CONFIG_MMC_JZ4740=y
115CONFIG_RTC_CLASS=y 113CONFIG_RTC_CLASS=y
@@ -183,7 +181,6 @@ CONFIG_PANIC_ON_OOPS=y
183# CONFIG_FTRACE is not set 181# CONFIG_FTRACE is not set
184CONFIG_KGDB=y 182CONFIG_KGDB=y
185CONFIG_RUNTIME_DEBUG=y 183CONFIG_RUNTIME_DEBUG=y
186CONFIG_CRYPTO_ZLIB=y
187# CONFIG_CRYPTO_ANSI_CPRNG is not set 184# CONFIG_CRYPTO_ANSI_CPRNG is not set
188CONFIG_FONTS=y 185CONFIG_FONTS=y
189CONFIG_FONT_SUN8x16=y 186CONFIG_FONT_SUN8x16=y
diff --git a/arch/mips/configs/rb532_defconfig b/arch/mips/configs/rb532_defconfig
index 5d9d708e12e5..6fa56c6e53f5 100644
--- a/arch/mips/configs/rb532_defconfig
+++ b/arch/mips/configs/rb532_defconfig
@@ -3,7 +3,6 @@ CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y 3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_HZ_100=y 4CONFIG_HZ_100=y
5# CONFIG_SECCOMP is not set 5# CONFIG_SECCOMP is not set
6CONFIG_EXPERIMENTAL=y
7# CONFIG_LOCALVERSION_AUTO is not set 6# CONFIG_LOCALVERSION_AUTO is not set
8CONFIG_SYSVIPC=y 7CONFIG_SYSVIPC=y
9CONFIG_BSD_PROCESS_ACCT=y 8CONFIG_BSD_PROCESS_ACCT=y
@@ -39,7 +38,6 @@ CONFIG_SYN_COOKIES=y
39# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 38# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
40# CONFIG_INET_XFRM_MODE_TUNNEL is not set 39# CONFIG_INET_XFRM_MODE_TUNNEL is not set
41# CONFIG_INET_XFRM_MODE_BEET is not set 40# CONFIG_INET_XFRM_MODE_BEET is not set
42# CONFIG_INET_LRO is not set
43CONFIG_INET_DIAG=m 41CONFIG_INET_DIAG=m
44CONFIG_TCP_CONG_ADVANCED=y 42CONFIG_TCP_CONG_ADVANCED=y
45CONFIG_TCP_CONG_CUBIC=m 43CONFIG_TCP_CONG_CUBIC=m
@@ -114,7 +112,6 @@ CONFIG_NET_CLS_IND=y
114CONFIG_HAMRADIO=y 112CONFIG_HAMRADIO=y
115CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 113CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
116CONFIG_MTD=y 114CONFIG_MTD=y
117CONFIG_MTD_CHAR=y
118CONFIG_MTD_BLOCK=y 115CONFIG_MTD_BLOCK=y
119CONFIG_MTD_BLOCK2MTD=y 116CONFIG_MTD_BLOCK2MTD=y
120CONFIG_MTD_NAND=y 117CONFIG_MTD_NAND=y
@@ -129,8 +126,6 @@ CONFIG_NET_ETHERNET=y
129CONFIG_KORINA=y 126CONFIG_KORINA=y
130CONFIG_NET_PCI=y 127CONFIG_NET_PCI=y
131CONFIG_VIA_RHINE=y 128CONFIG_VIA_RHINE=y
132# CONFIG_NETDEV_1000 is not set
133# CONFIG_NETDEV_10000 is not set
134CONFIG_ATMEL=m 129CONFIG_ATMEL=m
135CONFIG_PPP=m 130CONFIG_PPP=m
136CONFIG_PPP_MULTILINK=y 131CONFIG_PPP_MULTILINK=y
@@ -183,7 +178,6 @@ CONFIG_BSD_DISKLABEL=y
183CONFIG_STRIP_ASM_SYMS=y 178CONFIG_STRIP_ASM_SYMS=y
184CONFIG_CRYPTO=y 179CONFIG_CRYPTO=y
185CONFIG_CRYPTO_TEST=m 180CONFIG_CRYPTO_TEST=m
186CONFIG_CRYPTO_ZLIB=y
187# CONFIG_CRYPTO_HW is not set 181# CONFIG_CRYPTO_HW is not set
188CONFIG_CRC16=m 182CONFIG_CRC16=m
189CONFIG_LIBCRC32C=m 183CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/rbtx49xx_defconfig b/arch/mips/configs/rbtx49xx_defconfig
index 43d55e5abacb..fb195e29e449 100644
--- a/arch/mips/configs/rbtx49xx_defconfig
+++ b/arch/mips/configs/rbtx49xx_defconfig
@@ -31,12 +31,10 @@ CONFIG_IP_PNP=y
31# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 31# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32# CONFIG_INET_XFRM_MODE_TUNNEL is not set 32# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33# CONFIG_INET_XFRM_MODE_BEET is not set 33# CONFIG_INET_XFRM_MODE_BEET is not set
34# CONFIG_INET_LRO is not set
35# CONFIG_IPV6 is not set 34# CONFIG_IPV6 is not set
36# CONFIG_WIRELESS is not set 35# CONFIG_WIRELESS is not set
37CONFIG_MTD=y 36CONFIG_MTD=y
38CONFIG_MTD_CMDLINE_PARTS=y 37CONFIG_MTD_CMDLINE_PARTS=y
39CONFIG_MTD_CHAR=y
40CONFIG_MTD_BLOCK=m 38CONFIG_MTD_BLOCK=m
41CONFIG_MTD_BLOCK_RO=m 39CONFIG_MTD_BLOCK_RO=m
42CONFIG_MTD_CFI=y 40CONFIG_MTD_CFI=y
@@ -50,7 +48,6 @@ CONFIG_MTD_NAND_TXX9NDFMC=m
50CONFIG_BLK_DEV_LOOP=y 48CONFIG_BLK_DEV_LOOP=y
51CONFIG_BLK_DEV_RAM=y 49CONFIG_BLK_DEV_RAM=y
52CONFIG_BLK_DEV_RAM_SIZE=8192 50CONFIG_BLK_DEV_RAM_SIZE=8192
53# CONFIG_MISC_DEVICES is not set
54CONFIG_IDE=y 51CONFIG_IDE=y
55CONFIG_BLK_DEV_IDE_TX4938=y 52CONFIG_BLK_DEV_IDE_TX4938=y
56CONFIG_BLK_DEV_IDE_TX4939=y 53CONFIG_BLK_DEV_IDE_TX4939=y
@@ -60,8 +57,6 @@ CONFIG_SMC91X=y
60CONFIG_NE2000=y 57CONFIG_NE2000=y
61CONFIG_NET_PCI=y 58CONFIG_NET_PCI=y
62CONFIG_TC35815=y 59CONFIG_TC35815=y
63# CONFIG_NETDEV_1000 is not set
64# CONFIG_NETDEV_10000 is not set
65# CONFIG_WLAN is not set 60# CONFIG_WLAN is not set
66# CONFIG_INPUT is not set 61# CONFIG_INPUT is not set
67# CONFIG_SERIO is not set 62# CONFIG_SERIO is not set
@@ -108,5 +103,3 @@ CONFIG_NFS_V3=y
108CONFIG_ROOT_NFS=y 103CONFIG_ROOT_NFS=y
109CONFIG_STRIP_ASM_SYMS=y 104CONFIG_STRIP_ASM_SYMS=y
110CONFIG_DEBUG_FS=y 105CONFIG_DEBUG_FS=y
111# CONFIG_RCU_CPU_STALL_DETECTOR is not set
112CONFIG_SYSCTL_SYSCALL_CHECK=y
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index c2b4e3f33a73..99679e514042 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -3,7 +3,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y
3CONFIG_ARC_CONSOLE=y 3CONFIG_ARC_CONSOLE=y
4CONFIG_HZ_1000=y 4CONFIG_HZ_1000=y
5CONFIG_PREEMPT_VOLUNTARY=y 5CONFIG_PREEMPT_VOLUNTARY=y
6CONFIG_EXPERIMENTAL=y
7CONFIG_SYSVIPC=y 6CONFIG_SYSVIPC=y
8CONFIG_POSIX_MQUEUE=y 7CONFIG_POSIX_MQUEUE=y
9CONFIG_BSD_PROCESS_ACCT=y 8CONFIG_BSD_PROCESS_ACCT=y
@@ -94,7 +93,6 @@ CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
94CONFIG_NETFILTER_XT_MATCH_STRING=m 93CONFIG_NETFILTER_XT_MATCH_STRING=m
95CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 94CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
96CONFIG_NF_CONNTRACK_IPV4=m 95CONFIG_NF_CONNTRACK_IPV4=m
97CONFIG_IP_NF_QUEUE=m
98CONFIG_IP_NF_IPTABLES=m 96CONFIG_IP_NF_IPTABLES=m
99CONFIG_IP_NF_MATCH_ADDRTYPE=m 97CONFIG_IP_NF_MATCH_ADDRTYPE=m
100CONFIG_IP_NF_MATCH_AH=m 98CONFIG_IP_NF_MATCH_AH=m
@@ -103,7 +101,6 @@ CONFIG_IP_NF_MATCH_TTL=m
103CONFIG_IP_NF_FILTER=m 101CONFIG_IP_NF_FILTER=m
104CONFIG_IP_NF_TARGET_REJECT=m 102CONFIG_IP_NF_TARGET_REJECT=m
105CONFIG_IP_NF_TARGET_LOG=m 103CONFIG_IP_NF_TARGET_LOG=m
106CONFIG_IP_NF_TARGET_ULOG=m
107CONFIG_NF_NAT=m 104CONFIG_NF_NAT=m
108CONFIG_IP_NF_TARGET_MASQUERADE=m 105CONFIG_IP_NF_TARGET_MASQUERADE=m
109CONFIG_IP_NF_TARGET_NETMAP=m 106CONFIG_IP_NF_TARGET_NETMAP=m
@@ -118,7 +115,6 @@ CONFIG_IP_NF_ARPTABLES=m
118CONFIG_IP_NF_ARPFILTER=m 115CONFIG_IP_NF_ARPFILTER=m
119CONFIG_IP_NF_ARP_MANGLE=m 116CONFIG_IP_NF_ARP_MANGLE=m
120CONFIG_NF_CONNTRACK_IPV6=m 117CONFIG_NF_CONNTRACK_IPV6=m
121CONFIG_IP6_NF_QUEUE=m
122CONFIG_IP6_NF_IPTABLES=m 118CONFIG_IP6_NF_IPTABLES=m
123CONFIG_IP6_NF_MATCH_AH=m 119CONFIG_IP6_NF_MATCH_AH=m
124CONFIG_IP6_NF_MATCH_EUI64=m 120CONFIG_IP6_NF_MATCH_EUI64=m
@@ -129,7 +125,6 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m
129CONFIG_IP6_NF_MATCH_MH=m 125CONFIG_IP6_NF_MATCH_MH=m
130CONFIG_IP6_NF_MATCH_RT=m 126CONFIG_IP6_NF_MATCH_RT=m
131CONFIG_IP6_NF_TARGET_HL=m 127CONFIG_IP6_NF_TARGET_HL=m
132CONFIG_IP6_NF_TARGET_LOG=m
133CONFIG_IP6_NF_FILTER=m 128CONFIG_IP6_NF_FILTER=m
134CONFIG_IP6_NF_TARGET_REJECT=m 129CONFIG_IP6_NF_TARGET_REJECT=m
135CONFIG_IP6_NF_MANGLE=m 130CONFIG_IP6_NF_MANGLE=m
@@ -214,7 +209,6 @@ CONFIG_BLK_DEV_LOOP=m
214CONFIG_BLK_DEV_CRYPTOLOOP=m 209CONFIG_BLK_DEV_CRYPTOLOOP=m
215CONFIG_BLK_DEV_NBD=m 210CONFIG_BLK_DEV_NBD=m
216CONFIG_BLK_DEV_SX8=m 211CONFIG_BLK_DEV_SX8=m
217CONFIG_BLK_DEV_UB=m
218CONFIG_BLK_DEV_RAM=m 212CONFIG_BLK_DEV_RAM=m
219CONFIG_CDROM_PKTCDVD=m 213CONFIG_CDROM_PKTCDVD=m
220CONFIG_ATA_OVER_ETH=m 214CONFIG_ATA_OVER_ETH=m
@@ -353,7 +347,6 @@ CONFIG_USB_SERIAL_OMNINET=m
353CONFIG_USB_RIO500=m 347CONFIG_USB_RIO500=m
354CONFIG_USB_LEGOTOWER=m 348CONFIG_USB_LEGOTOWER=m
355CONFIG_USB_LCD=m 349CONFIG_USB_LCD=m
356CONFIG_USB_LED=m
357CONFIG_USB_CYTHERM=m 350CONFIG_USB_CYTHERM=m
358CONFIG_USB_SISUSBVGA=m 351CONFIG_USB_SISUSBVGA=m
359CONFIG_USB_LD=m 352CONFIG_USB_LD=m
@@ -366,7 +359,6 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
366CONFIG_REISERFS_FS_SECURITY=y 359CONFIG_REISERFS_FS_SECURITY=y
367CONFIG_XFS_FS=m 360CONFIG_XFS_FS=m
368CONFIG_XFS_QUOTA=y 361CONFIG_XFS_QUOTA=y
369CONFIG_AUTOFS_FS=m
370CONFIG_AUTOFS4_FS=m 362CONFIG_AUTOFS4_FS=m
371CONFIG_FUSE_FS=m 363CONFIG_FUSE_FS=m
372CONFIG_ISO9660_FS=m 364CONFIG_ISO9660_FS=m
diff --git a/arch/mips/configs/rt305x_defconfig b/arch/mips/configs/rt305x_defconfig
index d14ae2fa7d13..c695b7b1c4ae 100644
--- a/arch/mips/configs/rt305x_defconfig
+++ b/arch/mips/configs/rt305x_defconfig
@@ -5,7 +5,6 @@ CONFIG_CPU_MIPS32_R2=y
5# CONFIG_CROSS_MEMORY_ATTACH is not set 5# CONFIG_CROSS_MEMORY_ATTACH is not set
6CONFIG_HZ_100=y 6CONFIG_HZ_100=y
7# CONFIG_SECCOMP is not set 7# CONFIG_SECCOMP is not set
8CONFIG_EXPERIMENTAL=y
9# CONFIG_LOCALVERSION_AUTO is not set 8# CONFIG_LOCALVERSION_AUTO is not set
10CONFIG_SYSVIPC=y 9CONFIG_SYSVIPC=y
11CONFIG_HIGH_RES_TIMERS=y 10CONFIG_HIGH_RES_TIMERS=y
@@ -44,7 +43,6 @@ CONFIG_SYN_COOKIES=y
44# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 43# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
45# CONFIG_INET_XFRM_MODE_TUNNEL is not set 44# CONFIG_INET_XFRM_MODE_TUNNEL is not set
46# CONFIG_INET_XFRM_MODE_BEET is not set 45# CONFIG_INET_XFRM_MODE_BEET is not set
47# CONFIG_INET_LRO is not set
48# CONFIG_INET_DIAG is not set 46# CONFIG_INET_DIAG is not set
49CONFIG_TCP_CONG_ADVANCED=y 47CONFIG_TCP_CONG_ADVANCED=y
50# CONFIG_TCP_CONG_BIC is not set 48# CONFIG_TCP_CONG_BIC is not set
diff --git a/arch/mips/configs/sb1250_swarm_defconfig b/arch/mips/configs/sb1250_swarm_defconfig
index 7fca09fedb59..c724bdd6a7e6 100644
--- a/arch/mips/configs/sb1250_swarm_defconfig
+++ b/arch/mips/configs/sb1250_swarm_defconfig
@@ -4,7 +4,6 @@ CONFIG_64BIT=y
4CONFIG_SMP=y 4CONFIG_SMP=y
5CONFIG_HIGH_RES_TIMERS=y 5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_HZ_1000=y 6CONFIG_HZ_1000=y
7CONFIG_EXPERIMENTAL=y
8CONFIG_SYSVIPC=y 7CONFIG_SYSVIPC=y
9CONFIG_LOG_BUF_SHIFT=15 8CONFIG_LOG_BUF_SHIFT=15
10CONFIG_CGROUPS=y 9CONFIG_CGROUPS=y
diff --git a/arch/mips/configs/tb0219_defconfig b/arch/mips/configs/tb0219_defconfig
index 11f51505d562..4041597e3170 100644
--- a/arch/mips/configs/tb0219_defconfig
+++ b/arch/mips/configs/tb0219_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_TANBAC_TB0219=y 2CONFIG_TANBAC_TB0219=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6CONFIG_SYSFS_DEPRECATED_V2=y 5CONFIG_SYSFS_DEPRECATED_V2=y
@@ -31,7 +30,6 @@ CONFIG_SYN_COOKIES=y
31# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 30# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32# CONFIG_INET_XFRM_MODE_TUNNEL is not set 31# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33# CONFIG_INET_XFRM_MODE_BEET is not set 32# CONFIG_INET_XFRM_MODE_BEET is not set
34# CONFIG_INET_LRO is not set
35# CONFIG_IPV6 is not set 33# CONFIG_IPV6 is not set
36CONFIG_NETWORK_SECMARK=y 34CONFIG_NETWORK_SECMARK=y
37CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 35CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@@ -40,7 +38,6 @@ CONFIG_BLK_DEV_LOOP=m
40CONFIG_BLK_DEV_NBD=m 38CONFIG_BLK_DEV_NBD=m
41CONFIG_BLK_DEV_RAM=y 39CONFIG_BLK_DEV_RAM=y
42CONFIG_BLK_DEV_XIP=y 40CONFIG_BLK_DEV_XIP=y
43# CONFIG_MISC_DEVICES is not set
44CONFIG_NETDEVICES=y 41CONFIG_NETDEVICES=y
45CONFIG_PHYLIB=m 42CONFIG_PHYLIB=m
46CONFIG_MARVELL_PHY=m 43CONFIG_MARVELL_PHY=m
@@ -57,7 +54,6 @@ CONFIG_VIA_RHINE=y
57CONFIG_VIA_RHINE_MMIO=y 54CONFIG_VIA_RHINE_MMIO=y
58CONFIG_R8169=y 55CONFIG_R8169=y
59CONFIG_VIA_VELOCITY=y 56CONFIG_VIA_VELOCITY=y
60# CONFIG_NETDEV_10000 is not set
61# CONFIG_INPUT_MOUSEDEV is not set 57# CONFIG_INPUT_MOUSEDEV is not set
62# CONFIG_INPUT_KEYBOARD is not set 58# CONFIG_INPUT_KEYBOARD is not set
63# CONFIG_INPUT_MOUSE is not set 59# CONFIG_INPUT_MOUSE is not set
@@ -70,7 +66,6 @@ CONFIG_SERIAL_VR41XX_CONSOLE=y
70CONFIG_GPIO_TB0219=y 66CONFIG_GPIO_TB0219=y
71# CONFIG_HWMON is not set 67# CONFIG_HWMON is not set
72# CONFIG_VGA_CONSOLE is not set 68# CONFIG_VGA_CONSOLE is not set
73# CONFIG_HID_SUPPORT is not set
74CONFIG_USB=m 69CONFIG_USB=m
75CONFIG_USB_MON=m 70CONFIG_USB_MON=m
76CONFIG_USB_EHCI_HCD=m 71CONFIG_USB_EHCI_HCD=m
@@ -91,6 +86,5 @@ CONFIG_NFS_V3=y
91CONFIG_ROOT_NFS=y 86CONFIG_ROOT_NFS=y
92CONFIG_NFSD=y 87CONFIG_NFSD=y
93CONFIG_NFSD_V3=y 88CONFIG_NFSD_V3=y
94CONFIG_SYSCTL_SYSCALL_CHECK=y
95CONFIG_CMDLINE_BOOL=y 89CONFIG_CMDLINE_BOOL=y
96CONFIG_CMDLINE="cca=3 mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs" 90CONFIG_CMDLINE="cca=3 mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index 9327b3af32cd..565f0441c50d 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_TANBAC_TB0226=y 2CONFIG_TANBAC_TB0226=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6CONFIG_SYSFS_DEPRECATED_V2=y 5CONFIG_SYSFS_DEPRECATED_V2=y
@@ -29,7 +28,6 @@ CONFIG_SYN_COOKIES=y
29# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 28# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
30# CONFIG_INET_XFRM_MODE_TUNNEL is not set 29# CONFIG_INET_XFRM_MODE_TUNNEL is not set
31# CONFIG_INET_XFRM_MODE_BEET is not set 30# CONFIG_INET_XFRM_MODE_BEET is not set
32# CONFIG_INET_LRO is not set
33# CONFIG_IPV6 is not set 31# CONFIG_IPV6 is not set
34CONFIG_NETWORK_SECMARK=y 32CONFIG_NETWORK_SECMARK=y
35CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@@ -37,7 +35,6 @@ CONFIG_BLK_DEV_LOOP=m
37CONFIG_BLK_DEV_NBD=m 35CONFIG_BLK_DEV_NBD=m
38CONFIG_BLK_DEV_RAM=y 36CONFIG_BLK_DEV_RAM=y
39CONFIG_BLK_DEV_XIP=y 37CONFIG_BLK_DEV_XIP=y
40# CONFIG_MISC_DEVICES is not set
41CONFIG_SCSI=y 38CONFIG_SCSI=y
42CONFIG_BLK_DEV_SD=y 39CONFIG_BLK_DEV_SD=y
43CONFIG_SCSI_MULTI_LUN=y 40CONFIG_SCSI_MULTI_LUN=y
@@ -49,8 +46,6 @@ CONFIG_NETDEVICES=y
49CONFIG_NET_ETHERNET=y 46CONFIG_NET_ETHERNET=y
50CONFIG_NET_PCI=y 47CONFIG_NET_PCI=y
51CONFIG_E100=y 48CONFIG_E100=y
52# CONFIG_NETDEV_1000 is not set
53# CONFIG_NETDEV_10000 is not set
54CONFIG_USB_CATC=m 49CONFIG_USB_CATC=m
55CONFIG_USB_KAWETH=m 50CONFIG_USB_KAWETH=m
56CONFIG_USB_PEGASUS=m 51CONFIG_USB_PEGASUS=m
@@ -66,7 +61,6 @@ CONFIG_SERIAL_VR41XX_CONSOLE=y
66# CONFIG_HW_RANDOM is not set 61# CONFIG_HW_RANDOM is not set
67# CONFIG_HWMON is not set 62# CONFIG_HWMON is not set
68# CONFIG_VGA_CONSOLE is not set 63# CONFIG_VGA_CONSOLE is not set
69# CONFIG_HID_SUPPORT is not set
70CONFIG_USB=y 64CONFIG_USB=y
71CONFIG_USB_EHCI_HCD=y 65CONFIG_USB_EHCI_HCD=y
72# CONFIG_USB_EHCI_TT_NEWSCHED is not set 66# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -87,7 +81,6 @@ CONFIG_NFS_V3=y
87CONFIG_ROOT_NFS=y 81CONFIG_ROOT_NFS=y
88CONFIG_NFSD=m 82CONFIG_NFSD=m
89CONFIG_NFSD_V3=y 83CONFIG_NFSD_V3=y
90CONFIG_SYSCTL_SYSCALL_CHECK=y
91CONFIG_CMDLINE_BOOL=y 84CONFIG_CMDLINE_BOOL=y
92CONFIG_CMDLINE="cca=3 mem=32M console=ttyVR0,115200" 85CONFIG_CMDLINE="cca=3 mem=32M console=ttyVR0,115200"
93CONFIG_CRC32=m 86CONFIG_CRC32=m
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
index a967289b7970..a702be602fb9 100644
--- a/arch/mips/configs/tb0287_defconfig
+++ b/arch/mips/configs/tb0287_defconfig
@@ -1,5 +1,4 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
4CONFIG_LOG_BUF_SHIFT=14 3CONFIG_LOG_BUF_SHIFT=14
5CONFIG_SYSFS_DEPRECATED_V2=y 4CONFIG_SYSFS_DEPRECATED_V2=y
@@ -31,7 +30,6 @@ CONFIG_SYN_COOKIES=y
31# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 30# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32# CONFIG_INET_XFRM_MODE_TUNNEL is not set 31# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33# CONFIG_INET_XFRM_MODE_BEET is not set 32# CONFIG_INET_XFRM_MODE_BEET is not set
34# CONFIG_INET_LRO is not set
35CONFIG_TCP_CONG_ADVANCED=y 33CONFIG_TCP_CONG_ADVANCED=y
36CONFIG_TCP_CONG_BIC=y 34CONFIG_TCP_CONG_BIC=y
37CONFIG_TCP_CONG_CUBIC=m 35CONFIG_TCP_CONG_CUBIC=m
@@ -43,7 +41,6 @@ CONFIG_BLK_DEV_LOOP=m
43CONFIG_BLK_DEV_NBD=m 41CONFIG_BLK_DEV_NBD=m
44CONFIG_BLK_DEV_RAM=y 42CONFIG_BLK_DEV_RAM=y
45CONFIG_BLK_DEV_XIP=y 43CONFIG_BLK_DEV_XIP=y
46# CONFIG_MISC_DEVICES is not set
47CONFIG_BLK_DEV_SD=y 44CONFIG_BLK_DEV_SD=y
48CONFIG_SCSI_SCAN_ASYNC=y 45CONFIG_SCSI_SCAN_ASYNC=y
49# CONFIG_SCSI_LOWLEVEL is not set 46# CONFIG_SCSI_LOWLEVEL is not set
@@ -64,7 +61,6 @@ CONFIG_VIA_RHINE=y
64CONFIG_VIA_RHINE_MMIO=y 61CONFIG_VIA_RHINE_MMIO=y
65CONFIG_R8169=y 62CONFIG_R8169=y
66CONFIG_VIA_VELOCITY=y 63CONFIG_VIA_VELOCITY=y
67# CONFIG_NETDEV_10000 is not set
68# CONFIG_INPUT_KEYBOARD is not set 64# CONFIG_INPUT_KEYBOARD is not set
69# CONFIG_INPUT_MOUSE is not set 65# CONFIG_INPUT_MOUSE is not set
70# CONFIG_SERIO is not set 66# CONFIG_SERIO is not set
@@ -76,7 +72,6 @@ CONFIG_SERIAL_VR41XX_CONSOLE=y
76CONFIG_GPIO_VR41XX=y 72CONFIG_GPIO_VR41XX=y
77# CONFIG_HWMON is not set 73# CONFIG_HWMON is not set
78CONFIG_MFD_SM501=y 74CONFIG_MFD_SM501=y
79CONFIG_VIDEO_OUTPUT_CONTROL=m
80CONFIG_FB=y 75CONFIG_FB=y
81CONFIG_FB_SM501=y 76CONFIG_FB_SM501=y
82# CONFIG_VGA_CONSOLE is not set 77# CONFIG_VGA_CONSOLE is not set
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index ee4b2be43c44..a84eac409c9c 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -1,6 +1,5 @@
1CONFIG_MACH_VR41XX=y 1CONFIG_MACH_VR41XX=y
2CONFIG_IBM_WORKPAD=y 2CONFIG_IBM_WORKPAD=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
6# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -28,13 +27,10 @@ CONFIG_IP_MULTICAST=y
28# CONFIG_IPV6 is not set 27# CONFIG_IPV6 is not set
29CONFIG_NETWORK_SECMARK=y 28CONFIG_NETWORK_SECMARK=y
30CONFIG_BLK_DEV_RAM=m 29CONFIG_BLK_DEV_RAM=m
31# CONFIG_MISC_DEVICES is not set
32CONFIG_IDE=y 30CONFIG_IDE=y
33CONFIG_BLK_DEV_IDECS=m 31CONFIG_BLK_DEV_IDECS=m
34CONFIG_IDE_GENERIC=y 32CONFIG_IDE_GENERIC=y
35CONFIG_NETDEVICES=y 33CONFIG_NETDEVICES=y
36# CONFIG_NETDEV_1000 is not set
37# CONFIG_NETDEV_10000 is not set
38CONFIG_NET_PCMCIA=y 34CONFIG_NET_PCMCIA=y
39CONFIG_PCMCIA_3C589=m 35CONFIG_PCMCIA_3C589=m
40CONFIG_PCMCIA_3C574=m 36CONFIG_PCMCIA_3C574=m
diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig
index a606b3f9196c..51ffbbaddee2 100644
--- a/arch/mips/generic/Kconfig
+++ b/arch/mips/generic/Kconfig
@@ -9,11 +9,31 @@ config LEGACY_BOARDS
9 kernel is booted without being provided with an FDT via the UHI 9 kernel is booted without being provided with an FDT via the UHI
10 boot protocol. 10 boot protocol.
11 11
12config YAMON_DT_SHIM
13 bool
14 help
15 Select this from your board if the board uses the YAMON bootloader
16 and you wish to include code which helps translate various
17 YAMON-provided environment variables into a device tree properties.
18
19comment "Legacy (non-UHI/non-FIT) Boards"
20
12config LEGACY_BOARD_SEAD3 21config LEGACY_BOARD_SEAD3
13 bool "Support MIPS SEAD-3 boards" 22 bool "Support MIPS SEAD-3 boards"
14 select LEGACY_BOARDS 23 select LEGACY_BOARDS
24 select YAMON_DT_SHIM
15 help 25 help
16 Enable this to include support for booting on MIPS SEAD-3 FPGA-based 26 Enable this to include support for booting on MIPS SEAD-3 FPGA-based
17 development boards, which boot using a legacy boot protocol. 27 development boards, which boot using a legacy boot protocol.
18 28
29comment "FIT/UHI Boards"
30
31config FIT_IMAGE_FDT_BOSTON
32 bool "Include FDT for MIPS Boston boards"
33 help
34 Enable this to include the FDT for the MIPS Boston development board
35 from Imagination Technologies in the FIT kernel image. You should
36 enable this if you wish to boot on a MIPS Boston board, as it is
37 expected by the bootloader.
38
19endif 39endif
diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile
index acb9b6d62b16..56b3ea565ed9 100644
--- a/arch/mips/generic/Makefile
+++ b/arch/mips/generic/Makefile
@@ -12,5 +12,6 @@ obj-y += init.o
12obj-y += irq.o 12obj-y += irq.o
13obj-y += proc.o 13obj-y += proc.o
14 14
15obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o
15obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o 16obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o
16obj-$(CONFIG_KEXEC) += kexec.o 17obj-$(CONFIG_KEXEC) += kexec.o
diff --git a/arch/mips/generic/board-sead3.c b/arch/mips/generic/board-sead3.c
index f4ae0584a33b..f109a6b9fdd0 100644
--- a/arch/mips/generic/board-sead3.c
+++ b/arch/mips/generic/board-sead3.c
@@ -13,10 +13,12 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/libfdt.h> 14#include <linux/libfdt.h>
15#include <linux/printk.h> 15#include <linux/printk.h>
16#include <linux/sizes.h>
16 17
17#include <asm/fw/fw.h> 18#include <asm/fw/fw.h>
18#include <asm/io.h> 19#include <asm/io.h>
19#include <asm/machine.h> 20#include <asm/machine.h>
21#include <asm/yamon-dt.h>
20 22
21#define SEAD_CONFIG CKSEG1ADDR(0x1b100110) 23#define SEAD_CONFIG CKSEG1ADDR(0x1b100110)
22#define SEAD_CONFIG_GIC_PRESENT BIT(1) 24#define SEAD_CONFIG_GIC_PRESENT BIT(1)
@@ -25,6 +27,15 @@
25#define MIPS_REVISION_MACHINE (0xf << 4) 27#define MIPS_REVISION_MACHINE (0xf << 4)
26#define MIPS_REVISION_MACHINE_SEAD3 (0x4 << 4) 28#define MIPS_REVISION_MACHINE_SEAD3 (0x4 << 4)
27 29
30/*
31 * Maximum 384MB RAM at physical address 0, preceding any I/O.
32 */
33static struct yamon_mem_region mem_regions[] __initdata = {
34 /* start size */
35 { 0, SZ_256M + SZ_128M },
36 {}
37};
38
28static __init bool sead3_detect(void) 39static __init bool sead3_detect(void)
29{ 40{
30 uint32_t rev; 41 uint32_t rev;
@@ -33,96 +44,9 @@ static __init bool sead3_detect(void)
33 return (rev & MIPS_REVISION_MACHINE) == MIPS_REVISION_MACHINE_SEAD3; 44 return (rev & MIPS_REVISION_MACHINE) == MIPS_REVISION_MACHINE_SEAD3;
34} 45}
35 46
36static __init int append_cmdline(void *fdt)
37{
38 int err, chosen_off;
39
40 /* find or add chosen node */
41 chosen_off = fdt_path_offset(fdt, "/chosen");
42 if (chosen_off == -FDT_ERR_NOTFOUND)
43 chosen_off = fdt_path_offset(fdt, "/chosen@0");
44 if (chosen_off == -FDT_ERR_NOTFOUND)
45 chosen_off = fdt_add_subnode(fdt, 0, "chosen");
46 if (chosen_off < 0) {
47 pr_err("Unable to find or add DT chosen node: %d\n",
48 chosen_off);
49 return chosen_off;
50 }
51
52 err = fdt_setprop_string(fdt, chosen_off, "bootargs", fw_getcmdline());
53 if (err) {
54 pr_err("Unable to set bootargs property: %d\n", err);
55 return err;
56 }
57
58 return 0;
59}
60
61static __init int append_memory(void *fdt) 47static __init int append_memory(void *fdt)
62{ 48{
63 unsigned long phys_memsize, memsize; 49 return yamon_dt_append_memory(fdt, mem_regions);
64 __be32 mem_array[2];
65 int err, mem_off;
66 char *var;
67
68 /* find memory size from the bootloader environment */
69 var = fw_getenv("memsize");
70 if (var) {
71 err = kstrtoul(var, 0, &phys_memsize);
72 if (err) {
73 pr_err("Failed to read memsize env variable '%s'\n",
74 var);
75 return -EINVAL;
76 }
77 } else {
78 pr_warn("The bootloader didn't provide memsize: defaulting to 32MB\n");
79 phys_memsize = 32 << 20;
80 }
81
82 /* default to using all available RAM */
83 memsize = phys_memsize;
84
85 /* allow the user to override the usable memory */
86 var = strstr(arcs_cmdline, "memsize=");
87 if (var)
88 memsize = memparse(var + strlen("memsize="), NULL);
89
90 /* if the user says there's more RAM than we thought, believe them */
91 phys_memsize = max_t(unsigned long, phys_memsize, memsize);
92
93 /* find or add a memory node */
94 mem_off = fdt_path_offset(fdt, "/memory");
95 if (mem_off == -FDT_ERR_NOTFOUND)
96 mem_off = fdt_add_subnode(fdt, 0, "memory");
97 if (mem_off < 0) {
98 pr_err("Unable to find or add memory DT node: %d\n", mem_off);
99 return mem_off;
100 }
101
102 err = fdt_setprop_string(fdt, mem_off, "device_type", "memory");
103 if (err) {
104 pr_err("Unable to set memory node device_type: %d\n", err);
105 return err;
106 }
107
108 mem_array[0] = 0;
109 mem_array[1] = cpu_to_be32(phys_memsize);
110 err = fdt_setprop(fdt, mem_off, "reg", mem_array, sizeof(mem_array));
111 if (err) {
112 pr_err("Unable to set memory regs property: %d\n", err);
113 return err;
114 }
115
116 mem_array[0] = 0;
117 mem_array[1] = cpu_to_be32(memsize);
118 err = fdt_setprop(fdt, mem_off, "linux,usable-memory",
119 mem_array, sizeof(mem_array));
120 if (err) {
121 pr_err("Unable to set linux,usable-memory property: %d\n", err);
122 return err;
123 }
124
125 return 0;
126} 50}
127 51
128static __init int remove_gic(void *fdt) 52static __init int remove_gic(void *fdt)
@@ -163,14 +87,16 @@ static __init int remove_gic(void *fdt)
163 return -EINVAL; 87 return -EINVAL;
164 } 88 }
165 89
166 err = fdt_setprop_u32(fdt, 0, "interrupt-parent", cpu_phandle);
167 if (err) {
168 pr_err("unable to set root interrupt-parent: %d\n", err);
169 return err;
170 }
171
172 uart_off = fdt_node_offset_by_compatible(fdt, -1, "ns16550a"); 90 uart_off = fdt_node_offset_by_compatible(fdt, -1, "ns16550a");
173 while (uart_off >= 0) { 91 while (uart_off >= 0) {
92 err = fdt_setprop_u32(fdt, uart_off, "interrupt-parent",
93 cpu_phandle);
94 if (err) {
95 pr_warn("unable to set UART interrupt-parent: %d\n",
96 err);
97 return err;
98 }
99
174 err = fdt_setprop_u32(fdt, uart_off, "interrupts", 100 err = fdt_setprop_u32(fdt, uart_off, "interrupts",
175 cpu_uart_int); 101 cpu_uart_int);
176 if (err) { 102 if (err) {
@@ -193,6 +119,12 @@ static __init int remove_gic(void *fdt)
193 return eth_off; 119 return eth_off;
194 } 120 }
195 121
122 err = fdt_setprop_u32(fdt, eth_off, "interrupt-parent", cpu_phandle);
123 if (err) {
124 pr_err("unable to set ethernet interrupt-parent: %d\n", err);
125 return err;
126 }
127
196 err = fdt_setprop_u32(fdt, eth_off, "interrupts", cpu_eth_int); 128 err = fdt_setprop_u32(fdt, eth_off, "interrupts", cpu_eth_int);
197 if (err) { 129 if (err) {
198 pr_err("unable to set ethernet interrupts property: %d\n", err); 130 pr_err("unable to set ethernet interrupts property: %d\n", err);
@@ -205,94 +137,29 @@ static __init int remove_gic(void *fdt)
205 return ehci_off; 137 return ehci_off;
206 } 138 }
207 139
208 err = fdt_setprop_u32(fdt, ehci_off, "interrupts", cpu_ehci_int); 140 err = fdt_setprop_u32(fdt, ehci_off, "interrupt-parent", cpu_phandle);
209 if (err) { 141 if (err) {
210 pr_err("unable to set EHCI interrupts property: %d\n", err); 142 pr_err("unable to set EHCI interrupt-parent: %d\n", err);
211 return err; 143 return err;
212 } 144 }
213 145
214 return 0; 146 err = fdt_setprop_u32(fdt, ehci_off, "interrupts", cpu_ehci_int);
215}
216
217static __init int serial_config(void *fdt)
218{
219 const char *yamontty, *mode_var;
220 char mode_var_name[9], path[18], parity;
221 unsigned int uart, baud, stop_bits;
222 bool hw_flow;
223 int chosen_off, err;
224
225 yamontty = fw_getenv("yamontty");
226 if (!yamontty || !strcmp(yamontty, "tty0")) {
227 uart = 0;
228 } else if (!strcmp(yamontty, "tty1")) {
229 uart = 1;
230 } else {
231 pr_warn("yamontty environment variable '%s' invalid\n",
232 yamontty);
233 uart = 0;
234 }
235
236 baud = stop_bits = 0;
237 parity = 0;
238 hw_flow = false;
239
240 snprintf(mode_var_name, sizeof(mode_var_name), "modetty%u", uart);
241 mode_var = fw_getenv(mode_var_name);
242 if (mode_var) {
243 while (mode_var[0] >= '0' && mode_var[0] <= '9') {
244 baud *= 10;
245 baud += mode_var[0] - '0';
246 mode_var++;
247 }
248 if (mode_var[0] == ',')
249 mode_var++;
250 if (mode_var[0])
251 parity = mode_var[0];
252 if (mode_var[0] == ',')
253 mode_var++;
254 if (mode_var[0])
255 stop_bits = mode_var[0] - '0';
256 if (mode_var[0] == ',')
257 mode_var++;
258 if (!strcmp(mode_var, "hw"))
259 hw_flow = true;
260 }
261
262 if (!baud)
263 baud = 38400;
264
265 if (parity != 'e' && parity != 'n' && parity != 'o')
266 parity = 'n';
267
268 if (stop_bits != 7 && stop_bits != 8)
269 stop_bits = 8;
270
271 WARN_ON(snprintf(path, sizeof(path), "uart%u:%u%c%u%s",
272 uart, baud, parity, stop_bits,
273 hw_flow ? "r" : "") >= sizeof(path));
274
275 /* find or add chosen node */
276 chosen_off = fdt_path_offset(fdt, "/chosen");
277 if (chosen_off == -FDT_ERR_NOTFOUND)
278 chosen_off = fdt_path_offset(fdt, "/chosen@0");
279 if (chosen_off == -FDT_ERR_NOTFOUND)
280 chosen_off = fdt_add_subnode(fdt, 0, "chosen");
281 if (chosen_off < 0) {
282 pr_err("Unable to find or add DT chosen node: %d\n",
283 chosen_off);
284 return chosen_off;
285 }
286
287 err = fdt_setprop_string(fdt, chosen_off, "stdout-path", path);
288 if (err) { 147 if (err) {
289 pr_err("Unable to set stdout-path property: %d\n", err); 148 pr_err("unable to set EHCI interrupts property: %d\n", err);
290 return err; 149 return err;
291 } 150 }
292 151
293 return 0; 152 return 0;
294} 153}
295 154
155static const struct mips_fdt_fixup sead3_fdt_fixups[] __initconst = {
156 { yamon_dt_append_cmdline, "append command line" },
157 { append_memory, "append memory" },
158 { remove_gic, "remove GIC when not present" },
159 { yamon_dt_serial_config, "append serial configuration" },
160 { },
161};
162
296static __init const void *sead3_fixup_fdt(const void *fdt, 163static __init const void *sead3_fixup_fdt(const void *fdt,
297 const void *match_data) 164 const void *match_data)
298{ 165{
@@ -307,29 +174,10 @@ static __init const void *sead3_fixup_fdt(const void *fdt,
307 174
308 fw_init_cmdline(); 175 fw_init_cmdline();
309 176
310 err = fdt_open_into(fdt, fdt_buf, sizeof(fdt_buf)); 177 err = apply_mips_fdt_fixups(fdt_buf, sizeof(fdt_buf),
311 if (err) 178 fdt, sead3_fdt_fixups);
312 panic("Unable to open FDT: %d", err);
313
314 err = append_cmdline(fdt_buf);
315 if (err)
316 panic("Unable to patch FDT: %d", err);
317
318 err = append_memory(fdt_buf);
319 if (err)
320 panic("Unable to patch FDT: %d", err);
321
322 err = remove_gic(fdt_buf);
323 if (err)
324 panic("Unable to patch FDT: %d", err);
325
326 err = serial_config(fdt_buf);
327 if (err)
328 panic("Unable to patch FDT: %d", err);
329
330 err = fdt_pack(fdt_buf);
331 if (err) 179 if (err)
332 panic("Unable to pack FDT: %d\n", err); 180 panic("Unable to fixup FDT: %d", err);
333 181
334 return fdt_buf; 182 return fdt_buf;
335} 183}
diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index 1231b5a17b37..3f32b376d30e 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -122,6 +122,33 @@ void __init device_tree_init(void)
122 err = register_up_smp_ops(); 122 err = register_up_smp_ops();
123} 123}
124 124
125int __init apply_mips_fdt_fixups(void *fdt_out, size_t fdt_out_size,
126 const void *fdt_in,
127 const struct mips_fdt_fixup *fixups)
128{
129 int err;
130
131 err = fdt_open_into(fdt_in, fdt_out, fdt_out_size);
132 if (err) {
133 pr_err("Failed to open FDT\n");
134 return err;
135 }
136
137 for (; fixups->apply; fixups++) {
138 err = fixups->apply(fdt_out);
139 if (err) {
140 pr_err("Failed to apply FDT fixup \"%s\"\n",
141 fixups->description);
142 return err;
143 }
144 }
145
146 err = fdt_pack(fdt_out);
147 if (err)
148 pr_err("Failed to pack FDT\n");
149 return err;
150}
151
125void __init plat_time_init(void) 152void __init plat_time_init(void)
126{ 153{
127 struct device_node *np; 154 struct device_node *np;
diff --git a/arch/mips/generic/vmlinux.its.S b/arch/mips/generic/vmlinux.its.S
index f67fbf1c8541..3390e2f80b80 100644
--- a/arch/mips/generic/vmlinux.its.S
+++ b/arch/mips/generic/vmlinux.its.S
@@ -29,3 +29,28 @@
29 }; 29 };
30 }; 30 };
31}; 31};
32
33#ifdef CONFIG_FIT_IMAGE_FDT_BOSTON
34/ {
35 images {
36 fdt@boston {
37 description = "img,boston Device Tree";
38 data = /incbin/("boot/dts/img/boston.dtb");
39 type = "flat_dt";
40 arch = "mips";
41 compression = "none";
42 hash@0 {
43 algo = "sha1";
44 };
45 };
46 };
47
48 configurations {
49 conf@boston {
50 description = "Boston Linux kernel";
51 kernel = "kernel@0";
52 fdt = "fdt@boston";
53 };
54 };
55};
56#endif /* CONFIG_FIT_IMAGE_FDT_BOSTON */
diff --git a/arch/mips/generic/yamon-dt.c b/arch/mips/generic/yamon-dt.c
new file mode 100644
index 000000000000..6077bca9b364
--- /dev/null
+++ b/arch/mips/generic/yamon-dt.c
@@ -0,0 +1,240 @@
1/*
2 * Copyright (C) 2016 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#define pr_fmt(fmt) "yamon-dt: " fmt
12
13#include <linux/bug.h>
14#include <linux/errno.h>
15#include <linux/kernel.h>
16#include <linux/libfdt.h>
17#include <linux/printk.h>
18
19#include <asm/fw/fw.h>
20#include <asm/yamon-dt.h>
21
22#define MAX_MEM_ARRAY_ENTRIES 2
23
24__init int yamon_dt_append_cmdline(void *fdt)
25{
26 int err, chosen_off;
27
28 /* find or add chosen node */
29 chosen_off = fdt_path_offset(fdt, "/chosen");
30 if (chosen_off == -FDT_ERR_NOTFOUND)
31 chosen_off = fdt_path_offset(fdt, "/chosen@0");
32 if (chosen_off == -FDT_ERR_NOTFOUND)
33 chosen_off = fdt_add_subnode(fdt, 0, "chosen");
34 if (chosen_off < 0) {
35 pr_err("Unable to find or add DT chosen node: %d\n",
36 chosen_off);
37 return chosen_off;
38 }
39
40 err = fdt_setprop_string(fdt, chosen_off, "bootargs", fw_getcmdline());
41 if (err) {
42 pr_err("Unable to set bootargs property: %d\n", err);
43 return err;
44 }
45
46 return 0;
47}
48
49static unsigned int __init gen_fdt_mem_array(
50 const struct yamon_mem_region *regions,
51 __be32 *mem_array,
52 unsigned int max_entries,
53 unsigned long memsize)
54{
55 const struct yamon_mem_region *mr;
56 unsigned long size;
57 unsigned int entries = 0;
58
59 for (mr = regions; mr->size && memsize; ++mr) {
60 if (entries >= max_entries) {
61 pr_warn("Number of regions exceeds max %u\n",
62 max_entries);
63 break;
64 }
65
66 /* How much of the remaining RAM fits in the next region? */
67 size = min_t(unsigned long, memsize, mr->size);
68 memsize -= size;
69
70 /* Emit a memory region */
71 *(mem_array++) = cpu_to_be32(mr->start);
72 *(mem_array++) = cpu_to_be32(size);
73 ++entries;
74
75 /* Discard the next mr->discard bytes */
76 memsize -= min_t(unsigned long, memsize, mr->discard);
77 }
78 return entries;
79}
80
81__init int yamon_dt_append_memory(void *fdt,
82 const struct yamon_mem_region *regions)
83{
84 unsigned long phys_memsize, memsize;
85 __be32 mem_array[2 * MAX_MEM_ARRAY_ENTRIES];
86 unsigned int mem_entries;
87 int i, err, mem_off;
88 char *var, param_name[10], *var_names[] = {
89 "ememsize", "memsize",
90 };
91
92 /* find memory size from the bootloader environment */
93 for (i = 0; i < ARRAY_SIZE(var_names); i++) {
94 var = fw_getenv(var_names[i]);
95 if (!var)
96 continue;
97
98 err = kstrtoul(var, 0, &phys_memsize);
99 if (!err)
100 break;
101
102 pr_warn("Failed to read the '%s' env variable '%s'\n",
103 var_names[i], var);
104 }
105
106 if (!phys_memsize) {
107 pr_warn("The bootloader didn't provide memsize: defaulting to 32MB\n");
108 phys_memsize = 32 << 20;
109 }
110
111 /* default to using all available RAM */
112 memsize = phys_memsize;
113
114 /* allow the user to override the usable memory */
115 for (i = 0; i < ARRAY_SIZE(var_names); i++) {
116 snprintf(param_name, sizeof(param_name), "%s=", var_names[i]);
117 var = strstr(arcs_cmdline, param_name);
118 if (!var)
119 continue;
120
121 memsize = memparse(var + strlen(param_name), NULL);
122 }
123
124 /* if the user says there's more RAM than we thought, believe them */
125 phys_memsize = max_t(unsigned long, phys_memsize, memsize);
126
127 /* find or add a memory node */
128 mem_off = fdt_path_offset(fdt, "/memory");
129 if (mem_off == -FDT_ERR_NOTFOUND)
130 mem_off = fdt_add_subnode(fdt, 0, "memory");
131 if (mem_off < 0) {
132 pr_err("Unable to find or add memory DT node: %d\n", mem_off);
133 return mem_off;
134 }
135
136 err = fdt_setprop_string(fdt, mem_off, "device_type", "memory");
137 if (err) {
138 pr_err("Unable to set memory node device_type: %d\n", err);
139 return err;
140 }
141
142 mem_entries = gen_fdt_mem_array(regions, mem_array,
143 MAX_MEM_ARRAY_ENTRIES, phys_memsize);
144 err = fdt_setprop(fdt, mem_off, "reg",
145 mem_array, mem_entries * 2 * sizeof(mem_array[0]));
146 if (err) {
147 pr_err("Unable to set memory regs property: %d\n", err);
148 return err;
149 }
150
151 mem_entries = gen_fdt_mem_array(regions, mem_array,
152 MAX_MEM_ARRAY_ENTRIES, memsize);
153 err = fdt_setprop(fdt, mem_off, "linux,usable-memory",
154 mem_array, mem_entries * 2 * sizeof(mem_array[0]));
155 if (err) {
156 pr_err("Unable to set linux,usable-memory property: %d\n", err);
157 return err;
158 }
159
160 return 0;
161}
162
163__init int yamon_dt_serial_config(void *fdt)
164{
165 const char *yamontty, *mode_var;
166 char mode_var_name[9], path[20], parity;
167 unsigned int uart, baud, stop_bits;
168 bool hw_flow;
169 int chosen_off, err;
170
171 yamontty = fw_getenv("yamontty");
172 if (!yamontty || !strcmp(yamontty, "tty0")) {
173 uart = 0;
174 } else if (!strcmp(yamontty, "tty1")) {
175 uart = 1;
176 } else {
177 pr_warn("yamontty environment variable '%s' invalid\n",
178 yamontty);
179 uart = 0;
180 }
181
182 baud = stop_bits = 0;
183 parity = 0;
184 hw_flow = false;
185
186 snprintf(mode_var_name, sizeof(mode_var_name), "modetty%u", uart);
187 mode_var = fw_getenv(mode_var_name);
188 if (mode_var) {
189 while (mode_var[0] >= '0' && mode_var[0] <= '9') {
190 baud *= 10;
191 baud += mode_var[0] - '0';
192 mode_var++;
193 }
194 if (mode_var[0] == ',')
195 mode_var++;
196 if (mode_var[0])
197 parity = mode_var[0];
198 if (mode_var[0] == ',')
199 mode_var++;
200 if (mode_var[0])
201 stop_bits = mode_var[0] - '0';
202 if (mode_var[0] == ',')
203 mode_var++;
204 if (!strcmp(mode_var, "hw"))
205 hw_flow = true;
206 }
207
208 if (!baud)
209 baud = 38400;
210
211 if (parity != 'e' && parity != 'n' && parity != 'o')
212 parity = 'n';
213
214 if (stop_bits != 7 && stop_bits != 8)
215 stop_bits = 8;
216
217 WARN_ON(snprintf(path, sizeof(path), "serial%u:%u%c%u%s",
218 uart, baud, parity, stop_bits,
219 hw_flow ? "r" : "") >= sizeof(path));
220
221 /* find or add chosen node */
222 chosen_off = fdt_path_offset(fdt, "/chosen");
223 if (chosen_off == -FDT_ERR_NOTFOUND)
224 chosen_off = fdt_path_offset(fdt, "/chosen@0");
225 if (chosen_off == -FDT_ERR_NOTFOUND)
226 chosen_off = fdt_add_subnode(fdt, 0, "chosen");
227 if (chosen_off < 0) {
228 pr_err("Unable to find or add DT chosen node: %d\n",
229 chosen_off);
230 return chosen_off;
231 }
232
233 err = fdt_setprop_string(fdt, chosen_off, "stdout-path", path);
234 if (err) {
235 pr_err("Unable to set stdout-path property: %d\n", err);
236 return err;
237 }
238
239 return 0;
240}
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 2535c7b4c482..7c8aab23bce8 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -12,6 +12,8 @@ generic-y += mm-arch-hooks.h
12generic-y += parport.h 12generic-y += parport.h
13generic-y += percpu.h 13generic-y += percpu.h
14generic-y += preempt.h 14generic-y += preempt.h
15generic-y += qrwlock.h
16generic-y += qspinlock.h
15generic-y += sections.h 17generic-y += sections.h
16generic-y += segment.h 18generic-y += segment.h
17generic-y += serial.h 19generic-y += serial.h
diff --git a/arch/mips/include/asm/branch.h b/arch/mips/include/asm/branch.h
index de781cf54bc7..da80878f2c0d 100644
--- a/arch/mips/include/asm/branch.h
+++ b/arch/mips/include/asm/branch.h
@@ -74,10 +74,7 @@ static inline int compute_return_epc(struct pt_regs *regs)
74 return __microMIPS_compute_return_epc(regs); 74 return __microMIPS_compute_return_epc(regs);
75 if (cpu_has_mips16) 75 if (cpu_has_mips16)
76 return __MIPS16e_compute_return_epc(regs); 76 return __MIPS16e_compute_return_epc(regs);
77 return regs->cp0_epc; 77 } else if (!delay_slot(regs)) {
78 }
79
80 if (!delay_slot(regs)) {
81 regs->cp0_epc += 4; 78 regs->cp0_epc += 4;
82 return 0; 79 return 0;
83 } 80 }
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index b71ab4a5fd50..903f3bf48419 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -13,153 +13,107 @@
13#include <asm/compiler.h> 13#include <asm/compiler.h>
14#include <asm/war.h> 14#include <asm/war.h>
15 15
16static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) 16/*
17{ 17 * Using a branch-likely instruction to check the result of an sc instruction
18 __u32 retval; 18 * works around a bug present in R10000 CPUs prior to revision 3.0 that could
19 19 * cause ll-sc sequences to execute non-atomically.
20 smp_mb__before_llsc(); 20 */
21 21#if R10000_LLSC_WAR
22 if (kernel_uses_llsc && R10000_LLSC_WAR) { 22# define __scbeqz "beqzl"
23 unsigned long dummy; 23#else
24 24# define __scbeqz "beqz"
25 __asm__ __volatile__( 25#endif
26 " .set arch=r4000 \n"
27 "1: ll %0, %3 # xchg_u32 \n"
28 " .set mips0 \n"
29 " move %2, %z4 \n"
30 " .set arch=r4000 \n"
31 " sc %2, %1 \n"
32 " beqzl %2, 1b \n"
33 " .set mips0 \n"
34 : "=&r" (retval), "=" GCC_OFF_SMALL_ASM() (*m), "=&r" (dummy)
35 : GCC_OFF_SMALL_ASM() (*m), "Jr" (val)
36 : "memory");
37 } else if (kernel_uses_llsc) {
38 unsigned long dummy;
39
40 do {
41 __asm__ __volatile__(
42 " .set "MIPS_ISA_ARCH_LEVEL" \n"
43 " ll %0, %3 # xchg_u32 \n"
44 " .set mips0 \n"
45 " move %2, %z4 \n"
46 " .set "MIPS_ISA_ARCH_LEVEL" \n"
47 " sc %2, %1 \n"
48 " .set mips0 \n"
49 : "=&r" (retval), "=" GCC_OFF_SMALL_ASM() (*m),
50 "=&r" (dummy)
51 : GCC_OFF_SMALL_ASM() (*m), "Jr" (val)
52 : "memory");
53 } while (unlikely(!dummy));
54 } else {
55 unsigned long flags;
56
57 raw_local_irq_save(flags);
58 retval = *m;
59 *m = val;
60 raw_local_irq_restore(flags); /* implies memory barrier */
61 }
62
63 smp_llsc_mb();
64
65 return retval;
66}
67 26
68#ifdef CONFIG_64BIT 27/*
69static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) 28 * These functions doesn't exist, so if they are called you'll either:
70{ 29 *
71 __u64 retval; 30 * - Get an error at compile-time due to __compiletime_error, if supported by
72 31 * your compiler.
73 smp_mb__before_llsc(); 32 *
74 33 * or:
75 if (kernel_uses_llsc && R10000_LLSC_WAR) { 34 *
76 unsigned long dummy; 35 * - Get an error at link-time due to the call to the missing function.
77 36 */
78 __asm__ __volatile__( 37extern unsigned long __cmpxchg_called_with_bad_pointer(void)
79 " .set arch=r4000 \n" 38 __compiletime_error("Bad argument size for cmpxchg");
80 "1: lld %0, %3 # xchg_u64 \n" 39extern unsigned long __xchg_called_with_bad_pointer(void)
81 " move %2, %z4 \n" 40 __compiletime_error("Bad argument size for xchg");
82 " scd %2, %1 \n"
83 " beqzl %2, 1b \n"
84 " .set mips0 \n"
85 : "=&r" (retval), "=" GCC_OFF_SMALL_ASM() (*m), "=&r" (dummy)
86 : GCC_OFF_SMALL_ASM() (*m), "Jr" (val)
87 : "memory");
88 } else if (kernel_uses_llsc) {
89 unsigned long dummy;
90
91 do {
92 __asm__ __volatile__(
93 " .set "MIPS_ISA_ARCH_LEVEL" \n"
94 " lld %0, %3 # xchg_u64 \n"
95 " move %2, %z4 \n"
96 " scd %2, %1 \n"
97 " .set mips0 \n"
98 : "=&r" (retval), "=" GCC_OFF_SMALL_ASM() (*m),
99 "=&r" (dummy)
100 : GCC_OFF_SMALL_ASM() (*m), "Jr" (val)
101 : "memory");
102 } while (unlikely(!dummy));
103 } else {
104 unsigned long flags;
105
106 raw_local_irq_save(flags);
107 retval = *m;
108 *m = val;
109 raw_local_irq_restore(flags); /* implies memory barrier */
110 }
111 41
112 smp_llsc_mb(); 42#define __xchg_asm(ld, st, m, val) \
43({ \
44 __typeof(*(m)) __ret; \
45 \
46 if (kernel_uses_llsc) { \
47 __asm__ __volatile__( \
48 " .set push \n" \
49 " .set noat \n" \
50 " .set " MIPS_ISA_ARCH_LEVEL " \n" \
51 "1: " ld " %0, %2 # __xchg_asm \n" \
52 " .set mips0 \n" \
53 " move $1, %z3 \n" \
54 " .set " MIPS_ISA_ARCH_LEVEL " \n" \
55 " " st " $1, %1 \n" \
56 "\t" __scbeqz " $1, 1b \n" \
57 " .set pop \n" \
58 : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \
59 : GCC_OFF_SMALL_ASM() (*m), "Jr" (val) \
60 : "memory"); \
61 } else { \
62 unsigned long __flags; \
63 \
64 raw_local_irq_save(__flags); \
65 __ret = *m; \
66 *m = val; \
67 raw_local_irq_restore(__flags); \
68 } \
69 \
70 __ret; \
71})
113 72
114 return retval; 73extern unsigned long __xchg_small(volatile void *ptr, unsigned long val,
115} 74 unsigned int size);
116#else
117extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 val);
118#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
119#endif
120 75
121static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 76static inline unsigned long __xchg(volatile void *ptr, unsigned long x,
77 int size)
122{ 78{
123 switch (size) { 79 switch (size) {
80 case 1:
81 case 2:
82 return __xchg_small(ptr, x, size);
83
124 case 4: 84 case 4:
125 return __xchg_u32(ptr, x); 85 return __xchg_asm("ll", "sc", (volatile u32 *)ptr, x);
86
126 case 8: 87 case 8:
127 return __xchg_u64(ptr, x); 88 if (!IS_ENABLED(CONFIG_64BIT))
128 } 89 return __xchg_called_with_bad_pointer();
90
91 return __xchg_asm("lld", "scd", (volatile u64 *)ptr, x);
129 92
130 return x; 93 default:
94 return __xchg_called_with_bad_pointer();
95 }
131} 96}
132 97
133#define xchg(ptr, x) \ 98#define xchg(ptr, x) \
134({ \ 99({ \
135 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \ 100 __typeof__(*(ptr)) __res; \
136 \ 101 \
137 ((__typeof__(*(ptr))) \ 102 smp_mb__before_llsc(); \
138 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \ 103 \
104 __res = (__typeof__(*(ptr))) \
105 __xchg((ptr), (unsigned long)(x), sizeof(*(ptr))); \
106 \
107 smp_llsc_mb(); \
108 \
109 __res; \
139}) 110})
140 111
141#define __cmpxchg_asm(ld, st, m, old, new) \ 112#define __cmpxchg_asm(ld, st, m, old, new) \
142({ \ 113({ \
143 __typeof(*(m)) __ret; \ 114 __typeof(*(m)) __ret; \
144 \ 115 \
145 if (kernel_uses_llsc && R10000_LLSC_WAR) { \ 116 if (kernel_uses_llsc) { \
146 __asm__ __volatile__( \
147 " .set push \n" \
148 " .set noat \n" \
149 " .set arch=r4000 \n" \
150 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
151 " bne %0, %z3, 2f \n" \
152 " .set mips0 \n" \
153 " move $1, %z4 \n" \
154 " .set arch=r4000 \n" \
155 " " st " $1, %1 \n" \
156 " beqzl $1, 1b \n" \
157 "2: \n" \
158 " .set pop \n" \
159 : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \
160 : GCC_OFF_SMALL_ASM() (*m), "Jr" (old), "Jr" (new) \
161 : "memory"); \
162 } else if (kernel_uses_llsc) { \
163 __asm__ __volatile__( \ 117 __asm__ __volatile__( \
164 " .set push \n" \ 118 " .set push \n" \
165 " .set noat \n" \ 119 " .set noat \n" \
@@ -170,7 +124,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
170 " move $1, %z4 \n" \ 124 " move $1, %z4 \n" \
171 " .set "MIPS_ISA_ARCH_LEVEL" \n" \ 125 " .set "MIPS_ISA_ARCH_LEVEL" \n" \
172 " " st " $1, %1 \n" \ 126 " " st " $1, %1 \n" \
173 " beqz $1, 1b \n" \ 127 "\t" __scbeqz " $1, 1b \n" \
174 " .set pop \n" \ 128 " .set pop \n" \
175 "2: \n" \ 129 "2: \n" \
176 : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \ 130 : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \
@@ -189,44 +143,50 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
189 __ret; \ 143 __ret; \
190}) 144})
191 145
192/* 146extern unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
193 * This function doesn't exist, so you'll get a linker error 147 unsigned long new, unsigned int size);
194 * if something tries to do an invalid cmpxchg(). 148
195 */ 149static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
196extern void __cmpxchg_called_with_bad_pointer(void); 150 unsigned long new, unsigned int size)
151{
152 switch (size) {
153 case 1:
154 case 2:
155 return __cmpxchg_small(ptr, old, new, size);
156
157 case 4:
158 return __cmpxchg_asm("ll", "sc", (volatile u32 *)ptr, old, new);
159
160 case 8:
161 /* lld/scd are only available for MIPS64 */
162 if (!IS_ENABLED(CONFIG_64BIT))
163 return __cmpxchg_called_with_bad_pointer();
164
165 return __cmpxchg_asm("lld", "scd", (volatile u64 *)ptr, old, new);
197 166
198#define __cmpxchg(ptr, old, new, pre_barrier, post_barrier) \ 167 default:
168 return __cmpxchg_called_with_bad_pointer();
169 }
170}
171
172#define cmpxchg_local(ptr, old, new) \
173 ((__typeof__(*(ptr))) \
174 __cmpxchg((ptr), \
175 (unsigned long)(__typeof__(*(ptr)))(old), \
176 (unsigned long)(__typeof__(*(ptr)))(new), \
177 sizeof(*(ptr))))
178
179#define cmpxchg(ptr, old, new) \
199({ \ 180({ \
200 __typeof__(ptr) __ptr = (ptr); \ 181 __typeof__(*(ptr)) __res; \
201 __typeof__(*(ptr)) __old = (old); \
202 __typeof__(*(ptr)) __new = (new); \
203 __typeof__(*(ptr)) __res = 0; \
204 \ 182 \
205 pre_barrier; \ 183 smp_mb__before_llsc(); \
206 \ 184 __res = cmpxchg_local((ptr), (old), (new)); \
207 switch (sizeof(*(__ptr))) { \ 185 smp_llsc_mb(); \
208 case 4: \
209 __res = __cmpxchg_asm("ll", "sc", __ptr, __old, __new); \
210 break; \
211 case 8: \
212 if (sizeof(long) == 8) { \
213 __res = __cmpxchg_asm("lld", "scd", __ptr, \
214 __old, __new); \
215 break; \
216 } \
217 default: \
218 __cmpxchg_called_with_bad_pointer(); \
219 break; \
220 } \
221 \
222 post_barrier; \
223 \ 186 \
224 __res; \ 187 __res; \
225}) 188})
226 189
227#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_mb__before_llsc(), smp_llsc_mb())
228#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, , )
229
230#ifdef CONFIG_64BIT 190#ifdef CONFIG_64BIT
231#define cmpxchg64_local(ptr, o, n) \ 191#define cmpxchg64_local(ptr, o, n) \
232 ({ \ 192 ({ \
@@ -245,4 +205,6 @@ extern void __cmpxchg_called_with_bad_pointer(void);
245#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) 205#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
246#endif 206#endif
247 207
208#undef __scbeqz
209
248#endif /* __ASM_CMPXCHG_H */ 210#endif /* __ASM_CMPXCHG_H */
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 494d38274142..8baa9033b181 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -138,6 +138,9 @@
138#ifndef cpu_has_mips16 138#ifndef cpu_has_mips16
139#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16) 139#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16)
140#endif 140#endif
141#ifndef cpu_has_mips16e2
142#define cpu_has_mips16e2 (cpu_data[0].ases & MIPS_ASE_MIPS16E2)
143#endif
141#ifndef cpu_has_mdmx 144#ifndef cpu_has_mdmx
142#define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX) 145#define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX)
143#endif 146#endif
@@ -487,6 +490,47 @@
487# define cpu_has_perf (cpu_data[0].options & MIPS_CPU_PERF) 490# define cpu_has_perf (cpu_data[0].options & MIPS_CPU_PERF)
488#endif 491#endif
489 492
493#if defined(CONFIG_SMP) && defined(__mips_isa_rev) && (__mips_isa_rev >= 6)
494/*
495 * Some systems share FTLB RAMs between threads within a core (siblings in
496 * kernel parlance). This means that FTLB entries may become invalid at almost
497 * any point when an entry is evicted due to a sibling thread writing an entry
498 * to the shared FTLB RAM.
499 *
500 * This is only relevant to SMP systems, and the only systems that exhibit this
501 * property implement MIPSr6 or higher so we constrain support for this to
502 * kernels that will run on such systems.
503 */
504# ifndef cpu_has_shared_ftlb_ram
505# define cpu_has_shared_ftlb_ram \
506 (current_cpu_data.options & MIPS_CPU_SHARED_FTLB_RAM)
507# endif
508
509/*
510 * Some systems take this a step further & share FTLB entries between siblings.
511 * This is implemented as TLB writes happening as usual, but if an entry
512 * written by a sibling exists in the shared FTLB for a translation which would
513 * otherwise cause a TLB refill exception then the CPU will use the entry
514 * written by its sibling rather than triggering a refill & writing a matching
515 * TLB entry for itself.
516 *
517 * This is naturally only valid if a TLB entry is known to be suitable for use
518 * on all siblings in a CPU, and so it only takes effect when MMIDs are in use
519 * rather than ASIDs or when a TLB entry is marked global.
520 */
521# ifndef cpu_has_shared_ftlb_entries
522# define cpu_has_shared_ftlb_entries \
523 (current_cpu_data.options & MIPS_CPU_SHARED_FTLB_ENTRIES)
524# endif
525#endif /* SMP && __mips_isa_rev >= 6 */
526
527#ifndef cpu_has_shared_ftlb_ram
528# define cpu_has_shared_ftlb_ram 0
529#endif
530#ifndef cpu_has_shared_ftlb_entries
531# define cpu_has_shared_ftlb_entries 0
532#endif
533
490/* 534/*
491 * Guest capabilities 535 * Guest capabilities
492 */ 536 */
diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h
index bdd6dc18e65c..175fe565f4e1 100644
--- a/arch/mips/include/asm/cpu-type.h
+++ b/arch/mips/include/asm/cpu-type.h
@@ -84,6 +84,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
84 84
85#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R6 85#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R6
86 case CPU_I6400: 86 case CPU_I6400:
87 case CPU_I6500:
87 case CPU_P6600: 88 case CPU_P6600:
88#endif 89#endif
89 90
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 98f59307e6a3..d0c152b989f8 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -124,6 +124,7 @@
124#define PRID_IMP_P5600 0xa800 124#define PRID_IMP_P5600 0xa800
125#define PRID_IMP_I6400 0xa900 125#define PRID_IMP_I6400 0xa900
126#define PRID_IMP_M6250 0xab00 126#define PRID_IMP_M6250 0xab00
127#define PRID_IMP_I6500 0xb000
127 128
128/* 129/*
129 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE 130 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
@@ -247,6 +248,7 @@
247#define PRID_REV_LOONGSON3B_R1 0x0006 248#define PRID_REV_LOONGSON3B_R1 0x0006
248#define PRID_REV_LOONGSON3B_R2 0x0007 249#define PRID_REV_LOONGSON3B_R2 0x0007
249#define PRID_REV_LOONGSON3A_R2 0x0008 250#define PRID_REV_LOONGSON3A_R2 0x0008
251#define PRID_REV_LOONGSON3A_R3 0x0009
250 252
251/* 253/*
252 * Older processors used to encode processor version and revision in two 254 * Older processors used to encode processor version and revision in two
@@ -322,7 +324,7 @@ enum cpu_type_enum {
322 */ 324 */
323 CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, 325 CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
324 CPU_LOONGSON3, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, 326 CPU_LOONGSON3, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS,
325 CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP, 327 CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP, CPU_I6500,
326 328
327 CPU_QEMU_GENERIC, 329 CPU_QEMU_GENERIC,
328 330
@@ -416,6 +418,10 @@ enum cpu_type_enum {
416#define MIPS_CPU_GUESTID MBIT_ULL(51) /* CPU uses VZ ASE GuestID feature */ 418#define MIPS_CPU_GUESTID MBIT_ULL(51) /* CPU uses VZ ASE GuestID feature */
417#define MIPS_CPU_DRG MBIT_ULL(52) /* CPU has VZ Direct Root to Guest (DRG) */ 419#define MIPS_CPU_DRG MBIT_ULL(52) /* CPU has VZ Direct Root to Guest (DRG) */
418#define MIPS_CPU_UFR MBIT_ULL(53) /* CPU supports User mode FR switching */ 420#define MIPS_CPU_UFR MBIT_ULL(53) /* CPU supports User mode FR switching */
421#define MIPS_CPU_SHARED_FTLB_RAM \
422 MBIT_ULL(54) /* CPU shares FTLB RAM with another */
423#define MIPS_CPU_SHARED_FTLB_ENTRIES \
424 MBIT_ULL(55) /* CPU shares FTLB entries with another */
419 425
420/* 426/*
421 * CPU ASE encodings 427 * CPU ASE encodings
@@ -430,5 +436,6 @@ enum cpu_type_enum {
430#define MIPS_ASE_VZ 0x00000080 /* Virtualization ASE */ 436#define MIPS_ASE_VZ 0x00000080 /* Virtualization ASE */
431#define MIPS_ASE_MSA 0x00000100 /* MIPS SIMD Architecture */ 437#define MIPS_ASE_MSA 0x00000100 /* MIPS SIMD Architecture */
432#define MIPS_ASE_DSP3 0x00000200 /* Signal Processing ASE Rev 3*/ 438#define MIPS_ASE_DSP3 0x00000200 /* Signal Processing ASE Rev 3*/
439#define MIPS_ASE_MIPS16E2 0x00000400 /* MIPS16e2 */
433 440
434#endif /* _ASM_CPU_H */ 441#endif /* _ASM_CPU_H */
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h
index ddd1c918103b..c5d351786416 100644
--- a/arch/mips/include/asm/irq.h
+++ b/arch/mips/include/asm/irq.h
@@ -18,7 +18,7 @@
18#include <irq.h> 18#include <irq.h>
19 19
20#define IRQ_STACK_SIZE THREAD_SIZE 20#define IRQ_STACK_SIZE THREAD_SIZE
21#define IRQ_STACK_START (IRQ_STACK_SIZE - sizeof(unsigned long)) 21#define IRQ_STACK_START (IRQ_STACK_SIZE - 16)
22 22
23extern void *irq_stack[NR_CPUS]; 23extern void *irq_stack[NR_CPUS];
24 24
diff --git a/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
index ade0356df257..e6a8108cde4e 100644
--- a/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
@@ -40,6 +40,7 @@
40#endif 40#endif
41 41
42#define cpu_has_mips16 0 42#define cpu_has_mips16 0
43#define cpu_has_mips16e2 0
43#define cpu_has_mdmx 0 44#define cpu_has_mdmx 0
44#define cpu_has_mips3d 0 45#define cpu_has_mips3d 0
45#define cpu_has_smartmips 0 46#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
index c5b6eef0efa7..bace5b9ae4df 100644
--- a/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
@@ -31,6 +31,7 @@
31#define cpu_has_ejtag 1 31#define cpu_has_ejtag 1
32#define cpu_has_llsc 1 32#define cpu_has_llsc 1
33#define cpu_has_mips16 0 33#define cpu_has_mips16 0
34#define cpu_has_mips16e2 0
34#define cpu_has_mdmx 0 35#define cpu_has_mdmx 0
35#define cpu_has_mips3d 0 36#define cpu_has_mips3d 0
36#define cpu_has_smartmips 0 37#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
index bc1167dbd4e3..b56cf10b91d3 100644
--- a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
@@ -19,6 +19,7 @@
19#define cpu_has_ejtag 1 19#define cpu_has_ejtag 1
20#define cpu_has_llsc 1 20#define cpu_has_llsc 1
21#define cpu_has_mips16 0 21#define cpu_has_mips16 0
22#define cpu_has_mips16e2 0
22#define cpu_has_mdmx 0 23#define cpu_has_mdmx 0
23#define cpu_has_mips3d 0 24#define cpu_has_mips3d 0
24#define cpu_has_smartmips 0 25#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
index 30c5cd9fd973..291fe90aafa5 100644
--- a/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
@@ -37,6 +37,7 @@
37#endif 37#endif
38 38
39#define cpu_has_mips16 0 39#define cpu_has_mips16 0
40#define cpu_has_mips16e2 0
40#define cpu_has_mdmx 0 41#define cpu_has_mdmx 0
41#define cpu_has_mips3d 0 42#define cpu_has_mips3d 0
42#define cpu_has_smartmips 0 43#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h b/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
index 21eae03d752a..2ec10237688c 100644
--- a/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
@@ -27,6 +27,7 @@
27#define cpu_has_mcheck 0 27#define cpu_has_mcheck 0
28#define cpu_has_ejtag 0 28#define cpu_has_ejtag 0
29#define cpu_has_mips16 0 29#define cpu_has_mips16 0
30#define cpu_has_mips16e2 0
30#define cpu_has_mdmx 0 31#define cpu_has_mdmx 0
31#define cpu_has_mips3d 0 32#define cpu_has_mips3d 0
32#define cpu_has_smartmips 0 33#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-generic/mc146818rtc.h b/arch/mips/include/asm/mach-generic/mc146818rtc.h
index 0b9a942f079d..9c72e540ff56 100644
--- a/arch/mips/include/asm/mach-generic/mc146818rtc.h
+++ b/arch/mips/include/asm/mach-generic/mc146818rtc.h
@@ -27,7 +27,7 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
27 outb_p(data, RTC_PORT(1)); 27 outb_p(data, RTC_PORT(1));
28} 28}
29 29
30#define RTC_ALWAYS_BCD 1 30#define RTC_ALWAYS_BCD 0
31 31
32#ifndef mc146818_decode_year 32#ifndef mc146818_decode_year
33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) 33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
diff --git a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
index 9b19b72dba56..b80d5eafc9db 100644
--- a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
@@ -19,6 +19,7 @@
19#define cpu_has_32fpr 1 19#define cpu_has_32fpr 1
20#define cpu_has_counter 1 20#define cpu_has_counter 1
21#define cpu_has_mips16 0 21#define cpu_has_mips16 0
22#define cpu_has_mips16e2 0
22#define cpu_has_divec 0 23#define cpu_has_divec 0
23#define cpu_has_cache_cdex_p 1 24#define cpu_has_cache_cdex_p 1
24#define cpu_has_prefetch 0 25#define cpu_has_prefetch 0
diff --git a/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
index 7449794eade6..136d6d464e32 100644
--- a/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
@@ -43,6 +43,7 @@
43#define cpu_has_ejtag 0 43#define cpu_has_ejtag 0
44#define cpu_has_llsc 1 44#define cpu_has_llsc 1
45#define cpu_has_mips16 0 45#define cpu_has_mips16 0
46#define cpu_has_mips16e2 0
46#define cpu_has_mdmx 0 47#define cpu_has_mdmx 0
47#define cpu_has_mips3d 0 48#define cpu_has_mips3d 0
48#define cpu_has_smartmips 0 49#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
index 4cec06d133db..ba8b4e30b3e2 100644
--- a/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
@@ -16,6 +16,7 @@
16 */ 16 */
17#define cpu_has_watch 1 17#define cpu_has_watch 1
18#define cpu_has_mips16 0 18#define cpu_has_mips16 0
19#define cpu_has_mips16e2 0
19#define cpu_has_divec 0 20#define cpu_has_divec 0
20#define cpu_has_vce 0 21#define cpu_has_vce 0
21#define cpu_has_cache_cdex_p 0 22#define cpu_has_cache_cdex_p 0
diff --git a/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
index 241409b78ff1..63b4c889094b 100644
--- a/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
@@ -29,6 +29,7 @@
29#define cpu_has_32fpr 1 29#define cpu_has_32fpr 1
30#define cpu_has_counter 1 30#define cpu_has_counter 1
31#define cpu_has_mips16 0 31#define cpu_has_mips16 0
32#define cpu_has_mips16e2 0
32#define cpu_has_vce 0 33#define cpu_has_vce 0
33#define cpu_has_cache_cdex_s 0 34#define cpu_has_cache_cdex_s 0
34#define cpu_has_mcheck 0 35#define cpu_has_mcheck 0
diff --git a/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h b/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
index 0933f94a1e69..7c5e576f9d96 100644
--- a/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
@@ -23,6 +23,7 @@
23#define cpu_has_ejtag 1 23#define cpu_has_ejtag 1
24#define cpu_has_llsc 1 24#define cpu_has_llsc 1
25#define cpu_has_mips16 0 25#define cpu_has_mips16 0
26#define cpu_has_mips16e2 0
26#define cpu_has_mdmx 0 27#define cpu_has_mdmx 0
27#define cpu_has_mips3d 0 28#define cpu_has_mips3d 0
28#define cpu_has_smartmips 0 29#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
index d3f3258b7cd4..9f9bb9c53785 100644
--- a/arch/mips/include/asm/mach-loongson64/boot_param.h
+++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
@@ -27,12 +27,22 @@ struct efi_memory_map_loongson {
27} __packed; 27} __packed;
28 28
29enum loongson_cpu_type { 29enum loongson_cpu_type {
30 Loongson_2E = 0, 30 Legacy_2E = 0x0,
31 Loongson_2F = 1, 31 Legacy_2F = 0x1,
32 Loongson_3A = 2, 32 Legacy_3A = 0x2,
33 Loongson_3B = 3, 33 Legacy_3B = 0x3,
34 Loongson_1A = 4, 34 Legacy_1A = 0x4,
35 Loongson_1B = 5 35 Legacy_1B = 0x5,
36 Legacy_2G = 0x6,
37 Legacy_2H = 0x7,
38 Loongson_1A = 0x100,
39 Loongson_1B = 0x101,
40 Loongson_2E = 0x200,
41 Loongson_2F = 0x201,
42 Loongson_2G = 0x202,
43 Loongson_2H = 0x203,
44 Loongson_3A = 0x300,
45 Loongson_3B = 0x301
36}; 46};
37 47
38/* 48/*
diff --git a/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h
index 89328a3d44d8..581915ce231c 100644
--- a/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h
@@ -32,6 +32,7 @@
32#define cpu_has_mcheck 0 32#define cpu_has_mcheck 0
33#define cpu_has_mdmx 0 33#define cpu_has_mdmx 0
34#define cpu_has_mips16 0 34#define cpu_has_mips16 0
35#define cpu_has_mips16e2 0
35#define cpu_has_mips3d 0 36#define cpu_has_mips3d 0
36#define cpu_has_mipsmt 0 37#define cpu_has_mipsmt 0
37#define cpu_has_smartmips 0 38#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
index 091deb1700e5..0c29ff820bb9 100644
--- a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
@@ -13,6 +13,7 @@
13#define cpu_has_4k_cache 1 13#define cpu_has_4k_cache 1
14#define cpu_has_watch 1 14#define cpu_has_watch 1
15#define cpu_has_mips16 0 15#define cpu_has_mips16 0
16#define cpu_has_mips16e2 0
16#define cpu_has_counter 1 17#define cpu_has_counter 1
17#define cpu_has_divec 1 18#define cpu_has_divec 1
18#define cpu_has_vce 0 19#define cpu_has_vce 0
diff --git a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
index b15307597ee3..6a1087ee8c6e 100644
--- a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
@@ -48,6 +48,7 @@
48#define cpu_has_llsc 1 48#define cpu_has_llsc 1
49 49
50#define cpu_has_mips16 0 50#define cpu_has_mips16 0
51#define cpu_has_mips16e2 0
51#define cpu_has_mdmx 0 52#define cpu_has_mdmx 0
52#define cpu_has_mips3d 0 53#define cpu_has_mips3d 0
53#define cpu_has_smartmips 0 54#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
index d38be668e338..e1e182300fea 100644
--- a/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
@@ -17,6 +17,7 @@
17#define cpu_has_counter 1 17#define cpu_has_counter 1
18#define cpu_has_watch 0 18#define cpu_has_watch 0
19#define cpu_has_mips16 0 19#define cpu_has_mips16 0
20#define cpu_has_mips16e2 0
20#define cpu_has_divec 0 21#define cpu_has_divec 0
21#define cpu_has_cache_cdex_p 1 22#define cpu_has_cache_cdex_p 1
22#define cpu_has_prefetch 0 23#define cpu_has_prefetch 0
diff --git a/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h b/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
index 92927b62b5a0..7022358057fd 100644
--- a/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
@@ -13,6 +13,7 @@
13 */ 13 */
14#define cpu_has_watch 1 14#define cpu_has_watch 1
15#define cpu_has_mips16 0 15#define cpu_has_mips16 0
16#define cpu_has_mips16e2 0
16#define cpu_has_divec 1 17#define cpu_has_divec 1
17#define cpu_has_vce 0 18#define cpu_has_vce 0
18#define cpu_has_cache_cdex_p 0 19#define cpu_has_cache_cdex_p 0
diff --git a/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
index 7f5144c6ce2d..b9d39dc45420 100644
--- a/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
@@ -6,6 +6,7 @@
6#define cpu_has_inclusive_pcaches 0 6#define cpu_has_inclusive_pcaches 0
7 7
8#define cpu_has_mips16 0 8#define cpu_has_mips16 0
9#define cpu_has_mips16e2 0
9#define cpu_has_mdmx 0 10#define cpu_has_mdmx 0
10#define cpu_has_mips3d 0 11#define cpu_has_mips3d 0
11#define cpu_has_smartmips 0 12#define cpu_has_smartmips 0
diff --git a/arch/mips/include/asm/machine.h b/arch/mips/include/asm/machine.h
index 6b444cd9526f..ecb6c7335484 100644
--- a/arch/mips/include/asm/machine.h
+++ b/arch/mips/include/asm/machine.h
@@ -60,4 +60,35 @@ mips_machine_is_compatible(const struct mips_machine *mach, const void *fdt)
60 return NULL; 60 return NULL;
61} 61}
62 62
63/**
64 * struct mips_fdt_fixup - Describe a fixup to apply to an FDT
65 * @apply: applies the fixup to @fdt, returns zero on success else -errno
66 * @description: a short description of the fixup
67 *
68 * Describes a fixup applied to an FDT blob by the @apply function. The
69 * @description field provides a short description of the fixup intended for
70 * use in error messages if the @apply function returns non-zero.
71 */
72struct mips_fdt_fixup {
73 int (*apply)(void *fdt);
74 const char *description;
75};
76
77/**
78 * apply_mips_fdt_fixups() - apply fixups to an FDT blob
79 * @fdt_out: buffer in which to place the fixed-up FDT
80 * @fdt_out_size: the size of the @fdt_out buffer
81 * @fdt_in: the FDT blob
82 * @fixups: pointer to an array of fixups to be applied
83 *
84 * Loop through the array of fixups pointed to by @fixups, calling the apply
85 * function on each until either one returns an error or we reach the end of
86 * the list as indicated by an entry with a NULL apply field.
87 *
88 * Return: zero on success, else -errno
89 */
90extern int __init apply_mips_fdt_fixups(void *fdt_out, size_t fdt_out_size,
91 const void *fdt_in,
92 const struct mips_fdt_fixup *fixups);
93
63#endif /* __MIPS_ASM_MACHINE_H__ */ 94#endif /* __MIPS_ASM_MACHINE_H__ */
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 6875b69f59f7..dbb0eceda2c6 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -652,6 +652,7 @@
652#define MIPS_CONF5_SBRI (_ULCAST_(1) << 6) 652#define MIPS_CONF5_SBRI (_ULCAST_(1) << 6)
653#define MIPS_CONF5_FRE (_ULCAST_(1) << 8) 653#define MIPS_CONF5_FRE (_ULCAST_(1) << 8)
654#define MIPS_CONF5_UFE (_ULCAST_(1) << 9) 654#define MIPS_CONF5_UFE (_ULCAST_(1) << 9)
655#define MIPS_CONF5_CA2 (_ULCAST_(1) << 14)
655#define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27) 656#define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27)
656#define MIPS_CONF5_EVA (_ULCAST_(1) << 28) 657#define MIPS_CONF5_EVA (_ULCAST_(1) << 28)
657#define MIPS_CONF5_CV (_ULCAST_(1) << 29) 658#define MIPS_CONF5_CV (_ULCAST_(1) << 29)
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h
index 702c273e67a9..e51add184717 100644
--- a/arch/mips/include/asm/module.h
+++ b/arch/mips/include/asm/module.h
@@ -47,8 +47,8 @@ typedef struct {
47#define Elf_Mips_Rel Elf32_Rel 47#define Elf_Mips_Rel Elf32_Rel
48#define Elf_Mips_Rela Elf32_Rela 48#define Elf_Mips_Rela Elf32_Rela
49 49
50#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info) 50#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM((rel).r_info)
51#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info) 51#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE((rel).r_info)
52 52
53#endif 53#endif
54 54
@@ -65,8 +65,8 @@ typedef struct {
65#define Elf_Mips_Rel Elf64_Mips_Rel 65#define Elf_Mips_Rel Elf64_Mips_Rel
66#define Elf_Mips_Rela Elf64_Mips_Rela 66#define Elf_Mips_Rela Elf64_Mips_Rela
67 67
68#define ELF_MIPS_R_SYM(rel) (rel.r_sym) 68#define ELF_MIPS_R_SYM(rel) ((rel).r_sym)
69#define ELF_MIPS_R_TYPE(rel) (rel.r_type) 69#define ELF_MIPS_R_TYPE(rel) ((rel).r_type)
70 70
71#endif 71#endif
72 72
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
index a8df44d60607..a7d21da16b6a 100644
--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -9,431 +9,9 @@
9#ifndef _ASM_SPINLOCK_H 9#ifndef _ASM_SPINLOCK_H
10#define _ASM_SPINLOCK_H 10#define _ASM_SPINLOCK_H
11 11
12#include <linux/compiler.h>
13
14#include <asm/barrier.h>
15#include <asm/processor.h> 12#include <asm/processor.h>
16#include <asm/compiler.h> 13#include <asm/qrwlock.h>
17#include <asm/war.h> 14#include <asm/qspinlock.h>
18
19/*
20 * Your basic SMP spinlocks, allowing only a single CPU anywhere
21 *
22 * Simple spin lock operations. There are two variants, one clears IRQ's
23 * on the local processor, one does not.
24 *
25 * These are fair FIFO ticket locks
26 *
27 * (the type definitions are in asm/spinlock_types.h)
28 */
29
30
31/*
32 * Ticket locks are conceptually two parts, one indicating the current head of
33 * the queue, and the other indicating the current tail. The lock is acquired
34 * by atomically noting the tail and incrementing it by one (thus adding
35 * ourself to the queue and noting our position), then waiting until the head
36 * becomes equal to the the initial value of the tail.
37 */
38
39static inline int arch_spin_is_locked(arch_spinlock_t *lock)
40{
41 u32 counters = ACCESS_ONCE(lock->lock);
42
43 return ((counters >> 16) ^ counters) & 0xffff;
44}
45
46static inline int arch_spin_value_unlocked(arch_spinlock_t lock)
47{
48 return lock.h.serving_now == lock.h.ticket;
49}
50
51#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
52
53static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
54{
55 u16 owner = READ_ONCE(lock->h.serving_now);
56 smp_rmb();
57 for (;;) {
58 arch_spinlock_t tmp = READ_ONCE(*lock);
59
60 if (tmp.h.serving_now == tmp.h.ticket ||
61 tmp.h.serving_now != owner)
62 break;
63
64 cpu_relax();
65 }
66 smp_acquire__after_ctrl_dep();
67}
68
69static inline int arch_spin_is_contended(arch_spinlock_t *lock)
70{
71 u32 counters = ACCESS_ONCE(lock->lock);
72
73 return (((counters >> 16) - counters) & 0xffff) > 1;
74}
75#define arch_spin_is_contended arch_spin_is_contended
76
77static inline void arch_spin_lock(arch_spinlock_t *lock)
78{
79 int my_ticket;
80 int tmp;
81 int inc = 0x10000;
82
83 if (R10000_LLSC_WAR) {
84 __asm__ __volatile__ (
85 " .set push # arch_spin_lock \n"
86 " .set noreorder \n"
87 " \n"
88 "1: ll %[ticket], %[ticket_ptr] \n"
89 " addu %[my_ticket], %[ticket], %[inc] \n"
90 " sc %[my_ticket], %[ticket_ptr] \n"
91 " beqzl %[my_ticket], 1b \n"
92 " nop \n"
93 " srl %[my_ticket], %[ticket], 16 \n"
94 " andi %[ticket], %[ticket], 0xffff \n"
95 " bne %[ticket], %[my_ticket], 4f \n"
96 " subu %[ticket], %[my_ticket], %[ticket] \n"
97 "2: \n"
98 " .subsection 2 \n"
99 "4: andi %[ticket], %[ticket], 0xffff \n"
100 " sll %[ticket], 5 \n"
101 " \n"
102 "6: bnez %[ticket], 6b \n"
103 " subu %[ticket], 1 \n"
104 " \n"
105 " lhu %[ticket], %[serving_now_ptr] \n"
106 " beq %[ticket], %[my_ticket], 2b \n"
107 " subu %[ticket], %[my_ticket], %[ticket] \n"
108 " b 4b \n"
109 " subu %[ticket], %[ticket], 1 \n"
110 " .previous \n"
111 " .set pop \n"
112 : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock),
113 [serving_now_ptr] "+m" (lock->h.serving_now),
114 [ticket] "=&r" (tmp),
115 [my_ticket] "=&r" (my_ticket)
116 : [inc] "r" (inc));
117 } else {
118 __asm__ __volatile__ (
119 " .set push # arch_spin_lock \n"
120 " .set noreorder \n"
121 " \n"
122 "1: ll %[ticket], %[ticket_ptr] \n"
123 " addu %[my_ticket], %[ticket], %[inc] \n"
124 " sc %[my_ticket], %[ticket_ptr] \n"
125 " beqz %[my_ticket], 1b \n"
126 " srl %[my_ticket], %[ticket], 16 \n"
127 " andi %[ticket], %[ticket], 0xffff \n"
128 " bne %[ticket], %[my_ticket], 4f \n"
129 " subu %[ticket], %[my_ticket], %[ticket] \n"
130 "2: .insn \n"
131 " .subsection 2 \n"
132 "4: andi %[ticket], %[ticket], 0xffff \n"
133 " sll %[ticket], 5 \n"
134 " \n"
135 "6: bnez %[ticket], 6b \n"
136 " subu %[ticket], 1 \n"
137 " \n"
138 " lhu %[ticket], %[serving_now_ptr] \n"
139 " beq %[ticket], %[my_ticket], 2b \n"
140 " subu %[ticket], %[my_ticket], %[ticket] \n"
141 " b 4b \n"
142 " subu %[ticket], %[ticket], 1 \n"
143 " .previous \n"
144 " .set pop \n"
145 : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock),
146 [serving_now_ptr] "+m" (lock->h.serving_now),
147 [ticket] "=&r" (tmp),
148 [my_ticket] "=&r" (my_ticket)
149 : [inc] "r" (inc));
150 }
151
152 smp_llsc_mb();
153}
154
155static inline void arch_spin_unlock(arch_spinlock_t *lock)
156{
157 unsigned int serving_now = lock->h.serving_now + 1;
158 wmb();
159 lock->h.serving_now = (u16)serving_now;
160 nudge_writes();
161}
162
163static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock)
164{
165 int tmp, tmp2, tmp3;
166 int inc = 0x10000;
167
168 if (R10000_LLSC_WAR) {
169 __asm__ __volatile__ (
170 " .set push # arch_spin_trylock \n"
171 " .set noreorder \n"
172 " \n"
173 "1: ll %[ticket], %[ticket_ptr] \n"
174 " srl %[my_ticket], %[ticket], 16 \n"
175 " andi %[now_serving], %[ticket], 0xffff \n"
176 " bne %[my_ticket], %[now_serving], 3f \n"
177 " addu %[ticket], %[ticket], %[inc] \n"
178 " sc %[ticket], %[ticket_ptr] \n"
179 " beqzl %[ticket], 1b \n"
180 " li %[ticket], 1 \n"
181 "2: \n"
182 " .subsection 2 \n"
183 "3: b 2b \n"
184 " li %[ticket], 0 \n"
185 " .previous \n"
186 " .set pop \n"
187 : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock),
188 [ticket] "=&r" (tmp),
189 [my_ticket] "=&r" (tmp2),
190 [now_serving] "=&r" (tmp3)
191 : [inc] "r" (inc));
192 } else {
193 __asm__ __volatile__ (
194 " .set push # arch_spin_trylock \n"
195 " .set noreorder \n"
196 " \n"
197 "1: ll %[ticket], %[ticket_ptr] \n"
198 " srl %[my_ticket], %[ticket], 16 \n"
199 " andi %[now_serving], %[ticket], 0xffff \n"
200 " bne %[my_ticket], %[now_serving], 3f \n"
201 " addu %[ticket], %[ticket], %[inc] \n"
202 " sc %[ticket], %[ticket_ptr] \n"
203 " beqz %[ticket], 1b \n"
204 " li %[ticket], 1 \n"
205 "2: .insn \n"
206 " .subsection 2 \n"
207 "3: b 2b \n"
208 " li %[ticket], 0 \n"
209 " .previous \n"
210 " .set pop \n"
211 : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock),
212 [ticket] "=&r" (tmp),
213 [my_ticket] "=&r" (tmp2),
214 [now_serving] "=&r" (tmp3)
215 : [inc] "r" (inc));
216 }
217
218 smp_llsc_mb();
219
220 return tmp;
221}
222
223/*
224 * Read-write spinlocks, allowing multiple readers but only one writer.
225 *
226 * NOTE! it is quite common to have readers in interrupts but no interrupt
227 * writers. For those circumstances we can "mix" irq-safe locks - any writer
228 * needs to get a irq-safe write-lock, but readers can get non-irqsafe
229 * read-locks.
230 */
231
232/*
233 * read_can_lock - would read_trylock() succeed?
234 * @lock: the rwlock in question.
235 */
236#define arch_read_can_lock(rw) ((rw)->lock >= 0)
237
238/*
239 * write_can_lock - would write_trylock() succeed?
240 * @lock: the rwlock in question.
241 */
242#define arch_write_can_lock(rw) (!(rw)->lock)
243
244static inline void arch_read_lock(arch_rwlock_t *rw)
245{
246 unsigned int tmp;
247
248 if (R10000_LLSC_WAR) {
249 __asm__ __volatile__(
250 " .set noreorder # arch_read_lock \n"
251 "1: ll %1, %2 \n"
252 " bltz %1, 1b \n"
253 " addu %1, 1 \n"
254 " sc %1, %0 \n"
255 " beqzl %1, 1b \n"
256 " nop \n"
257 " .set reorder \n"
258 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
259 : GCC_OFF_SMALL_ASM() (rw->lock)
260 : "memory");
261 } else {
262 do {
263 __asm__ __volatile__(
264 "1: ll %1, %2 # arch_read_lock \n"
265 " bltz %1, 1b \n"
266 " addu %1, 1 \n"
267 "2: sc %1, %0 \n"
268 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
269 : GCC_OFF_SMALL_ASM() (rw->lock)
270 : "memory");
271 } while (unlikely(!tmp));
272 }
273
274 smp_llsc_mb();
275}
276
277static inline void arch_read_unlock(arch_rwlock_t *rw)
278{
279 unsigned int tmp;
280
281 smp_mb__before_llsc();
282
283 if (R10000_LLSC_WAR) {
284 __asm__ __volatile__(
285 "1: ll %1, %2 # arch_read_unlock \n"
286 " addiu %1, -1 \n"
287 " sc %1, %0 \n"
288 " beqzl %1, 1b \n"
289 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
290 : GCC_OFF_SMALL_ASM() (rw->lock)
291 : "memory");
292 } else {
293 do {
294 __asm__ __volatile__(
295 "1: ll %1, %2 # arch_read_unlock \n"
296 " addiu %1, -1 \n"
297 " sc %1, %0 \n"
298 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
299 : GCC_OFF_SMALL_ASM() (rw->lock)
300 : "memory");
301 } while (unlikely(!tmp));
302 }
303}
304
305static inline void arch_write_lock(arch_rwlock_t *rw)
306{
307 unsigned int tmp;
308
309 if (R10000_LLSC_WAR) {
310 __asm__ __volatile__(
311 " .set noreorder # arch_write_lock \n"
312 "1: ll %1, %2 \n"
313 " bnez %1, 1b \n"
314 " lui %1, 0x8000 \n"
315 " sc %1, %0 \n"
316 " beqzl %1, 1b \n"
317 " nop \n"
318 " .set reorder \n"
319 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
320 : GCC_OFF_SMALL_ASM() (rw->lock)
321 : "memory");
322 } else {
323 do {
324 __asm__ __volatile__(
325 "1: ll %1, %2 # arch_write_lock \n"
326 " bnez %1, 1b \n"
327 " lui %1, 0x8000 \n"
328 "2: sc %1, %0 \n"
329 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
330 : GCC_OFF_SMALL_ASM() (rw->lock)
331 : "memory");
332 } while (unlikely(!tmp));
333 }
334
335 smp_llsc_mb();
336}
337
338static inline void arch_write_unlock(arch_rwlock_t *rw)
339{
340 smp_mb__before_llsc();
341
342 __asm__ __volatile__(
343 " # arch_write_unlock \n"
344 " sw $0, %0 \n"
345 : "=m" (rw->lock)
346 : "m" (rw->lock)
347 : "memory");
348}
349
350static inline int arch_read_trylock(arch_rwlock_t *rw)
351{
352 unsigned int tmp;
353 int ret;
354
355 if (R10000_LLSC_WAR) {
356 __asm__ __volatile__(
357 " .set noreorder # arch_read_trylock \n"
358 " li %2, 0 \n"
359 "1: ll %1, %3 \n"
360 " bltz %1, 2f \n"
361 " addu %1, 1 \n"
362 " sc %1, %0 \n"
363 " .set reorder \n"
364 " beqzl %1, 1b \n"
365 " nop \n"
366 __WEAK_LLSC_MB
367 " li %2, 1 \n"
368 "2: \n"
369 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp), "=&r" (ret)
370 : GCC_OFF_SMALL_ASM() (rw->lock)
371 : "memory");
372 } else {
373 __asm__ __volatile__(
374 " .set noreorder # arch_read_trylock \n"
375 " li %2, 0 \n"
376 "1: ll %1, %3 \n"
377 " bltz %1, 2f \n"
378 " addu %1, 1 \n"
379 " sc %1, %0 \n"
380 " beqz %1, 1b \n"
381 " nop \n"
382 " .set reorder \n"
383 __WEAK_LLSC_MB
384 " li %2, 1 \n"
385 "2: .insn \n"
386 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp), "=&r" (ret)
387 : GCC_OFF_SMALL_ASM() (rw->lock)
388 : "memory");
389 }
390
391 return ret;
392}
393
394static inline int arch_write_trylock(arch_rwlock_t *rw)
395{
396 unsigned int tmp;
397 int ret;
398
399 if (R10000_LLSC_WAR) {
400 __asm__ __volatile__(
401 " .set noreorder # arch_write_trylock \n"
402 " li %2, 0 \n"
403 "1: ll %1, %3 \n"
404 " bnez %1, 2f \n"
405 " lui %1, 0x8000 \n"
406 " sc %1, %0 \n"
407 " beqzl %1, 1b \n"
408 " nop \n"
409 __WEAK_LLSC_MB
410 " li %2, 1 \n"
411 " .set reorder \n"
412 "2: \n"
413 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp), "=&r" (ret)
414 : GCC_OFF_SMALL_ASM() (rw->lock)
415 : "memory");
416 } else {
417 do {
418 __asm__ __volatile__(
419 " ll %1, %3 # arch_write_trylock \n"
420 " li %2, 0 \n"
421 " bnez %1, 2f \n"
422 " lui %1, 0x8000 \n"
423 " sc %1, %0 \n"
424 " li %2, 1 \n"
425 "2: .insn \n"
426 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp),
427 "=&r" (ret)
428 : GCC_OFF_SMALL_ASM() (rw->lock)
429 : "memory");
430 } while (unlikely(!tmp));
431
432 smp_llsc_mb();
433 }
434
435 return ret;
436}
437 15
438#define arch_read_lock_flags(lock, flags) arch_read_lock(lock) 16#define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
439#define arch_write_lock_flags(lock, flags) arch_write_lock(lock) 17#define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
diff --git a/arch/mips/include/asm/spinlock_types.h b/arch/mips/include/asm/spinlock_types.h
index 9b2528e612c0..177e722eb96c 100644
--- a/arch/mips/include/asm/spinlock_types.h
+++ b/arch/mips/include/asm/spinlock_types.h
@@ -1,37 +1,7 @@
1#ifndef _ASM_SPINLOCK_TYPES_H 1#ifndef _ASM_SPINLOCK_TYPES_H
2#define _ASM_SPINLOCK_TYPES_H 2#define _ASM_SPINLOCK_TYPES_H
3 3
4#ifndef __LINUX_SPINLOCK_TYPES_H 4#include <asm-generic/qspinlock_types.h>
5# error "please don't include this file directly" 5#include <asm-generic/qrwlock_types.h>
6#endif
7
8#include <linux/types.h>
9
10#include <asm/byteorder.h>
11
12typedef union {
13 /*
14 * bits 0..15 : serving_now
15 * bits 16..31 : ticket
16 */
17 u32 lock;
18 struct {
19#ifdef __BIG_ENDIAN
20 u16 ticket;
21 u16 serving_now;
22#else
23 u16 serving_now;
24 u16 ticket;
25#endif
26 } h;
27} arch_spinlock_t;
28
29#define __ARCH_SPIN_LOCK_UNLOCKED { .lock = 0 }
30
31typedef struct {
32 volatile unsigned int lock;
33} arch_rwlock_t;
34
35#define __ARCH_RW_LOCK_UNLOCKED { 0 }
36 6
37#endif 7#endif
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index d87882513ee3..7c713025b23f 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -85,7 +85,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
85{ 85{
86 if (error) { 86 if (error) {
87 regs->regs[2] = -error; 87 regs->regs[2] = -error;
88 regs->regs[7] = -1; 88 regs->regs[7] = 1;
89 } else { 89 } else {
90 regs->regs[2] = val; 90 regs->regs[2] = val;
91 regs->regs[7] = 0; 91 regs->regs[7] = 0;
diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h
index 3748f4d120a5..59dae37f6b8d 100644
--- a/arch/mips/include/asm/uasm.h
+++ b/arch/mips/include/asm/uasm.h
@@ -72,9 +72,12 @@ Ip_u1u2s3(_beq);
72Ip_u1u2s3(_beql); 72Ip_u1u2s3(_beql);
73Ip_u1s2(_bgez); 73Ip_u1s2(_bgez);
74Ip_u1s2(_bgezl); 74Ip_u1s2(_bgezl);
75Ip_u1s2(_bgtz);
76Ip_u1s2(_blez);
75Ip_u1s2(_bltz); 77Ip_u1s2(_bltz);
76Ip_u1s2(_bltzl); 78Ip_u1s2(_bltzl);
77Ip_u1u2s3(_bne); 79Ip_u1u2s3(_bne);
80Ip_u1(_break);
78Ip_u2s3u1(_cache); 81Ip_u2s3u1(_cache);
79Ip_u1u2(_cfc1); 82Ip_u1u2(_cfc1);
80Ip_u2u1(_cfcmsa); 83Ip_u2u1(_cfcmsa);
@@ -82,19 +85,28 @@ Ip_u1u2(_ctc1);
82Ip_u2u1(_ctcmsa); 85Ip_u2u1(_ctcmsa);
83Ip_u2u1s3(_daddiu); 86Ip_u2u1s3(_daddiu);
84Ip_u3u1u2(_daddu); 87Ip_u3u1u2(_daddu);
88Ip_u1u2(_ddivu);
85Ip_u1(_di); 89Ip_u1(_di);
86Ip_u2u1msbu3(_dins); 90Ip_u2u1msbu3(_dins);
87Ip_u2u1msbu3(_dinsm); 91Ip_u2u1msbu3(_dinsm);
92Ip_u2u1msbu3(_dinsu);
88Ip_u1u2(_divu); 93Ip_u1u2(_divu);
89Ip_u1u2u3(_dmfc0); 94Ip_u1u2u3(_dmfc0);
90Ip_u1u2u3(_dmtc0); 95Ip_u1u2u3(_dmtc0);
96Ip_u1u2(_dmultu);
91Ip_u2u1u3(_drotr); 97Ip_u2u1u3(_drotr);
92Ip_u2u1u3(_drotr32); 98Ip_u2u1u3(_drotr32);
99Ip_u2u1(_dsbh);
100Ip_u2u1(_dshd);
93Ip_u2u1u3(_dsll); 101Ip_u2u1u3(_dsll);
94Ip_u2u1u3(_dsll32); 102Ip_u2u1u3(_dsll32);
103Ip_u3u2u1(_dsllv);
95Ip_u2u1u3(_dsra); 104Ip_u2u1u3(_dsra);
105Ip_u2u1u3(_dsra32);
106Ip_u3u2u1(_dsrav);
96Ip_u2u1u3(_dsrl); 107Ip_u2u1u3(_dsrl);
97Ip_u2u1u3(_dsrl32); 108Ip_u2u1u3(_dsrl32);
109Ip_u3u2u1(_dsrlv);
98Ip_u3u1u2(_dsubu); 110Ip_u3u1u2(_dsubu);
99Ip_0(_eret); 111Ip_0(_eret);
100Ip_u2u1msbu3(_ext); 112Ip_u2u1msbu3(_ext);
@@ -104,6 +116,7 @@ Ip_u1(_jal);
104Ip_u2u1(_jalr); 116Ip_u2u1(_jalr);
105Ip_u1(_jr); 117Ip_u1(_jr);
106Ip_u2s3u1(_lb); 118Ip_u2s3u1(_lb);
119Ip_u2s3u1(_lbu);
107Ip_u2s3u1(_ld); 120Ip_u2s3u1(_ld);
108Ip_u3u1u2(_ldx); 121Ip_u3u1u2(_ldx);
109Ip_u2s3u1(_lh); 122Ip_u2s3u1(_lh);
@@ -112,27 +125,35 @@ Ip_u2s3u1(_ll);
112Ip_u2s3u1(_lld); 125Ip_u2s3u1(_lld);
113Ip_u1s2(_lui); 126Ip_u1s2(_lui);
114Ip_u2s3u1(_lw); 127Ip_u2s3u1(_lw);
128Ip_u2s3u1(_lwu);
115Ip_u3u1u2(_lwx); 129Ip_u3u1u2(_lwx);
116Ip_u1u2u3(_mfc0); 130Ip_u1u2u3(_mfc0);
117Ip_u1u2u3(_mfhc0); 131Ip_u1u2u3(_mfhc0);
118Ip_u1(_mfhi); 132Ip_u1(_mfhi);
119Ip_u1(_mflo); 133Ip_u1(_mflo);
134Ip_u3u1u2(_movn);
135Ip_u3u1u2(_movz);
120Ip_u1u2u3(_mtc0); 136Ip_u1u2u3(_mtc0);
121Ip_u1u2u3(_mthc0); 137Ip_u1u2u3(_mthc0);
122Ip_u1(_mthi); 138Ip_u1(_mthi);
123Ip_u1(_mtlo); 139Ip_u1(_mtlo);
124Ip_u3u1u2(_mul); 140Ip_u3u1u2(_mul);
141Ip_u1u2(_multu);
142Ip_u3u1u2(_nor);
125Ip_u3u1u2(_or); 143Ip_u3u1u2(_or);
126Ip_u2u1u3(_ori); 144Ip_u2u1u3(_ori);
127Ip_u2s3u1(_pref); 145Ip_u2s3u1(_pref);
128Ip_0(_rfe); 146Ip_0(_rfe);
129Ip_u2u1u3(_rotr); 147Ip_u2u1u3(_rotr);
148Ip_u2s3u1(_sb);
130Ip_u2s3u1(_sc); 149Ip_u2s3u1(_sc);
131Ip_u2s3u1(_scd); 150Ip_u2s3u1(_scd);
132Ip_u2s3u1(_sd); 151Ip_u2s3u1(_sd);
152Ip_u2s3u1(_sh);
133Ip_u2u1u3(_sll); 153Ip_u2u1u3(_sll);
134Ip_u3u2u1(_sllv); 154Ip_u3u2u1(_sllv);
135Ip_s3s1s2(_slt); 155Ip_s3s1s2(_slt);
156Ip_u2u1s3(_slti);
136Ip_u2u1s3(_sltiu); 157Ip_u2u1s3(_sltiu);
137Ip_u3u1u2(_sltu); 158Ip_u3u1u2(_sltu);
138Ip_u2u1u3(_sra); 159Ip_u2u1u3(_sra);
@@ -248,6 +269,15 @@ static inline void uasm_i_dsrl_safe(u32 **p, unsigned int a1,
248 uasm_i_dsrl32(p, a1, a2, a3 - 32); 269 uasm_i_dsrl32(p, a1, a2, a3 - 32);
249} 270}
250 271
272static inline void uasm_i_dsra_safe(u32 **p, unsigned int a1,
273 unsigned int a2, unsigned int a3)
274{
275 if (a3 < 32)
276 uasm_i_dsra(p, a1, a2, a3);
277 else
278 uasm_i_dsra32(p, a1, a2, a3 - 32);
279}
280
251/* Handle relocations. */ 281/* Handle relocations. */
252struct uasm_reloc { 282struct uasm_reloc {
253 u32 *addr; 283 u32 *addr;
diff --git a/arch/mips/include/asm/vdso.h b/arch/mips/include/asm/vdso.h
index 8f4ca5dd992b..b7cd6cf77b83 100644
--- a/arch/mips/include/asm/vdso.h
+++ b/arch/mips/include/asm/vdso.h
@@ -79,8 +79,8 @@ union mips_vdso_data {
79 struct { 79 struct {
80 u64 xtime_sec; 80 u64 xtime_sec;
81 u64 xtime_nsec; 81 u64 xtime_nsec;
82 u32 wall_to_mono_sec; 82 u64 wall_to_mono_sec;
83 u32 wall_to_mono_nsec; 83 u64 wall_to_mono_nsec;
84 u32 seq_count; 84 u32 seq_count;
85 u32 cs_shift; 85 u32 cs_shift;
86 u8 clock_mode; 86 u8 clock_mode;
diff --git a/arch/mips/include/asm/yamon-dt.h b/arch/mips/include/asm/yamon-dt.h
new file mode 100644
index 000000000000..485cfe3e45e1
--- /dev/null
+++ b/arch/mips/include/asm/yamon-dt.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2016 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __MIPS_ASM_YAMON_DT_H__
12#define __MIPS_ASM_YAMON_DT_H__
13
14#include <linux/types.h>
15
16/**
17 * struct yamon_mem_region - Represents a contiguous range of physical RAM.
18 * @start: Start physical address.
19 * @size: Maximum size of region.
20 * @discard: Length of additional memory to discard after the region.
21 */
22struct yamon_mem_region {
23 phys_addr_t start;
24 phys_addr_t size;
25 phys_addr_t discard;
26};
27
28/**
29 * yamon_dt_append_cmdline() - Append YAMON-provided command line to /chosen
30 * @fdt: the FDT blob
31 *
32 * Write the YAMON-provided command line to the bootargs property of the
33 * /chosen node in @fdt.
34 *
35 * Return: 0 on success, else -errno
36 */
37extern __init int yamon_dt_append_cmdline(void *fdt);
38
39/**
40 * yamon_dt_append_memory() - Append YAMON-provided memory info to /memory
41 * @fdt: the FDT blob
42 * @regions: zero size terminated array of physical memory regions
43 *
44 * Generate a /memory node in @fdt based upon memory size information provided
45 * by YAMON in its environment and the @regions array.
46 *
47 * Return: 0 on success, else -errno
48 */
49extern __init int yamon_dt_append_memory(void *fdt,
50 const struct yamon_mem_region *regions);
51
52/**
53 * yamon_dt_serial_config() - Append YAMON-provided serial config to /chosen
54 * @fdt: the FDT blob
55 *
56 * Generate a stdout-path property in the /chosen node of @fdt, based upon
57 * information provided in the YAMON environment about the UART configuration
58 * of the system.
59 *
60 * Return: 0 on success, else -errno
61 */
62extern __init int yamon_dt_serial_config(void *fdt);
63
64#endif /* __MIPS_ASM_YAMON_DT_H__ */
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h
index b5e46ae872d3..d61897535926 100644
--- a/arch/mips/include/uapi/asm/inst.h
+++ b/arch/mips/include/uapi/asm/inst.h
@@ -276,12 +276,19 @@ enum lx_func {
276 */ 276 */
277enum bshfl_func { 277enum bshfl_func {
278 wsbh_op = 0x2, 278 wsbh_op = 0x2,
279 dshd_op = 0x5,
280 seb_op = 0x10, 279 seb_op = 0x10,
281 seh_op = 0x18, 280 seh_op = 0x18,
282}; 281};
283 282
284/* 283/*
284 * DBSHFL opcodes
285 */
286enum dbshfl_func {
287 dsbh_op = 0x2,
288 dshd_op = 0x5,
289};
290
291/*
285 * MSA minor opcodes. 292 * MSA minor opcodes.
286 */ 293 */
287enum msa_func { 294enum msa_func {
@@ -755,6 +762,16 @@ struct msa_mi10_format { /* MSA MI10 */
755 ;)))))) 762 ;))))))
756}; 763};
757 764
765struct dsp_format { /* SPEC3 DSP format instructions */
766 __BITFIELD_FIELD(unsigned int opcode : 6,
767 __BITFIELD_FIELD(unsigned int base : 5,
768 __BITFIELD_FIELD(unsigned int index : 5,
769 __BITFIELD_FIELD(unsigned int rd : 5,
770 __BITFIELD_FIELD(unsigned int op : 5,
771 __BITFIELD_FIELD(unsigned int func : 6,
772 ;))))))
773};
774
758struct spec3_format { /* SPEC3 */ 775struct spec3_format { /* SPEC3 */
759 __BITFIELD_FIELD(unsigned int opcode:6, 776 __BITFIELD_FIELD(unsigned int opcode:6,
760 __BITFIELD_FIELD(unsigned int rs:5, 777 __BITFIELD_FIELD(unsigned int rs:5,
@@ -1046,6 +1063,7 @@ union mips_instruction {
1046 struct b_format b_format; 1063 struct b_format b_format;
1047 struct ps_format ps_format; 1064 struct ps_format ps_format;
1048 struct v_format v_format; 1065 struct v_format v_format;
1066 struct dsp_format dsp_format;
1049 struct spec3_format spec3_format; 1067 struct spec3_format spec3_format;
1050 struct fb_format fb_format; 1068 struct fb_format fb_format;
1051 struct fp0_format fp0_format; 1069 struct fp0_format fp0_format;
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 9a0e37b92ce0..46c0581256f1 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -4,7 +4,7 @@
4 4
5extra-y := head.o vmlinux.lds 5extra-y := head.o vmlinux.lds
6 6
7obj-y += cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \ 7obj-y += cmpxchg.o cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \
8 process.o prom.o ptrace.o reset.o setup.o signal.o \ 8 process.o prom.o ptrace.o reset.o setup.o signal.o \
9 syscall.o time.o topology.o traps.o unaligned.o watch.o \ 9 syscall.o time.o topology.o traps.o unaligned.o watch.o \
10 vdso.o cacheinfo.o 10 vdso.o cacheinfo.o
@@ -31,7 +31,6 @@ obj-$(CONFIG_SYNC_R4K) += sync-r4k.o
31obj-$(CONFIG_DEBUG_FS) += segment.o 31obj-$(CONFIG_DEBUG_FS) += segment.o
32obj-$(CONFIG_STACKTRACE) += stacktrace.o 32obj-$(CONFIG_STACKTRACE) += stacktrace.o
33obj-$(CONFIG_MODULES) += module.o 33obj-$(CONFIG_MODULES) += module.o
34obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o
35 34
36obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o 35obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
37obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o 36obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c
index f702a459a830..b79ed9af9886 100644
--- a/arch/mips/kernel/branch.c
+++ b/arch/mips/kernel/branch.c
@@ -399,7 +399,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
399 * 399 *
400 * @regs: Pointer to pt_regs 400 * @regs: Pointer to pt_regs
401 * @insn: branch instruction to decode 401 * @insn: branch instruction to decode
402 * @returns: -EFAULT on error and forces SIGBUS, and on success 402 * @returns: -EFAULT on error and forces SIGILL, and on success
403 * returns 0 or BRANCH_LIKELY_TAKEN as appropriate after 403 * returns 0 or BRANCH_LIKELY_TAKEN as appropriate after
404 * evaluating the branch. 404 * evaluating the branch.
405 * 405 *
@@ -431,7 +431,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
431 /* Fall through */ 431 /* Fall through */
432 case jr_op: 432 case jr_op:
433 if (NO_R6EMU && insn.r_format.func == jr_op) 433 if (NO_R6EMU && insn.r_format.func == jr_op)
434 goto sigill_r6; 434 goto sigill_r2r6;
435 regs->cp0_epc = regs->regs[insn.r_format.rs]; 435 regs->cp0_epc = regs->regs[insn.r_format.rs];
436 break; 436 break;
437 } 437 }
@@ -446,7 +446,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
446 switch (insn.i_format.rt) { 446 switch (insn.i_format.rt) {
447 case bltzl_op: 447 case bltzl_op:
448 if (NO_R6EMU) 448 if (NO_R6EMU)
449 goto sigill_r6; 449 goto sigill_r2r6;
450 case bltz_op: 450 case bltz_op:
451 if ((long)regs->regs[insn.i_format.rs] < 0) { 451 if ((long)regs->regs[insn.i_format.rs] < 0) {
452 epc = epc + 4 + (insn.i_format.simmediate << 2); 452 epc = epc + 4 + (insn.i_format.simmediate << 2);
@@ -459,7 +459,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
459 459
460 case bgezl_op: 460 case bgezl_op:
461 if (NO_R6EMU) 461 if (NO_R6EMU)
462 goto sigill_r6; 462 goto sigill_r2r6;
463 case bgez_op: 463 case bgez_op:
464 if ((long)regs->regs[insn.i_format.rs] >= 0) { 464 if ((long)regs->regs[insn.i_format.rs] >= 0) {
465 epc = epc + 4 + (insn.i_format.simmediate << 2); 465 epc = epc + 4 + (insn.i_format.simmediate << 2);
@@ -473,10 +473,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
473 case bltzal_op: 473 case bltzal_op:
474 case bltzall_op: 474 case bltzall_op:
475 if (NO_R6EMU && (insn.i_format.rs || 475 if (NO_R6EMU && (insn.i_format.rs ||
476 insn.i_format.rt == bltzall_op)) { 476 insn.i_format.rt == bltzall_op))
477 ret = -SIGILL; 477 goto sigill_r2r6;
478 break;
479 }
480 regs->regs[31] = epc + 8; 478 regs->regs[31] = epc + 8;
481 /* 479 /*
482 * OK we are here either because we hit a NAL 480 * OK we are here either because we hit a NAL
@@ -507,10 +505,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
507 case bgezal_op: 505 case bgezal_op:
508 case bgezall_op: 506 case bgezall_op:
509 if (NO_R6EMU && (insn.i_format.rs || 507 if (NO_R6EMU && (insn.i_format.rs ||
510 insn.i_format.rt == bgezall_op)) { 508 insn.i_format.rt == bgezall_op))
511 ret = -SIGILL; 509 goto sigill_r2r6;
512 break;
513 }
514 regs->regs[31] = epc + 8; 510 regs->regs[31] = epc + 8;
515 /* 511 /*
516 * OK we are here either because we hit a BAL 512 * OK we are here either because we hit a BAL
@@ -556,6 +552,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
556 /* 552 /*
557 * These are unconditional and in j_format. 553 * These are unconditional and in j_format.
558 */ 554 */
555 case jalx_op:
559 case jal_op: 556 case jal_op:
560 regs->regs[31] = regs->cp0_epc + 8; 557 regs->regs[31] = regs->cp0_epc + 8;
561 case j_op: 558 case j_op:
@@ -573,7 +570,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
573 */ 570 */
574 case beql_op: 571 case beql_op:
575 if (NO_R6EMU) 572 if (NO_R6EMU)
576 goto sigill_r6; 573 goto sigill_r2r6;
577 case beq_op: 574 case beq_op:
578 if (regs->regs[insn.i_format.rs] == 575 if (regs->regs[insn.i_format.rs] ==
579 regs->regs[insn.i_format.rt]) { 576 regs->regs[insn.i_format.rt]) {
@@ -587,7 +584,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
587 584
588 case bnel_op: 585 case bnel_op:
589 if (NO_R6EMU) 586 if (NO_R6EMU)
590 goto sigill_r6; 587 goto sigill_r2r6;
591 case bne_op: 588 case bne_op:
592 if (regs->regs[insn.i_format.rs] != 589 if (regs->regs[insn.i_format.rs] !=
593 regs->regs[insn.i_format.rt]) { 590 regs->regs[insn.i_format.rt]) {
@@ -601,7 +598,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
601 598
602 case blezl_op: /* not really i_format */ 599 case blezl_op: /* not really i_format */
603 if (!insn.i_format.rt && NO_R6EMU) 600 if (!insn.i_format.rt && NO_R6EMU)
604 goto sigill_r6; 601 goto sigill_r2r6;
605 case blez_op: 602 case blez_op:
606 /* 603 /*
607 * Compact branches for R6 for the 604 * Compact branches for R6 for the
@@ -636,7 +633,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
636 633
637 case bgtzl_op: 634 case bgtzl_op:
638 if (!insn.i_format.rt && NO_R6EMU) 635 if (!insn.i_format.rt && NO_R6EMU)
639 goto sigill_r6; 636 goto sigill_r2r6;
640 case bgtz_op: 637 case bgtz_op:
641 /* 638 /*
642 * Compact branches for R6 for the 639 * Compact branches for R6 for the
@@ -774,35 +771,27 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
774#else 771#else
775 case bc6_op: 772 case bc6_op:
776 /* Only valid for MIPS R6 */ 773 /* Only valid for MIPS R6 */
777 if (!cpu_has_mips_r6) { 774 if (!cpu_has_mips_r6)
778 ret = -SIGILL; 775 goto sigill_r6;
779 break;
780 }
781 regs->cp0_epc += 8; 776 regs->cp0_epc += 8;
782 break; 777 break;
783 case balc6_op: 778 case balc6_op:
784 if (!cpu_has_mips_r6) { 779 if (!cpu_has_mips_r6)
785 ret = -SIGILL; 780 goto sigill_r6;
786 break;
787 }
788 /* Compact branch: BALC */ 781 /* Compact branch: BALC */
789 regs->regs[31] = epc + 4; 782 regs->regs[31] = epc + 4;
790 epc += 4 + (insn.i_format.simmediate << 2); 783 epc += 4 + (insn.i_format.simmediate << 2);
791 regs->cp0_epc = epc; 784 regs->cp0_epc = epc;
792 break; 785 break;
793 case pop66_op: 786 case pop66_op:
794 if (!cpu_has_mips_r6) { 787 if (!cpu_has_mips_r6)
795 ret = -SIGILL; 788 goto sigill_r6;
796 break;
797 }
798 /* Compact branch: BEQZC || JIC */ 789 /* Compact branch: BEQZC || JIC */
799 regs->cp0_epc += 8; 790 regs->cp0_epc += 8;
800 break; 791 break;
801 case pop76_op: 792 case pop76_op:
802 if (!cpu_has_mips_r6) { 793 if (!cpu_has_mips_r6)
803 ret = -SIGILL; 794 goto sigill_r6;
804 break;
805 }
806 /* Compact branch: BNEZC || JIALC */ 795 /* Compact branch: BNEZC || JIALC */
807 if (!insn.i_format.rs) { 796 if (!insn.i_format.rs) {
808 /* JIALC: set $31/ra */ 797 /* JIALC: set $31/ra */
@@ -814,10 +803,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
814 case pop10_op: 803 case pop10_op:
815 case pop30_op: 804 case pop30_op:
816 /* Only valid for MIPS R6 */ 805 /* Only valid for MIPS R6 */
817 if (!cpu_has_mips_r6) { 806 if (!cpu_has_mips_r6)
818 ret = -SIGILL; 807 goto sigill_r6;
819 break;
820 }
821 /* 808 /*
822 * Compact branches: 809 * Compact branches:
823 * bovc, beqc, beqzalc, bnvc, bnec, bnezlac 810 * bovc, beqc, beqzalc, bnvc, bnec, bnezlac
@@ -831,12 +818,18 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
831 return ret; 818 return ret;
832 819
833sigill_dsp: 820sigill_dsp:
834 printk("%s: DSP branch but not DSP ASE - sending SIGBUS.\n", current->comm); 821 pr_debug("%s: DSP branch but not DSP ASE - sending SIGILL.\n",
835 force_sig(SIGBUS, current); 822 current->comm);
823 force_sig(SIGILL, current);
824 return -EFAULT;
825sigill_r2r6:
826 pr_debug("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n",
827 current->comm);
828 force_sig(SIGILL, current);
836 return -EFAULT; 829 return -EFAULT;
837sigill_r6: 830sigill_r6:
838 pr_info("%s: R2 branch but r2-to-r6 emulator is not preset - sending SIGILL.\n", 831 pr_debug("%s: R6 branch but no MIPSr6 ISA support - sending SIGILL.\n",
839 current->comm); 832 current->comm);
840 force_sig(SIGILL, current); 833 force_sig(SIGILL, current);
841 return -EFAULT; 834 return -EFAULT;
842} 835}
diff --git a/arch/mips/kernel/cmpxchg.c b/arch/mips/kernel/cmpxchg.c
new file mode 100644
index 000000000000..7730f1d3434f
--- /dev/null
+++ b/arch/mips/kernel/cmpxchg.c
@@ -0,0 +1,109 @@
1/*
2 * Copyright (C) 2017 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/bitops.h>
12#include <asm/cmpxchg.h>
13
14unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int size)
15{
16 u32 old32, new32, load32, mask;
17 volatile u32 *ptr32;
18 unsigned int shift;
19
20 /* Check that ptr is naturally aligned */
21 WARN_ON((unsigned long)ptr & (size - 1));
22
23 /* Mask value to the correct size. */
24 mask = GENMASK((size * BITS_PER_BYTE) - 1, 0);
25 val &= mask;
26
27 /*
28 * Calculate a shift & mask that correspond to the value we wish to
29 * exchange within the naturally aligned 4 byte integerthat includes
30 * it.
31 */
32 shift = (unsigned long)ptr & 0x3;
33 if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
34 shift ^= sizeof(u32) - size;
35 shift *= BITS_PER_BYTE;
36 mask <<= shift;
37
38 /*
39 * Calculate a pointer to the naturally aligned 4 byte integer that
40 * includes our byte of interest, and load its value.
41 */
42 ptr32 = (volatile u32 *)((unsigned long)ptr & ~0x3);
43 load32 = *ptr32;
44
45 do {
46 old32 = load32;
47 new32 = (load32 & ~mask) | (val << shift);
48 load32 = cmpxchg(ptr32, old32, new32);
49 } while (load32 != old32);
50
51 return (load32 & mask) >> shift;
52}
53
54unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
55 unsigned long new, unsigned int size)
56{
57 u32 mask, old32, new32, load32;
58 volatile u32 *ptr32;
59 unsigned int shift;
60 u8 load;
61
62 /* Check that ptr is naturally aligned */
63 WARN_ON((unsigned long)ptr & (size - 1));
64
65 /* Mask inputs to the correct size. */
66 mask = GENMASK((size * BITS_PER_BYTE) - 1, 0);
67 old &= mask;
68 new &= mask;
69
70 /*
71 * Calculate a shift & mask that correspond to the value we wish to
72 * compare & exchange within the naturally aligned 4 byte integer
73 * that includes it.
74 */
75 shift = (unsigned long)ptr & 0x3;
76 if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
77 shift ^= sizeof(u32) - size;
78 shift *= BITS_PER_BYTE;
79 mask <<= shift;
80
81 /*
82 * Calculate a pointer to the naturally aligned 4 byte integer that
83 * includes our byte of interest, and load its value.
84 */
85 ptr32 = (volatile u32 *)((unsigned long)ptr & ~0x3);
86 load32 = *ptr32;
87
88 while (true) {
89 /*
90 * Ensure the byte we want to exchange matches the expected
91 * old value, and if not then bail.
92 */
93 load = (load32 & mask) >> shift;
94 if (load != old)
95 return load;
96
97 /*
98 * Calculate the old & new values of the naturally aligned
99 * 4 byte integer that include the byte we want to exchange.
100 * Attempt to exchange the old value for the new value, and
101 * return if we succeed.
102 */
103 old32 = (load32 & ~mask) | (old << shift);
104 new32 = (load32 & ~mask) | (new << shift);
105 load32 = cmpxchg(ptr32, old32, new32);
106 if (load32 == old32)
107 return old;
108 }
109}
diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S
index a00e87b0256d..b849fe6aad94 100644
--- a/arch/mips/kernel/cps-vec.S
+++ b/arch/mips/kernel/cps-vec.S
@@ -22,6 +22,7 @@
22#define GCR_CL_COHERENCE_OFS 0x2008 22#define GCR_CL_COHERENCE_OFS 0x2008
23#define GCR_CL_ID_OFS 0x2028 23#define GCR_CL_ID_OFS 0x2028
24 24
25#define CPC_CL_VC_STOP_OFS 0x2020
25#define CPC_CL_VC_RUN_OFS 0x2028 26#define CPC_CL_VC_RUN_OFS 0x2028
26 27
27.extern mips_cm_base 28.extern mips_cm_base
@@ -376,8 +377,12 @@ LEAF(mips_cps_boot_vpes)
376 PTR_LI t2, UNCAC_BASE 377 PTR_LI t2, UNCAC_BASE
377 PTR_ADD t1, t1, t2 378 PTR_ADD t1, t1, t2
378 379
379 /* Set VC_RUN to the VPE mask */ 380 /* Start any other VPs that ought to be running */
380 PTR_S ta2, CPC_CL_VC_RUN_OFS(t1) 381 PTR_S ta2, CPC_CL_VC_RUN_OFS(t1)
382
383 /* Ensure this VP stops running if it shouldn't be */
384 not ta2
385 PTR_S ta2, CPC_CL_VC_STOP_OFS(t1)
381 ehb 386 ehb
382 387
383#elif defined(CONFIG_MIPS_MT) 388#elif defined(CONFIG_MIPS_MT)
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 1aba27786bd5..d08afc7dc507 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -564,6 +564,7 @@ static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags)
564 back_to_back_c0_hazard(); 564 back_to_back_c0_hazard();
565 break; 565 break;
566 case CPU_I6400: 566 case CPU_I6400:
567 case CPU_I6500:
567 /* There's no way to disable the FTLB */ 568 /* There's no way to disable the FTLB */
568 if (!(flags & FTLB_EN)) 569 if (!(flags & FTLB_EN))
569 return 1; 570 return 1;
@@ -844,6 +845,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c)
844 c->options |= MIPS_CPU_MVH; 845 c->options |= MIPS_CPU_MVH;
845 if (cpu_has_mips_r6 && (config5 & MIPS_CONF5_VP)) 846 if (cpu_has_mips_r6 && (config5 & MIPS_CONF5_VP))
846 c->options |= MIPS_CPU_VP; 847 c->options |= MIPS_CPU_VP;
848 if (config5 & MIPS_CONF5_CA2)
849 c->ases |= MIPS_ASE_MIPS16E2;
847 850
848 return config5 & MIPS_CONF_M; 851 return config5 & MIPS_CONF_M;
849} 852}
@@ -1635,6 +1638,10 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
1635 c->cputype = CPU_I6400; 1638 c->cputype = CPU_I6400;
1636 __cpu_name[cpu] = "MIPS I6400"; 1639 __cpu_name[cpu] = "MIPS I6400";
1637 break; 1640 break;
1641 case PRID_IMP_I6500:
1642 c->cputype = CPU_I6500;
1643 __cpu_name[cpu] = "MIPS I6500";
1644 break;
1638 case PRID_IMP_M5150: 1645 case PRID_IMP_M5150:
1639 c->cputype = CPU_M5150; 1646 c->cputype = CPU_M5150;
1640 __cpu_name[cpu] = "MIPS M5150"; 1647 __cpu_name[cpu] = "MIPS M5150";
@@ -1648,6 +1655,17 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
1648 decode_configs(c); 1655 decode_configs(c);
1649 1656
1650 spram_config(); 1657 spram_config();
1658
1659 switch (__get_cpu_type(c->cputype)) {
1660 case CPU_I6500:
1661 c->options |= MIPS_CPU_SHARED_FTLB_ENTRIES;
1662 /* fall-through */
1663 case CPU_I6400:
1664 c->options |= MIPS_CPU_SHARED_FTLB_RAM;
1665 /* fall-through */
1666 default:
1667 break;
1668 }
1651} 1669}
1652 1670
1653static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) 1671static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
@@ -1831,6 +1849,12 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
1831 set_elf_platform(cpu, "loongson3a"); 1849 set_elf_platform(cpu, "loongson3a");
1832 set_isa(c, MIPS_CPU_ISA_M64R2); 1850 set_isa(c, MIPS_CPU_ISA_M64R2);
1833 break; 1851 break;
1852 case PRID_REV_LOONGSON3A_R3:
1853 c->cputype = CPU_LOONGSON3;
1854 __cpu_name[cpu] = "ICT Loongson-3";
1855 set_elf_platform(cpu, "loongson3a");
1856 set_isa(c, MIPS_CPU_ISA_M64R2);
1857 break;
1834 } 1858 }
1835 1859
1836 decode_configs(c); 1860 decode_configs(c);
diff --git a/arch/mips/kernel/mips-cm.c b/arch/mips/kernel/mips-cm.c
index 659e6d3ae335..cb0c57f860d4 100644
--- a/arch/mips/kernel/mips-cm.c
+++ b/arch/mips/kernel/mips-cm.c
@@ -265,15 +265,34 @@ void mips_cm_lock_other(unsigned int core, unsigned int vp)
265 u32 val; 265 u32 val;
266 266
267 preempt_disable(); 267 preempt_disable();
268 curr_core = current_cpu_data.core;
269 spin_lock_irqsave(&per_cpu(cm_core_lock, curr_core),
270 per_cpu(cm_core_lock_flags, curr_core));
271 268
272 if (mips_cm_revision() >= CM_REV_CM3) { 269 if (mips_cm_revision() >= CM_REV_CM3) {
273 val = core << CM3_GCR_Cx_OTHER_CORE_SHF; 270 val = core << CM3_GCR_Cx_OTHER_CORE_SHF;
274 val |= vp << CM3_GCR_Cx_OTHER_VP_SHF; 271 val |= vp << CM3_GCR_Cx_OTHER_VP_SHF;
272
273 /*
274 * We need to disable interrupts in SMP systems in order to
275 * ensure that we don't interrupt the caller with code which
276 * may modify the redirect register. We do so here in a
277 * slightly obscure way by using a spin lock, since this has
278 * the neat property of also catching any nested uses of
279 * mips_cm_lock_other() leading to a deadlock or a nice warning
280 * with lockdep enabled.
281 */
282 spin_lock_irqsave(this_cpu_ptr(&cm_core_lock),
283 *this_cpu_ptr(&cm_core_lock_flags));
275 } else { 284 } else {
276 BUG_ON(vp != 0); 285 WARN_ON(vp != 0);
286
287 /*
288 * We only have a GCR_CL_OTHER per core in systems with
289 * CM 2.5 & older, so have to ensure other VP(E)s don't
290 * race with us.
291 */
292 curr_core = current_cpu_data.core;
293 spin_lock_irqsave(&per_cpu(cm_core_lock, curr_core),
294 per_cpu(cm_core_lock_flags, curr_core));
295
277 val = core << CM_GCR_Cx_OTHER_CORENUM_SHF; 296 val = core << CM_GCR_Cx_OTHER_CORENUM_SHF;
278 } 297 }
279 298
@@ -288,10 +307,17 @@ void mips_cm_lock_other(unsigned int core, unsigned int vp)
288 307
289void mips_cm_unlock_other(void) 308void mips_cm_unlock_other(void)
290{ 309{
291 unsigned curr_core = current_cpu_data.core; 310 unsigned int curr_core;
311
312 if (mips_cm_revision() < CM_REV_CM3) {
313 curr_core = current_cpu_data.core;
314 spin_unlock_irqrestore(&per_cpu(cm_core_lock, curr_core),
315 per_cpu(cm_core_lock_flags, curr_core));
316 } else {
317 spin_unlock_irqrestore(this_cpu_ptr(&cm_core_lock),
318 *this_cpu_ptr(&cm_core_lock_flags));
319 }
292 320
293 spin_unlock_irqrestore(&per_cpu(cm_core_lock, curr_core),
294 per_cpu(cm_core_lock_flags, curr_core));
295 preempt_enable(); 321 preempt_enable();
296} 322}
297 323
diff --git a/arch/mips/kernel/module-rela.c b/arch/mips/kernel/module-rela.c
deleted file mode 100644
index 781168834456..000000000000
--- a/arch/mips/kernel/module-rela.c
+++ /dev/null
@@ -1,202 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Copyright (C) 2001 Rusty Russell.
17 * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
18 * Copyright (C) 2005 Thiemo Seufer
19 * Copyright (C) 2015 Imagination Technologies Ltd.
20 */
21
22#include <linux/elf.h>
23#include <linux/err.h>
24#include <linux/errno.h>
25#include <linux/moduleloader.h>
26
27extern int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v);
28
29static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
30{
31 *location = v;
32
33 return 0;
34}
35
36static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
37{
38 if (v % 4) {
39 pr_err("module %s: dangerous R_MIPS_26 RELA relocation\n",
40 me->name);
41 return -ENOEXEC;
42 }
43
44 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
45 pr_err("module %s: relocation overflow\n", me->name);
46 return -ENOEXEC;
47 }
48
49 *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
50
51 return 0;
52}
53
54static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
55{
56 *location = (*location & 0xffff0000) |
57 ((((long long) v + 0x8000LL) >> 16) & 0xffff);
58
59 return 0;
60}
61
62static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
63{
64 *location = (*location & 0xffff0000) | (v & 0xffff);
65
66 return 0;
67}
68
69static int apply_r_mips_pc_rela(struct module *me, u32 *location, Elf_Addr v,
70 unsigned bits)
71{
72 unsigned long mask = GENMASK(bits - 1, 0);
73 unsigned long se_bits;
74 long offset;
75
76 if (v % 4) {
77 pr_err("module %s: dangerous R_MIPS_PC%u RELA relocation\n",
78 me->name, bits);
79 return -ENOEXEC;
80 }
81
82 offset = ((long)v - (long)location) >> 2;
83
84 /* check the sign bit onwards are identical - ie. we didn't overflow */
85 se_bits = (offset & BIT(bits - 1)) ? ~0ul : 0;
86 if ((offset & ~mask) != (se_bits & ~mask)) {
87 pr_err("module %s: relocation overflow\n", me->name);
88 return -ENOEXEC;
89 }
90
91 *location = (*location & ~mask) | (offset & mask);
92
93 return 0;
94}
95
96static int apply_r_mips_pc16_rela(struct module *me, u32 *location, Elf_Addr v)
97{
98 return apply_r_mips_pc_rela(me, location, v, 16);
99}
100
101static int apply_r_mips_pc21_rela(struct module *me, u32 *location, Elf_Addr v)
102{
103 return apply_r_mips_pc_rela(me, location, v, 21);
104}
105
106static int apply_r_mips_pc26_rela(struct module *me, u32 *location, Elf_Addr v)
107{
108 return apply_r_mips_pc_rela(me, location, v, 26);
109}
110
111static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
112{
113 *(Elf_Addr *)location = v;
114
115 return 0;
116}
117
118static int apply_r_mips_higher_rela(struct module *me, u32 *location,
119 Elf_Addr v)
120{
121 *location = (*location & 0xffff0000) |
122 ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
123
124 return 0;
125}
126
127static int apply_r_mips_highest_rela(struct module *me, u32 *location,
128 Elf_Addr v)
129{
130 *location = (*location & 0xffff0000) |
131 ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
132
133 return 0;
134}
135
136static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
137 Elf_Addr v) = {
138 [R_MIPS_NONE] = apply_r_mips_none,
139 [R_MIPS_32] = apply_r_mips_32_rela,
140 [R_MIPS_26] = apply_r_mips_26_rela,
141 [R_MIPS_HI16] = apply_r_mips_hi16_rela,
142 [R_MIPS_LO16] = apply_r_mips_lo16_rela,
143 [R_MIPS_PC16] = apply_r_mips_pc16_rela,
144 [R_MIPS_64] = apply_r_mips_64_rela,
145 [R_MIPS_HIGHER] = apply_r_mips_higher_rela,
146 [R_MIPS_HIGHEST] = apply_r_mips_highest_rela,
147 [R_MIPS_PC21_S2] = apply_r_mips_pc21_rela,
148 [R_MIPS_PC26_S2] = apply_r_mips_pc26_rela,
149};
150
151int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
152 unsigned int symindex, unsigned int relsec,
153 struct module *me)
154{
155 Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
156 int (*handler)(struct module *me, u32 *location, Elf_Addr v);
157 Elf_Sym *sym;
158 u32 *location;
159 unsigned int i, type;
160 Elf_Addr v;
161 int res;
162
163 pr_debug("Applying relocate section %u to %u\n", relsec,
164 sechdrs[relsec].sh_info);
165
166 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
167 /* This is where to make the change */
168 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
169 + rel[i].r_offset;
170 /* This is the symbol it is referring to */
171 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
172 + ELF_MIPS_R_SYM(rel[i]);
173 if (sym->st_value >= -MAX_ERRNO) {
174 /* Ignore unresolved weak symbol */
175 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
176 continue;
177 pr_warn("%s: Unknown symbol %s\n",
178 me->name, strtab + sym->st_name);
179 return -ENOENT;
180 }
181
182 type = ELF_MIPS_R_TYPE(rel[i]);
183
184 if (type < ARRAY_SIZE(reloc_handlers_rela))
185 handler = reloc_handlers_rela[type];
186 else
187 handler = NULL;
188
189 if (!handler) {
190 pr_err("%s: Unknown relocation type %u\n",
191 me->name, type);
192 return -EINVAL;
193 }
194
195 v = sym->st_value + rel[i].r_addend;
196 res = handler(me, location, v);
197 if (res)
198 return res;
199 }
200
201 return 0;
202}
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 50c020c47e54..491605137b03 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -53,22 +53,25 @@ void *module_alloc(unsigned long size)
53} 53}
54#endif 54#endif
55 55
56int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v) 56static int apply_r_mips_none(struct module *me, u32 *location,
57 u32 base, Elf_Addr v, bool rela)
57{ 58{
58 return 0; 59 return 0;
59} 60}
60 61
61static int apply_r_mips_32_rel(struct module *me, u32 *location, Elf_Addr v) 62static int apply_r_mips_32(struct module *me, u32 *location,
63 u32 base, Elf_Addr v, bool rela)
62{ 64{
63 *location += v; 65 *location = base + v;
64 66
65 return 0; 67 return 0;
66} 68}
67 69
68static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v) 70static int apply_r_mips_26(struct module *me, u32 *location,
71 u32 base, Elf_Addr v, bool rela)
69{ 72{
70 if (v % 4) { 73 if (v % 4) {
71 pr_err("module %s: dangerous R_MIPS_26 REL relocation\n", 74 pr_err("module %s: dangerous R_MIPS_26 relocation\n",
72 me->name); 75 me->name);
73 return -ENOEXEC; 76 return -ENOEXEC;
74 } 77 }
@@ -80,15 +83,22 @@ static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
80 } 83 }
81 84
82 *location = (*location & ~0x03ffffff) | 85 *location = (*location & ~0x03ffffff) |
83 ((*location + (v >> 2)) & 0x03ffffff); 86 ((base + (v >> 2)) & 0x03ffffff);
84 87
85 return 0; 88 return 0;
86} 89}
87 90
88static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v) 91static int apply_r_mips_hi16(struct module *me, u32 *location,
92 u32 base, Elf_Addr v, bool rela)
89{ 93{
90 struct mips_hi16 *n; 94 struct mips_hi16 *n;
91 95
96 if (rela) {
97 *location = (*location & 0xffff0000) |
98 ((((long long) v + 0x8000LL) >> 16) & 0xffff);
99 return 0;
100 }
101
92 /* 102 /*
93 * We cannot relocate this one now because we don't know the value of 103 * We cannot relocate this one now because we don't know the value of
94 * the carry we need to add. Save the information, and let LO16 do the 104 * the carry we need to add. Save the information, and let LO16 do the
@@ -117,12 +127,18 @@ static void free_relocation_chain(struct mips_hi16 *l)
117 } 127 }
118} 128}
119 129
120static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v) 130static int apply_r_mips_lo16(struct module *me, u32 *location,
131 u32 base, Elf_Addr v, bool rela)
121{ 132{
122 unsigned long insnlo = *location; 133 unsigned long insnlo = base;
123 struct mips_hi16 *l; 134 struct mips_hi16 *l;
124 Elf_Addr val, vallo; 135 Elf_Addr val, vallo;
125 136
137 if (rela) {
138 *location = (*location & 0xffff0000) | (v & 0xffff);
139 return 0;
140 }
141
126 /* Sign extend the addend we extract from the lo insn. */ 142 /* Sign extend the addend we extract from the lo insn. */
127 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000; 143 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
128 144
@@ -178,26 +194,26 @@ out_danger:
178 free_relocation_chain(l); 194 free_relocation_chain(l);
179 me->arch.r_mips_hi16_list = NULL; 195 me->arch.r_mips_hi16_list = NULL;
180 196
181 pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name); 197 pr_err("module %s: dangerous R_MIPS_LO16 relocation\n", me->name);
182 198
183 return -ENOEXEC; 199 return -ENOEXEC;
184} 200}
185 201
186static int apply_r_mips_pc_rel(struct module *me, u32 *location, Elf_Addr v, 202static int apply_r_mips_pc(struct module *me, u32 *location, u32 base,
187 unsigned bits) 203 Elf_Addr v, unsigned int bits)
188{ 204{
189 unsigned long mask = GENMASK(bits - 1, 0); 205 unsigned long mask = GENMASK(bits - 1, 0);
190 unsigned long se_bits; 206 unsigned long se_bits;
191 long offset; 207 long offset;
192 208
193 if (v % 4) { 209 if (v % 4) {
194 pr_err("module %s: dangerous R_MIPS_PC%u REL relocation\n", 210 pr_err("module %s: dangerous R_MIPS_PC%u relocation\n",
195 me->name, bits); 211 me->name, bits);
196 return -ENOEXEC; 212 return -ENOEXEC;
197 } 213 }
198 214
199 /* retrieve & sign extend implicit addend */ 215 /* retrieve & sign extend implicit addend if any */
200 offset = *location & mask; 216 offset = base & mask;
201 offset |= (offset & BIT(bits - 1)) ? ~mask : 0; 217 offset |= (offset & BIT(bits - 1)) ? ~mask : 0;
202 218
203 offset += ((long)v - (long)location) >> 2; 219 offset += ((long)v - (long)location) >> 2;
@@ -214,99 +230,192 @@ static int apply_r_mips_pc_rel(struct module *me, u32 *location, Elf_Addr v,
214 return 0; 230 return 0;
215} 231}
216 232
217static int apply_r_mips_pc16_rel(struct module *me, u32 *location, Elf_Addr v) 233static int apply_r_mips_pc16(struct module *me, u32 *location,
234 u32 base, Elf_Addr v, bool rela)
235{
236 return apply_r_mips_pc(me, location, base, v, 16);
237}
238
239static int apply_r_mips_pc21(struct module *me, u32 *location,
240 u32 base, Elf_Addr v, bool rela)
241{
242 return apply_r_mips_pc(me, location, base, v, 21);
243}
244
245static int apply_r_mips_pc26(struct module *me, u32 *location,
246 u32 base, Elf_Addr v, bool rela)
247{
248 return apply_r_mips_pc(me, location, base, v, 26);
249}
250
251static int apply_r_mips_64(struct module *me, u32 *location,
252 u32 base, Elf_Addr v, bool rela)
218{ 253{
219 return apply_r_mips_pc_rel(me, location, v, 16); 254 if (WARN_ON(!rela))
255 return -EINVAL;
256
257 *(Elf_Addr *)location = v;
258
259 return 0;
220} 260}
221 261
222static int apply_r_mips_pc21_rel(struct module *me, u32 *location, Elf_Addr v) 262static int apply_r_mips_higher(struct module *me, u32 *location,
263 u32 base, Elf_Addr v, bool rela)
223{ 264{
224 return apply_r_mips_pc_rel(me, location, v, 21); 265 if (WARN_ON(!rela))
266 return -EINVAL;
267
268 *location = (*location & 0xffff0000) |
269 ((((long long)v + 0x80008000LL) >> 32) & 0xffff);
270
271 return 0;
225} 272}
226 273
227static int apply_r_mips_pc26_rel(struct module *me, u32 *location, Elf_Addr v) 274static int apply_r_mips_highest(struct module *me, u32 *location,
275 u32 base, Elf_Addr v, bool rela)
228{ 276{
229 return apply_r_mips_pc_rel(me, location, v, 26); 277 if (WARN_ON(!rela))
278 return -EINVAL;
279
280 *location = (*location & 0xffff0000) |
281 ((((long long)v + 0x800080008000LL) >> 48) & 0xffff);
282
283 return 0;
230} 284}
231 285
232static int (*reloc_handlers_rel[]) (struct module *me, u32 *location, 286/**
233 Elf_Addr v) = { 287 * reloc_handler() - Apply a particular relocation to a module
288 * @me: the module to apply the reloc to
289 * @location: the address at which the reloc is to be applied
290 * @base: the existing value at location for REL-style; 0 for RELA-style
291 * @v: the value of the reloc, with addend for RELA-style
292 *
293 * Each implemented reloc_handler function applies a particular type of
294 * relocation to the module @me. Relocs that may be found in either REL or RELA
295 * variants can be handled by making use of the @base & @v parameters which are
296 * set to values which abstract the difference away from the particular reloc
297 * implementations.
298 *
299 * Return: 0 upon success, else -ERRNO
300 */
301typedef int (*reloc_handler)(struct module *me, u32 *location,
302 u32 base, Elf_Addr v, bool rela);
303
304/* The handlers for known reloc types */
305static reloc_handler reloc_handlers[] = {
234 [R_MIPS_NONE] = apply_r_mips_none, 306 [R_MIPS_NONE] = apply_r_mips_none,
235 [R_MIPS_32] = apply_r_mips_32_rel, 307 [R_MIPS_32] = apply_r_mips_32,
236 [R_MIPS_26] = apply_r_mips_26_rel, 308 [R_MIPS_26] = apply_r_mips_26,
237 [R_MIPS_HI16] = apply_r_mips_hi16_rel, 309 [R_MIPS_HI16] = apply_r_mips_hi16,
238 [R_MIPS_LO16] = apply_r_mips_lo16_rel, 310 [R_MIPS_LO16] = apply_r_mips_lo16,
239 [R_MIPS_PC16] = apply_r_mips_pc16_rel, 311 [R_MIPS_PC16] = apply_r_mips_pc16,
240 [R_MIPS_PC21_S2] = apply_r_mips_pc21_rel, 312 [R_MIPS_64] = apply_r_mips_64,
241 [R_MIPS_PC26_S2] = apply_r_mips_pc26_rel, 313 [R_MIPS_HIGHER] = apply_r_mips_higher,
314 [R_MIPS_HIGHEST] = apply_r_mips_highest,
315 [R_MIPS_PC21_S2] = apply_r_mips_pc21,
316 [R_MIPS_PC26_S2] = apply_r_mips_pc26,
242}; 317};
243 318
244int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, 319static int __apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
245 unsigned int symindex, unsigned int relsec, 320 unsigned int symindex, unsigned int relsec,
246 struct module *me) 321 struct module *me, bool rela)
247{ 322{
248 Elf_Mips_Rel *rel = (void *) sechdrs[relsec].sh_addr; 323 union {
249 int (*handler)(struct module *me, u32 *location, Elf_Addr v); 324 Elf_Mips_Rel *rel;
325 Elf_Mips_Rela *rela;
326 } r;
327 reloc_handler handler;
250 Elf_Sym *sym; 328 Elf_Sym *sym;
251 u32 *location; 329 u32 *location, base;
252 unsigned int i, type; 330 unsigned int i, type;
253 Elf_Addr v; 331 Elf_Addr v;
254 int res; 332 int err = 0;
333 size_t reloc_sz;
255 334
256 pr_debug("Applying relocate section %u to %u\n", relsec, 335 pr_debug("Applying relocate section %u to %u\n", relsec,
257 sechdrs[relsec].sh_info); 336 sechdrs[relsec].sh_info);
258 337
338 r.rel = (void *)sechdrs[relsec].sh_addr;
339 reloc_sz = rela ? sizeof(*r.rela) : sizeof(*r.rel);
259 me->arch.r_mips_hi16_list = NULL; 340 me->arch.r_mips_hi16_list = NULL;
260 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 341 for (i = 0; i < sechdrs[relsec].sh_size / reloc_sz; i++) {
261 /* This is where to make the change */ 342 /* This is where to make the change */
262 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr 343 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
263 + rel[i].r_offset; 344 + r.rel->r_offset;
264 /* This is the symbol it is referring to */ 345 /* This is the symbol it is referring to */
265 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 346 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
266 + ELF_MIPS_R_SYM(rel[i]); 347 + ELF_MIPS_R_SYM(*r.rel);
267 if (sym->st_value >= -MAX_ERRNO) { 348 if (sym->st_value >= -MAX_ERRNO) {
268 /* Ignore unresolved weak symbol */ 349 /* Ignore unresolved weak symbol */
269 if (ELF_ST_BIND(sym->st_info) == STB_WEAK) 350 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
270 continue; 351 continue;
271 pr_warn("%s: Unknown symbol %s\n", 352 pr_warn("%s: Unknown symbol %s\n",
272 me->name, strtab + sym->st_name); 353 me->name, strtab + sym->st_name);
273 return -ENOENT; 354 err = -ENOENT;
355 goto out;
274 } 356 }
275 357
276 type = ELF_MIPS_R_TYPE(rel[i]); 358 type = ELF_MIPS_R_TYPE(*r.rel);
277 359 if (type < ARRAY_SIZE(reloc_handlers))
278 if (type < ARRAY_SIZE(reloc_handlers_rel)) 360 handler = reloc_handlers[type];
279 handler = reloc_handlers_rel[type];
280 else 361 else
281 handler = NULL; 362 handler = NULL;
282 363
283 if (!handler) { 364 if (!handler) {
284 pr_err("%s: Unknown relocation type %u\n", 365 pr_err("%s: Unknown relocation type %u\n",
285 me->name, type); 366 me->name, type);
286 return -EINVAL; 367 err = -EINVAL;
368 goto out;
287 } 369 }
288 370
289 v = sym->st_value; 371 if (rela) {
290 res = handler(me, location, v); 372 v = sym->st_value + r.rela->r_addend;
291 if (res) 373 base = 0;
292 return res; 374 r.rela = &r.rela[1];
375 } else {
376 v = sym->st_value;
377 base = *location;
378 r.rel = &r.rel[1];
379 }
380
381 err = handler(me, location, base, v, rela);
382 if (err)
383 goto out;
293 } 384 }
294 385
386out:
295 /* 387 /*
296 * Normally the hi16 list should be deallocated at this point. A 388 * Normally the hi16 list should be deallocated at this point. A
297 * malformed binary however could contain a series of R_MIPS_HI16 389 * malformed binary however could contain a series of R_MIPS_HI16
298 * relocations not followed by a R_MIPS_LO16 relocation. In that 390 * relocations not followed by a R_MIPS_LO16 relocation, or if we hit
299 * case, free up the list and return an error. 391 * an error processing a reloc we might have gotten here before
392 * reaching the R_MIPS_LO16. In either case, free up the list and
393 * return an error.
300 */ 394 */
301 if (me->arch.r_mips_hi16_list) { 395 if (me->arch.r_mips_hi16_list) {
302 free_relocation_chain(me->arch.r_mips_hi16_list); 396 free_relocation_chain(me->arch.r_mips_hi16_list);
303 me->arch.r_mips_hi16_list = NULL; 397 me->arch.r_mips_hi16_list = NULL;
304 398 err = err ?: -ENOEXEC;
305 return -ENOEXEC;
306 } 399 }
307 400
308 return 0; 401 return err;
402}
403
404int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
405 unsigned int symindex, unsigned int relsec,
406 struct module *me)
407{
408 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, false);
409}
410
411#ifdef CONFIG_MODULES_USE_ELF_RELA
412int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
413 unsigned int symindex, unsigned int relsec,
414 struct module *me)
415{
416 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, true);
309} 417}
418#endif /* CONFIG_MODULES_USE_ELF_RELA */
310 419
311/* Given an address, look for it in the module exception tables. */ 420/* Given an address, look for it in the module exception tables. */
312const struct exception_table_entry *search_module_dbetables(unsigned long addr) 421const struct exception_table_entry *search_module_dbetables(unsigned long addr)
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index f3e301f95aef..9e6c74bf66c4 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -814,7 +814,7 @@ static const struct mips_perf_event mipsxxcore_event_map2
814 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x27, CNTR_ODD, T }, 814 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x27, CNTR_ODD, T },
815}; 815};
816 816
817static const struct mips_perf_event i6400_event_map[PERF_COUNT_HW_MAX] = { 817static const struct mips_perf_event i6x00_event_map[PERF_COUNT_HW_MAX] = {
818 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD }, 818 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD },
819 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD }, 819 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD },
820 /* These only count dcache, not icache */ 820 /* These only count dcache, not icache */
@@ -1014,7 +1014,7 @@ static const struct mips_perf_event mipsxxcore_cache_map2
1014}, 1014},
1015}; 1015};
1016 1016
1017static const struct mips_perf_event i6400_cache_map 1017static const struct mips_perf_event i6x00_cache_map
1018 [PERF_COUNT_HW_CACHE_MAX] 1018 [PERF_COUNT_HW_CACHE_MAX]
1019 [PERF_COUNT_HW_CACHE_OP_MAX] 1019 [PERF_COUNT_HW_CACHE_OP_MAX]
1020 [PERF_COUNT_HW_CACHE_RESULT_MAX] = { 1020 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
@@ -1610,6 +1610,7 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
1610#endif 1610#endif
1611 break; 1611 break;
1612 case CPU_I6400: 1612 case CPU_I6400:
1613 case CPU_I6500:
1613 /* 8-bit event numbers */ 1614 /* 8-bit event numbers */
1614 base_id = config & 0xff; 1615 base_id = config & 0xff;
1615 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD; 1616 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
@@ -1770,8 +1771,13 @@ init_hw_perf_events(void)
1770 break; 1771 break;
1771 case CPU_I6400: 1772 case CPU_I6400:
1772 mipspmu.name = "mips/I6400"; 1773 mipspmu.name = "mips/I6400";
1773 mipspmu.general_event_map = &i6400_event_map; 1774 mipspmu.general_event_map = &i6x00_event_map;
1774 mipspmu.cache_event_map = &i6400_cache_map; 1775 mipspmu.cache_event_map = &i6x00_cache_map;
1776 break;
1777 case CPU_I6500:
1778 mipspmu.name = "mips/I6500";
1779 mipspmu.general_event_map = &i6x00_event_map;
1780 mipspmu.cache_event_map = &i6x00_cache_map;
1775 break; 1781 break;
1776 case CPU_1004K: 1782 case CPU_1004K:
1777 mipspmu.name = "mips/1004K"; 1783 mipspmu.name = "mips/1004K";
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 4eff2aed7360..70604c753aa4 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -83,7 +83,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
83 } 83 }
84 84
85 seq_printf(m, "isa\t\t\t:"); 85 seq_printf(m, "isa\t\t\t:");
86 if (cpu_has_mips_r1) 86 if (cpu_has_mips_1)
87 seq_printf(m, " mips1"); 87 seq_printf(m, " mips1");
88 if (cpu_has_mips_2) 88 if (cpu_has_mips_2)
89 seq_printf(m, "%s", " mips2"); 89 seq_printf(m, "%s", " mips2");
@@ -109,6 +109,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
109 109
110 seq_printf(m, "ASEs implemented\t:"); 110 seq_printf(m, "ASEs implemented\t:");
111 if (cpu_has_mips16) seq_printf(m, "%s", " mips16"); 111 if (cpu_has_mips16) seq_printf(m, "%s", " mips16");
112 if (cpu_has_mips16e2) seq_printf(m, "%s", " mips16e2");
112 if (cpu_has_mdmx) seq_printf(m, "%s", " mdmx"); 113 if (cpu_has_mdmx) seq_printf(m, "%s", " mdmx");
113 if (cpu_has_mips3d) seq_printf(m, "%s", " mips3d"); 114 if (cpu_has_mips3d) seq_printf(m, "%s", " mips3d");
114 if (cpu_has_smartmips) seq_printf(m, "%s", " smartmips"); 115 if (cpu_has_smartmips) seq_printf(m, "%s", " smartmips");
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 6931fe722a0b..6dd13641a418 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -868,14 +868,39 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
868 tracehook_report_syscall_entry(regs)) 868 tracehook_report_syscall_entry(regs))
869 return -1; 869 return -1;
870 870
871 if (secure_computing(NULL) == -1) 871#ifdef CONFIG_SECCOMP
872 return -1; 872 if (unlikely(test_thread_flag(TIF_SECCOMP))) {
873 int ret, i;
874 struct seccomp_data sd;
875
876 sd.nr = syscall;
877 sd.arch = syscall_get_arch();
878 for (i = 0; i < 6; i++) {
879 unsigned long v, r;
880
881 r = mips_get_syscall_arg(&v, current, regs, i);
882 sd.args[i] = r ? 0 : v;
883 }
884 sd.instruction_pointer = KSTK_EIP(current);
885
886 ret = __secure_computing(&sd);
887 if (ret == -1)
888 return ret;
889 }
890#endif
873 891
874 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 892 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
875 trace_sys_enter(regs, regs->regs[2]); 893 trace_sys_enter(regs, regs->regs[2]);
876 894
877 audit_syscall_entry(syscall, regs->regs[4], regs->regs[5], 895 audit_syscall_entry(syscall, regs->regs[4], regs->regs[5],
878 regs->regs[6], regs->regs[7]); 896 regs->regs[6], regs->regs[7]);
897
898 /*
899 * Negative syscall numbers are mistaken for rejected syscalls, but
900 * won't have had the return value set appropriately, so we do so now.
901 */
902 if (syscall < 0)
903 syscall_set_return_value(current, regs, -ENOSYS, 0);
879 return syscall; 904 return syscall;
880} 905}
881 906
@@ -895,7 +920,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
895 audit_syscall_exit(regs); 920 audit_syscall_exit(regs);
896 921
897 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 922 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
898 trace_sys_exit(regs, regs->regs[2]); 923 trace_sys_exit(regs, regs_return_value(regs));
899 924
900 if (test_thread_flag(TIF_SYSCALL_TRACE)) 925 if (test_thread_flag(TIF_SYSCALL_TRACE))
901 tracehook_report_syscall_exit(regs, 0); 926 tracehook_report_syscall_exit(regs, 0);
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 80ed68b2c95e..27c2f90eeb21 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -371,7 +371,7 @@ EXPORT(sys_call_table)
371 PTR sys_writev 371 PTR sys_writev
372 PTR sys_cacheflush 372 PTR sys_cacheflush
373 PTR sys_cachectl 373 PTR sys_cachectl
374 PTR sys_sysmips 374 PTR __sys_sysmips
375 PTR sys_ni_syscall /* 4150 */ 375 PTR sys_ni_syscall /* 4150 */
376 PTR sys_getsid 376 PTR sys_getsid
377 PTR sys_fdatasync 377 PTR sys_fdatasync
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 49765b44aa9b..65d5aeeb9bdb 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -311,7 +311,7 @@ EXPORT(sys_call_table)
311 PTR sys_sched_getaffinity 311 PTR sys_sched_getaffinity
312 PTR sys_cacheflush 312 PTR sys_cacheflush
313 PTR sys_cachectl 313 PTR sys_cachectl
314 PTR sys_sysmips 314 PTR __sys_sysmips
315 PTR sys_io_setup /* 5200 */ 315 PTR sys_io_setup /* 5200 */
316 PTR sys_io_destroy 316 PTR sys_io_destroy
317 PTR sys_io_getevents 317 PTR sys_io_getevents
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 90bad2d1b2d3..cbf190ef9e8a 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -302,7 +302,7 @@ EXPORT(sysn32_call_table)
302 PTR compat_sys_sched_getaffinity 302 PTR compat_sys_sched_getaffinity
303 PTR sys_cacheflush 303 PTR sys_cacheflush
304 PTR sys_cachectl 304 PTR sys_cachectl
305 PTR sys_sysmips 305 PTR __sys_sysmips
306 PTR compat_sys_io_setup /* 6200 */ 306 PTR compat_sys_io_setup /* 6200 */
307 PTR sys_io_destroy 307 PTR sys_io_destroy
308 PTR compat_sys_io_getevents 308 PTR compat_sys_io_getevents
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 2dd70bd104e1..c30bc520885f 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -371,7 +371,7 @@ EXPORT(sys32_call_table)
371 PTR compat_sys_writev 371 PTR compat_sys_writev
372 PTR sys_cacheflush 372 PTR sys_cacheflush
373 PTR sys_cachectl 373 PTR sys_cachectl
374 PTR sys_sysmips 374 PTR __sys_sysmips
375 PTR sys_ni_syscall /* 4150 */ 375 PTR sys_ni_syscall /* 4150 */
376 PTR sys_getsid 376 PTR sys_getsid
377 PTR sys_fdatasync 377 PTR sys_fdatasync
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 01d1dbde5fbf..fe3939726765 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -670,6 +670,46 @@ static int __init early_parse_mem(char *p)
670} 670}
671early_param("mem", early_parse_mem); 671early_param("mem", early_parse_mem);
672 672
673static int __init early_parse_memmap(char *p)
674{
675 char *oldp;
676 u64 start_at, mem_size;
677
678 if (!p)
679 return -EINVAL;
680
681 if (!strncmp(p, "exactmap", 8)) {
682 pr_err("\"memmap=exactmap\" invalid on MIPS\n");
683 return 0;
684 }
685
686 oldp = p;
687 mem_size = memparse(p, &p);
688 if (p == oldp)
689 return -EINVAL;
690
691 if (*p == '@') {
692 start_at = memparse(p+1, &p);
693 add_memory_region(start_at, mem_size, BOOT_MEM_RAM);
694 } else if (*p == '#') {
695 pr_err("\"memmap=nn#ss\" (force ACPI data) invalid on MIPS\n");
696 return -EINVAL;
697 } else if (*p == '$') {
698 start_at = memparse(p+1, &p);
699 add_memory_region(start_at, mem_size, BOOT_MEM_RESERVED);
700 } else {
701 pr_err("\"memmap\" invalid format!\n");
702 return -EINVAL;
703 }
704
705 if (*p == '\0') {
706 usermem = 1;
707 return 0;
708 } else
709 return -EINVAL;
710}
711early_param("memmap", early_parse_memmap);
712
673#ifdef CONFIG_PROC_VMCORE 713#ifdef CONFIG_PROC_VMCORE
674unsigned long setup_elfcorehdr, setup_elfcorehdr_size; 714unsigned long setup_elfcorehdr, setup_elfcorehdr_size;
675static int __init early_parse_elfcorehdr(char *p) 715static int __init early_parse_elfcorehdr(char *p)
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 36954ddd0b9f..f832e99ad4c3 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -142,9 +142,11 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
142 142
143 /* Warn the user if the CCA prevents multi-core */ 143 /* Warn the user if the CCA prevents multi-core */
144 ncores = mips_cm_numcores(); 144 ncores = mips_cm_numcores();
145 if (cca_unsuitable && ncores > 1) { 145 if ((cca_unsuitable || cpu_has_dc_aliases) && ncores > 1) {
146 pr_warn("Using only one core due to unsuitable CCA 0x%x\n", 146 pr_warn("Using only one core due to %s%s%s\n",
147 cca); 147 cca_unsuitable ? "unsuitable CCA" : "",
148 (cca_unsuitable && cpu_has_dc_aliases) ? " & " : "",
149 cpu_has_dc_aliases ? "dcache aliasing" : "");
148 150
149 for_each_present_cpu(c) { 151 for_each_present_cpu(c) {
150 if (cpu_data[c].core) 152 if (cpu_data[c].core)
@@ -488,6 +490,7 @@ static void cps_cpu_die(unsigned int cpu)
488{ 490{
489 unsigned core = cpu_data[cpu].core; 491 unsigned core = cpu_data[cpu].core;
490 unsigned int vpe_id = cpu_vpe_id(&cpu_data[cpu]); 492 unsigned int vpe_id = cpu_vpe_id(&cpu_data[cpu]);
493 ktime_t fail_time;
491 unsigned stat; 494 unsigned stat;
492 int err; 495 int err;
493 496
@@ -514,6 +517,7 @@ static void cps_cpu_die(unsigned int cpu)
514 * state, the latter happening when a JTAG probe is connected 517 * state, the latter happening when a JTAG probe is connected
515 * in which case the CPC will refuse to power down the core. 518 * in which case the CPC will refuse to power down the core.
516 */ 519 */
520 fail_time = ktime_add_ms(ktime_get(), 2000);
517 do { 521 do {
518 mips_cm_lock_other(core, 0); 522 mips_cm_lock_other(core, 0);
519 mips_cpc_lock_other(core); 523 mips_cpc_lock_other(core);
@@ -521,9 +525,28 @@ static void cps_cpu_die(unsigned int cpu)
521 stat &= CPC_Cx_STAT_CONF_SEQSTATE_MSK; 525 stat &= CPC_Cx_STAT_CONF_SEQSTATE_MSK;
522 mips_cpc_unlock_other(); 526 mips_cpc_unlock_other();
523 mips_cm_unlock_other(); 527 mips_cm_unlock_other();
524 } while (stat != CPC_Cx_STAT_CONF_SEQSTATE_D0 && 528
525 stat != CPC_Cx_STAT_CONF_SEQSTATE_D2 && 529 if (stat == CPC_Cx_STAT_CONF_SEQSTATE_D0 ||
526 stat != CPC_Cx_STAT_CONF_SEQSTATE_U2); 530 stat == CPC_Cx_STAT_CONF_SEQSTATE_D2 ||
531 stat == CPC_Cx_STAT_CONF_SEQSTATE_U2)
532 break;
533
534 /*
535 * The core ought to have powered down, but didn't &
536 * now we don't really know what state it's in. It's
537 * likely that its _pwr_up pin has been wired to logic
538 * 1 & it powered back up as soon as we powered it
539 * down...
540 *
541 * The best we can do is warn the user & continue in
542 * the hope that the core is doing nothing harmful &
543 * might behave properly if we online it later.
544 */
545 if (WARN(ktime_after(ktime_get(), fail_time),
546 "CPU%u hasn't powered down, seq. state %u\n",
547 cpu, stat >> CPC_Cx_STAT_CONF_SEQSTATE_SHF))
548 break;
549 } while (1);
527 550
528 /* Indicate the core is powered off */ 551 /* Indicate the core is powered off */
529 bitmap_clear(core_power, core, 1); 552 bitmap_clear(core_power, core, 1);
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index aba1afb64b62..770d4d1516cb 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -335,6 +335,9 @@ int mips_smp_ipi_free(const struct cpumask *mask)
335 335
336static int __init mips_smp_ipi_init(void) 336static int __init mips_smp_ipi_init(void)
337{ 337{
338 if (num_possible_cpus() == 1)
339 return 0;
340
338 mips_smp_ipi_allocate(cpu_possible_mask); 341 mips_smp_ipi_allocate(cpu_possible_mask);
339 342
340 call_desc = irq_to_desc(call_virq); 343 call_desc = irq_to_desc(call_virq);
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 1dfa7f5796c7..58c6f634b550 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -29,6 +29,7 @@
29#include <linux/sched/task_stack.h> 29#include <linux/sched/task_stack.h>
30 30
31#include <asm/asm.h> 31#include <asm/asm.h>
32#include <asm/asm-eva.h>
32#include <asm/branch.h> 33#include <asm/branch.h>
33#include <asm/cachectl.h> 34#include <asm/cachectl.h>
34#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
@@ -131,16 +132,14 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
131 __asm__ __volatile__ ( 132 __asm__ __volatile__ (
132 " .set "MIPS_ISA_ARCH_LEVEL" \n" 133 " .set "MIPS_ISA_ARCH_LEVEL" \n"
133 " li %[err], 0 \n" 134 " li %[err], 0 \n"
134 "1: ll %[old], (%[addr]) \n" 135 "1: \n"
136 user_ll("%[old]", "(%[addr])")
135 " move %[tmp], %[new] \n" 137 " move %[tmp], %[new] \n"
136 "2: sc %[tmp], (%[addr]) \n" 138 "2: \n"
137 " bnez %[tmp], 4f \n" 139 user_sc("%[tmp]", "(%[addr])")
140 " beqz %[tmp], 1b \n"
138 "3: \n" 141 "3: \n"
139 " .insn \n" 142 " .insn \n"
140 " .subsection 2 \n"
141 "4: b 1b \n"
142 " .previous \n"
143 " \n"
144 " .section .fixup,\"ax\" \n" 143 " .section .fixup,\"ax\" \n"
145 "5: li %[err], %[efault] \n" 144 "5: li %[err], %[efault] \n"
146 " j 3b \n" 145 " j 3b \n"
@@ -192,6 +191,12 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
192 unreachable(); 191 unreachable();
193} 192}
194 193
194/*
195 * mips_atomic_set() normally returns directly via syscall_exit potentially
196 * clobbering static registers, so be sure to preserve them.
197 */
198save_static_function(sys_sysmips);
199
195SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2) 200SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2)
196{ 201{
197 switch (cmd) { 202 switch (cmd) {
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index f806ee56e639..5eaf2578ac04 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -939,88 +939,114 @@ static void emulate_load_store_insn(struct pt_regs *regs,
939 * The remaining opcodes are the ones that are really of 939 * The remaining opcodes are the ones that are really of
940 * interest. 940 * interest.
941 */ 941 */
942#ifdef CONFIG_EVA
943 case spec3_op: 942 case spec3_op:
944 /* 943 if (insn.dsp_format.func == lx_op) {
945 * we can land here only from kernel accessing user memory, 944 switch (insn.dsp_format.op) {
946 * so we need to "switch" the address limit to user space, so 945 case lwx_op:
947 * address check can work properly. 946 if (!access_ok(VERIFY_READ, addr, 4))
948 */ 947 goto sigbus;
949 seg = get_fs(); 948 LoadW(addr, value, res);
950 set_fs(USER_DS); 949 if (res)
951 switch (insn.spec3_format.func) { 950 goto fault;
952 case lhe_op: 951 compute_return_epc(regs);
953 if (!access_ok(VERIFY_READ, addr, 2)) { 952 regs->regs[insn.dsp_format.rd] = value;
954 set_fs(seg); 953 break;
955 goto sigbus; 954 case lhx_op:
956 } 955 if (!access_ok(VERIFY_READ, addr, 2))
957 LoadHWE(addr, value, res); 956 goto sigbus;
958 if (res) { 957 LoadHW(addr, value, res);
959 set_fs(seg); 958 if (res)
960 goto fault; 959 goto fault;
961 } 960 compute_return_epc(regs);
962 compute_return_epc(regs); 961 regs->regs[insn.dsp_format.rd] = value;
963 regs->regs[insn.spec3_format.rt] = value; 962 break;
964 break; 963 default:
965 case lwe_op: 964 goto sigill;
966 if (!access_ok(VERIFY_READ, addr, 4)) {
967 set_fs(seg);
968 goto sigbus;
969 } 965 }
966 }
967#ifdef CONFIG_EVA
968 else {
969 /*
970 * we can land here only from kernel accessing user
971 * memory, so we need to "switch" the address limit to
972 * user space, so that address check can work properly.
973 */
974 seg = get_fs();
975 set_fs(USER_DS);
976 switch (insn.spec3_format.func) {
977 case lhe_op:
978 if (!access_ok(VERIFY_READ, addr, 2)) {
979 set_fs(seg);
980 goto sigbus;
981 }
982 LoadHWE(addr, value, res);
983 if (res) {
984 set_fs(seg);
985 goto fault;
986 }
987 compute_return_epc(regs);
988 regs->regs[insn.spec3_format.rt] = value;
989 break;
990 case lwe_op:
991 if (!access_ok(VERIFY_READ, addr, 4)) {
992 set_fs(seg);
993 goto sigbus;
994 }
970 LoadWE(addr, value, res); 995 LoadWE(addr, value, res);
971 if (res) { 996 if (res) {
972 set_fs(seg); 997 set_fs(seg);
973 goto fault; 998 goto fault;
974 } 999 }
975 compute_return_epc(regs); 1000 compute_return_epc(regs);
976 regs->regs[insn.spec3_format.rt] = value; 1001 regs->regs[insn.spec3_format.rt] = value;
977 break; 1002 break;
978 case lhue_op: 1003 case lhue_op:
979 if (!access_ok(VERIFY_READ, addr, 2)) { 1004 if (!access_ok(VERIFY_READ, addr, 2)) {
980 set_fs(seg); 1005 set_fs(seg);
981 goto sigbus; 1006 goto sigbus;
982 } 1007 }
983 LoadHWUE(addr, value, res); 1008 LoadHWUE(addr, value, res);
984 if (res) { 1009 if (res) {
985 set_fs(seg); 1010 set_fs(seg);
986 goto fault; 1011 goto fault;
987 } 1012 }
988 compute_return_epc(regs); 1013 compute_return_epc(regs);
989 regs->regs[insn.spec3_format.rt] = value; 1014 regs->regs[insn.spec3_format.rt] = value;
990 break; 1015 break;
991 case she_op: 1016 case she_op:
992 if (!access_ok(VERIFY_WRITE, addr, 2)) { 1017 if (!access_ok(VERIFY_WRITE, addr, 2)) {
993 set_fs(seg); 1018 set_fs(seg);
994 goto sigbus; 1019 goto sigbus;
995 } 1020 }
996 compute_return_epc(regs); 1021 compute_return_epc(regs);
997 value = regs->regs[insn.spec3_format.rt]; 1022 value = regs->regs[insn.spec3_format.rt];
998 StoreHWE(addr, value, res); 1023 StoreHWE(addr, value, res);
999 if (res) { 1024 if (res) {
1000 set_fs(seg); 1025 set_fs(seg);
1001 goto fault; 1026 goto fault;
1002 } 1027 }
1003 break; 1028 break;
1004 case swe_op: 1029 case swe_op:
1005 if (!access_ok(VERIFY_WRITE, addr, 4)) { 1030 if (!access_ok(VERIFY_WRITE, addr, 4)) {
1006 set_fs(seg); 1031 set_fs(seg);
1007 goto sigbus; 1032 goto sigbus;
1008 } 1033 }
1009 compute_return_epc(regs); 1034 compute_return_epc(regs);
1010 value = regs->regs[insn.spec3_format.rt]; 1035 value = regs->regs[insn.spec3_format.rt];
1011 StoreWE(addr, value, res); 1036 StoreWE(addr, value, res);
1012 if (res) { 1037 if (res) {
1038 set_fs(seg);
1039 goto fault;
1040 }
1041 break;
1042 default:
1013 set_fs(seg); 1043 set_fs(seg);
1014 goto fault; 1044 goto sigill;
1015 } 1045 }
1016 break;
1017 default:
1018 set_fs(seg); 1046 set_fs(seg);
1019 goto sigill;
1020 } 1047 }
1021 set_fs(seg);
1022 break;
1023#endif 1048#endif
1049 break;
1024 case lh_op: 1050 case lh_op:
1025 if (!access_ok(VERIFY_READ, addr, 2)) 1051 if (!access_ok(VERIFY_READ, addr, 2))
1026 goto sigbus; 1052 goto sigbus;
@@ -1984,6 +2010,8 @@ static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
1984 u16 __user *pc16; 2010 u16 __user *pc16;
1985 unsigned long origpc; 2011 unsigned long origpc;
1986 union mips16e_instruction mips16inst, oldinst; 2012 union mips16e_instruction mips16inst, oldinst;
2013 unsigned int opcode;
2014 int extended = 0;
1987 2015
1988 origpc = regs->cp0_epc; 2016 origpc = regs->cp0_epc;
1989 orig31 = regs->regs[31]; 2017 orig31 = regs->regs[31];
@@ -1996,6 +2024,7 @@ static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
1996 2024
1997 /* skip EXTEND instruction */ 2025 /* skip EXTEND instruction */
1998 if (mips16inst.ri.opcode == MIPS16e_extend_op) { 2026 if (mips16inst.ri.opcode == MIPS16e_extend_op) {
2027 extended = 1;
1999 pc16++; 2028 pc16++;
2000 __get_user(mips16inst.full, pc16); 2029 __get_user(mips16inst.full, pc16);
2001 } else if (delay_slot(regs)) { 2030 } else if (delay_slot(regs)) {
@@ -2008,7 +2037,8 @@ static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
2008 goto sigbus; 2037 goto sigbus;
2009 } 2038 }
2010 2039
2011 switch (mips16inst.ri.opcode) { 2040 opcode = mips16inst.ri.opcode;
2041 switch (opcode) {
2012 case MIPS16e_i64_op: /* I64 or RI64 instruction */ 2042 case MIPS16e_i64_op: /* I64 or RI64 instruction */
2013 switch (mips16inst.i64.func) { /* I64/RI64 func field check */ 2043 switch (mips16inst.i64.func) { /* I64/RI64 func field check */
2014 case MIPS16e_ldpc_func: 2044 case MIPS16e_ldpc_func:
@@ -2028,9 +2058,40 @@ static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
2028 goto sigbus; 2058 goto sigbus;
2029 2059
2030 case MIPS16e_swsp_op: 2060 case MIPS16e_swsp_op:
2061 reg = reg16to32[mips16inst.ri.rx];
2062 if (extended && cpu_has_mips16e2)
2063 switch (mips16inst.ri.imm >> 5) {
2064 case 0: /* SWSP */
2065 case 1: /* SWGP */
2066 break;
2067 case 2: /* SHGP */
2068 opcode = MIPS16e_sh_op;
2069 break;
2070 default:
2071 goto sigbus;
2072 }
2073 break;
2074
2031 case MIPS16e_lwpc_op: 2075 case MIPS16e_lwpc_op:
2076 reg = reg16to32[mips16inst.ri.rx];
2077 break;
2078
2032 case MIPS16e_lwsp_op: 2079 case MIPS16e_lwsp_op:
2033 reg = reg16to32[mips16inst.ri.rx]; 2080 reg = reg16to32[mips16inst.ri.rx];
2081 if (extended && cpu_has_mips16e2)
2082 switch (mips16inst.ri.imm >> 5) {
2083 case 0: /* LWSP */
2084 case 1: /* LWGP */
2085 break;
2086 case 2: /* LHGP */
2087 opcode = MIPS16e_lh_op;
2088 break;
2089 case 4: /* LHUGP */
2090 opcode = MIPS16e_lhu_op;
2091 break;
2092 default:
2093 goto sigbus;
2094 }
2034 break; 2095 break;
2035 2096
2036 case MIPS16e_i8_op: 2097 case MIPS16e_i8_op:
@@ -2044,7 +2105,7 @@ static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
2044 break; 2105 break;
2045 } 2106 }
2046 2107
2047 switch (mips16inst.ri.opcode) { 2108 switch (opcode) {
2048 2109
2049 case MIPS16e_lb_op: 2110 case MIPS16e_lb_op:
2050 case MIPS16e_lbu_op: 2111 case MIPS16e_lbu_op:
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index 3114a2ed1f4e..03e3304d6ae5 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -28,6 +28,9 @@
28#ifdef CONFIG_MIPS_MALTA 28#ifdef CONFIG_MIPS_MALTA
29#undef CONFIG_CPU_HAS_PREFETCH 29#undef CONFIG_CPU_HAS_PREFETCH
30#endif 30#endif
31#ifdef CONFIG_CPU_MIPSR6
32#undef CONFIG_CPU_HAS_PREFETCH
33#endif
31 34
32#include <asm/asm.h> 35#include <asm/asm.h>
33#include <asm/asm-offsets.h> 36#include <asm/asm-offsets.h>
diff --git a/arch/mips/loongson64/common/env.c b/arch/mips/loongson64/common/env.c
index 6afa21850267..1e8a955ae5a8 100644
--- a/arch/mips/loongson64/common/env.c
+++ b/arch/mips/loongson64/common/env.c
@@ -90,7 +90,9 @@ void __init prom_init_env(void)
90 90
91 cpu_clock_freq = ecpu->cpu_clock_freq; 91 cpu_clock_freq = ecpu->cpu_clock_freq;
92 loongson_sysconf.cputype = ecpu->cputype; 92 loongson_sysconf.cputype = ecpu->cputype;
93 if (ecpu->cputype == Loongson_3A) { 93 switch (ecpu->cputype) {
94 case Legacy_3A:
95 case Loongson_3A:
94 loongson_sysconf.cores_per_node = 4; 96 loongson_sysconf.cores_per_node = 4;
95 loongson_sysconf.cores_per_package = 4; 97 loongson_sysconf.cores_per_package = 4;
96 smp_group[0] = 0x900000003ff01000; 98 smp_group[0] = 0x900000003ff01000;
@@ -111,7 +113,9 @@ void __init prom_init_env(void)
111 loongson_freqctrl[3] = 0x900030001fe001d0; 113 loongson_freqctrl[3] = 0x900030001fe001d0;
112 loongson_sysconf.ht_control_base = 0x90000EFDFB000000; 114 loongson_sysconf.ht_control_base = 0x90000EFDFB000000;
113 loongson_sysconf.workarounds = WORKAROUND_CPUFREQ; 115 loongson_sysconf.workarounds = WORKAROUND_CPUFREQ;
114 } else if (ecpu->cputype == Loongson_3B) { 116 break;
117 case Legacy_3B:
118 case Loongson_3B:
115 loongson_sysconf.cores_per_node = 4; /* One chip has 2 nodes */ 119 loongson_sysconf.cores_per_node = 4; /* One chip has 2 nodes */
116 loongson_sysconf.cores_per_package = 8; 120 loongson_sysconf.cores_per_package = 8;
117 smp_group[0] = 0x900000003ff01000; 121 smp_group[0] = 0x900000003ff01000;
@@ -132,7 +136,8 @@ void __init prom_init_env(void)
132 loongson_freqctrl[3] = 0x900060001fe001d0; 136 loongson_freqctrl[3] = 0x900060001fe001d0;
133 loongson_sysconf.ht_control_base = 0x90001EFDFB000000; 137 loongson_sysconf.ht_control_base = 0x90001EFDFB000000;
134 loongson_sysconf.workarounds = WORKAROUND_CPUHOTPLUG; 138 loongson_sysconf.workarounds = WORKAROUND_CPUHOTPLUG;
135 } else { 139 break;
140 default:
136 loongson_sysconf.cores_per_node = 1; 141 loongson_sysconf.cores_per_node = 1;
137 loongson_sysconf.cores_per_package = 1; 142 loongson_sysconf.cores_per_package = 1;
138 loongson_chipcfg[0] = 0x900000001fe00180; 143 loongson_chipcfg[0] = 0x900000001fe00180;
@@ -193,6 +198,7 @@ void __init prom_init_env(void)
193 break; 198 break;
194 case PRID_REV_LOONGSON3A_R1: 199 case PRID_REV_LOONGSON3A_R1:
195 case PRID_REV_LOONGSON3A_R2: 200 case PRID_REV_LOONGSON3A_R2:
201 case PRID_REV_LOONGSON3A_R3:
196 cpu_clock_freq = 900000000; 202 cpu_clock_freq = 900000000;
197 break; 203 break;
198 case PRID_REV_LOONGSON3B_R1: 204 case PRID_REV_LOONGSON3B_R1:
diff --git a/arch/mips/loongson64/common/init.c b/arch/mips/loongson64/common/init.c
index 9b987fe98b5b..6ef17120722f 100644
--- a/arch/mips/loongson64/common/init.c
+++ b/arch/mips/loongson64/common/init.c
@@ -10,13 +10,25 @@
10 10
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12#include <asm/bootinfo.h> 12#include <asm/bootinfo.h>
13#include <asm/traps.h>
13#include <asm/smp-ops.h> 14#include <asm/smp-ops.h>
15#include <asm/cacheflush.h>
14 16
15#include <loongson.h> 17#include <loongson.h>
16 18
17/* Loongson CPU address windows config space base address */ 19/* Loongson CPU address windows config space base address */
18unsigned long __maybe_unused _loongson_addrwincfg_base; 20unsigned long __maybe_unused _loongson_addrwincfg_base;
19 21
22static void __init mips_nmi_setup(void)
23{
24 void *base;
25 extern char except_vec_nmi;
26
27 base = (void *)(CAC_BASE + 0x380);
28 memcpy(base, &except_vec_nmi, 0x80);
29 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
30}
31
20void __init prom_init(void) 32void __init prom_init(void)
21{ 33{
22#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG 34#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
@@ -40,6 +52,7 @@ void __init prom_init(void)
40 /*init the uart base address */ 52 /*init the uart base address */
41 prom_init_uart_base(); 53 prom_init_uart_base();
42 register_smp_ops(&loongson3_smp_ops); 54 register_smp_ops(&loongson3_smp_ops);
55 board_nmi_handler_setup = mips_nmi_setup;
43} 56}
44 57
45void __init prom_free_prom_memory(void) 58void __init prom_free_prom_memory(void)
diff --git a/arch/mips/loongson64/loongson-3/irq.c b/arch/mips/loongson64/loongson-3/irq.c
index 548f759454dc..7202e52cd046 100644
--- a/arch/mips/loongson64/loongson-3/irq.c
+++ b/arch/mips/loongson64/loongson-3/irq.c
@@ -9,18 +9,69 @@
9 9
10#include "smp.h" 10#include "smp.h"
11 11
12extern void loongson3_send_irq_by_ipi(int cpu, int irqs);
13
14unsigned int irq_cpu[16] = {[0 ... 15] = -1};
12unsigned int ht_irq[] = {0, 1, 3, 4, 5, 6, 7, 8, 12, 14, 15}; 15unsigned int ht_irq[] = {0, 1, 3, 4, 5, 6, 7, 8, 12, 14, 15};
16unsigned int local_irq = 1<<0 | 1<<1 | 1<<2 | 1<<7 | 1<<8 | 1<<12;
17
18int plat_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity,
19 bool force)
20{
21 unsigned int cpu;
22 struct cpumask new_affinity;
23
24 /* I/O devices are connected on package-0 */
25 cpumask_copy(&new_affinity, affinity);
26 for_each_cpu(cpu, affinity)
27 if (cpu_data[cpu].package > 0)
28 cpumask_clear_cpu(cpu, &new_affinity);
29
30 if (cpumask_empty(&new_affinity))
31 return -EINVAL;
32
33 cpumask_copy(d->common->affinity, &new_affinity);
34
35 return IRQ_SET_MASK_OK_NOCOPY;
36}
13 37
14static void ht_irqdispatch(void) 38static void ht_irqdispatch(void)
15{ 39{
16 unsigned int i, irq; 40 unsigned int i, irq;
41 struct irq_data *irqd;
42 struct cpumask affinity;
17 43
18 irq = LOONGSON_HT1_INT_VECTOR(0); 44 irq = LOONGSON_HT1_INT_VECTOR(0);
19 LOONGSON_HT1_INT_VECTOR(0) = irq; /* Acknowledge the IRQs */ 45 LOONGSON_HT1_INT_VECTOR(0) = irq; /* Acknowledge the IRQs */
20 46
21 for (i = 0; i < ARRAY_SIZE(ht_irq); i++) { 47 for (i = 0; i < ARRAY_SIZE(ht_irq); i++) {
22 if (irq & (0x1 << ht_irq[i])) 48 if (!(irq & (0x1 << ht_irq[i])))
49 continue;
50
51 /* handled by local core */
52 if (local_irq & (0x1 << ht_irq[i])) {
23 do_IRQ(ht_irq[i]); 53 do_IRQ(ht_irq[i]);
54 continue;
55 }
56
57 irqd = irq_get_irq_data(ht_irq[i]);
58 cpumask_and(&affinity, irqd->common->affinity, cpu_active_mask);
59 if (cpumask_empty(&affinity)) {
60 do_IRQ(ht_irq[i]);
61 continue;
62 }
63
64 irq_cpu[ht_irq[i]] = cpumask_next(irq_cpu[ht_irq[i]], &affinity);
65 if (irq_cpu[ht_irq[i]] >= nr_cpu_ids)
66 irq_cpu[ht_irq[i]] = cpumask_first(&affinity);
67
68 if (irq_cpu[ht_irq[i]] == 0) {
69 do_IRQ(ht_irq[i]);
70 continue;
71 }
72
73 /* balanced by other cores */
74 loongson3_send_irq_by_ipi(irq_cpu[ht_irq[i]], (0x1 << ht_irq[i]));
24 } 75 }
25} 76}
26 77
@@ -120,11 +171,16 @@ void irq_router_init(void)
120 171
121void __init mach_init_irq(void) 172void __init mach_init_irq(void)
122{ 173{
174 struct irq_chip *chip;
175
123 clear_c0_status(ST0_IM | ST0_BEV); 176 clear_c0_status(ST0_IM | ST0_BEV);
124 177
125 irq_router_init(); 178 irq_router_init();
126 mips_cpu_irq_init(); 179 mips_cpu_irq_init();
127 init_i8259_irqs(); 180 init_i8259_irqs();
181 chip = irq_get_chip(I8259A_IRQ_BASE);
182 chip->irq_set_affinity = plat_set_irq_affinity;
183
128 irq_set_chip_and_handler(LOONGSON_UART_IRQ, 184 irq_set_chip_and_handler(LOONGSON_UART_IRQ,
129 &loongson_irq_chip, handle_level_irq); 185 &loongson_irq_chip, handle_level_irq);
130 186
diff --git a/arch/mips/loongson64/loongson-3/smp.c b/arch/mips/loongson64/loongson-3/smp.c
index 64659fc73940..b7a355c3c408 100644
--- a/arch/mips/loongson64/loongson-3/smp.c
+++ b/arch/mips/loongson64/loongson-3/smp.c
@@ -254,13 +254,21 @@ loongson3_send_ipi_mask(const struct cpumask *mask, unsigned int action)
254 loongson3_ipi_write32((u32)action, ipi_set0_regs[cpu_logical_map(i)]); 254 loongson3_ipi_write32((u32)action, ipi_set0_regs[cpu_logical_map(i)]);
255} 255}
256 256
257#define IPI_IRQ_OFFSET 6
258
259void loongson3_send_irq_by_ipi(int cpu, int irqs)
260{
261 loongson3_ipi_write32(irqs << IPI_IRQ_OFFSET, ipi_set0_regs[cpu_logical_map(cpu)]);
262}
263
257void loongson3_ipi_interrupt(struct pt_regs *regs) 264void loongson3_ipi_interrupt(struct pt_regs *regs)
258{ 265{
259 int i, cpu = smp_processor_id(); 266 int i, cpu = smp_processor_id();
260 unsigned int action, c0count; 267 unsigned int action, c0count, irqs;
261 268
262 /* Load the ipi register to figure out what we're supposed to do */ 269 /* Load the ipi register to figure out what we're supposed to do */
263 action = loongson3_ipi_read32(ipi_status0_regs[cpu_logical_map(cpu)]); 270 action = loongson3_ipi_read32(ipi_status0_regs[cpu_logical_map(cpu)]);
271 irqs = action >> IPI_IRQ_OFFSET;
264 272
265 /* Clear the ipi register to clear the interrupt */ 273 /* Clear the ipi register to clear the interrupt */
266 loongson3_ipi_write32((u32)action, ipi_clear0_regs[cpu_logical_map(cpu)]); 274 loongson3_ipi_write32((u32)action, ipi_clear0_regs[cpu_logical_map(cpu)]);
@@ -282,6 +290,14 @@ void loongson3_ipi_interrupt(struct pt_regs *regs)
282 core0_c0count[i] = c0count; 290 core0_c0count[i] = c0count;
283 __wbflush(); /* Let others see the result ASAP */ 291 __wbflush(); /* Let others see the result ASAP */
284 } 292 }
293
294 if (irqs) {
295 int irq;
296 while ((irq = ffs(irqs))) {
297 do_IRQ(irq-1);
298 irqs &= ~(1<<(irq-1));
299 }
300 }
285} 301}
286 302
287#define MAX_LOOPS 800 303#define MAX_LOOPS 800
@@ -503,7 +519,7 @@ static void loongson3a_r1_play_dead(int *state_addr)
503 : "a1"); 519 : "a1");
504} 520}
505 521
506static void loongson3a_r2_play_dead(int *state_addr) 522static void loongson3a_r2r3_play_dead(int *state_addr)
507{ 523{
508 register int val; 524 register int val;
509 register long cpuid, core, node, count; 525 register long cpuid, core, node, count;
@@ -664,8 +680,9 @@ void play_dead(void)
664 (void *)CKSEG1ADDR((unsigned long)loongson3a_r1_play_dead); 680 (void *)CKSEG1ADDR((unsigned long)loongson3a_r1_play_dead);
665 break; 681 break;
666 case PRID_REV_LOONGSON3A_R2: 682 case PRID_REV_LOONGSON3A_R2:
683 case PRID_REV_LOONGSON3A_R3:
667 play_dead_at_ckseg1 = 684 play_dead_at_ckseg1 =
668 (void *)CKSEG1ADDR((unsigned long)loongson3a_r2_play_dead); 685 (void *)CKSEG1ADDR((unsigned long)loongson3a_r2r3_play_dead);
669 break; 686 break;
670 case PRID_REV_LOONGSON3B_R1: 687 case PRID_REV_LOONGSON3B_R1:
671 case PRID_REV_LOONGSON3B_R2: 688 case PRID_REV_LOONGSON3B_R2:
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index f12fde10c8ad..f08a7b4facb9 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -1142,7 +1142,7 @@ emul:
1142 1142
1143 case mfhc_op: 1143 case mfhc_op:
1144 if (!cpu_has_mips_r2_r6) 1144 if (!cpu_has_mips_r2_r6)
1145 goto sigill; 1145 return SIGILL;
1146 1146
1147 /* copregister rd -> gpr[rt] */ 1147 /* copregister rd -> gpr[rt] */
1148 if (MIPSInst_RT(ir) != 0) { 1148 if (MIPSInst_RT(ir) != 0) {
@@ -1153,7 +1153,7 @@ emul:
1153 1153
1154 case mthc_op: 1154 case mthc_op:
1155 if (!cpu_has_mips_r2_r6) 1155 if (!cpu_has_mips_r2_r6)
1156 goto sigill; 1156 return SIGILL;
1157 1157
1158 /* copregister rd <- gpr[rt] */ 1158 /* copregister rd <- gpr[rt] */
1159 SITOHREG(xcp->regs[MIPSInst_RT(ir)], MIPSInst_RD(ir)); 1159 SITOHREG(xcp->regs[MIPSInst_RT(ir)], MIPSInst_RD(ir));
@@ -1376,7 +1376,6 @@ branch_common:
1376 xcp->regs[MIPSInst_RS(ir)]; 1376 xcp->regs[MIPSInst_RS(ir)];
1377 break; 1377 break;
1378 default: 1378 default:
1379sigill:
1380 return SIGILL; 1379 return SIGILL;
1381 } 1380 }
1382 1381
@@ -2524,6 +2523,35 @@ dcopuop:
2524 return 0; 2523 return 0;
2525} 2524}
2526 2525
2526/*
2527 * Emulate FPU instructions.
2528 *
2529 * If we use FPU hardware, then we have been typically called to handle
2530 * an unimplemented operation, such as where an operand is a NaN or
2531 * denormalized. In that case exit the emulation loop after a single
2532 * iteration so as to let hardware execute any subsequent instructions.
2533 *
2534 * If we have no FPU hardware or it has been disabled, then continue
2535 * emulating floating-point instructions until one of these conditions
2536 * has occurred:
2537 *
2538 * - a non-FPU instruction has been encountered,
2539 *
2540 * - an attempt to emulate has ended with a signal,
2541 *
2542 * - the ISA mode has been switched.
2543 *
2544 * We need to terminate the emulation loop if we got switched to the
2545 * MIPS16 mode, whether supported or not, so that we do not attempt
2546 * to emulate a MIPS16 instruction as a regular MIPS FPU instruction.
2547 * Similarly if we got switched to the microMIPS mode and only the
2548 * regular MIPS mode is supported, so that we do not attempt to emulate
2549 * a microMIPS instruction as a regular MIPS FPU instruction. Or if
2550 * we got switched to the regular MIPS mode and only the microMIPS mode
2551 * is supported, so that we do not attempt to emulate a regular MIPS
2552 * instruction that should cause an Address Error exception instead.
2553 * For simplicity we always terminate upon an ISA mode switch.
2554 */
2527int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx, 2555int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
2528 int has_fpu, void *__user *fault_addr) 2556 int has_fpu, void *__user *fault_addr)
2529{ 2557{
@@ -2609,6 +2637,15 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
2609 break; 2637 break;
2610 if (sig) 2638 if (sig)
2611 break; 2639 break;
2640 /*
2641 * We have to check for the ISA bit explicitly here,
2642 * because `get_isa16_mode' may return 0 if support
2643 * for code compression has been globally disabled,
2644 * or otherwise we may produce the wrong signal or
2645 * even proceed successfully where we must not.
2646 */
2647 if ((xcp->cp0_epc ^ prevepc) & 0x1)
2648 break;
2612 2649
2613 cond_resched(); 2650 cond_resched();
2614 } while (xcp->cp0_epc > prevepc); 2651 } while (xcp->cp0_epc > prevepc);
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 3fe99cb271a9..81d6a15c93d0 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1453,6 +1453,7 @@ static void probe_pcache(void)
1453 case CPU_20KC: 1453 case CPU_20KC:
1454 case CPU_25KF: 1454 case CPU_25KF:
1455 case CPU_I6400: 1455 case CPU_I6400:
1456 case CPU_I6500:
1456 case CPU_SB1: 1457 case CPU_SB1:
1457 case CPU_SB1A: 1458 case CPU_SB1A:
1458 case CPU_XLR: 1459 case CPU_XLR:
@@ -1512,6 +1513,7 @@ static void probe_pcache(void)
1512 1513
1513 case CPU_ALCHEMY: 1514 case CPU_ALCHEMY:
1514 case CPU_I6400: 1515 case CPU_I6400:
1516 case CPU_I6500:
1515 c->icache.flags |= MIPS_CACHE_IC_F_DC; 1517 c->icache.flags |= MIPS_CACHE_IC_F_DC;
1516 break; 1518 break;
1517 1519
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index ed1c5297547a..5aadc69c8ce3 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -153,8 +153,7 @@ static int scratchpad_offset(int i)
153 */ 153 */
154static int m4kc_tlbp_war(void) 154static int m4kc_tlbp_war(void)
155{ 155{
156 return (current_cpu_data.processor_id & 0xffff00) == 156 return current_cpu_type() == CPU_4KC;
157 (PRID_COMP_MIPS | PRID_IMP_4KC);
158} 157}
159 158
160/* Handle labels (which must be positive integers). */ 159/* Handle labels (which must be positive integers). */
@@ -2015,6 +2014,26 @@ static void build_r3000_tlb_modify_handler(void)
2015} 2014}
2016#endif /* CONFIG_MIPS_PGD_C0_CONTEXT */ 2015#endif /* CONFIG_MIPS_PGD_C0_CONTEXT */
2017 2016
2017static bool cpu_has_tlbex_tlbp_race(void)
2018{
2019 /*
2020 * When a Hardware Table Walker is running it can replace TLB entries
2021 * at any time, leading to a race between it & the CPU.
2022 */
2023 if (cpu_has_htw)
2024 return true;
2025
2026 /*
2027 * If the CPU shares FTLB RAM with its siblings then our entry may be
2028 * replaced at any time by a sibling performing a write to the FTLB.
2029 */
2030 if (cpu_has_shared_ftlb_ram)
2031 return true;
2032
2033 /* In all other cases there ought to be no race condition to handle */
2034 return false;
2035}
2036
2018/* 2037/*
2019 * R4000 style TLB load/store/modify handlers. 2038 * R4000 style TLB load/store/modify handlers.
2020 */ 2039 */
@@ -2051,7 +2070,7 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l,
2051 iPTE_LW(p, wr.r1, wr.r2); /* get even pte */ 2070 iPTE_LW(p, wr.r1, wr.r2); /* get even pte */
2052 if (!m4kc_tlbp_war()) { 2071 if (!m4kc_tlbp_war()) {
2053 build_tlb_probe_entry(p); 2072 build_tlb_probe_entry(p);
2054 if (cpu_has_htw) { 2073 if (cpu_has_tlbex_tlbp_race()) {
2055 /* race condition happens, leaving */ 2074 /* race condition happens, leaving */
2056 uasm_i_ehb(p); 2075 uasm_i_ehb(p);
2057 uasm_i_mfc0(p, wr.r3, C0_INDEX); 2076 uasm_i_mfc0(p, wr.r3, C0_INDEX);
@@ -2125,6 +2144,14 @@ static void build_r4000_tlb_load_handler(void)
2125 } 2144 }
2126 uasm_i_nop(&p); 2145 uasm_i_nop(&p);
2127 2146
2147 /*
2148 * Warn if something may race with us & replace the TLB entry
2149 * before we read it here. Everything with such races should
2150 * also have dedicated RiXi exception handlers, so this
2151 * shouldn't be hit.
2152 */
2153 WARN(cpu_has_tlbex_tlbp_race(), "Unhandled race in RiXi path");
2154
2128 uasm_i_tlbr(&p); 2155 uasm_i_tlbr(&p);
2129 2156
2130 switch (current_cpu_type()) { 2157 switch (current_cpu_type()) {
@@ -2192,6 +2219,14 @@ static void build_r4000_tlb_load_handler(void)
2192 } 2219 }
2193 uasm_i_nop(&p); 2220 uasm_i_nop(&p);
2194 2221
2222 /*
2223 * Warn if something may race with us & replace the TLB entry
2224 * before we read it here. Everything with such races should
2225 * also have dedicated RiXi exception handlers, so this
2226 * shouldn't be hit.
2227 */
2228 WARN(cpu_has_tlbex_tlbp_race(), "Unhandled race in RiXi path");
2229
2195 uasm_i_tlbr(&p); 2230 uasm_i_tlbr(&p);
2196 2231
2197 switch (current_cpu_type()) { 2232 switch (current_cpu_type()) {
diff --git a/arch/mips/mm/uasm-micromips.c b/arch/mips/mm/uasm-micromips.c
index 277cf52d80e1..c28ff53c8da0 100644
--- a/arch/mips/mm/uasm-micromips.c
+++ b/arch/mips/mm/uasm-micromips.c
@@ -40,93 +40,92 @@
40 40
41#include "uasm.c" 41#include "uasm.c"
42 42
43static struct insn insn_table_MM[] = { 43static const struct insn const insn_table_MM[insn_invalid] = {
44 { insn_addu, M(mm_pool32a_op, 0, 0, 0, 0, mm_addu32_op), RT | RS | RD }, 44 [insn_addu] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_addu32_op), RT | RS | RD},
45 { insn_addiu, M(mm_addiu32_op, 0, 0, 0, 0, 0), RT | RS | SIMM }, 45 [insn_addiu] = {M(mm_addiu32_op, 0, 0, 0, 0, 0), RT | RS | SIMM},
46 { insn_and, M(mm_pool32a_op, 0, 0, 0, 0, mm_and_op), RT | RS | RD }, 46 [insn_and] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_and_op), RT | RS | RD},
47 { insn_andi, M(mm_andi32_op, 0, 0, 0, 0, 0), RT | RS | UIMM }, 47 [insn_andi] = {M(mm_andi32_op, 0, 0, 0, 0, 0), RT | RS | UIMM},
48 { insn_beq, M(mm_beq32_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 48 [insn_beq] = {M(mm_beq32_op, 0, 0, 0, 0, 0), RS | RT | BIMM},
49 { insn_beql, 0, 0 }, 49 [insn_beql] = {0, 0},
50 { insn_bgez, M(mm_pool32i_op, mm_bgez_op, 0, 0, 0, 0), RS | BIMM }, 50 [insn_bgez] = {M(mm_pool32i_op, mm_bgez_op, 0, 0, 0, 0), RS | BIMM},
51 { insn_bgezl, 0, 0 }, 51 [insn_bgezl] = {0, 0},
52 { insn_bltz, M(mm_pool32i_op, mm_bltz_op, 0, 0, 0, 0), RS | BIMM }, 52 [insn_bltz] = {M(mm_pool32i_op, mm_bltz_op, 0, 0, 0, 0), RS | BIMM},
53 { insn_bltzl, 0, 0 }, 53 [insn_bltzl] = {0, 0},
54 { insn_bne, M(mm_bne32_op, 0, 0, 0, 0, 0), RT | RS | BIMM }, 54 [insn_bne] = {M(mm_bne32_op, 0, 0, 0, 0, 0), RT | RS | BIMM},
55 { insn_cache, M(mm_pool32b_op, 0, 0, mm_cache_func, 0, 0), RT | RS | SIMM }, 55 [insn_cache] = {M(mm_pool32b_op, 0, 0, mm_cache_func, 0, 0), RT | RS | SIMM},
56 { insn_cfc1, M(mm_pool32f_op, 0, 0, 0, mm_cfc1_op, mm_32f_73_op), RT | RS }, 56 [insn_cfc1] = {M(mm_pool32f_op, 0, 0, 0, mm_cfc1_op, mm_32f_73_op), RT | RS},
57 { insn_cfcmsa, M(mm_pool32s_op, 0, msa_cfc_op, 0, 0, mm_32s_elm_op), RD | RE }, 57 [insn_cfcmsa] = {M(mm_pool32s_op, 0, msa_cfc_op, 0, 0, mm_32s_elm_op), RD | RE},
58 { insn_ctc1, M(mm_pool32f_op, 0, 0, 0, mm_ctc1_op, mm_32f_73_op), RT | RS }, 58 [insn_ctc1] = {M(mm_pool32f_op, 0, 0, 0, mm_ctc1_op, mm_32f_73_op), RT | RS},
59 { insn_ctcmsa, M(mm_pool32s_op, 0, msa_ctc_op, 0, 0, mm_32s_elm_op), RD | RE }, 59 [insn_ctcmsa] = {M(mm_pool32s_op, 0, msa_ctc_op, 0, 0, mm_32s_elm_op), RD | RE},
60 { insn_daddu, 0, 0 }, 60 [insn_daddu] = {0, 0},
61 { insn_daddiu, 0, 0 }, 61 [insn_daddiu] = {0, 0},
62 { insn_di, M(mm_pool32a_op, 0, 0, 0, mm_di_op, mm_pool32axf_op), RS }, 62 [insn_di] = {M(mm_pool32a_op, 0, 0, 0, mm_di_op, mm_pool32axf_op), RS},
63 { insn_divu, M(mm_pool32a_op, 0, 0, 0, mm_divu_op, mm_pool32axf_op), RT | RS }, 63 [insn_divu] = {M(mm_pool32a_op, 0, 0, 0, mm_divu_op, mm_pool32axf_op), RT | RS},
64 { insn_dmfc0, 0, 0 }, 64 [insn_dmfc0] = {0, 0},
65 { insn_dmtc0, 0, 0 }, 65 [insn_dmtc0] = {0, 0},
66 { insn_dsll, 0, 0 }, 66 [insn_dsll] = {0, 0},
67 { insn_dsll32, 0, 0 }, 67 [insn_dsll32] = {0, 0},
68 { insn_dsra, 0, 0 }, 68 [insn_dsra] = {0, 0},
69 { insn_dsrl, 0, 0 }, 69 [insn_dsrl] = {0, 0},
70 { insn_dsrl32, 0, 0 }, 70 [insn_dsrl32] = {0, 0},
71 { insn_drotr, 0, 0 }, 71 [insn_drotr] = {0, 0},
72 { insn_drotr32, 0, 0 }, 72 [insn_drotr32] = {0, 0},
73 { insn_dsubu, 0, 0 }, 73 [insn_dsubu] = {0, 0},
74 { insn_eret, M(mm_pool32a_op, 0, 0, 0, mm_eret_op, mm_pool32axf_op), 0 }, 74 [insn_eret] = {M(mm_pool32a_op, 0, 0, 0, mm_eret_op, mm_pool32axf_op), 0},
75 { insn_ins, M(mm_pool32a_op, 0, 0, 0, 0, mm_ins_op), RT | RS | RD | RE }, 75 [insn_ins] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_ins_op), RT | RS | RD | RE},
76 { insn_ext, M(mm_pool32a_op, 0, 0, 0, 0, mm_ext_op), RT | RS | RD | RE }, 76 [insn_ext] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_ext_op), RT | RS | RD | RE},
77 { insn_j, M(mm_j32_op, 0, 0, 0, 0, 0), JIMM }, 77 [insn_j] = {M(mm_j32_op, 0, 0, 0, 0, 0), JIMM},
78 { insn_jal, M(mm_jal32_op, 0, 0, 0, 0, 0), JIMM }, 78 [insn_jal] = {M(mm_jal32_op, 0, 0, 0, 0, 0), JIMM},
79 { insn_jalr, M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RT | RS }, 79 [insn_jalr] = {M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RT | RS},
80 { insn_jr, M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RS }, 80 [insn_jr] = {M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RS},
81 { insn_lb, M(mm_lb32_op, 0, 0, 0, 0, 0), RT | RS | SIMM }, 81 [insn_lb] = {M(mm_lb32_op, 0, 0, 0, 0, 0), RT | RS | SIMM},
82 { insn_ld, 0, 0 }, 82 [insn_ld] = {0, 0},
83 { insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RS | RS | SIMM }, 83 [insn_lh] = {M(mm_lh32_op, 0, 0, 0, 0, 0), RS | RS | SIMM},
84 { insn_ll, M(mm_pool32c_op, 0, 0, (mm_ll_func << 1), 0, 0), RS | RT | SIMM }, 84 [insn_ll] = {M(mm_pool32c_op, 0, 0, (mm_ll_func << 1), 0, 0), RS | RT | SIMM},
85 { insn_lld, 0, 0 }, 85 [insn_lld] = {0, 0},
86 { insn_lui, M(mm_pool32i_op, mm_lui_op, 0, 0, 0, 0), RS | SIMM }, 86 [insn_lui] = {M(mm_pool32i_op, mm_lui_op, 0, 0, 0, 0), RS | SIMM},
87 { insn_lw, M(mm_lw32_op, 0, 0, 0, 0, 0), RT | RS | SIMM }, 87 [insn_lw] = {M(mm_lw32_op, 0, 0, 0, 0, 0), RT | RS | SIMM},
88 { insn_mfc0, M(mm_pool32a_op, 0, 0, 0, mm_mfc0_op, mm_pool32axf_op), RT | RS | RD }, 88 [insn_mfc0] = {M(mm_pool32a_op, 0, 0, 0, mm_mfc0_op, mm_pool32axf_op), RT | RS | RD},
89 { insn_mfhi, M(mm_pool32a_op, 0, 0, 0, mm_mfhi32_op, mm_pool32axf_op), RS }, 89 [insn_mfhi] = {M(mm_pool32a_op, 0, 0, 0, mm_mfhi32_op, mm_pool32axf_op), RS},
90 { insn_mflo, M(mm_pool32a_op, 0, 0, 0, mm_mflo32_op, mm_pool32axf_op), RS }, 90 [insn_mflo] = {M(mm_pool32a_op, 0, 0, 0, mm_mflo32_op, mm_pool32axf_op), RS},
91 { insn_mtc0, M(mm_pool32a_op, 0, 0, 0, mm_mtc0_op, mm_pool32axf_op), RT | RS | RD }, 91 [insn_mtc0] = {M(mm_pool32a_op, 0, 0, 0, mm_mtc0_op, mm_pool32axf_op), RT | RS | RD},
92 { insn_mthi, M(mm_pool32a_op, 0, 0, 0, mm_mthi32_op, mm_pool32axf_op), RS }, 92 [insn_mthi] = {M(mm_pool32a_op, 0, 0, 0, mm_mthi32_op, mm_pool32axf_op), RS},
93 { insn_mtlo, M(mm_pool32a_op, 0, 0, 0, mm_mtlo32_op, mm_pool32axf_op), RS }, 93 [insn_mtlo] = {M(mm_pool32a_op, 0, 0, 0, mm_mtlo32_op, mm_pool32axf_op), RS},
94 { insn_mul, M(mm_pool32a_op, 0, 0, 0, 0, mm_mul_op), RT | RS | RD }, 94 [insn_mul] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_mul_op), RT | RS | RD},
95 { insn_or, M(mm_pool32a_op, 0, 0, 0, 0, mm_or32_op), RT | RS | RD }, 95 [insn_or] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_or32_op), RT | RS | RD},
96 { insn_ori, M(mm_ori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM }, 96 [insn_ori] = {M(mm_ori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM},
97 { insn_pref, M(mm_pool32c_op, 0, 0, (mm_pref_func << 1), 0, 0), RT | RS | SIMM }, 97 [insn_pref] = {M(mm_pool32c_op, 0, 0, (mm_pref_func << 1), 0, 0), RT | RS | SIMM},
98 { insn_rfe, 0, 0 }, 98 [insn_rfe] = {0, 0},
99 { insn_sc, M(mm_pool32c_op, 0, 0, (mm_sc_func << 1), 0, 0), RT | RS | SIMM }, 99 [insn_sc] = {M(mm_pool32c_op, 0, 0, (mm_sc_func << 1), 0, 0), RT | RS | SIMM},
100 { insn_scd, 0, 0 }, 100 [insn_scd] = {0, 0},
101 { insn_sd, 0, 0 }, 101 [insn_sd] = {0, 0},
102 { insn_sll, M(mm_pool32a_op, 0, 0, 0, 0, mm_sll32_op), RT | RS | RD }, 102 [insn_sll] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_sll32_op), RT | RS | RD},
103 { insn_sllv, M(mm_pool32a_op, 0, 0, 0, 0, mm_sllv32_op), RT | RS | RD }, 103 [insn_sllv] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_sllv32_op), RT | RS | RD},
104 { insn_slt, M(mm_pool32a_op, 0, 0, 0, 0, mm_slt_op), RT | RS | RD }, 104 [insn_slt] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_slt_op), RT | RS | RD},
105 { insn_sltiu, M(mm_sltiu32_op, 0, 0, 0, 0, 0), RT | RS | SIMM }, 105 [insn_sltiu] = {M(mm_sltiu32_op, 0, 0, 0, 0, 0), RT | RS | SIMM},
106 { insn_sltu, M(mm_pool32a_op, 0, 0, 0, 0, mm_sltu_op), RT | RS | RD }, 106 [insn_sltu] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_sltu_op), RT | RS | RD},
107 { insn_sra, M(mm_pool32a_op, 0, 0, 0, 0, mm_sra_op), RT | RS | RD }, 107 [insn_sra] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_sra_op), RT | RS | RD},
108 { insn_srl, M(mm_pool32a_op, 0, 0, 0, 0, mm_srl32_op), RT | RS | RD }, 108 [insn_srl] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_srl32_op), RT | RS | RD},
109 { insn_srlv, M(mm_pool32a_op, 0, 0, 0, 0, mm_srlv32_op), RT | RS | RD }, 109 [insn_srlv] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_srlv32_op), RT | RS | RD},
110 { insn_rotr, M(mm_pool32a_op, 0, 0, 0, 0, mm_rotr_op), RT | RS | RD }, 110 [insn_rotr] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_rotr_op), RT | RS | RD},
111 { insn_subu, M(mm_pool32a_op, 0, 0, 0, 0, mm_subu32_op), RT | RS | RD }, 111 [insn_subu] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_subu32_op), RT | RS | RD},
112 { insn_sw, M(mm_sw32_op, 0, 0, 0, 0, 0), RT | RS | SIMM }, 112 [insn_sw] = {M(mm_sw32_op, 0, 0, 0, 0, 0), RT | RS | SIMM},
113 { insn_sync, M(mm_pool32a_op, 0, 0, 0, mm_sync_op, mm_pool32axf_op), RS }, 113 [insn_sync] = {M(mm_pool32a_op, 0, 0, 0, mm_sync_op, mm_pool32axf_op), RS},
114 { insn_tlbp, M(mm_pool32a_op, 0, 0, 0, mm_tlbp_op, mm_pool32axf_op), 0 }, 114 [insn_tlbp] = {M(mm_pool32a_op, 0, 0, 0, mm_tlbp_op, mm_pool32axf_op), 0},
115 { insn_tlbr, M(mm_pool32a_op, 0, 0, 0, mm_tlbr_op, mm_pool32axf_op), 0 }, 115 [insn_tlbr] = {M(mm_pool32a_op, 0, 0, 0, mm_tlbr_op, mm_pool32axf_op), 0},
116 { insn_tlbwi, M(mm_pool32a_op, 0, 0, 0, mm_tlbwi_op, mm_pool32axf_op), 0 }, 116 [insn_tlbwi] = {M(mm_pool32a_op, 0, 0, 0, mm_tlbwi_op, mm_pool32axf_op), 0},
117 { insn_tlbwr, M(mm_pool32a_op, 0, 0, 0, mm_tlbwr_op, mm_pool32axf_op), 0 }, 117 [insn_tlbwr] = {M(mm_pool32a_op, 0, 0, 0, mm_tlbwr_op, mm_pool32axf_op), 0},
118 { insn_wait, M(mm_pool32a_op, 0, 0, 0, mm_wait_op, mm_pool32axf_op), SCIMM }, 118 [insn_wait] = {M(mm_pool32a_op, 0, 0, 0, mm_wait_op, mm_pool32axf_op), SCIMM},
119 { insn_wsbh, M(mm_pool32a_op, 0, 0, 0, mm_wsbh_op, mm_pool32axf_op), RT | RS }, 119 [insn_wsbh] = {M(mm_pool32a_op, 0, 0, 0, mm_wsbh_op, mm_pool32axf_op), RT | RS},
120 { insn_xor, M(mm_pool32a_op, 0, 0, 0, 0, mm_xor32_op), RT | RS | RD }, 120 [insn_xor] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_xor32_op), RT | RS | RD},
121 { insn_xori, M(mm_xori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM }, 121 [insn_xori] = {M(mm_xori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM},
122 { insn_dins, 0, 0 }, 122 [insn_dins] = {0, 0},
123 { insn_dinsm, 0, 0 }, 123 [insn_dinsm] = {0, 0},
124 { insn_syscall, M(mm_pool32a_op, 0, 0, 0, mm_syscall_op, mm_pool32axf_op), SCIMM}, 124 [insn_syscall] = {M(mm_pool32a_op, 0, 0, 0, mm_syscall_op, mm_pool32axf_op), SCIMM},
125 { insn_bbit0, 0, 0 }, 125 [insn_bbit0] = {0, 0},
126 { insn_bbit1, 0, 0 }, 126 [insn_bbit1] = {0, 0},
127 { insn_lwx, 0, 0 }, 127 [insn_lwx] = {0, 0},
128 { insn_ldx, 0, 0 }, 128 [insn_ldx] = {0, 0},
129 { insn_invalid, 0, 0 }
130}; 129};
131 130
132#undef M 131#undef M
@@ -156,20 +155,17 @@ static inline u32 build_jimm(u32 arg)
156 */ 155 */
157static void build_insn(u32 **buf, enum opcode opc, ...) 156static void build_insn(u32 **buf, enum opcode opc, ...)
158{ 157{
159 struct insn *ip = NULL; 158 const struct insn *ip;
160 unsigned int i;
161 va_list ap; 159 va_list ap;
162 u32 op; 160 u32 op;
163 161
164 for (i = 0; insn_table_MM[i].opcode != insn_invalid; i++) 162 if (opc < 0 || opc >= insn_invalid ||
165 if (insn_table_MM[i].opcode == opc) { 163 (opc == insn_daddiu && r4k_daddiu_bug()) ||
166 ip = &insn_table_MM[i]; 164 (insn_table_MM[opc].match == 0 && insn_table_MM[opc].fields == 0))
167 break;
168 }
169
170 if (!ip || (opc == insn_daddiu && r4k_daddiu_bug()))
171 panic("Unsupported Micro-assembler instruction %d", opc); 165 panic("Unsupported Micro-assembler instruction %d", opc);
172 166
167 ip = &insn_table_MM[opc];
168
173 op = ip->match; 169 op = ip->match;
174 va_start(ap, opc); 170 va_start(ap, opc);
175 if (ip->fields & RS) { 171 if (ip->fields & RS) {
diff --git a/arch/mips/mm/uasm-mips.c b/arch/mips/mm/uasm-mips.c
index 2277499fe6ae..3f74f6c1f065 100644
--- a/arch/mips/mm/uasm-mips.c
+++ b/arch/mips/mm/uasm-mips.c
@@ -48,126 +48,145 @@
48 48
49#include "uasm.c" 49#include "uasm.c"
50 50
51static struct insn insn_table[] = { 51static const struct insn const insn_table[insn_invalid] = {
52 { insn_addiu, M(addiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 52 [insn_addiu] = {M(addiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
53 { insn_addu, M(spec_op, 0, 0, 0, 0, addu_op), RS | RT | RD }, 53 [insn_addu] = {M(spec_op, 0, 0, 0, 0, addu_op), RS | RT | RD},
54 { insn_andi, M(andi_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, 54 [insn_and] = {M(spec_op, 0, 0, 0, 0, and_op), RS | RT | RD},
55 { insn_and, M(spec_op, 0, 0, 0, 0, and_op), RS | RT | RD }, 55 [insn_andi] = {M(andi_op, 0, 0, 0, 0, 0), RS | RT | UIMM},
56 { insn_bbit0, M(lwc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 56 [insn_bbit0] = {M(lwc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM},
57 { insn_bbit1, M(swc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 57 [insn_bbit1] = {M(swc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM},
58 { insn_beql, M(beql_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 58 [insn_beq] = {M(beq_op, 0, 0, 0, 0, 0), RS | RT | BIMM},
59 { insn_beq, M(beq_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 59 [insn_beql] = {M(beql_op, 0, 0, 0, 0, 0), RS | RT | BIMM},
60 { insn_bgezl, M(bcond_op, 0, bgezl_op, 0, 0, 0), RS | BIMM }, 60 [insn_bgez] = {M(bcond_op, 0, bgez_op, 0, 0, 0), RS | BIMM},
61 { insn_bgez, M(bcond_op, 0, bgez_op, 0, 0, 0), RS | BIMM }, 61 [insn_bgezl] = {M(bcond_op, 0, bgezl_op, 0, 0, 0), RS | BIMM},
62 { insn_bltzl, M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM }, 62 [insn_bgtz] = {M(bgtz_op, 0, 0, 0, 0, 0), RS | BIMM},
63 { insn_bltz, M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM }, 63 [insn_blez] = {M(blez_op, 0, 0, 0, 0, 0), RS | BIMM},
64 { insn_bne, M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 64 [insn_bltz] = {M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM},
65 [insn_bltzl] = {M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM},
66 [insn_bne] = {M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM},
67 [insn_break] = {M(spec_op, 0, 0, 0, 0, break_op), SCIMM},
65#ifndef CONFIG_CPU_MIPSR6 68#ifndef CONFIG_CPU_MIPSR6
66 { insn_cache, M(cache_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 69 [insn_cache] = {M(cache_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
67#else 70#else
68 { insn_cache, M6(spec3_op, 0, 0, 0, cache6_op), RS | RT | SIMM9 }, 71 [insn_cache] = {M6(spec3_op, 0, 0, 0, cache6_op), RS | RT | SIMM9},
69#endif 72#endif
70 { insn_cfc1, M(cop1_op, cfc_op, 0, 0, 0, 0), RT | RD }, 73 [insn_cfc1] = {M(cop1_op, cfc_op, 0, 0, 0, 0), RT | RD},
71 { insn_cfcmsa, M(msa_op, 0, msa_cfc_op, 0, 0, msa_elm_op), RD | RE }, 74 [insn_cfcmsa] = {M(msa_op, 0, msa_cfc_op, 0, 0, msa_elm_op), RD | RE},
72 { insn_ctc1, M(cop1_op, ctc_op, 0, 0, 0, 0), RT | RD }, 75 [insn_ctc1] = {M(cop1_op, ctc_op, 0, 0, 0, 0), RT | RD},
73 { insn_ctcmsa, M(msa_op, 0, msa_ctc_op, 0, 0, msa_elm_op), RD | RE }, 76 [insn_ctcmsa] = {M(msa_op, 0, msa_ctc_op, 0, 0, msa_elm_op), RD | RE},
74 { insn_daddiu, M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 77 [insn_daddiu] = {M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
75 { insn_daddu, M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD }, 78 [insn_daddu] = {M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD},
76 { insn_dinsm, M(spec3_op, 0, 0, 0, 0, dinsm_op), RS | RT | RD | RE }, 79 [insn_ddivu] = {M(spec_op, 0, 0, 0, 0, ddivu_op), RS | RT},
77 { insn_di, M(cop0_op, mfmc0_op, 0, 12, 0, 0), RT }, 80 [insn_di] = {M(cop0_op, mfmc0_op, 0, 12, 0, 0), RT},
78 { insn_dins, M(spec3_op, 0, 0, 0, 0, dins_op), RS | RT | RD | RE }, 81 [insn_dins] = {M(spec3_op, 0, 0, 0, 0, dins_op), RS | RT | RD | RE},
79 { insn_divu, M(spec_op, 0, 0, 0, 0, divu_op), RS | RT }, 82 [insn_dinsm] = {M(spec3_op, 0, 0, 0, 0, dinsm_op), RS | RT | RD | RE},
80 { insn_dmfc0, M(cop0_op, dmfc_op, 0, 0, 0, 0), RT | RD | SET}, 83 [insn_dinsu] = {M(spec3_op, 0, 0, 0, 0, dinsu_op), RS | RT | RD | RE},
81 { insn_dmtc0, M(cop0_op, dmtc_op, 0, 0, 0, 0), RT | RD | SET}, 84 [insn_divu] = {M(spec_op, 0, 0, 0, 0, divu_op), RS | RT},
82 { insn_drotr32, M(spec_op, 1, 0, 0, 0, dsrl32_op), RT | RD | RE }, 85 [insn_dmfc0] = {M(cop0_op, dmfc_op, 0, 0, 0, 0), RT | RD | SET},
83 { insn_drotr, M(spec_op, 1, 0, 0, 0, dsrl_op), RT | RD | RE }, 86 [insn_dmtc0] = {M(cop0_op, dmtc_op, 0, 0, 0, 0), RT | RD | SET},
84 { insn_dsll32, M(spec_op, 0, 0, 0, 0, dsll32_op), RT | RD | RE }, 87 [insn_dmultu] = {M(spec_op, 0, 0, 0, 0, dmultu_op), RS | RT},
85 { insn_dsll, M(spec_op, 0, 0, 0, 0, dsll_op), RT | RD | RE }, 88 [insn_drotr] = {M(spec_op, 1, 0, 0, 0, dsrl_op), RT | RD | RE},
86 { insn_dsra, M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE }, 89 [insn_drotr32] = {M(spec_op, 1, 0, 0, 0, dsrl32_op), RT | RD | RE},
87 { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE }, 90 [insn_dsbh] = {M(spec3_op, 0, 0, 0, dsbh_op, dbshfl_op), RT | RD},
88 { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE }, 91 [insn_dshd] = {M(spec3_op, 0, 0, 0, dshd_op, dbshfl_op), RT | RD},
89 { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD }, 92 [insn_dsll] = {M(spec_op, 0, 0, 0, 0, dsll_op), RT | RD | RE},
90 { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 }, 93 [insn_dsll32] = {M(spec_op, 0, 0, 0, 0, dsll32_op), RT | RD | RE},
91 { insn_ext, M(spec3_op, 0, 0, 0, 0, ext_op), RS | RT | RD | RE }, 94 [insn_dsllv] = {M(spec_op, 0, 0, 0, 0, dsllv_op), RS | RT | RD},
92 { insn_ins, M(spec3_op, 0, 0, 0, 0, ins_op), RS | RT | RD | RE }, 95 [insn_dsra] = {M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE},
93 { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, 96 [insn_dsra32] = {M(spec_op, 0, 0, 0, 0, dsra32_op), RT | RD | RE},
94 { insn_jal, M(jal_op, 0, 0, 0, 0, 0), JIMM }, 97 [insn_dsrav] = {M(spec_op, 0, 0, 0, 0, dsrav_op), RS | RT | RD},
95 { insn_jalr, M(spec_op, 0, 0, 0, 0, jalr_op), RS | RD }, 98 [insn_dsrl] = {M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE},
96 { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, 99 [insn_dsrl32] = {M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE},
100 [insn_dsrlv] = {M(spec_op, 0, 0, 0, 0, dsrlv_op), RS | RT | RD},
101 [insn_dsubu] = {M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD},
102 [insn_eret] = {M(cop0_op, cop_op, 0, 0, 0, eret_op), 0},
103 [insn_ext] = {M(spec3_op, 0, 0, 0, 0, ext_op), RS | RT | RD | RE},
104 [insn_ins] = {M(spec3_op, 0, 0, 0, 0, ins_op), RS | RT | RD | RE},
105 [insn_j] = {M(j_op, 0, 0, 0, 0, 0), JIMM},
106 [insn_jal] = {M(jal_op, 0, 0, 0, 0, 0), JIMM},
107 [insn_jalr] = {M(spec_op, 0, 0, 0, 0, jalr_op), RS | RD},
97#ifndef CONFIG_CPU_MIPSR6 108#ifndef CONFIG_CPU_MIPSR6
98 { insn_jr, M(spec_op, 0, 0, 0, 0, jr_op), RS }, 109 [insn_jr] = {M(spec_op, 0, 0, 0, 0, jr_op), RS},
99#else 110#else
100 { insn_jr, M(spec_op, 0, 0, 0, 0, jalr_op), RS }, 111 [insn_jr] = {M(spec_op, 0, 0, 0, 0, jalr_op), RS},
101#endif 112#endif
102 { insn_lb, M(lb_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 113 [insn_lb] = {M(lb_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
103 { insn_ld, M(ld_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 114 [insn_lbu] = {M(lbu_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
104 { insn_ldx, M(spec3_op, 0, 0, 0, ldx_op, lx_op), RS | RT | RD }, 115 [insn_ld] = {M(ld_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
105 { insn_lh, M(lh_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 116 [insn_lddir] = {M(lwc2_op, 0, 0, 0, lddir_op, mult_op), RS | RT | RD},
106 { insn_lhu, M(lhu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 117 [insn_ldpte] = {M(lwc2_op, 0, 0, 0, ldpte_op, mult_op), RS | RD},
118 [insn_ldx] = {M(spec3_op, 0, 0, 0, ldx_op, lx_op), RS | RT | RD},
119 [insn_lh] = {M(lh_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
120 [insn_lhu] = {M(lhu_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
107#ifndef CONFIG_CPU_MIPSR6 121#ifndef CONFIG_CPU_MIPSR6
108 { insn_lld, M(lld_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 122 [insn_ll] = {M(ll_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
109 { insn_ll, M(ll_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 123 [insn_lld] = {M(lld_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
110#else 124#else
111 { insn_lld, M6(spec3_op, 0, 0, 0, lld6_op), RS | RT | SIMM9 }, 125 [insn_ll] = {M6(spec3_op, 0, 0, 0, ll6_op), RS | RT | SIMM9},
112 { insn_ll, M6(spec3_op, 0, 0, 0, ll6_op), RS | RT | SIMM9 }, 126 [insn_lld] = {M6(spec3_op, 0, 0, 0, lld6_op), RS | RT | SIMM9},
113#endif 127#endif
114 { insn_lui, M(lui_op, 0, 0, 0, 0, 0), RT | SIMM }, 128 [insn_lui] = {M(lui_op, 0, 0, 0, 0, 0), RT | SIMM},
115 { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 129 [insn_lw] = {M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
116 { insn_lwx, M(spec3_op, 0, 0, 0, lwx_op, lx_op), RS | RT | RD }, 130 [insn_lwu] = {M(lwu_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
117 { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET}, 131 [insn_lwx] = {M(spec3_op, 0, 0, 0, lwx_op, lx_op), RS | RT | RD},
118 { insn_mfhc0, M(cop0_op, mfhc0_op, 0, 0, 0, 0), RT | RD | SET}, 132 [insn_mfc0] = {M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET},
119 { insn_mfhi, M(spec_op, 0, 0, 0, 0, mfhi_op), RD }, 133 [insn_mfhc0] = {M(cop0_op, mfhc0_op, 0, 0, 0, 0), RT | RD | SET},
120 { insn_mflo, M(spec_op, 0, 0, 0, 0, mflo_op), RD }, 134 [insn_mfhi] = {M(spec_op, 0, 0, 0, 0, mfhi_op), RD},
121 { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, 135 [insn_mflo] = {M(spec_op, 0, 0, 0, 0, mflo_op), RD},
122 { insn_mthc0, M(cop0_op, mthc0_op, 0, 0, 0, 0), RT | RD | SET}, 136 [insn_movn] = {M(spec_op, 0, 0, 0, 0, movn_op), RS | RT | RD},
123 { insn_mthi, M(spec_op, 0, 0, 0, 0, mthi_op), RS }, 137 [insn_movz] = {M(spec_op, 0, 0, 0, 0, movz_op), RS | RT | RD},
124 { insn_mtlo, M(spec_op, 0, 0, 0, 0, mtlo_op), RS }, 138 [insn_mtc0] = {M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET},
139 [insn_mthc0] = {M(cop0_op, mthc0_op, 0, 0, 0, 0), RT | RD | SET},
140 [insn_mthi] = {M(spec_op, 0, 0, 0, 0, mthi_op), RS},
141 [insn_mtlo] = {M(spec_op, 0, 0, 0, 0, mtlo_op), RS},
125#ifndef CONFIG_CPU_MIPSR6 142#ifndef CONFIG_CPU_MIPSR6
126 { insn_mul, M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD}, 143 [insn_mul] = {M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD},
127#else 144#else
128 { insn_mul, M(spec_op, 0, 0, 0, mult_mul_op, mult_op), RS | RT | RD}, 145 [insn_mul] = {M(spec_op, 0, 0, 0, mult_mul_op, mult_op), RS | RT | RD},
129#endif 146#endif
130 { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, 147 [insn_multu] = {M(spec_op, 0, 0, 0, 0, multu_op), RS | RT},
131 { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, 148 [insn_nor] = {M(spec_op, 0, 0, 0, 0, nor_op), RS | RT | RD},
149 [insn_or] = {M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD},
150 [insn_ori] = {M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM},
132#ifndef CONFIG_CPU_MIPSR6 151#ifndef CONFIG_CPU_MIPSR6
133 { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 152 [insn_pref] = {M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
134#else 153#else
135 { insn_pref, M6(spec3_op, 0, 0, 0, pref6_op), RS | RT | SIMM9 }, 154 [insn_pref] = {M6(spec3_op, 0, 0, 0, pref6_op), RS | RT | SIMM9},
136#endif 155#endif
137 { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 }, 156 [insn_rfe] = {M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0},
138 { insn_rotr, M(spec_op, 1, 0, 0, 0, srl_op), RT | RD | RE }, 157 [insn_rotr] = {M(spec_op, 1, 0, 0, 0, srl_op), RT | RD | RE},
158 [insn_sb] = {M(sb_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
139#ifndef CONFIG_CPU_MIPSR6 159#ifndef CONFIG_CPU_MIPSR6
140 { insn_scd, M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 160 [insn_sc] = {M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
141 { insn_sc, M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 161 [insn_scd] = {M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
142#else 162#else
143 { insn_scd, M6(spec3_op, 0, 0, 0, scd6_op), RS | RT | SIMM9 }, 163 [insn_sc] = {M6(spec3_op, 0, 0, 0, sc6_op), RS | RT | SIMM9},
144 { insn_sc, M6(spec3_op, 0, 0, 0, sc6_op), RS | RT | SIMM9 }, 164 [insn_scd] = {M6(spec3_op, 0, 0, 0, scd6_op), RS | RT | SIMM9},
145#endif 165#endif
146 { insn_sd, M(sd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 166 [insn_sd] = {M(sd_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
147 { insn_sll, M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE }, 167 [insn_sh] = {M(sh_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
148 { insn_sllv, M(spec_op, 0, 0, 0, 0, sllv_op), RS | RT | RD }, 168 [insn_sll] = {M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE},
149 { insn_slt, M(spec_op, 0, 0, 0, 0, slt_op), RS | RT | RD }, 169 [insn_sllv] = {M(spec_op, 0, 0, 0, 0, sllv_op), RS | RT | RD},
150 { insn_sltiu, M(sltiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 170 [insn_slt] = {M(spec_op, 0, 0, 0, 0, slt_op), RS | RT | RD},
151 { insn_sltu, M(spec_op, 0, 0, 0, 0, sltu_op), RS | RT | RD }, 171 [insn_slti] = {M(slti_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
152 { insn_sra, M(spec_op, 0, 0, 0, 0, sra_op), RT | RD | RE }, 172 [insn_sltiu] = {M(sltiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
153 { insn_srl, M(spec_op, 0, 0, 0, 0, srl_op), RT | RD | RE }, 173 [insn_sltu] = {M(spec_op, 0, 0, 0, 0, sltu_op), RS | RT | RD},
154 { insn_srlv, M(spec_op, 0, 0, 0, 0, srlv_op), RS | RT | RD }, 174 [insn_sra] = {M(spec_op, 0, 0, 0, 0, sra_op), RT | RD | RE},
155 { insn_subu, M(spec_op, 0, 0, 0, 0, subu_op), RS | RT | RD }, 175 [insn_srl] = {M(spec_op, 0, 0, 0, 0, srl_op), RT | RD | RE},
156 { insn_sw, M(sw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 176 [insn_srlv] = {M(spec_op, 0, 0, 0, 0, srlv_op), RS | RT | RD},
157 { insn_sync, M(spec_op, 0, 0, 0, 0, sync_op), RE }, 177 [insn_subu] = {M(spec_op, 0, 0, 0, 0, subu_op), RS | RT | RD},
158 { insn_syscall, M(spec_op, 0, 0, 0, 0, syscall_op), SCIMM}, 178 [insn_sw] = {M(sw_op, 0, 0, 0, 0, 0), RS | RT | SIMM},
159 { insn_tlbp, M(cop0_op, cop_op, 0, 0, 0, tlbp_op), 0 }, 179 [insn_sync] = {M(spec_op, 0, 0, 0, 0, sync_op), RE},
160 { insn_tlbr, M(cop0_op, cop_op, 0, 0, 0, tlbr_op), 0 }, 180 [insn_syscall] = {M(spec_op, 0, 0, 0, 0, syscall_op), SCIMM},
161 { insn_tlbwi, M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0 }, 181 [insn_tlbp] = {M(cop0_op, cop_op, 0, 0, 0, tlbp_op), 0},
162 { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, 182 [insn_tlbr] = {M(cop0_op, cop_op, 0, 0, 0, tlbr_op), 0},
163 { insn_wait, M(cop0_op, cop_op, 0, 0, 0, wait_op), SCIMM }, 183 [insn_tlbwi] = {M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0},
164 { insn_wsbh, M(spec3_op, 0, 0, 0, wsbh_op, bshfl_op), RT | RD }, 184 [insn_tlbwr] = {M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0},
165 { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, 185 [insn_wait] = {M(cop0_op, cop_op, 0, 0, 0, wait_op), SCIMM},
166 { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, 186 [insn_wsbh] = {M(spec3_op, 0, 0, 0, wsbh_op, bshfl_op), RT | RD},
167 { insn_yield, M(spec3_op, 0, 0, 0, 0, yield_op), RS | RD }, 187 [insn_xor] = {M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD},
168 { insn_ldpte, M(lwc2_op, 0, 0, 0, ldpte_op, mult_op), RS | RD }, 188 [insn_xori] = {M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM},
169 { insn_lddir, M(lwc2_op, 0, 0, 0, lddir_op, mult_op), RS | RT | RD }, 189 [insn_yield] = {M(spec3_op, 0, 0, 0, 0, yield_op), RS | RD},
170 { insn_invalid, 0, 0 }
171}; 190};
172 191
173#undef M 192#undef M
@@ -196,20 +215,17 @@ static inline u32 build_jimm(u32 arg)
196 */ 215 */
197static void build_insn(u32 **buf, enum opcode opc, ...) 216static void build_insn(u32 **buf, enum opcode opc, ...)
198{ 217{
199 struct insn *ip = NULL; 218 const struct insn *ip;
200 unsigned int i;
201 va_list ap; 219 va_list ap;
202 u32 op; 220 u32 op;
203 221
204 for (i = 0; insn_table[i].opcode != insn_invalid; i++) 222 if (opc < 0 || opc >= insn_invalid ||
205 if (insn_table[i].opcode == opc) { 223 (opc == insn_daddiu && r4k_daddiu_bug()) ||
206 ip = &insn_table[i]; 224 (insn_table[opc].match == 0 && insn_table[opc].fields == 0))
207 break;
208 }
209
210 if (!ip || (opc == insn_daddiu && r4k_daddiu_bug()))
211 panic("Unsupported Micro-assembler instruction %d", opc); 225 panic("Unsupported Micro-assembler instruction %d", opc);
212 226
227 ip = &insn_table[opc];
228
213 op = ip->match; 229 op = ip->match;
214 va_start(ap, opc); 230 va_start(ap, opc);
215 if (ip->fields & RS) 231 if (ip->fields & RS)
diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c
index 730363b59bac..57570c0649b4 100644
--- a/arch/mips/mm/uasm.c
+++ b/arch/mips/mm/uasm.c
@@ -46,26 +46,29 @@ enum fields {
46#define SIMM9_MASK 0x1ff 46#define SIMM9_MASK 0x1ff
47 47
48enum opcode { 48enum opcode {
49 insn_invalid,
50 insn_addiu, insn_addu, insn_and, insn_andi, insn_bbit0, insn_bbit1, 49 insn_addiu, insn_addu, insn_and, insn_andi, insn_bbit0, insn_bbit1,
51 insn_beq, insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, 50 insn_beq, insn_beql, insn_bgez, insn_bgezl, insn_bgtz, insn_blez,
52 insn_bne, insn_cache, insn_cfc1, insn_cfcmsa, insn_ctc1, insn_ctcmsa, 51 insn_bltz, insn_bltzl, insn_bne, insn_break, insn_cache, insn_cfc1,
53 insn_daddiu, insn_daddu, insn_di, insn_dins, insn_dinsm, insn_divu, 52 insn_cfcmsa, insn_ctc1, insn_ctcmsa, insn_daddiu, insn_daddu, insn_ddivu,
54 insn_dmfc0, insn_dmtc0, insn_drotr, insn_drotr32, insn_dsll, 53 insn_di, insn_dins, insn_dinsm, insn_dinsu, insn_divu, insn_dmfc0,
55 insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_dsubu, insn_eret, 54 insn_dmtc0, insn_dmultu, insn_drotr, insn_drotr32, insn_dsbh, insn_dshd,
56 insn_ext, insn_ins, insn_j, insn_jal, insn_jalr, insn_jr, insn_lb, 55 insn_dsll, insn_dsll32, insn_dsllv, insn_dsra, insn_dsra32, insn_dsrav,
57 insn_ld, insn_ldx, insn_lh, insn_ll, insn_lld, insn_lui, insn_lw, 56 insn_dsrl, insn_dsrl32, insn_dsrlv, insn_dsubu, insn_eret, insn_ext,
58 insn_lwx, insn_mfc0, insn_mfhc0, insn_mfhi, insn_mflo, insn_mtc0, 57 insn_ins, insn_j, insn_jal, insn_jalr, insn_jr, insn_lb, insn_lbu,
59 insn_mthc0, insn_mthi, insn_mtlo, insn_mul, insn_or, insn_ori, 58 insn_ld, insn_lddir, insn_ldpte, insn_ldx, insn_lh, insn_lhu,
60 insn_pref, insn_rfe, insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll, 59 insn_ll, insn_lld, insn_lui, insn_lw, insn_lwu, insn_lwx, insn_mfc0,
61 insn_sllv, insn_slt, insn_sltiu, insn_sltu, insn_sra, insn_srl, 60 insn_mfhc0, insn_mfhi, insn_mflo, insn_movn, insn_movz, insn_mtc0,
61 insn_mthc0, insn_mthi, insn_mtlo, insn_mul, insn_multu, insn_nor,
62 insn_or, insn_ori, insn_pref, insn_rfe, insn_rotr, insn_sb,
63 insn_sc, insn_scd, insn_sd, insn_sh, insn_sll, insn_sllv,
64 insn_slt, insn_slti, insn_sltiu, insn_sltu, insn_sra, insn_srl,
62 insn_srlv, insn_subu, insn_sw, insn_sync, insn_syscall, insn_tlbp, 65 insn_srlv, insn_subu, insn_sw, insn_sync, insn_syscall, insn_tlbp,
63 insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, insn_wsbh, insn_xor, 66 insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, insn_wsbh, insn_xor,
64 insn_xori, insn_yield, insn_lddir, insn_ldpte, insn_lhu, 67 insn_xori, insn_yield,
68 insn_invalid /* insn_invalid must be last */
65}; 69};
66 70
67struct insn { 71struct insn {
68 enum opcode opcode;
69 u32 match; 72 u32 match;
70 enum fields fields; 73 enum fields fields;
71}; 74};
@@ -215,6 +218,13 @@ Ip_u2u1msbu3(op) \
215} \ 218} \
216UASM_EXPORT_SYMBOL(uasm_i##op); 219UASM_EXPORT_SYMBOL(uasm_i##op);
217 220
221#define I_u2u1msb32msb3(op) \
222Ip_u2u1msbu3(op) \
223{ \
224 build_insn(buf, insn##op, b, a, c+d-33, c-32); \
225} \
226UASM_EXPORT_SYMBOL(uasm_i##op);
227
218#define I_u2u1msbdu3(op) \ 228#define I_u2u1msbdu3(op) \
219Ip_u2u1msbu3(op) \ 229Ip_u2u1msbu3(op) \
220{ \ 230{ \
@@ -265,25 +275,36 @@ I_u1u2s3(_beq)
265I_u1u2s3(_beql) 275I_u1u2s3(_beql)
266I_u1s2(_bgez) 276I_u1s2(_bgez)
267I_u1s2(_bgezl) 277I_u1s2(_bgezl)
278I_u1s2(_bgtz)
279I_u1s2(_blez)
268I_u1s2(_bltz) 280I_u1s2(_bltz)
269I_u1s2(_bltzl) 281I_u1s2(_bltzl)
270I_u1u2s3(_bne) 282I_u1u2s3(_bne)
283I_u1(_break)
271I_u2s3u1(_cache) 284I_u2s3u1(_cache)
272I_u1u2(_cfc1) 285I_u1u2(_cfc1)
273I_u2u1(_cfcmsa) 286I_u2u1(_cfcmsa)
274I_u1u2(_ctc1) 287I_u1u2(_ctc1)
275I_u2u1(_ctcmsa) 288I_u2u1(_ctcmsa)
289I_u1u2(_ddivu)
276I_u1u2u3(_dmfc0) 290I_u1u2u3(_dmfc0)
277I_u1u2u3(_dmtc0) 291I_u1u2u3(_dmtc0)
292I_u1u2(_dmultu)
278I_u2u1s3(_daddiu) 293I_u2u1s3(_daddiu)
279I_u3u1u2(_daddu) 294I_u3u1u2(_daddu)
280I_u1(_di); 295I_u1(_di);
281I_u1u2(_divu) 296I_u1u2(_divu)
297I_u2u1(_dsbh);
298I_u2u1(_dshd);
282I_u2u1u3(_dsll) 299I_u2u1u3(_dsll)
283I_u2u1u3(_dsll32) 300I_u2u1u3(_dsll32)
301I_u3u2u1(_dsllv)
284I_u2u1u3(_dsra) 302I_u2u1u3(_dsra)
303I_u2u1u3(_dsra32)
304I_u3u2u1(_dsrav)
285I_u2u1u3(_dsrl) 305I_u2u1u3(_dsrl)
286I_u2u1u3(_dsrl32) 306I_u2u1u3(_dsrl32)
307I_u3u2u1(_dsrlv)
287I_u2u1u3(_drotr) 308I_u2u1u3(_drotr)
288I_u2u1u3(_drotr32) 309I_u2u1u3(_drotr32)
289I_u3u1u2(_dsubu) 310I_u3u1u2(_dsubu)
@@ -295,6 +316,7 @@ I_u1(_jal)
295I_u2u1(_jalr) 316I_u2u1(_jalr)
296I_u1(_jr) 317I_u1(_jr)
297I_u2s3u1(_lb) 318I_u2s3u1(_lb)
319I_u2s3u1(_lbu)
298I_u2s3u1(_ld) 320I_u2s3u1(_ld)
299I_u2s3u1(_lh) 321I_u2s3u1(_lh)
300I_u2s3u1(_lhu) 322I_u2s3u1(_lhu)
@@ -302,8 +324,11 @@ I_u2s3u1(_ll)
302I_u2s3u1(_lld) 324I_u2s3u1(_lld)
303I_u1s2(_lui) 325I_u1s2(_lui)
304I_u2s3u1(_lw) 326I_u2s3u1(_lw)
327I_u2s3u1(_lwu)
305I_u1u2u3(_mfc0) 328I_u1u2u3(_mfc0)
306I_u1u2u3(_mfhc0) 329I_u1u2u3(_mfhc0)
330I_u3u1u2(_movn)
331I_u3u1u2(_movz)
307I_u1(_mfhi) 332I_u1(_mfhi)
308I_u1(_mflo) 333I_u1(_mflo)
309I_u1u2u3(_mtc0) 334I_u1u2u3(_mtc0)
@@ -311,15 +336,20 @@ I_u1u2u3(_mthc0)
311I_u1(_mthi) 336I_u1(_mthi)
312I_u1(_mtlo) 337I_u1(_mtlo)
313I_u3u1u2(_mul) 338I_u3u1u2(_mul)
314I_u2u1u3(_ori) 339I_u1u2(_multu)
340I_u3u1u2(_nor)
315I_u3u1u2(_or) 341I_u3u1u2(_or)
342I_u2u1u3(_ori)
316I_0(_rfe) 343I_0(_rfe)
344I_u2s3u1(_sb)
317I_u2s3u1(_sc) 345I_u2s3u1(_sc)
318I_u2s3u1(_scd) 346I_u2s3u1(_scd)
319I_u2s3u1(_sd) 347I_u2s3u1(_sd)
348I_u2s3u1(_sh)
320I_u2u1u3(_sll) 349I_u2u1u3(_sll)
321I_u3u2u1(_sllv) 350I_u3u2u1(_sllv)
322I_s3s1s2(_slt) 351I_s3s1s2(_slt)
352I_u2u1s3(_slti)
323I_u2u1s3(_sltiu) 353I_u2u1s3(_sltiu)
324I_u3u1u2(_sltu) 354I_u3u1u2(_sltu)
325I_u2u1u3(_sra) 355I_u2u1u3(_sra)
@@ -340,6 +370,7 @@ I_u2u1u3(_xori)
340I_u2u1(_yield) 370I_u2u1(_yield)
341I_u2u1msbu3(_dins); 371I_u2u1msbu3(_dins);
342I_u2u1msb32u3(_dinsm); 372I_u2u1msb32u3(_dinsm);
373I_u2u1msb32msb3(_dinsu);
343I_u1(_syscall); 374I_u1(_syscall);
344I_u1u2s3(_bbit0); 375I_u1u2s3(_bbit0);
345I_u1u2s3(_bbit1); 376I_u1u2s3(_bbit1);
diff --git a/arch/mips/net/Makefile b/arch/mips/net/Makefile
index 8c2771401f54..47d678416715 100644
--- a/arch/mips/net/Makefile
+++ b/arch/mips/net/Makefile
@@ -1,3 +1,4 @@
1# MIPS networking code 1# MIPS networking code
2 2
3obj-$(CONFIG_BPF_JIT) += bpf_jit.o bpf_jit_asm.o 3obj-$(CONFIG_MIPS_CBPF_JIT) += bpf_jit.o bpf_jit_asm.o
4obj-$(CONFIG_MIPS_EBPF_JIT) += ebpf_jit.o
diff --git a/arch/mips/vdso/gettimeofday.c b/arch/mips/vdso/gettimeofday.c
index ce89c9e294f9..974276e828b2 100644
--- a/arch/mips/vdso/gettimeofday.c
+++ b/arch/mips/vdso/gettimeofday.c
@@ -20,6 +20,46 @@
20#include <asm/unistd.h> 20#include <asm/unistd.h>
21#include <asm/vdso.h> 21#include <asm/vdso.h>
22 22
23#ifdef CONFIG_MIPS_CLOCK_VSYSCALL
24
25static __always_inline long gettimeofday_fallback(struct timeval *_tv,
26 struct timezone *_tz)
27{
28 register struct timezone *tz asm("a1") = _tz;
29 register struct timeval *tv asm("a0") = _tv;
30 register long ret asm("v0");
31 register long nr asm("v0") = __NR_gettimeofday;
32 register long error asm("a3");
33
34 asm volatile(
35 " syscall\n"
36 : "=r" (ret), "=r" (error)
37 : "r" (tv), "r" (tz), "r" (nr)
38 : "memory");
39
40 return error ? -ret : ret;
41}
42
43#endif
44
45static __always_inline long clock_gettime_fallback(clockid_t _clkid,
46 struct timespec *_ts)
47{
48 register struct timespec *ts asm("a1") = _ts;
49 register clockid_t clkid asm("a0") = _clkid;
50 register long ret asm("v0");
51 register long nr asm("v0") = __NR_clock_gettime;
52 register long error asm("a3");
53
54 asm volatile(
55 " syscall\n"
56 : "=r" (ret), "=r" (error)
57 : "r" (clkid), "r" (ts), "r" (nr)
58 : "memory");
59
60 return error ? -ret : ret;
61}
62
23static __always_inline int do_realtime_coarse(struct timespec *ts, 63static __always_inline int do_realtime_coarse(struct timespec *ts,
24 const union mips_vdso_data *data) 64 const union mips_vdso_data *data)
25{ 65{
@@ -39,8 +79,8 @@ static __always_inline int do_monotonic_coarse(struct timespec *ts,
39 const union mips_vdso_data *data) 79 const union mips_vdso_data *data)
40{ 80{
41 u32 start_seq; 81 u32 start_seq;
42 u32 to_mono_sec; 82 u64 to_mono_sec;
43 u32 to_mono_nsec; 83 u64 to_mono_nsec;
44 84
45 do { 85 do {
46 start_seq = vdso_data_read_begin(data); 86 start_seq = vdso_data_read_begin(data);
@@ -148,8 +188,8 @@ static __always_inline int do_monotonic(struct timespec *ts,
148{ 188{
149 u32 start_seq; 189 u32 start_seq;
150 u64 ns; 190 u64 ns;
151 u32 to_mono_sec; 191 u64 to_mono_sec;
152 u32 to_mono_nsec; 192 u64 to_mono_nsec;
153 193
154 do { 194 do {
155 start_seq = vdso_data_read_begin(data); 195 start_seq = vdso_data_read_begin(data);
@@ -187,7 +227,7 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
187 227
188 ret = do_realtime(&ts, data); 228 ret = do_realtime(&ts, data);
189 if (ret) 229 if (ret)
190 return ret; 230 return gettimeofday_fallback(tv, tz);
191 231
192 if (tv) { 232 if (tv) {
193 tv->tv_sec = ts.tv_sec; 233 tv->tv_sec = ts.tv_sec;
@@ -202,12 +242,12 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
202 return 0; 242 return 0;
203} 243}
204 244
205#endif /* CONFIG_CLKSRC_MIPS_GIC */ 245#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
206 246
207int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts) 247int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts)
208{ 248{
209 const union mips_vdso_data *data = get_vdso_data(); 249 const union mips_vdso_data *data = get_vdso_data();
210 int ret; 250 int ret = -1;
211 251
212 switch (clkid) { 252 switch (clkid) {
213 case CLOCK_REALTIME_COARSE: 253 case CLOCK_REALTIME_COARSE:
@@ -223,10 +263,11 @@ int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts)
223 ret = do_monotonic(ts, data); 263 ret = do_monotonic(ts, data);
224 break; 264 break;
225 default: 265 default:
226 ret = -ENOSYS;
227 break; 266 break;
228 } 267 }
229 268
230 /* If we return -ENOSYS libc should fall back to a syscall. */ 269 if (ret)
270 ret = clock_gettime_fallback(clkid, ts);
271
231 return ret; 272 return ret;
232} 273}
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index d406b087553f..68ca2d9fcd73 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -221,6 +221,7 @@ config COMMON_CLK_VC5
221 221
222source "drivers/clk/bcm/Kconfig" 222source "drivers/clk/bcm/Kconfig"
223source "drivers/clk/hisilicon/Kconfig" 223source "drivers/clk/hisilicon/Kconfig"
224source "drivers/clk/imgtec/Kconfig"
224source "drivers/clk/keystone/Kconfig" 225source "drivers/clk/keystone/Kconfig"
225source "drivers/clk/mediatek/Kconfig" 226source "drivers/clk/mediatek/Kconfig"
226source "drivers/clk/meson/Kconfig" 227source "drivers/clk/meson/Kconfig"
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 4f6a812342ed..cd376b3fb47a 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -60,6 +60,7 @@ obj-y += bcm/
60obj-$(CONFIG_ARCH_BERLIN) += berlin/ 60obj-$(CONFIG_ARCH_BERLIN) += berlin/
61obj-$(CONFIG_H8300) += h8300/ 61obj-$(CONFIG_H8300) += h8300/
62obj-$(CONFIG_ARCH_HISI) += hisilicon/ 62obj-$(CONFIG_ARCH_HISI) += hisilicon/
63obj-y += imgtec/
63obj-$(CONFIG_ARCH_MXC) += imx/ 64obj-$(CONFIG_ARCH_MXC) += imx/
64obj-$(CONFIG_MACH_INGENIC) += ingenic/ 65obj-$(CONFIG_MACH_INGENIC) += ingenic/
65obj-$(CONFIG_ARCH_KEYSTONE) += keystone/ 66obj-$(CONFIG_ARCH_KEYSTONE) += keystone/
diff --git a/drivers/clk/imgtec/Kconfig b/drivers/clk/imgtec/Kconfig
new file mode 100644
index 000000000000..f6dcb748e9c4
--- /dev/null
+++ b/drivers/clk/imgtec/Kconfig
@@ -0,0 +1,9 @@
1config COMMON_CLK_BOSTON
2 bool "Clock driver for MIPS Boston boards"
3 depends on MIPS || COMPILE_TEST
4 select MFD_SYSCON
5 ---help---
6 Enable this to support the system & CPU clocks on the MIPS Boston
7 development board from Imagination Technologies. These are simple
8 fixed rate clocks whose rate is determined by reading a platform
9 provided register.
diff --git a/drivers/clk/imgtec/Makefile b/drivers/clk/imgtec/Makefile
new file mode 100644
index 000000000000..ac779b8c22f2
--- /dev/null
+++ b/drivers/clk/imgtec/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_COMMON_CLK_BOSTON) += clk-boston.o
diff --git a/drivers/clk/imgtec/clk-boston.c b/drivers/clk/imgtec/clk-boston.c
new file mode 100644
index 000000000000..f18f10351785
--- /dev/null
+++ b/drivers/clk/imgtec/clk-boston.c
@@ -0,0 +1,103 @@
1/*
2 * Copyright (C) 2016-2017 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#define pr_fmt(fmt) "clk-boston: " fmt
12
13#include <linux/clk-provider.h>
14#include <linux/kernel.h>
15#include <linux/of.h>
16#include <linux/regmap.h>
17#include <linux/slab.h>
18#include <linux/mfd/syscon.h>
19
20#include <dt-bindings/clock/boston-clock.h>
21
22#define BOSTON_PLAT_MMCMDIV 0x30
23# define BOSTON_PLAT_MMCMDIV_CLK0DIV (0xff << 0)
24# define BOSTON_PLAT_MMCMDIV_INPUT (0xff << 8)
25# define BOSTON_PLAT_MMCMDIV_MUL (0xff << 16)
26# define BOSTON_PLAT_MMCMDIV_CLK1DIV (0xff << 24)
27
28#define BOSTON_CLK_COUNT 3
29
30static u32 ext_field(u32 val, u32 mask)
31{
32 return (val & mask) >> (ffs(mask) - 1);
33}
34
35static void __init clk_boston_setup(struct device_node *np)
36{
37 unsigned long in_freq, cpu_freq, sys_freq;
38 uint mmcmdiv, mul, cpu_div, sys_div;
39 struct clk_hw_onecell_data *onecell;
40 struct regmap *regmap;
41 struct clk_hw *hw;
42 int err;
43
44 regmap = syscon_node_to_regmap(np->parent);
45 if (IS_ERR(regmap)) {
46 pr_err("failed to find regmap\n");
47 return;
48 }
49
50 err = regmap_read(regmap, BOSTON_PLAT_MMCMDIV, &mmcmdiv);
51 if (err) {
52 pr_err("failed to read mmcm_div register: %d\n", err);
53 return;
54 }
55
56 in_freq = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_INPUT) * 1000000;
57 mul = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_MUL);
58
59 sys_div = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_CLK0DIV);
60 sys_freq = mult_frac(in_freq, mul, sys_div);
61
62 cpu_div = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_CLK1DIV);
63 cpu_freq = mult_frac(in_freq, mul, cpu_div);
64
65 onecell = kzalloc(sizeof(*onecell) +
66 (BOSTON_CLK_COUNT * sizeof(struct clk_hw *)),
67 GFP_KERNEL);
68 if (!onecell)
69 return;
70
71 onecell->num = BOSTON_CLK_COUNT;
72
73 hw = clk_hw_register_fixed_rate(NULL, "input", NULL, 0, in_freq);
74 if (IS_ERR(hw)) {
75 pr_err("failed to register input clock: %ld\n", PTR_ERR(hw));
76 return;
77 }
78 onecell->hws[BOSTON_CLK_INPUT] = hw;
79
80 hw = clk_hw_register_fixed_rate(NULL, "sys", "input", 0, sys_freq);
81 if (IS_ERR(hw)) {
82 pr_err("failed to register sys clock: %ld\n", PTR_ERR(hw));
83 return;
84 }
85 onecell->hws[BOSTON_CLK_SYS] = hw;
86
87 hw = clk_hw_register_fixed_rate(NULL, "cpu", "input", 0, cpu_freq);
88 if (IS_ERR(hw)) {
89 pr_err("failed to register cpu clock: %ld\n", PTR_ERR(hw));
90 return;
91 }
92 onecell->hws[BOSTON_CLK_CPU] = hw;
93
94 err = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, onecell);
95 if (err)
96 pr_err("failed to add DT provider: %d\n", err);
97}
98
99/*
100 * Use CLK_OF_DECLARE so that this driver is probed early enough to provide the
101 * CPU frequency for use with the GIC or cop0 counters/timers.
102 */
103CLK_OF_DECLARE(clk_boston, "img,boston-clock", clk_boston_setup);
diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c
index 4300a558d0f3..322de58eebaf 100644
--- a/drivers/platform/mips/cpu_hwmon.c
+++ b/drivers/platform/mips/cpu_hwmon.c
@@ -17,17 +17,27 @@
17 */ 17 */
18int loongson3_cpu_temp(int cpu) 18int loongson3_cpu_temp(int cpu)
19{ 19{
20 u32 reg; 20 u32 reg, prid_rev;
21 21
22 reg = LOONGSON_CHIPTEMP(cpu); 22 reg = LOONGSON_CHIPTEMP(cpu);
23 if ((read_c0_prid() & PRID_REV_MASK) == PRID_REV_LOONGSON3A_R1) 23 prid_rev = read_c0_prid() & PRID_REV_MASK;
24 switch (prid_rev) {
25 case PRID_REV_LOONGSON3A_R1:
24 reg = (reg >> 8) & 0xff; 26 reg = (reg >> 8) & 0xff;
25 else 27 break;
28 case PRID_REV_LOONGSON3A_R2:
29 case PRID_REV_LOONGSON3B_R1:
30 case PRID_REV_LOONGSON3B_R2:
26 reg = ((reg >> 8) & 0xff) - 100; 31 reg = ((reg >> 8) & 0xff) - 100;
27 32 break;
33 case PRID_REV_LOONGSON3A_R3:
34 reg = (reg & 0xffff)*731/0x4000 - 273;
35 break;
36 }
28 return (int)reg * 1000; 37 return (int)reg * 1000;
29} 38}
30 39
40static int nr_packages;
31static struct device *cpu_hwmon_dev; 41static struct device *cpu_hwmon_dev;
32 42
33static ssize_t get_hwmon_name(struct device *dev, 43static ssize_t get_hwmon_name(struct device *dev,
@@ -51,88 +61,74 @@ static ssize_t get_hwmon_name(struct device *dev,
51 return sprintf(buf, "cpu-hwmon\n"); 61 return sprintf(buf, "cpu-hwmon\n");
52} 62}
53 63
54static ssize_t get_cpu0_temp(struct device *dev, 64static ssize_t get_cpu_temp(struct device *dev,
55 struct device_attribute *attr, char *buf);
56static ssize_t get_cpu1_temp(struct device *dev,
57 struct device_attribute *attr, char *buf); 65 struct device_attribute *attr, char *buf);
58static ssize_t cpu0_temp_label(struct device *dev, 66static ssize_t cpu_temp_label(struct device *dev,
59 struct device_attribute *attr, char *buf); 67 struct device_attribute *attr, char *buf);
60static ssize_t cpu1_temp_label(struct device *dev,
61 struct device_attribute *attr, char *buf);
62
63static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, get_cpu0_temp, NULL, 1);
64static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, cpu0_temp_label, NULL, 1);
65static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, get_cpu1_temp, NULL, 2);
66static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, cpu1_temp_label, NULL, 2);
67 68
68static const struct attribute *hwmon_cputemp1[] = { 69static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, get_cpu_temp, NULL, 1);
69 &sensor_dev_attr_temp1_input.dev_attr.attr, 70static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, cpu_temp_label, NULL, 1);
70 &sensor_dev_attr_temp1_label.dev_attr.attr, 71static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, get_cpu_temp, NULL, 2);
71 NULL 72static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, cpu_temp_label, NULL, 2);
72}; 73static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, get_cpu_temp, NULL, 3);
73 74static SENSOR_DEVICE_ATTR(temp3_label, S_IRUGO, cpu_temp_label, NULL, 3);
74static const struct attribute *hwmon_cputemp2[] = { 75static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, get_cpu_temp, NULL, 4);
75 &sensor_dev_attr_temp2_input.dev_attr.attr, 76static SENSOR_DEVICE_ATTR(temp4_label, S_IRUGO, cpu_temp_label, NULL, 4);
76 &sensor_dev_attr_temp2_label.dev_attr.attr, 77
77 NULL 78static const struct attribute *hwmon_cputemp[4][3] = {
79 {
80 &sensor_dev_attr_temp1_input.dev_attr.attr,
81 &sensor_dev_attr_temp1_label.dev_attr.attr,
82 NULL
83 },
84 {
85 &sensor_dev_attr_temp2_input.dev_attr.attr,
86 &sensor_dev_attr_temp2_label.dev_attr.attr,
87 NULL
88 },
89 {
90 &sensor_dev_attr_temp3_input.dev_attr.attr,
91 &sensor_dev_attr_temp3_label.dev_attr.attr,
92 NULL
93 },
94 {
95 &sensor_dev_attr_temp4_input.dev_attr.attr,
96 &sensor_dev_attr_temp4_label.dev_attr.attr,
97 NULL
98 }
78}; 99};
79 100
80static ssize_t cpu0_temp_label(struct device *dev, 101static ssize_t cpu_temp_label(struct device *dev,
81 struct device_attribute *attr, char *buf)
82{
83 return sprintf(buf, "CPU 0 Temperature\n");
84}
85
86static ssize_t cpu1_temp_label(struct device *dev,
87 struct device_attribute *attr, char *buf) 102 struct device_attribute *attr, char *buf)
88{ 103{
89 return sprintf(buf, "CPU 1 Temperature\n"); 104 int id = (to_sensor_dev_attr(attr))->index - 1;
105 return sprintf(buf, "CPU %d Temperature\n", id);
90} 106}
91 107
92static ssize_t get_cpu0_temp(struct device *dev, 108static ssize_t get_cpu_temp(struct device *dev,
93 struct device_attribute *attr, char *buf) 109 struct device_attribute *attr, char *buf)
94{ 110{
95 int value = loongson3_cpu_temp(0); 111 int id = (to_sensor_dev_attr(attr))->index - 1;
96 return sprintf(buf, "%d\n", value); 112 int value = loongson3_cpu_temp(id);
97}
98
99static ssize_t get_cpu1_temp(struct device *dev,
100 struct device_attribute *attr, char *buf)
101{
102 int value = loongson3_cpu_temp(1);
103 return sprintf(buf, "%d\n", value); 113 return sprintf(buf, "%d\n", value);
104} 114}
105 115
106static int create_sysfs_cputemp_files(struct kobject *kobj) 116static int create_sysfs_cputemp_files(struct kobject *kobj)
107{ 117{
108 int ret; 118 int i, ret = 0;
109
110 ret = sysfs_create_files(kobj, hwmon_cputemp1);
111 if (ret)
112 goto sysfs_create_temp1_fail;
113
114 if (loongson_sysconf.nr_cpus <= loongson_sysconf.cores_per_package)
115 return 0;
116 119
117 ret = sysfs_create_files(kobj, hwmon_cputemp2); 120 for (i=0; i<nr_packages; i++)
118 if (ret) 121 ret = sysfs_create_files(kobj, hwmon_cputemp[i]);
119 goto sysfs_create_temp2_fail;
120 122
121 return 0; 123 return ret;
122
123sysfs_create_temp2_fail:
124 sysfs_remove_files(kobj, hwmon_cputemp1);
125
126sysfs_create_temp1_fail:
127 return -1;
128} 124}
129 125
130static void remove_sysfs_cputemp_files(struct kobject *kobj) 126static void remove_sysfs_cputemp_files(struct kobject *kobj)
131{ 127{
132 sysfs_remove_files(&cpu_hwmon_dev->kobj, hwmon_cputemp1); 128 int i;
133 129
134 if (loongson_sysconf.nr_cpus > loongson_sysconf.cores_per_package) 130 for (i=0; i<nr_packages; i++)
135 sysfs_remove_files(&cpu_hwmon_dev->kobj, hwmon_cputemp2); 131 sysfs_remove_files(kobj, hwmon_cputemp[i]);
136} 132}
137 133
138#define CPU_THERMAL_THRESHOLD 90000 134#define CPU_THERMAL_THRESHOLD 90000
@@ -140,8 +136,15 @@ static struct delayed_work thermal_work;
140 136
141static void do_thermal_timer(struct work_struct *work) 137static void do_thermal_timer(struct work_struct *work)
142{ 138{
143 int value = loongson3_cpu_temp(0); 139 int i, value, temp_max = 0;
144 if (value <= CPU_THERMAL_THRESHOLD) 140
141 for (i=0; i<nr_packages; i++) {
142 value = loongson3_cpu_temp(i);
143 if (value > temp_max)
144 temp_max = value;
145 }
146
147 if (temp_max <= CPU_THERMAL_THRESHOLD)
145 schedule_delayed_work(&thermal_work, msecs_to_jiffies(5000)); 148 schedule_delayed_work(&thermal_work, msecs_to_jiffies(5000));
146 else 149 else
147 orderly_poweroff(true); 150 orderly_poweroff(true);
@@ -160,6 +163,9 @@ static int __init loongson_hwmon_init(void)
160 goto fail_hwmon_device_register; 163 goto fail_hwmon_device_register;
161 } 164 }
162 165
166 nr_packages = loongson_sysconf.nr_cpus /
167 loongson_sysconf.cores_per_package;
168
163 ret = sysfs_create_group(&cpu_hwmon_dev->kobj, 169 ret = sysfs_create_group(&cpu_hwmon_dev->kobj,
164 &cpu_hwmon_attribute_group); 170 &cpu_hwmon_attribute_group);
165 if (ret) { 171 if (ret) {
diff --git a/include/dt-bindings/clock/boston-clock.h b/include/dt-bindings/clock/boston-clock.h
new file mode 100644
index 000000000000..a6f009821137
--- /dev/null
+++ b/include/dt-bindings/clock/boston-clock.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2016 Imagination Technologies
3 *
4 * SPDX-License-Identifier: GPL-2.0
5 */
6
7#ifndef __DT_BINDINGS_CLOCK_BOSTON_CLOCK_H__
8#define __DT_BINDINGS_CLOCK_BOSTON_CLOCK_H__
9
10#define BOSTON_CLK_INPUT 0
11#define BOSTON_CLK_SYS 1
12#define BOSTON_CLK_CPU 2
13
14#endif /* __DT_BINDINGS_CLOCK_BOSTON_CLOCK_H__ */