aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 17:24:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 17:24:36 -0400
commit857b50f5d0eed113428c864e927289d8f5f2b864 (patch)
tree6864b17f92b855d35f896b84948b8d19b0105ce4
parent168f07a1ea75870b3fdee3d69d978813eb1fd58d (diff)
parent31d6f57d3c65fd75c18ea9a3acebedc6cd60d656 (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "This is the MIPS pull request for the next kernel: - Zubair's patch series adds CMA support for MIPS. Doing so it also touches ARM64 and x86. - remove the last instance of IRQF_DISABLED from arch/mips - updates to two of the MIPS defconfig files. - cleanup of how cache coherency bits are handled on MIPS and implement support for write-combining. - platform upgrades for Alchemy - move MIPS DTS files to arch/mips/boot/dts/" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (24 commits) MIPS: ralink: remove deprecated IRQF_DISABLED MIPS: pgtable.h: Implement the pgprot_writecombine function for MIPS MIPS: cpu-probe: Set the write-combine CCA value on per core basis MIPS: pgtable-bits: Define the CCA bit for WC writes on Ingenic cores MIPS: pgtable-bits: Move the CCA bits out of the core's ifdef blocks MIPS: DMA: Add cma support x86: use generic dma-contiguous.h arm64: use generic dma-contiguous.h asm-generic: Add dma-contiguous.h MIPS: BPF: Add new emit_long_instr macro MIPS: ralink: Move device-trees to arch/mips/boot/dts/ MIPS: Netlogic: Move device-trees to arch/mips/boot/dts/ MIPS: sead3: Move device-trees to arch/mips/boot/dts/ MIPS: Lantiq: Move device-trees to arch/mips/boot/dts/ MIPS: Octeon: Move device-trees to arch/mips/boot/dts/ MIPS: Add support for building device-tree binaries MIPS: Create common infrastructure for building built-in device-trees MIPS: SEAD3: Enable DEVTMPFS MIPS: SEAD3: Regenerate defconfigs MIPS: Alchemy: DB1300: Add touch penirq support ...
-rw-r--r--arch/arm64/include/asm/Kbuild1
-rw-r--r--arch/arm64/include/asm/dma-contiguous.h28
-rw-r--r--arch/mips/Kconfig6
-rw-r--r--arch/mips/Makefile11
-rw-r--r--arch/mips/alchemy/devboards/db1300.c47
-rw-r--r--arch/mips/alchemy/devboards/db1550.c9
-rw-r--r--arch/mips/alchemy/devboards/platform.c3
-rw-r--r--arch/mips/boot/.gitignore1
-rw-r--r--arch/mips/boot/dts/Makefile20
-rw-r--r--arch/mips/boot/dts/danube.dtsi (renamed from arch/mips/lantiq/dts/danube.dtsi)0
-rw-r--r--arch/mips/boot/dts/easy50712.dts (renamed from arch/mips/lantiq/dts/easy50712.dts)0
-rw-r--r--arch/mips/boot/dts/mt7620a.dtsi (renamed from arch/mips/ralink/dts/mt7620a.dtsi)0
-rw-r--r--arch/mips/boot/dts/mt7620a_eval.dts (renamed from arch/mips/ralink/dts/mt7620a_eval.dts)0
-rw-r--r--arch/mips/boot/dts/octeon_3xxx.dts (renamed from arch/mips/cavium-octeon/octeon_3xxx.dts)0
-rw-r--r--arch/mips/boot/dts/octeon_68xx.dts (renamed from arch/mips/cavium-octeon/octeon_68xx.dts)0
-rw-r--r--arch/mips/boot/dts/rt2880.dtsi (renamed from arch/mips/ralink/dts/rt2880.dtsi)0
-rw-r--r--arch/mips/boot/dts/rt2880_eval.dts (renamed from arch/mips/ralink/dts/rt2880_eval.dts)0
-rw-r--r--arch/mips/boot/dts/rt3050.dtsi (renamed from arch/mips/ralink/dts/rt3050.dtsi)0
-rw-r--r--arch/mips/boot/dts/rt3052_eval.dts (renamed from arch/mips/ralink/dts/rt3052_eval.dts)0
-rw-r--r--arch/mips/boot/dts/rt3883.dtsi (renamed from arch/mips/ralink/dts/rt3883.dtsi)0
-rw-r--r--arch/mips/boot/dts/rt3883_eval.dts (renamed from arch/mips/ralink/dts/rt3883_eval.dts)0
-rw-r--r--arch/mips/boot/dts/sead3.dts (renamed from arch/mips/mti-sead3/sead3.dts)0
-rw-r--r--arch/mips/boot/dts/xlp_evp.dts (renamed from arch/mips/netlogic/dts/xlp_evp.dts)0
-rw-r--r--arch/mips/boot/dts/xlp_fvp.dts (renamed from arch/mips/netlogic/dts/xlp_fvp.dts)0
-rw-r--r--arch/mips/boot/dts/xlp_gvp.dts (renamed from arch/mips/netlogic/dts/xlp_gvp.dts)0
-rw-r--r--arch/mips/boot/dts/xlp_svp.dts (renamed from arch/mips/netlogic/dts/xlp_svp.dts)0
-rw-r--r--arch/mips/cavium-octeon/.gitignore2
-rw-r--r--arch/mips/cavium-octeon/Makefile10
-rw-r--r--arch/mips/configs/sead3_defconfig2
-rw-r--r--arch/mips/configs/sead3micro_defconfig2
-rw-r--r--arch/mips/include/asm/Kbuild1
-rw-r--r--arch/mips/include/asm/cpu-features.h10
-rw-r--r--arch/mips/include/asm/cpu-info.h5
-rw-r--r--arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h12
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h2
-rw-r--r--arch/mips/include/asm/pgtable-bits.h44
-rw-r--r--arch/mips/include/asm/pgtable.h10
-rw-r--r--arch/mips/include/uapi/asm/swab.h18
-rw-r--r--arch/mips/kernel/cpu-probe.c21
-rw-r--r--arch/mips/kernel/setup.c9
-rw-r--r--arch/mips/lantiq/Kconfig1
-rw-r--r--arch/mips/lantiq/Makefile2
-rw-r--r--arch/mips/lantiq/dts/Makefile1
-rw-r--r--arch/mips/lib/csum_partial.S10
-rw-r--r--arch/mips/mm/dma-default.c37
-rw-r--r--arch/mips/mti-sead3/Makefile4
-rw-r--r--arch/mips/net/bpf_jit.c53
-rw-r--r--arch/mips/netlogic/Kconfig4
-rw-r--r--arch/mips/netlogic/Makefile1
-rw-r--r--arch/mips/netlogic/dts/Makefile4
-rw-r--r--arch/mips/ralink/Kconfig4
-rw-r--r--arch/mips/ralink/Makefile2
-rw-r--r--arch/mips/ralink/dts/Makefile4
-rw-r--r--arch/mips/ralink/timer.c2
-rw-r--r--arch/x86/include/asm/Kbuild1
-rw-r--r--include/asm-generic/dma-contiguous.h (renamed from arch/x86/include/asm/dma-contiguous.h)7
57 files changed, 274 insertions, 138 deletions
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
index 774a7c85e70f..dc770bd4f5a5 100644
--- a/arch/arm64/include/asm/Kbuild
+++ b/arch/arm64/include/asm/Kbuild
@@ -9,6 +9,7 @@ generic-y += current.h
9generic-y += delay.h 9generic-y += delay.h
10generic-y += div64.h 10generic-y += div64.h
11generic-y += dma.h 11generic-y += dma.h
12generic-y += dma-contiguous.h
12generic-y += early_ioremap.h 13generic-y += early_ioremap.h
13generic-y += emergency-restart.h 14generic-y += emergency-restart.h
14generic-y += errno.h 15generic-y += errno.h
diff --git a/arch/arm64/include/asm/dma-contiguous.h b/arch/arm64/include/asm/dma-contiguous.h
deleted file mode 100644
index 14c4c0ca7f2a..000000000000
--- a/arch/arm64/include/asm/dma-contiguous.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _ASM_DMA_CONTIGUOUS_H
15#define _ASM_DMA_CONTIGUOUS_H
16
17#ifdef __KERNEL__
18#ifdef CONFIG_DMA_CMA
19
20#include <linux/types.h>
21
22static inline void
23dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) { }
24
25#endif
26#endif
27
28#endif
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 574c43000699..ad6badb6be71 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -29,6 +29,7 @@ config MIPS
29 select GENERIC_ATOMIC64 if !64BIT 29 select GENERIC_ATOMIC64 if !64BIT
30 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 30 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
31 select HAVE_DMA_ATTRS 31 select HAVE_DMA_ATTRS
32 select HAVE_DMA_CONTIGUOUS
32 select HAVE_DMA_API_DEBUG 33 select HAVE_DMA_API_DEBUG
33 select GENERIC_IRQ_PROBE 34 select GENERIC_IRQ_PROBE
34 select GENERIC_IRQ_SHOW 35 select GENERIC_IRQ_SHOW
@@ -353,6 +354,7 @@ config MIPS_SEAD3
353 bool "MIPS SEAD3 board" 354 bool "MIPS SEAD3 board"
354 select BOOT_ELF32 355 select BOOT_ELF32
355 select BOOT_RAW 356 select BOOT_RAW
357 select BUILTIN_DTB
356 select CEVT_R4K 358 select CEVT_R4K
357 select CSRC_R4K 359 select CSRC_R4K
358 select CSRC_GIC 360 select CSRC_GIC
@@ -742,6 +744,7 @@ config CAVIUM_OCTEON_SOC
742 select ARCH_SPARSEMEM_ENABLE 744 select ARCH_SPARSEMEM_ENABLE
743 select SYS_SUPPORTS_SMP 745 select SYS_SUPPORTS_SMP
744 select NR_CPUS_DEFAULT_16 746 select NR_CPUS_DEFAULT_16
747 select BUILTIN_DTB
745 help 748 help
746 This option supports all of the Octeon reference boards from Cavium 749 This option supports all of the Octeon reference boards from Cavium
747 Networks. It builds a kernel that dynamically determines the Octeon 750 Networks. It builds a kernel that dynamically determines the Octeon
@@ -2482,6 +2485,9 @@ config USE_OF
2482 select OF_EARLY_FLATTREE 2485 select OF_EARLY_FLATTREE
2483 select IRQ_DOMAIN 2486 select IRQ_DOMAIN
2484 2487
2488config BUILTIN_DTB
2489 bool
2490
2485endmenu 2491endmenu
2486 2492
2487config LOCKDEP_SUPPORT 2493config LOCKDEP_SUPPORT
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index bbac51e11179..23cb94806fbc 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -333,6 +333,16 @@ endif
333 333
334CLEAN_FILES += vmlinux.32 vmlinux.64 334CLEAN_FILES += vmlinux.32 vmlinux.64
335 335
336# device-trees
337core-$(CONFIG_BUILTIN_DTB) += arch/mips/boot/dts/
338
339%.dtb %.dtb.S %.dtb.o: | scripts
340 $(Q)$(MAKE) $(build)=arch/mips/boot/dts arch/mips/boot/dts/$@
341
342PHONY += dtbs
343dtbs: scripts
344 $(Q)$(MAKE) $(build)=arch/mips/boot/dts dtbs
345
336archprepare: 346archprepare:
337ifdef CONFIG_MIPS32_N32 347ifdef CONFIG_MIPS32_N32
338 @echo ' Checking missing-syscalls for N32' 348 @echo ' Checking missing-syscalls for N32'
@@ -367,6 +377,7 @@ define archhelp
367 echo ' vmlinuz.srec - SREC zboot image' 377 echo ' vmlinuz.srec - SREC zboot image'
368 echo ' uImage - U-Boot image' 378 echo ' uImage - U-Boot image'
369 echo ' uImage.gz - U-Boot image (gzip)' 379 echo ' uImage.gz - U-Boot image (gzip)'
380 echo ' dtbs - Device-tree blobs for enabled boards'
370 echo 381 echo
371 echo ' These will be default as appropriate for a configured platform.' 382 echo ' These will be default as appropriate for a configured platform.'
372endef 383endef
diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c
index ef93ee3f6a2c..1c64fdbe4c81 100644
--- a/arch/mips/alchemy/devboards/db1300.c
+++ b/arch/mips/alchemy/devboards/db1300.c
@@ -21,6 +21,7 @@
21#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/smsc911x.h> 23#include <linux/smsc911x.h>
24#include <linux/wm97xx.h>
24 25
25#include <asm/mach-au1x00/au1000.h> 26#include <asm/mach-au1x00/au1000.h>
26#include <asm/mach-au1x00/au1100_mmc.h> 27#include <asm/mach-au1x00/au1100_mmc.h>
@@ -711,6 +712,46 @@ static struct platform_device db1300_lcd_dev = {
711 712
712/**********************************************************************/ 713/**********************************************************************/
713 714
715static void db1300_wm97xx_irqen(struct wm97xx *wm, int enable)
716{
717 if (enable)
718 enable_irq(DB1300_AC97_PEN_INT);
719 else
720 disable_irq_nosync(DB1300_AC97_PEN_INT);
721}
722
723static struct wm97xx_mach_ops db1300_wm97xx_ops = {
724 .irq_enable = db1300_wm97xx_irqen,
725 .irq_gpio = WM97XX_GPIO_3,
726};
727
728static int db1300_wm97xx_probe(struct platform_device *pdev)
729{
730 struct wm97xx *wm = platform_get_drvdata(pdev);
731
732 /* external pendown indicator */
733 wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN,
734 WM97XX_GPIO_POL_LOW, WM97XX_GPIO_STICKY,
735 WM97XX_GPIO_WAKE);
736
737 /* internal "virtual" pendown gpio */
738 wm97xx_config_gpio(wm, WM97XX_GPIO_3, WM97XX_GPIO_OUT,
739 WM97XX_GPIO_POL_LOW, WM97XX_GPIO_NOTSTICKY,
740 WM97XX_GPIO_NOWAKE);
741
742 wm->pen_irq = DB1300_AC97_PEN_INT;
743
744 return wm97xx_register_mach_ops(wm, &db1300_wm97xx_ops);
745}
746
747static struct platform_driver db1300_wm97xx_driver = {
748 .driver.name = "wm97xx-touch",
749 .driver.owner = THIS_MODULE,
750 .probe = db1300_wm97xx_probe,
751};
752
753/**********************************************************************/
754
714static struct platform_device *db1300_dev[] __initdata = { 755static struct platform_device *db1300_dev[] __initdata = {
715 &db1300_eth_dev, 756 &db1300_eth_dev,
716 &db1300_i2c_dev, 757 &db1300_i2c_dev,
@@ -755,6 +796,9 @@ int __init db1300_dev_setup(void)
755 i2c_register_board_info(0, db1300_i2c_devs, 796 i2c_register_board_info(0, db1300_i2c_devs,
756 ARRAY_SIZE(db1300_i2c_devs)); 797 ARRAY_SIZE(db1300_i2c_devs));
757 798
799 if (platform_driver_register(&db1300_wm97xx_driver))
800 pr_warn("DB1300: failed to init touch pen irq support!\n");
801
758 /* Audio PSC clock is supplied by codecs (PSC1, 2) */ 802 /* Audio PSC clock is supplied by codecs (PSC1, 2) */
759 __raw_writel(PSC_SEL_CLK_SERCLK, 803 __raw_writel(PSC_SEL_CLK_SERCLK,
760 (void __iomem *)KSEG1ADDR(AU1300_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET); 804 (void __iomem *)KSEG1ADDR(AU1300_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET);
@@ -762,9 +806,10 @@ int __init db1300_dev_setup(void)
762 __raw_writel(PSC_SEL_CLK_SERCLK, 806 __raw_writel(PSC_SEL_CLK_SERCLK,
763 (void __iomem *)KSEG1ADDR(AU1300_PSC2_PHYS_ADDR) + PSC_SEL_OFFSET); 807 (void __iomem *)KSEG1ADDR(AU1300_PSC2_PHYS_ADDR) + PSC_SEL_OFFSET);
764 wmb(); 808 wmb();
765 /* I2C uses internal 48MHz EXTCLK1 */ 809 /* I2C driver wants 50MHz, get as close as possible */
766 c = clk_get(NULL, "psc3_intclk"); 810 c = clk_get(NULL, "psc3_intclk");
767 if (!IS_ERR(c)) { 811 if (!IS_ERR(c)) {
812 clk_set_rate(c, 50000000);
768 clk_prepare_enable(c); 813 clk_prepare_enable(c);
769 clk_put(c); 814 clk_put(c);
770 } 815 }
diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c
index 7e89936f763e..0fd5177e35ab 100644
--- a/arch/mips/alchemy/devboards/db1550.c
+++ b/arch/mips/alchemy/devboards/db1550.c
@@ -34,12 +34,9 @@ static void __init db1550_hw_setup(void)
34 void __iomem *base; 34 void __iomem *base;
35 unsigned long v; 35 unsigned long v;
36 36
37 /* complete SPI setup: link psc0_intclk to a 48MHz source, 37 /* complete pin setup: assign GPIO16 to PSC0_SYNC1 (SPI cs# line)
38 * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line) as well as PSC1_SYNC 38 * as well as PSC1_SYNC for AC97 on PB1550.
39 * for AC97 on PB1550.
40 */ 39 */
41 v = alchemy_rdsys(AU1000_SYS_CLKSRC);
42 alchemy_wrsys(v | 0x000001e0, AU1000_SYS_CLKSRC);
43 v = alchemy_rdsys(AU1000_SYS_PINFUNC); 40 v = alchemy_rdsys(AU1000_SYS_PINFUNC);
44 alchemy_wrsys(v | 1 | SYS_PF_PSC1_S1, AU1000_SYS_PINFUNC); 41 alchemy_wrsys(v | 1 | SYS_PF_PSC1_S1, AU1000_SYS_PINFUNC);
45 42
@@ -586,11 +583,13 @@ int __init db1550_dev_setup(void)
586 583
587 c = clk_get(NULL, "psc0_intclk"); 584 c = clk_get(NULL, "psc0_intclk");
588 if (!IS_ERR(c)) { 585 if (!IS_ERR(c)) {
586 clk_set_rate(c, 50000000);
589 clk_prepare_enable(c); 587 clk_prepare_enable(c);
590 clk_put(c); 588 clk_put(c);
591 } 589 }
592 c = clk_get(NULL, "psc2_intclk"); 590 c = clk_get(NULL, "psc2_intclk");
593 if (!IS_ERR(c)) { 591 if (!IS_ERR(c)) {
592 clk_set_rate(c, db1550_spi_platdata.mainclk_hz);
594 clk_prepare_enable(c); 593 clk_prepare_enable(c);
595 clk_put(c); 594 clk_put(c);
596 } 595 }
diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c
index 8df86eb94972..be139a0198b0 100644
--- a/arch/mips/alchemy/devboards/platform.c
+++ b/arch/mips/alchemy/devboards/platform.c
@@ -11,6 +11,7 @@
11#include <linux/pm.h> 11#include <linux/pm.h>
12 12
13#include <asm/bootinfo.h> 13#include <asm/bootinfo.h>
14#include <asm/idle.h>
14#include <asm/reboot.h> 15#include <asm/reboot.h>
15#include <asm/mach-au1x00/au1000.h> 16#include <asm/mach-au1x00/au1000.h>
16#include <asm/mach-db1x00/bcsr.h> 17#include <asm/mach-db1x00/bcsr.h>
@@ -53,6 +54,8 @@ static void db1x_power_off(void)
53{ 54{
54 bcsr_write(BCSR_RESETS, 0); 55 bcsr_write(BCSR_RESETS, 0);
55 bcsr_write(BCSR_SYSTEM, BCSR_SYSTEM_PWROFF | BCSR_SYSTEM_RESET); 56 bcsr_write(BCSR_SYSTEM, BCSR_SYSTEM_PWROFF | BCSR_SYSTEM_RESET);
57 while (1) /* sit and spin */
58 cpu_wait();
56} 59}
57 60
58static void db1x_reset(char *c) 61static void db1x_reset(char *c)
diff --git a/arch/mips/boot/.gitignore b/arch/mips/boot/.gitignore
index a73d6e2c4f64..d3962cd5ce0c 100644
--- a/arch/mips/boot/.gitignore
+++ b/arch/mips/boot/.gitignore
@@ -5,3 +5,4 @@ zImage
5zImage.tmp 5zImage.tmp
6calc_vmlinuz_load_addr 6calc_vmlinuz_load_addr
7uImage 7uImage
8*.dtb
diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
new file mode 100644
index 000000000000..ca9c90e2cabf
--- /dev/null
+++ b/arch/mips/boot/dts/Makefile
@@ -0,0 +1,20 @@
1dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb
2dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb
3dtb-$(CONFIG_DT_XLP_EVP) += xlp_evp.dtb
4dtb-$(CONFIG_DT_XLP_SVP) += xlp_svp.dtb
5dtb-$(CONFIG_DT_XLP_FVP) += xlp_fvp.dtb
6dtb-$(CONFIG_DT_XLP_GVP) += xlp_gvp.dtb
7dtb-$(CONFIG_DTB_RT2880_EVAL) += rt2880_eval.dtb
8dtb-$(CONFIG_DTB_RT305X_EVAL) += rt3052_eval.dtb
9dtb-$(CONFIG_DTB_RT3883_EVAL) += rt3883_eval.dtb
10dtb-$(CONFIG_DTB_MT7620A_EVAL) += mt7620a_eval.dtb
11dtb-$(CONFIG_MIPS_SEAD3) += sead3.dtb
12
13obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
14
15targets += dtbs
16targets += $(dtb-y)
17
18dtbs: $(addprefix $(obj)/, $(dtb-y))
19
20clean-files += *.dtb *.dtb.S
diff --git a/arch/mips/lantiq/dts/danube.dtsi b/arch/mips/boot/dts/danube.dtsi
index d4c59e003708..d4c59e003708 100644
--- a/arch/mips/lantiq/dts/danube.dtsi
+++ b/arch/mips/boot/dts/danube.dtsi
diff --git a/arch/mips/lantiq/dts/easy50712.dts b/arch/mips/boot/dts/easy50712.dts
index 143b8a37b5e4..143b8a37b5e4 100644
--- a/arch/mips/lantiq/dts/easy50712.dts
+++ b/arch/mips/boot/dts/easy50712.dts
diff --git a/arch/mips/ralink/dts/mt7620a.dtsi b/arch/mips/boot/dts/mt7620a.dtsi
index 08bf24fefe9f..08bf24fefe9f 100644
--- a/arch/mips/ralink/dts/mt7620a.dtsi
+++ b/arch/mips/boot/dts/mt7620a.dtsi
diff --git a/arch/mips/ralink/dts/mt7620a_eval.dts b/arch/mips/boot/dts/mt7620a_eval.dts
index 709f58132f5c..709f58132f5c 100644
--- a/arch/mips/ralink/dts/mt7620a_eval.dts
+++ b/arch/mips/boot/dts/mt7620a_eval.dts
diff --git a/arch/mips/cavium-octeon/octeon_3xxx.dts b/arch/mips/boot/dts/octeon_3xxx.dts
index fa33115bde33..fa33115bde33 100644
--- a/arch/mips/cavium-octeon/octeon_3xxx.dts
+++ b/arch/mips/boot/dts/octeon_3xxx.dts
diff --git a/arch/mips/cavium-octeon/octeon_68xx.dts b/arch/mips/boot/dts/octeon_68xx.dts
index 79b46fcb0a11..79b46fcb0a11 100644
--- a/arch/mips/cavium-octeon/octeon_68xx.dts
+++ b/arch/mips/boot/dts/octeon_68xx.dts
diff --git a/arch/mips/ralink/dts/rt2880.dtsi b/arch/mips/boot/dts/rt2880.dtsi
index 182afde2f2e1..182afde2f2e1 100644
--- a/arch/mips/ralink/dts/rt2880.dtsi
+++ b/arch/mips/boot/dts/rt2880.dtsi
diff --git a/arch/mips/ralink/dts/rt2880_eval.dts b/arch/mips/boot/dts/rt2880_eval.dts
index 0a685db093d4..0a685db093d4 100644
--- a/arch/mips/ralink/dts/rt2880_eval.dts
+++ b/arch/mips/boot/dts/rt2880_eval.dts
diff --git a/arch/mips/ralink/dts/rt3050.dtsi b/arch/mips/boot/dts/rt3050.dtsi
index e3203d414fee..e3203d414fee 100644
--- a/arch/mips/ralink/dts/rt3050.dtsi
+++ b/arch/mips/boot/dts/rt3050.dtsi
diff --git a/arch/mips/ralink/dts/rt3052_eval.dts b/arch/mips/boot/dts/rt3052_eval.dts
index ec9e9a035541..ec9e9a035541 100644
--- a/arch/mips/ralink/dts/rt3052_eval.dts
+++ b/arch/mips/boot/dts/rt3052_eval.dts
diff --git a/arch/mips/ralink/dts/rt3883.dtsi b/arch/mips/boot/dts/rt3883.dtsi
index 3b131dd0d5ac..3b131dd0d5ac 100644
--- a/arch/mips/ralink/dts/rt3883.dtsi
+++ b/arch/mips/boot/dts/rt3883.dtsi
diff --git a/arch/mips/ralink/dts/rt3883_eval.dts b/arch/mips/boot/dts/rt3883_eval.dts
index e8df21a5d10d..e8df21a5d10d 100644
--- a/arch/mips/ralink/dts/rt3883_eval.dts
+++ b/arch/mips/boot/dts/rt3883_eval.dts
diff --git a/arch/mips/mti-sead3/sead3.dts b/arch/mips/boot/dts/sead3.dts
index e4b317d414f1..e4b317d414f1 100644
--- a/arch/mips/mti-sead3/sead3.dts
+++ b/arch/mips/boot/dts/sead3.dts
diff --git a/arch/mips/netlogic/dts/xlp_evp.dts b/arch/mips/boot/dts/xlp_evp.dts
index 89ad04808c02..89ad04808c02 100644
--- a/arch/mips/netlogic/dts/xlp_evp.dts
+++ b/arch/mips/boot/dts/xlp_evp.dts
diff --git a/arch/mips/netlogic/dts/xlp_fvp.dts b/arch/mips/boot/dts/xlp_fvp.dts
index 63e62b7bd758..63e62b7bd758 100644
--- a/arch/mips/netlogic/dts/xlp_fvp.dts
+++ b/arch/mips/boot/dts/xlp_fvp.dts
diff --git a/arch/mips/netlogic/dts/xlp_gvp.dts b/arch/mips/boot/dts/xlp_gvp.dts
index bb4ecd1d47fc..bb4ecd1d47fc 100644
--- a/arch/mips/netlogic/dts/xlp_gvp.dts
+++ b/arch/mips/boot/dts/xlp_gvp.dts
diff --git a/arch/mips/netlogic/dts/xlp_svp.dts b/arch/mips/boot/dts/xlp_svp.dts
index 1ebd00edaacc..1ebd00edaacc 100644
--- a/arch/mips/netlogic/dts/xlp_svp.dts
+++ b/arch/mips/boot/dts/xlp_svp.dts
diff --git a/arch/mips/cavium-octeon/.gitignore b/arch/mips/cavium-octeon/.gitignore
deleted file mode 100644
index 39c968605ff6..000000000000
--- a/arch/mips/cavium-octeon/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
1*.dtb.S
2*.dtb
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
index 4e952043c922..42f5f1a4b40a 100644
--- a/arch/mips/cavium-octeon/Makefile
+++ b/arch/mips/cavium-octeon/Makefile
@@ -20,13 +20,3 @@ obj-y += executive/
20obj-$(CONFIG_MTD) += flash_setup.o 20obj-$(CONFIG_MTD) += flash_setup.o
21obj-$(CONFIG_SMP) += smp.o 21obj-$(CONFIG_SMP) += smp.o
22obj-$(CONFIG_OCTEON_ILM) += oct_ilm.o 22obj-$(CONFIG_OCTEON_ILM) += oct_ilm.o
23
24DTS_FILES = octeon_3xxx.dts octeon_68xx.dts
25DTB_FILES = $(patsubst %.dts, %.dtb, $(DTS_FILES))
26
27obj-y += $(patsubst %.dts, %.dtb.o, $(DTS_FILES))
28
29# Let's keep the .dtb files around in case we want to look at them.
30.SECONDARY: $(addprefix $(obj)/, $(DTB_FILES))
31
32clean-files += $(DTB_FILES) $(patsubst %.dtb, %.dtb.S, $(DTB_FILES))
diff --git a/arch/mips/configs/sead3_defconfig b/arch/mips/configs/sead3_defconfig
index 0abe681c11a0..dae9354b6256 100644
--- a/arch/mips/configs/sead3_defconfig
+++ b/arch/mips/configs/sead3_defconfig
@@ -31,8 +31,8 @@ CONFIG_IP_PNP_BOOTP=y
31# CONFIG_IPV6 is not set 31# CONFIG_IPV6 is not set
32# CONFIG_WIRELESS is not set 32# CONFIG_WIRELESS is not set
33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34CONFIG_DEVTMPFS=y
34CONFIG_MTD=y 35CONFIG_MTD=y
35CONFIG_MTD_CHAR=y
36CONFIG_MTD_BLOCK=y 36CONFIG_MTD_BLOCK=y
37CONFIG_MTD_CFI=y 37CONFIG_MTD_CFI=y
38CONFIG_MTD_CFI_INTELEXT=y 38CONFIG_MTD_CFI_INTELEXT=y
diff --git a/arch/mips/configs/sead3micro_defconfig b/arch/mips/configs/sead3micro_defconfig
index 2a0da5bf4b64..cd91a775c74e 100644
--- a/arch/mips/configs/sead3micro_defconfig
+++ b/arch/mips/configs/sead3micro_defconfig
@@ -32,8 +32,8 @@ CONFIG_IP_PNP_BOOTP=y
32# CONFIG_IPV6 is not set 32# CONFIG_IPV6 is not set
33# CONFIG_WIRELESS is not set 33# CONFIG_WIRELESS is not set
34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
35CONFIG_DEVTMPFS=y
35CONFIG_MTD=y 36CONFIG_MTD=y
36CONFIG_MTD_CHAR=y
37CONFIG_MTD_BLOCK=y 37CONFIG_MTD_BLOCK=y
38CONFIG_MTD_CFI=y 38CONFIG_MTD_CFI=y
39CONFIG_MTD_CFI_INTELEXT=y 39CONFIG_MTD_CFI_INTELEXT=y
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 57012ef1f51e..72e1cf1cab00 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -1,6 +1,7 @@
1# MIPS headers 1# MIPS headers
2generic-y += cputime.h 2generic-y += cputime.h
3generic-y += current.h 3generic-y += current.h
4generic-y += dma-contiguous.h
4generic-y += emergency-restart.h 5generic-y += emergency-restart.h
5generic-y += hash.h 6generic-y += hash.h
6generic-y += irq_work.h 7generic-y += irq_work.h
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index e079598ae051..3325f3eb248c 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -231,6 +231,16 @@
231#define cpu_has_clo_clz cpu_has_mips_r 231#define cpu_has_clo_clz cpu_has_mips_r
232#endif 232#endif
233 233
234/*
235 * MIPS32 R2, MIPS64 R2, Loongson 3A and Octeon have WSBH.
236 * MIPS64 R2, Loongson 3A and Octeon have WSBH, DSBH and DSHD.
237 * This indicates the availability of WSBH and in case of 64 bit CPUs also
238 * DSBH and DSHD.
239 */
240#ifndef cpu_has_wsbh
241#define cpu_has_wsbh cpu_has_mips_r2
242#endif
243
234#ifndef cpu_has_dsp 244#ifndef cpu_has_dsp
235#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) 245#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
236#endif 246#endif
diff --git a/arch/mips/include/asm/cpu-info.h b/arch/mips/include/asm/cpu-info.h
index d5f42c168001..a6c9ccb33c5c 100644
--- a/arch/mips/include/asm/cpu-info.h
+++ b/arch/mips/include/asm/cpu-info.h
@@ -79,6 +79,11 @@ struct cpuinfo_mips {
79#define NUM_WATCH_REGS 4 79#define NUM_WATCH_REGS 4
80 u16 watch_reg_masks[NUM_WATCH_REGS]; 80 u16 watch_reg_masks[NUM_WATCH_REGS];
81 unsigned int kscratch_mask; /* Usable KScratch mask. */ 81 unsigned int kscratch_mask; /* Usable KScratch mask. */
82 /*
83 * Cache Coherency attribute for write-combine memory writes.
84 * (shifted by _CACHE_SHIFT)
85 */
86 unsigned int writecombine;
82} __attribute__((aligned(SMP_CACHE_BYTES))); 87} __attribute__((aligned(SMP_CACHE_BYTES)));
83 88
84extern struct cpuinfo_mips cpu_data[]; 89extern struct cpuinfo_mips cpu_data[];
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 09f45e6afade..c5b6eef0efa7 100644
--- a/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
@@ -8,6 +8,12 @@
8#define __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H 8#define __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H
9 9
10#define cpu_has_tlb 1 10#define cpu_has_tlb 1
11#define cpu_has_tlbinv 0
12#define cpu_has_segments 0
13#define cpu_has_eva 0
14#define cpu_has_htw 0
15#define cpu_has_rixiex 0
16#define cpu_has_maar 0
11#define cpu_has_4kex 1 17#define cpu_has_4kex 1
12#define cpu_has_3k_cache 0 18#define cpu_has_3k_cache 0
13#define cpu_has_4k_cache 1 19#define cpu_has_4k_cache 1
@@ -28,6 +34,8 @@
28#define cpu_has_mdmx 0 34#define cpu_has_mdmx 0
29#define cpu_has_mips3d 0 35#define cpu_has_mips3d 0
30#define cpu_has_smartmips 0 36#define cpu_has_smartmips 0
37#define cpu_has_rixi 0
38#define cpu_has_mmips 0
31#define cpu_has_vtag_icache 0 39#define cpu_has_vtag_icache 0
32#define cpu_has_dc_aliases 0 40#define cpu_has_dc_aliases 0
33#define cpu_has_ic_fills_f_dc 1 41#define cpu_has_ic_fills_f_dc 1
@@ -50,4 +58,8 @@
50#define cpu_dcache_line_size() 32 58#define cpu_dcache_line_size() 32
51#define cpu_icache_line_size() 32 59#define cpu_icache_line_size() 32
52 60
61#define cpu_has_perf_cntr_intr_bit 0
62#define cpu_has_vz 0
63#define cpu_has_msa 0
64
53#endif /* __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H */ 65#endif /* __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index cf8022872892..fa1f3cfbae8d 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -57,6 +57,7 @@
57#define cpu_has_vint 0 57#define cpu_has_vint 0
58#define cpu_has_veic 0 58#define cpu_has_veic 0
59#define cpu_hwrena_impl_bits 0xc0000000 59#define cpu_hwrena_impl_bits 0xc0000000
60#define cpu_has_wsbh 1
60 61
61#define cpu_has_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON) 62#define cpu_has_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON)
62 63
diff --git a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
index c0f3ef45c2c1..7d28f95b0512 100644
--- a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
@@ -59,4 +59,6 @@
59#define cpu_has_watch 1 59#define cpu_has_watch 1
60#define cpu_has_local_ebase 0 60#define cpu_has_local_ebase 0
61 61
62#define cpu_has_wsbh IS_ENABLED(CONFIG_CPU_LOONGSON3)
63
62#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */ 64#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index e592f3687d6f..e747bfa0be7e 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -224,38 +224,52 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
224#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) 224#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
225 225
226#define _CACHE_CACHABLE_NONCOHERENT 0 226#define _CACHE_CACHABLE_NONCOHERENT 0
227#define _CACHE_UNCACHED_ACCELERATED _CACHE_UNCACHED
227 228
228#elif defined(CONFIG_CPU_SB1) 229#elif defined(CONFIG_CPU_SB1)
229 230
230/* No penalty for being coherent on the SB1, so just 231/* No penalty for being coherent on the SB1, so just
231 use it for "noncoherent" spaces, too. Shouldn't hurt. */ 232 use it for "noncoherent" spaces, too. Shouldn't hurt. */
232 233
233#define _CACHE_UNCACHED (2<<_CACHE_SHIFT)
234#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT)
235#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) 234#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
236#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
237 235
238#elif defined(CONFIG_CPU_LOONGSON3) 236#elif defined(CONFIG_CPU_LOONGSON3)
239 237
240/* Using COHERENT flag for NONCOHERENT doesn't hurt. */ 238/* Using COHERENT flag for NONCOHERENT doesn't hurt. */
241 239
242#define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* LOONGSON */
243#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* LOONGSON */ 240#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* LOONGSON */
244#define _CACHE_CACHABLE_COHERENT (3<<_CACHE_SHIFT) /* LOONGSON-3 */ 241#define _CACHE_CACHABLE_COHERENT (3<<_CACHE_SHIFT) /* LOONGSON-3 */
245#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* LOONGSON */
246 242
247#else 243#elif defined(CONFIG_MACH_JZ4740)
244
245/* Ingenic uses the WA bit to achieve write-combine memory writes */
246#define _CACHE_UNCACHED_ACCELERATED (1<<_CACHE_SHIFT)
248 247
249#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */ 248#endif
250#define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT) /* R4600 only */
251#define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* R4[0246]00 */
252#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* R4[0246]00 */
253#define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT) /* R4[04]00MC only */
254#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) /* R4[04]00MC only */
255#define _CACHE_CACHABLE_COHERENT (5<<_CACHE_SHIFT) /* MIPS32R2 CMP */
256#define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT) /* R4[04]00MC only */
257#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* R10000 only */
258 249
250#ifndef _CACHE_CACHABLE_NO_WA
251#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT)
252#endif
253#ifndef _CACHE_CACHABLE_WA
254#define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT)
255#endif
256#ifndef _CACHE_UNCACHED
257#define _CACHE_UNCACHED (2<<_CACHE_SHIFT)
258#endif
259#ifndef _CACHE_CACHABLE_NONCOHERENT
260#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT)
261#endif
262#ifndef _CACHE_CACHABLE_CE
263#define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT)
264#endif
265#ifndef _CACHE_CACHABLE_COW
266#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT)
267#endif
268#ifndef _CACHE_CACHABLE_CUW
269#define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT)
270#endif
271#ifndef _CACHE_UNCACHED_ACCELERATED
272#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
259#endif 273#endif
260 274
261#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ)) 275#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ))
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index df49a308085c..d6d1928539b1 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -366,6 +366,16 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
366 return __pgprot(prot); 366 return __pgprot(prot);
367} 367}
368 368
369static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
370{
371 unsigned long prot = pgprot_val(_prot);
372
373 /* cpu_data[0].writecombine is already shifted by _CACHE_SHIFT */
374 prot = (prot & ~_CACHE_MASK) | cpu_data[0].writecombine;
375
376 return __pgprot(prot);
377}
378
369/* 379/*
370 * Conversion functions: convert a page and protection to a page entry, 380 * Conversion functions: convert a page and protection to a page entry,
371 * and a page entry and page directory to the page they refer to. 381 * and a page entry and page directory to the page they refer to.
diff --git a/arch/mips/include/uapi/asm/swab.h b/arch/mips/include/uapi/asm/swab.h
index ac9a8f9cd1fb..8f2d184dbe9f 100644
--- a/arch/mips/include/uapi/asm/swab.h
+++ b/arch/mips/include/uapi/asm/swab.h
@@ -13,12 +13,16 @@
13 13
14#define __SWAB_64_THRU_32__ 14#define __SWAB_64_THRU_32__
15 15
16#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) 16#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
17 defined(_MIPS_ARCH_LOONGSON3A)
17 18
18static inline __attribute_const__ __u16 __arch_swab16(__u16 x) 19static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
19{ 20{
20 __asm__( 21 __asm__(
22 " .set push \n"
23 " .set arch=mips32r2 \n"
21 " wsbh %0, %1 \n" 24 " wsbh %0, %1 \n"
25 " .set pop \n"
22 : "=r" (x) 26 : "=r" (x)
23 : "r" (x)); 27 : "r" (x));
24 28
@@ -29,8 +33,11 @@ static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
29static inline __attribute_const__ __u32 __arch_swab32(__u32 x) 33static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
30{ 34{
31 __asm__( 35 __asm__(
36 " .set push \n"
37 " .set arch=mips32r2 \n"
32 " wsbh %0, %1 \n" 38 " wsbh %0, %1 \n"
33 " rotr %0, %0, 16 \n" 39 " rotr %0, %0, 16 \n"
40 " .set pop \n"
34 : "=r" (x) 41 : "=r" (x)
35 : "r" (x)); 42 : "r" (x));
36 43
@@ -46,8 +53,11 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
46static inline __attribute_const__ __u64 __arch_swab64(__u64 x) 53static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
47{ 54{
48 __asm__( 55 __asm__(
49 " dsbh %0, %1\n" 56 " .set push \n"
50 " dshd %0, %0" 57 " .set arch=mips64r2 \n"
58 " dsbh %0, %1 \n"
59 " dshd %0, %0 \n"
60 " .set pop \n"
51 : "=r" (x) 61 : "=r" (x)
52 : "r" (x)); 62 : "r" (x));
53 63
@@ -55,5 +65,5 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
55} 65}
56#define __arch_swab64 __arch_swab64 66#define __arch_swab64 __arch_swab64
57#endif /* __mips64 */ 67#endif /* __mips64 */
58#endif /* MIPS R2 or newer */ 68#endif /* MIPS R2 or newer or Loongson 3A */
59#endif /* _ASM_SWAB_H */ 69#endif /* _ASM_SWAB_H */
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index e34b10be782e..94c4a0c0a577 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -27,6 +27,7 @@
27#include <asm/msa.h> 27#include <asm/msa.h>
28#include <asm/watch.h> 28#include <asm/watch.h>
29#include <asm/elf.h> 29#include <asm/elf.h>
30#include <asm/pgtable-bits.h>
30#include <asm/spram.h> 31#include <asm/spram.h>
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
32 33
@@ -764,6 +765,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
764 break; 765 break;
765 case PRID_REV_LOONGSON3A: 766 case PRID_REV_LOONGSON3A:
766 c->cputype = CPU_LOONGSON3; 767 c->cputype = CPU_LOONGSON3;
768 c->writecombine = _CACHE_UNCACHED_ACCELERATED;
767 __cpu_name[cpu] = "ICT Loongson-3"; 769 __cpu_name[cpu] = "ICT Loongson-3";
768 set_elf_platform(cpu, "loongson3a"); 770 set_elf_platform(cpu, "loongson3a");
769 break; 771 break;
@@ -798,67 +800,83 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
798 800
799static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) 801static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
800{ 802{
803 c->writecombine = _CACHE_UNCACHED_ACCELERATED;
801 switch (c->processor_id & PRID_IMP_MASK) { 804 switch (c->processor_id & PRID_IMP_MASK) {
802 case PRID_IMP_4KC: 805 case PRID_IMP_4KC:
803 c->cputype = CPU_4KC; 806 c->cputype = CPU_4KC;
807 c->writecombine = _CACHE_UNCACHED;
804 __cpu_name[cpu] = "MIPS 4Kc"; 808 __cpu_name[cpu] = "MIPS 4Kc";
805 break; 809 break;
806 case PRID_IMP_4KEC: 810 case PRID_IMP_4KEC:
807 case PRID_IMP_4KECR2: 811 case PRID_IMP_4KECR2:
808 c->cputype = CPU_4KEC; 812 c->cputype = CPU_4KEC;
813 c->writecombine = _CACHE_UNCACHED;
809 __cpu_name[cpu] = "MIPS 4KEc"; 814 __cpu_name[cpu] = "MIPS 4KEc";
810 break; 815 break;
811 case PRID_IMP_4KSC: 816 case PRID_IMP_4KSC:
812 case PRID_IMP_4KSD: 817 case PRID_IMP_4KSD:
813 c->cputype = CPU_4KSC; 818 c->cputype = CPU_4KSC;
819 c->writecombine = _CACHE_UNCACHED;
814 __cpu_name[cpu] = "MIPS 4KSc"; 820 __cpu_name[cpu] = "MIPS 4KSc";
815 break; 821 break;
816 case PRID_IMP_5KC: 822 case PRID_IMP_5KC:
817 c->cputype = CPU_5KC; 823 c->cputype = CPU_5KC;
824 c->writecombine = _CACHE_UNCACHED;
818 __cpu_name[cpu] = "MIPS 5Kc"; 825 __cpu_name[cpu] = "MIPS 5Kc";
819 break; 826 break;
820 case PRID_IMP_5KE: 827 case PRID_IMP_5KE:
821 c->cputype = CPU_5KE; 828 c->cputype = CPU_5KE;
829 c->writecombine = _CACHE_UNCACHED;
822 __cpu_name[cpu] = "MIPS 5KE"; 830 __cpu_name[cpu] = "MIPS 5KE";
823 break; 831 break;
824 case PRID_IMP_20KC: 832 case PRID_IMP_20KC:
825 c->cputype = CPU_20KC; 833 c->cputype = CPU_20KC;
834 c->writecombine = _CACHE_UNCACHED;
826 __cpu_name[cpu] = "MIPS 20Kc"; 835 __cpu_name[cpu] = "MIPS 20Kc";
827 break; 836 break;
828 case PRID_IMP_24K: 837 case PRID_IMP_24K:
829 c->cputype = CPU_24K; 838 c->cputype = CPU_24K;
839 c->writecombine = _CACHE_UNCACHED;
830 __cpu_name[cpu] = "MIPS 24Kc"; 840 __cpu_name[cpu] = "MIPS 24Kc";
831 break; 841 break;
832 case PRID_IMP_24KE: 842 case PRID_IMP_24KE:
833 c->cputype = CPU_24K; 843 c->cputype = CPU_24K;
844 c->writecombine = _CACHE_UNCACHED;
834 __cpu_name[cpu] = "MIPS 24KEc"; 845 __cpu_name[cpu] = "MIPS 24KEc";
835 break; 846 break;
836 case PRID_IMP_25KF: 847 case PRID_IMP_25KF:
837 c->cputype = CPU_25KF; 848 c->cputype = CPU_25KF;
849 c->writecombine = _CACHE_UNCACHED;
838 __cpu_name[cpu] = "MIPS 25Kc"; 850 __cpu_name[cpu] = "MIPS 25Kc";
839 break; 851 break;
840 case PRID_IMP_34K: 852 case PRID_IMP_34K:
841 c->cputype = CPU_34K; 853 c->cputype = CPU_34K;
854 c->writecombine = _CACHE_UNCACHED;
842 __cpu_name[cpu] = "MIPS 34Kc"; 855 __cpu_name[cpu] = "MIPS 34Kc";
843 break; 856 break;
844 case PRID_IMP_74K: 857 case PRID_IMP_74K:
845 c->cputype = CPU_74K; 858 c->cputype = CPU_74K;
859 c->writecombine = _CACHE_UNCACHED;
846 __cpu_name[cpu] = "MIPS 74Kc"; 860 __cpu_name[cpu] = "MIPS 74Kc";
847 break; 861 break;
848 case PRID_IMP_M14KC: 862 case PRID_IMP_M14KC:
849 c->cputype = CPU_M14KC; 863 c->cputype = CPU_M14KC;
864 c->writecombine = _CACHE_UNCACHED;
850 __cpu_name[cpu] = "MIPS M14Kc"; 865 __cpu_name[cpu] = "MIPS M14Kc";
851 break; 866 break;
852 case PRID_IMP_M14KEC: 867 case PRID_IMP_M14KEC:
853 c->cputype = CPU_M14KEC; 868 c->cputype = CPU_M14KEC;
869 c->writecombine = _CACHE_UNCACHED;
854 __cpu_name[cpu] = "MIPS M14KEc"; 870 __cpu_name[cpu] = "MIPS M14KEc";
855 break; 871 break;
856 case PRID_IMP_1004K: 872 case PRID_IMP_1004K:
857 c->cputype = CPU_1004K; 873 c->cputype = CPU_1004K;
874 c->writecombine = _CACHE_UNCACHED;
858 __cpu_name[cpu] = "MIPS 1004Kc"; 875 __cpu_name[cpu] = "MIPS 1004Kc";
859 break; 876 break;
860 case PRID_IMP_1074K: 877 case PRID_IMP_1074K:
861 c->cputype = CPU_1074K; 878 c->cputype = CPU_1074K;
879 c->writecombine = _CACHE_UNCACHED;
862 __cpu_name[cpu] = "MIPS 1074Kc"; 880 __cpu_name[cpu] = "MIPS 1074Kc";
863 break; 881 break;
864 case PRID_IMP_INTERAPTIV_UP: 882 case PRID_IMP_INTERAPTIV_UP:
@@ -932,6 +950,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu)
932{ 950{
933 decode_configs(c); 951 decode_configs(c);
934 952
953 c->writecombine = _CACHE_UNCACHED_ACCELERATED;
935 switch (c->processor_id & PRID_IMP_MASK) { 954 switch (c->processor_id & PRID_IMP_MASK) {
936 case PRID_IMP_SB1: 955 case PRID_IMP_SB1:
937 c->cputype = CPU_SB1; 956 c->cputype = CPU_SB1;
@@ -1063,6 +1082,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
1063 switch (c->processor_id & PRID_IMP_MASK) { 1082 switch (c->processor_id & PRID_IMP_MASK) {
1064 case PRID_IMP_JZRISC: 1083 case PRID_IMP_JZRISC:
1065 c->cputype = CPU_JZRISC; 1084 c->cputype = CPU_JZRISC;
1085 c->writecombine = _CACHE_UNCACHED_ACCELERATED;
1066 __cpu_name[cpu] = "Ingenic JZRISC"; 1086 __cpu_name[cpu] = "Ingenic JZRISC";
1067 break; 1087 break;
1068 default: 1088 default:
@@ -1169,6 +1189,7 @@ void cpu_probe(void)
1169 c->processor_id = PRID_IMP_UNKNOWN; 1189 c->processor_id = PRID_IMP_UNKNOWN;
1170 c->fpu_id = FPIR_IMP_NONE; 1190 c->fpu_id = FPIR_IMP_NONE;
1171 c->cputype = CPU_UNKNOWN; 1191 c->cputype = CPU_UNKNOWN;
1192 c->writecombine = _CACHE_UNCACHED;
1172 1193
1173 c->processor_id = read_c0_prid(); 1194 c->processor_id = read_c0_prid();
1174 switch (c->processor_id & PRID_COMP_MASK) { 1195 switch (c->processor_id & PRID_COMP_MASK) {
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 7c1fe2b42d40..b3b8f0d9d4a7 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -24,6 +24,8 @@
24#include <linux/debugfs.h> 24#include <linux/debugfs.h>
25#include <linux/kexec.h> 25#include <linux/kexec.h>
26#include <linux/sizes.h> 26#include <linux/sizes.h>
27#include <linux/device.h>
28#include <linux/dma-contiguous.h>
27 29
28#include <asm/addrspace.h> 30#include <asm/addrspace.h>
29#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
@@ -476,6 +478,7 @@ static void __init bootmem_init(void)
476 * o bootmem_init() 478 * o bootmem_init()
477 * o sparse_init() 479 * o sparse_init()
478 * o paging_init() 480 * o paging_init()
481 * o dma_continguous_reserve()
479 * 482 *
480 * At this stage the bootmem allocator is ready to use. 483 * At this stage the bootmem allocator is ready to use.
481 * 484 *
@@ -609,6 +612,7 @@ static void __init request_crashkernel(struct resource *res)
609 612
610static void __init arch_mem_init(char **cmdline_p) 613static void __init arch_mem_init(char **cmdline_p)
611{ 614{
615 struct memblock_region *reg;
612 extern void plat_mem_setup(void); 616 extern void plat_mem_setup(void);
613 617
614 /* call board setup routine */ 618 /* call board setup routine */
@@ -675,6 +679,11 @@ static void __init arch_mem_init(char **cmdline_p)
675 sparse_init(); 679 sparse_init();
676 plat_swiotlb_setup(); 680 plat_swiotlb_setup();
677 paging_init(); 681 paging_init();
682
683 dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
684 /* Tell bootmem about cma reserved memblock section */
685 for_each_memblock(reserved, reg)
686 reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
678} 687}
679 688
680static void __init resource_init(void) 689static void __init resource_init(void)
diff --git a/arch/mips/lantiq/Kconfig b/arch/mips/lantiq/Kconfig
index c0021912131e..e10d33342b30 100644
--- a/arch/mips/lantiq/Kconfig
+++ b/arch/mips/lantiq/Kconfig
@@ -30,6 +30,7 @@ choice
30config DT_EASY50712 30config DT_EASY50712
31 bool "Easy50712" 31 bool "Easy50712"
32 depends on SOC_XWAY 32 depends on SOC_XWAY
33 select BUILTIN_DTB
33endchoice 34endchoice
34 35
35config PCI_LANTIQ 36config PCI_LANTIQ
diff --git a/arch/mips/lantiq/Makefile b/arch/mips/lantiq/Makefile
index d6bdc579419f..690257ab86d6 100644
--- a/arch/mips/lantiq/Makefile
+++ b/arch/mips/lantiq/Makefile
@@ -6,8 +6,6 @@
6 6
7obj-y := irq.o clk.o prom.o 7obj-y := irq.o clk.o prom.o
8 8
9obj-y += dts/
10
11obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 9obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
12 10
13obj-$(CONFIG_SOC_TYPE_XWAY) += xway/ 11obj-$(CONFIG_SOC_TYPE_XWAY) += xway/
diff --git a/arch/mips/lantiq/dts/Makefile b/arch/mips/lantiq/dts/Makefile
deleted file mode 100644
index 6fa72dd641b2..000000000000
--- a/arch/mips/lantiq/dts/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-$(CONFIG_DT_EASY50712) := easy50712.dtb.o
diff --git a/arch/mips/lib/csum_partial.S b/arch/mips/lib/csum_partial.S
index 9901237563c5..4c721e247ac9 100644
--- a/arch/mips/lib/csum_partial.S
+++ b/arch/mips/lib/csum_partial.S
@@ -277,9 +277,12 @@ LEAF(csum_partial)
277#endif 277#endif
278 278
279 /* odd buffer alignment? */ 279 /* odd buffer alignment? */
280#ifdef CONFIG_CPU_MIPSR2 280#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON3)
281 .set push
282 .set arch=mips32r2
281 wsbh v1, sum 283 wsbh v1, sum
282 movn sum, v1, t7 284 movn sum, v1, t7
285 .set pop
283#else 286#else
284 beqz t7, 1f /* odd buffer alignment? */ 287 beqz t7, 1f /* odd buffer alignment? */
285 lui v1, 0x00ff 288 lui v1, 0x00ff
@@ -726,9 +729,12 @@ LEAF(csum_partial)
726 addu sum, v1 729 addu sum, v1
727#endif 730#endif
728 731
729#ifdef CONFIG_CPU_MIPSR2 732#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_LOONGSON3)
733 .set push
734 .set arch=mips32r2
730 wsbh v1, sum 735 wsbh v1, sum
731 movn sum, v1, odd 736 movn sum, v1, odd
737 .set pop
732#else 738#else
733 beqz odd, 1f /* odd buffer alignment? */ 739 beqz odd, 1f /* odd buffer alignment? */
734 lui v1, 0x00ff 740 lui v1, 0x00ff
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 44b6dff5aba2..33ba3c558fe4 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -16,6 +16,7 @@
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/gfp.h> 17#include <linux/gfp.h>
18#include <linux/highmem.h> 18#include <linux/highmem.h>
19#include <linux/dma-contiguous.h>
19 20
20#include <asm/cache.h> 21#include <asm/cache.h>
21#include <asm/cpu-type.h> 22#include <asm/cpu-type.h>
@@ -128,23 +129,30 @@ static void *mips_dma_alloc_coherent(struct device *dev, size_t size,
128 dma_addr_t * dma_handle, gfp_t gfp, struct dma_attrs *attrs) 129 dma_addr_t * dma_handle, gfp_t gfp, struct dma_attrs *attrs)
129{ 130{
130 void *ret; 131 void *ret;
132 struct page *page = NULL;
133 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
131 134
132 if (dma_alloc_from_coherent(dev, size, dma_handle, &ret)) 135 if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
133 return ret; 136 return ret;
134 137
135 gfp = massage_gfp_flags(dev, gfp); 138 gfp = massage_gfp_flags(dev, gfp);
136 139
137 ret = (void *) __get_free_pages(gfp, get_order(size)); 140 if (IS_ENABLED(CONFIG_DMA_CMA) && !(gfp & GFP_ATOMIC))
138 141 page = dma_alloc_from_contiguous(dev,
139 if (ret) { 142 count, get_order(size));
140 memset(ret, 0, size); 143 if (!page)
141 *dma_handle = plat_map_dma_mem(dev, ret, size); 144 page = alloc_pages(gfp, get_order(size));
142 145
143 if (!plat_device_is_coherent(dev)) { 146 if (!page)
144 dma_cache_wback_inv((unsigned long) ret, size); 147 return NULL;
145 if (!hw_coherentio) 148
146 ret = UNCAC_ADDR(ret); 149 ret = page_address(page);
147 } 150 memset(ret, 0, size);
151 *dma_handle = plat_map_dma_mem(dev, ret, size);
152 if (!plat_device_is_coherent(dev)) {
153 dma_cache_wback_inv((unsigned long) ret, size);
154 if (!hw_coherentio)
155 ret = UNCAC_ADDR(ret);
148 } 156 }
149 157
150 return ret; 158 return ret;
@@ -164,6 +172,8 @@ static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr,
164{ 172{
165 unsigned long addr = (unsigned long) vaddr; 173 unsigned long addr = (unsigned long) vaddr;
166 int order = get_order(size); 174 int order = get_order(size);
175 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
176 struct page *page = NULL;
167 177
168 if (dma_release_from_coherent(dev, order, vaddr)) 178 if (dma_release_from_coherent(dev, order, vaddr))
169 return; 179 return;
@@ -173,7 +183,10 @@ static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr,
173 if (!plat_device_is_coherent(dev) && !hw_coherentio) 183 if (!plat_device_is_coherent(dev) && !hw_coherentio)
174 addr = CAC_ADDR(addr); 184 addr = CAC_ADDR(addr);
175 185
176 free_pages(addr, get_order(size)); 186 page = virt_to_page((void *) addr);
187
188 if (!dma_release_from_contiguous(dev, page, count))
189 __free_pages(page, get_order(size));
177} 190}
178 191
179static inline void __dma_sync_virtual(void *addr, size_t size, 192static inline void __dma_sync_virtual(void *addr, size_t size,
diff --git a/arch/mips/mti-sead3/Makefile b/arch/mips/mti-sead3/Makefile
index 071786fa234b..febf4334545e 100644
--- a/arch/mips/mti-sead3/Makefile
+++ b/arch/mips/mti-sead3/Makefile
@@ -19,9 +19,5 @@ obj-y += sead3-i2c-dev.o sead3-i2c.o \
19 19
20obj-$(CONFIG_EARLY_PRINTK) += sead3-console.o 20obj-$(CONFIG_EARLY_PRINTK) += sead3-console.o
21obj-$(CONFIG_USB_EHCI_HCD) += sead3-ehci.o 21obj-$(CONFIG_USB_EHCI_HCD) += sead3-ehci.o
22obj-$(CONFIG_OF) += sead3.dtb.o
23 22
24CFLAGS_sead3-setup.o = -I$(src)/../../../scripts/dtc/libfdt 23CFLAGS_sead3-setup.o = -I$(src)/../../../scripts/dtc/libfdt
25
26$(obj)/%.dtb: $(obj)/%.dts
27 $(call if_changed,dtc)
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 7edc08398c4a..9b55143d19db 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -163,6 +163,19 @@ do { \
163 (ctx)->idx++; \ 163 (ctx)->idx++; \
164} while (0) 164} while (0)
165 165
166/*
167 * Similar to emit_instr but it must be used when we need to emit
168 * 32-bit or 64-bit instructions
169 */
170#define emit_long_instr(ctx, func, ...) \
171do { \
172 if ((ctx)->target != NULL) { \
173 u32 *p = &(ctx)->target[ctx->idx]; \
174 UASM_i_##func(&p, ##__VA_ARGS__); \
175 } \
176 (ctx)->idx++; \
177} while (0)
178
166/* Determine if immediate is within the 16-bit signed range */ 179/* Determine if immediate is within the 16-bit signed range */
167static inline bool is_range16(s32 imm) 180static inline bool is_range16(s32 imm)
168{ 181{
@@ -218,13 +231,6 @@ static inline void emit_ori(unsigned int dst, unsigned src, u32 imm,
218 } 231 }
219} 232}
220 233
221
222static inline void emit_daddu(unsigned int dst, unsigned int src1,
223 unsigned int src2, struct jit_ctx *ctx)
224{
225 emit_instr(ctx, daddu, dst, src1, src2);
226}
227
228static inline void emit_daddiu(unsigned int dst, unsigned int src, 234static inline void emit_daddiu(unsigned int dst, unsigned int src,
229 int imm, struct jit_ctx *ctx) 235 int imm, struct jit_ctx *ctx)
230{ 236{
@@ -283,11 +289,7 @@ static inline void emit_xori(ptr dst, ptr src, u32 imm, struct jit_ctx *ctx)
283 289
284static inline void emit_stack_offset(int offset, struct jit_ctx *ctx) 290static inline void emit_stack_offset(int offset, struct jit_ctx *ctx)
285{ 291{
286 if (config_enabled(CONFIG_64BIT)) 292 emit_long_instr(ctx, ADDIU, r_sp, r_sp, offset);
287 emit_instr(ctx, daddiu, r_sp, r_sp, offset);
288 else
289 emit_instr(ctx, addiu, r_sp, r_sp, offset);
290
291} 293}
292 294
293static inline void emit_subu(unsigned int dst, unsigned int src1, 295static inline void emit_subu(unsigned int dst, unsigned int src1,
@@ -365,10 +367,7 @@ static inline void emit_store_stack_reg(ptr reg, ptr base,
365 unsigned int offset, 367 unsigned int offset,
366 struct jit_ctx *ctx) 368 struct jit_ctx *ctx)
367{ 369{
368 if (config_enabled(CONFIG_64BIT)) 370 emit_long_instr(ctx, SW, reg, offset, base);
369 emit_instr(ctx, sd, reg, offset, base);
370 else
371 emit_instr(ctx, sw, reg, offset, base);
372} 371}
373 372
374static inline void emit_store(ptr reg, ptr base, unsigned int offset, 373static inline void emit_store(ptr reg, ptr base, unsigned int offset,
@@ -381,10 +380,7 @@ static inline void emit_load_stack_reg(ptr reg, ptr base,
381 unsigned int offset, 380 unsigned int offset,
382 struct jit_ctx *ctx) 381 struct jit_ctx *ctx)
383{ 382{
384 if (config_enabled(CONFIG_64BIT)) 383 emit_long_instr(ctx, LW, reg, offset, base);
385 emit_instr(ctx, ld, reg, offset, base);
386 else
387 emit_instr(ctx, lw, reg, offset, base);
388} 384}
389 385
390static inline void emit_load(unsigned int reg, unsigned int base, 386static inline void emit_load(unsigned int reg, unsigned int base,
@@ -458,10 +454,7 @@ static inline void emit_load_ptr(unsigned int dst, unsigned int src,
458 int imm, struct jit_ctx *ctx) 454 int imm, struct jit_ctx *ctx)
459{ 455{
460 /* src contains the base addr of the 32/64-pointer */ 456 /* src contains the base addr of the 32/64-pointer */
461 if (config_enabled(CONFIG_64BIT)) 457 emit_long_instr(ctx, LW, dst, imm, src);
462 emit_instr(ctx, ld, dst, imm, src);
463 else
464 emit_instr(ctx, lw, dst, imm, src);
465} 458}
466 459
467/* load a function pointer to register */ 460/* load a function pointer to register */
@@ -483,10 +476,7 @@ static inline void emit_load_func(unsigned int reg, ptr imm,
483/* Move to real MIPS register */ 476/* Move to real MIPS register */
484static inline void emit_reg_move(ptr dst, ptr src, struct jit_ctx *ctx) 477static inline void emit_reg_move(ptr dst, ptr src, struct jit_ctx *ctx)
485{ 478{
486 if (config_enabled(CONFIG_64BIT)) 479 emit_long_instr(ctx, ADDU, dst, src, r_zero);
487 emit_daddu(dst, src, r_zero, ctx);
488 else
489 emit_addu(dst, src, r_zero, ctx);
490} 480}
491 481
492/* Move to JIT (32-bit) register */ 482/* Move to JIT (32-bit) register */
@@ -623,10 +613,7 @@ static void save_bpf_jit_regs(struct jit_ctx *ctx, unsigned offset)
623 if (ctx->flags & SEEN_MEM) { 613 if (ctx->flags & SEEN_MEM) {
624 if (real_off % (RSIZE * 2)) 614 if (real_off % (RSIZE * 2))
625 real_off += RSIZE; 615 real_off += RSIZE;
626 if (config_enabled(CONFIG_64BIT)) 616 emit_long_instr(ctx, ADDIU, r_M, r_sp, real_off);
627 emit_daddiu(r_M, r_sp, real_off, ctx);
628 else
629 emit_addiu(r_M, r_sp, real_off, ctx);
630 } 617 }
631} 618}
632 619
@@ -1241,7 +1228,7 @@ jmp_cmp:
1241 emit_half_load(r_A, r_skb, off, ctx); 1228 emit_half_load(r_A, r_skb, off, ctx);
1242#ifdef CONFIG_CPU_LITTLE_ENDIAN 1229#ifdef CONFIG_CPU_LITTLE_ENDIAN
1243 /* This needs little endian fixup */ 1230 /* This needs little endian fixup */
1244 if (cpu_has_mips_r2) { 1231 if (cpu_has_wsbh) {
1245 /* R2 and later have the wsbh instruction */ 1232 /* R2 and later have the wsbh instruction */
1246 emit_wsbh(r_A, r_A, ctx); 1233 emit_wsbh(r_A, r_A, ctx);
1247 } else { 1234 } else {
diff --git a/arch/mips/netlogic/Kconfig b/arch/mips/netlogic/Kconfig
index 4eb683aef7d7..0823321c10e0 100644
--- a/arch/mips/netlogic/Kconfig
+++ b/arch/mips/netlogic/Kconfig
@@ -4,6 +4,7 @@ if NLM_XLP_BOARD
4config DT_XLP_EVP 4config DT_XLP_EVP
5 bool "Built-in device tree for XLP EVP boards" 5 bool "Built-in device tree for XLP EVP boards"
6 default y 6 default y
7 select BUILTIN_DTB
7 help 8 help
8 Add an FDT blob for XLP EVP boards into the kernel. 9 Add an FDT blob for XLP EVP boards into the kernel.
9 This DTB will be used if the firmware does not pass in a DTB 10 This DTB will be used if the firmware does not pass in a DTB
@@ -13,6 +14,7 @@ config DT_XLP_EVP
13config DT_XLP_SVP 14config DT_XLP_SVP
14 bool "Built-in device tree for XLP SVP boards" 15 bool "Built-in device tree for XLP SVP boards"
15 default y 16 default y
17 select BUILTIN_DTB
16 help 18 help
17 Add an FDT blob for XLP VP boards into the kernel. 19 Add an FDT blob for XLP VP boards into the kernel.
18 This DTB will be used if the firmware does not pass in a DTB 20 This DTB will be used if the firmware does not pass in a DTB
@@ -22,6 +24,7 @@ config DT_XLP_SVP
22config DT_XLP_FVP 24config DT_XLP_FVP
23 bool "Built-in device tree for XLP FVP boards" 25 bool "Built-in device tree for XLP FVP boards"
24 default y 26 default y
27 select BUILTIN_DTB
25 help 28 help
26 Add an FDT blob for XLP FVP board into the kernel. 29 Add an FDT blob for XLP FVP board into the kernel.
27 This DTB will be used if the firmware does not pass in a DTB 30 This DTB will be used if the firmware does not pass in a DTB
@@ -31,6 +34,7 @@ config DT_XLP_FVP
31config DT_XLP_GVP 34config DT_XLP_GVP
32 bool "Built-in device tree for XLP GVP boards" 35 bool "Built-in device tree for XLP GVP boards"
33 default y 36 default y
37 select BUILTIN_DTB
34 help 38 help
35 Add an FDT blob for XLP GVP board into the kernel. 39 Add an FDT blob for XLP GVP board into the kernel.
36 This DTB will be used if the firmware does not pass in a DTB 40 This DTB will be used if the firmware does not pass in a DTB
diff --git a/arch/mips/netlogic/Makefile b/arch/mips/netlogic/Makefile
index 7602d1386614..36d169b2ca6d 100644
--- a/arch/mips/netlogic/Makefile
+++ b/arch/mips/netlogic/Makefile
@@ -1,4 +1,3 @@
1obj-$(CONFIG_NLM_COMMON) += common/ 1obj-$(CONFIG_NLM_COMMON) += common/
2obj-$(CONFIG_CPU_XLR) += xlr/ 2obj-$(CONFIG_CPU_XLR) += xlr/
3obj-$(CONFIG_CPU_XLP) += xlp/ 3obj-$(CONFIG_CPU_XLP) += xlp/
4obj-$(CONFIG_CPU_XLP) += dts/
diff --git a/arch/mips/netlogic/dts/Makefile b/arch/mips/netlogic/dts/Makefile
deleted file mode 100644
index 25c8e873ee25..000000000000
--- a/arch/mips/netlogic/dts/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
1obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o
2obj-$(CONFIG_DT_XLP_SVP) += xlp_svp.dtb.o
3obj-$(CONFIG_DT_XLP_FVP) += xlp_fvp.dtb.o
4obj-$(CONFIG_DT_XLP_GVP) += xlp_gvp.dtb.o
diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
index 4a296655f446..77e8a9620e18 100644
--- a/arch/mips/ralink/Kconfig
+++ b/arch/mips/ralink/Kconfig
@@ -42,18 +42,22 @@ choice
42 config DTB_RT2880_EVAL 42 config DTB_RT2880_EVAL
43 bool "RT2880 eval kit" 43 bool "RT2880 eval kit"
44 depends on SOC_RT288X 44 depends on SOC_RT288X
45 select BUILTIN_DTB
45 46
46 config DTB_RT305X_EVAL 47 config DTB_RT305X_EVAL
47 bool "RT305x eval kit" 48 bool "RT305x eval kit"
48 depends on SOC_RT305X 49 depends on SOC_RT305X
50 select BUILTIN_DTB
49 51
50 config DTB_RT3883_EVAL 52 config DTB_RT3883_EVAL
51 bool "RT3883 eval kit" 53 bool "RT3883 eval kit"
52 depends on SOC_RT3883 54 depends on SOC_RT3883
55 select BUILTIN_DTB
53 56
54 config DTB_MT7620A_EVAL 57 config DTB_MT7620A_EVAL
55 bool "MT7620A eval kit" 58 bool "MT7620A eval kit"
56 depends on SOC_MT7620 59 depends on SOC_MT7620
60 select BUILTIN_DTB
57 61
58endchoice 62endchoice
59 63
diff --git a/arch/mips/ralink/Makefile b/arch/mips/ralink/Makefile
index 98ae349827be..2c09c8aa0ae2 100644
--- a/arch/mips/ralink/Makefile
+++ b/arch/mips/ralink/Makefile
@@ -16,5 +16,3 @@ obj-$(CONFIG_SOC_RT3883) += rt3883.o
16obj-$(CONFIG_SOC_MT7620) += mt7620.o 16obj-$(CONFIG_SOC_MT7620) += mt7620.o
17 17
18obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 18obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
19
20obj-y += dts/
diff --git a/arch/mips/ralink/dts/Makefile b/arch/mips/ralink/dts/Makefile
deleted file mode 100644
index 18194fa93e80..000000000000
--- a/arch/mips/ralink/dts/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
1obj-$(CONFIG_DTB_RT2880_EVAL) := rt2880_eval.dtb.o
2obj-$(CONFIG_DTB_RT305X_EVAL) := rt3052_eval.dtb.o
3obj-$(CONFIG_DTB_RT3883_EVAL) := rt3883_eval.dtb.o
4obj-$(CONFIG_DTB_MT7620A_EVAL) := mt7620a_eval.dtb.o
diff --git a/arch/mips/ralink/timer.c b/arch/mips/ralink/timer.c
index e38692a44e69..5bb29b3790ff 100644
--- a/arch/mips/ralink/timer.c
+++ b/arch/mips/ralink/timer.c
@@ -58,7 +58,7 @@ static irqreturn_t rt_timer_irq(int irq, void *_rt)
58 58
59static int rt_timer_request(struct rt_timer *rt) 59static int rt_timer_request(struct rt_timer *rt)
60{ 60{
61 int err = request_irq(rt->irq, rt_timer_irq, IRQF_DISABLED, 61 int err = request_irq(rt->irq, rt_timer_irq, 0,
62 dev_name(rt->dev), rt); 62 dev_name(rt->dev), rt);
63 if (err) { 63 if (err) {
64 dev_err(rt->dev, "failed to request irq\n"); 64 dev_err(rt->dev, "failed to request irq\n");
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 3bf000fab0ae..d55a210a49bf 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -6,6 +6,7 @@ genhdr-y += unistd_x32.h
6 6
7generic-y += clkdev.h 7generic-y += clkdev.h
8generic-y += cputime.h 8generic-y += cputime.h
9generic-y += dma-contiguous.h
9generic-y += early_ioremap.h 10generic-y += early_ioremap.h
10generic-y += mcs_spinlock.h 11generic-y += mcs_spinlock.h
11generic-y += scatterlist.h 12generic-y += scatterlist.h
diff --git a/arch/x86/include/asm/dma-contiguous.h b/include/asm-generic/dma-contiguous.h
index b4b38bacb404..292c571750f0 100644
--- a/arch/x86/include/asm/dma-contiguous.h
+++ b/include/asm-generic/dma-contiguous.h
@@ -1,7 +1,5 @@
1#ifndef ASMX86_DMA_CONTIGUOUS_H 1#ifndef _ASM_GENERIC_DMA_CONTIGUOUS_H
2#define ASMX86_DMA_CONTIGUOUS_H 2#define _ASM_GENERIC_DMA_CONTIGUOUS_H
3
4#ifdef __KERNEL__
5 3
6#include <linux/types.h> 4#include <linux/types.h>
7 5
@@ -9,4 +7,3 @@ static inline void
9dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) { } 7dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) { }
10 8
11#endif 9#endif
12#endif