aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-03-09 15:03:18 -0400
committerOlof Johansson <olof@lixom.net>2014-03-09 15:03:18 -0400
commit1760e4f855a2ead08a40deac9abd4fb8cdf3af32 (patch)
tree8ee1c79f4c46fd225d90e832def3d7f7e3742086 /arch/arm
parent1e871089f66416ce540d8e362225a0878a5d2c06 (diff)
parentc8ae7e9bfc8caf679e891c4f0a04f2435b45e2da (diff)
Merge tag 'imx-soc-3.15' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/soc
i.MX SoC changes for 3.15 from Shawn Guo: - Support suspend from ocram (DDR IO floating) for imx6 platforms - Add cpuidle support for imx6sl - Sparse warning fixes for imx6sl and vf610 clock code - Remove PWM platform code - Support ptp and rmii clock from pad - Support WEIM CS GPR configuration - Random cleanups and defconfig updates * tag 'imx-soc-3.15' of git://git.linaro.org/people/shawnguo/linux-2.6: (373 commits) ARM: imx6: drop .text.head section annotation from headsmp.S ARM: imx6: build suspend-imx6.o with CONFIG_SOC_IMX6 ARM: imx6: rename pm-imx6q.c to pm-imx6.c ARM: imx6: introduce CONFIG_SOC_IMX6 for i.MX6 common stuff ARM: imx6: do not call imx6q_suspend_init() with !CONFIG_SUSPEND ARM: imx6: call suspend_set_ops() from suspend routine ARM: imx6: build headsmp.o only on CONFIG_SMP ARM: imx6: move v7_cpu_resume() into suspend-imx6.S ARM i.MX6q: Mark VPU and IPU AXI transfers as cacheable, increase IPU priority ARM: imx6q: Add GPR6 and GPR7 register definitions for iomuxc gpr bus: imx-weim: support CS GPR configuration ARM: mach-imx: Kconfig: Remove IMX_HAVE_PLATFORM_IMX2_WDT from SOC_IMX53 ARM: imx_v6_v7_defconfig: Select CONFIG_DEBUG_FS ARM: mach-imx: Select CONFIG_SRAM at ARCH_MXC level ARM: imx: add speed grading check for i.mx6 soc ARM: imx: avoid calling clk APIs in idle thread which may cause schedule ARM: imx6q: support ptp and rmii clock from pad ARM: imx6q: remove unneeded clk lookups ARM: imx_v6_v7_defconfig: Select CONFIG_MMC_UNSAFE_RESUME ARM: imx_v4_v5_defconfig: Select CONFIG_MMC_UNSAFE_RESUME ...
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig15
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/dts/Makefile3
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts11
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi3
-rw-r--r--arch/arm/boot/dts/dove.dtsi11
-rw-r--r--arch/arm/boot/dts/imx6dl-hummingboard.dts10
-rw-r--r--arch/arm/boot/dts/imx6qdl-cubox-i.dtsi10
-rw-r--r--arch/arm/boot/dts/omap3-gta04.dts6
-rw-r--r--arch/arm/boot/dts/omap3-n9.dts2
-rw-r--r--arch/arm/boot/dts/omap3-n900.dts4
-rw-r--r--arch/arm/boot/dts/omap3-n950.dts2
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-tobi.dts22
-rw-r--r--arch/arm/boot/dts/omap3-overo-tobi-common.dtsi (renamed from arch/arm/boot/dts/omap3-tobi.dts)3
-rw-r--r--arch/arm/boot/dts/omap3-overo-tobi.dts22
-rw-r--r--arch/arm/boot/dts/omap3-overo.dtsi3
-rw-r--r--arch/arm/boot/dts/tegra114.dtsi4
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi4
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dtsi2
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi4
-rw-r--r--arch/arm/boot/dts/testcases/tests-interrupts.dtsi58
-rw-r--r--arch/arm/boot/dts/testcases/tests-phandle.dtsi39
-rw-r--r--arch/arm/boot/dts/testcases/tests.dtsi2
-rw-r--r--arch/arm/boot/dts/versatile-pb.dts4
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig1
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig7
-rw-r--r--arch/arm/include/asm/cacheflush.h1
-rw-r--r--arch/arm/include/asm/pgtable-3level.h15
-rw-r--r--arch/arm/include/asm/spinlock.h15
-rw-r--r--arch/arm/kernel/setup.c2
-rw-r--r--arch/arm/mach-bcm/Kconfig5
-rw-r--r--arch/arm/mach-bcm2835/Kconfig4
-rw-r--r--arch/arm/mach-berlin/Kconfig4
-rw-r--r--arch/arm/mach-cns3xxx/Kconfig3
-rw-r--r--arch/arm/mach-highbank/Kconfig7
-rw-r--r--arch/arm/mach-hisi/Kconfig4
-rw-r--r--arch/arm/mach-imx/Kconfig57
-rw-r--r--arch/arm/mach-imx/Makefile9
-rw-r--r--arch/arm/mach-imx/clk-imx21.c1
-rw-r--r--arch/arm/mach-imx/clk-imx25.c8
-rw-r--r--arch/arm/mach-imx/clk-imx27.c1
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c2
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c7
-rw-r--r--arch/arm/mach-imx/clk-imx6sl.c159
-rw-r--r--arch/arm/mach-imx/clk-vf610.c36
-rw-r--r--arch/arm/mach-imx/common.h21
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6q.c4
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6sl.c57
-rw-r--r--arch/arm/mach-imx/cpuidle.h5
-rw-r--r--arch/arm/mach-imx/devices-imx25.h4
-rw-r--r--arch/arm/mach-imx/devices-imx51.h4
-rw-r--r--arch/arm/mach-imx/devices/Kconfig3
-rw-r--r--arch/arm/mach-imx/devices/Makefile1
-rw-r--r--arch/arm/mach-imx/devices/devices-common.h9
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_pwm.c69
-rw-r--r--arch/arm/mach-imx/hardware.h4
-rw-r--r--arch/arm/mach-imx/headsmp.S40
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c98
-rw-r--r--arch/arm/mach-imx/mach-imx6sl.c6
-rw-r--r--arch/arm/mach-imx/pm-imx6.c552
-rw-r--r--arch/arm/mach-imx/pm-imx6q.c241
-rw-r--r--arch/arm/mach-imx/suspend-imx6.S361
-rw-r--r--arch/arm/mach-imx/time.c12
-rw-r--r--arch/arm/mach-keystone/Kconfig4
-rw-r--r--arch/arm/mach-moxart/Kconfig5
-rw-r--r--arch/arm/mach-mvebu/Kconfig6
-rw-r--r--arch/arm/mach-mxs/Kconfig4
-rw-r--r--arch/arm/mach-nomadik/Kconfig5
-rw-r--r--arch/arm/mach-nspire/Kconfig5
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c1
-rw-r--r--arch/arm/mach-omap2/Kconfig25
-rw-r--r--arch/arm/mach-omap2/gpmc.c4
-rw-r--r--arch/arm/mach-omap2/io.c9
-rw-r--r--arch/arm/mach-picoxcell/Kconfig5
-rw-r--r--arch/arm/mach-prima2/Kconfig6
-rw-r--r--arch/arm/mach-pxa/mioa701.c9
-rw-r--r--arch/arm/mach-rockchip/Kconfig3
-rw-r--r--arch/arm/mach-shmobile/Kconfig5
-rw-r--r--arch/arm/mach-socfpga/Kconfig7
-rw-r--r--arch/arm/mach-spear/Kconfig10
-rw-r--r--arch/arm/mach-sti/Kconfig4
-rw-r--r--arch/arm/mach-sunxi/Kconfig5
-rw-r--r--arch/arm/mach-tegra/Kconfig8
-rw-r--r--arch/arm/mach-tegra/pm.c1
-rw-r--r--arch/arm/mach-tegra/tegra.c10
-rw-r--r--arch/arm/mach-u300/Kconfig6
-rw-r--r--arch/arm/mach-ux500/Kconfig6
-rw-r--r--arch/arm/mach-vexpress/Kconfig5
-rw-r--r--arch/arm/mach-virt/Kconfig10
-rw-r--r--arch/arm/mach-virt/Makefile5
-rw-r--r--arch/arm/mach-virt/virt.c41
-rw-r--r--arch/arm/mach-vt8500/Kconfig4
-rw-r--r--arch/arm/mach-zynq/Kconfig7
-rw-r--r--arch/arm/mm/dma-mapping.c2
-rw-r--r--arch/arm/mm/mm.h1
-rw-r--r--arch/arm/mm/mmu.c7
-rw-r--r--arch/arm/mm/proc-v6.S3
-rw-r--r--arch/arm/mm/proc-v7.S2
98 files changed, 1442 insertions, 882 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d57b4753585d..cbee1169b883 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -306,9 +306,11 @@ choice
306config ARCH_MULTIPLATFORM 306config ARCH_MULTIPLATFORM
307 bool "Allow multiple platforms to be selected" 307 bool "Allow multiple platforms to be selected"
308 depends on MMU 308 depends on MMU
309 select ARCH_WANT_OPTIONAL_GPIOLIB
309 select ARM_PATCH_PHYS_VIRT 310 select ARM_PATCH_PHYS_VIRT
310 select AUTO_ZRELADDR 311 select AUTO_ZRELADDR
311 select COMMON_CLK 312 select COMMON_CLK
313 select GENERIC_CLOCKEVENTS
312 select MULTI_IRQ_HANDLER 314 select MULTI_IRQ_HANDLER
313 select SPARSE_IRQ 315 select SPARSE_IRQ
314 select USE_OF 316 select USE_OF
@@ -905,16 +907,18 @@ config ARCH_MULTI_V4_V5
905config ARCH_MULTI_V6 907config ARCH_MULTI_V6
906 bool "ARMv6 based platforms (ARM11)" 908 bool "ARMv6 based platforms (ARM11)"
907 select ARCH_MULTI_V6_V7 909 select ARCH_MULTI_V6_V7
908 select CPU_V6 910 select CPU_V6K
909 911
910config ARCH_MULTI_V7 912config ARCH_MULTI_V7
911 bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)" 913 bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)"
912 default y 914 default y
913 select ARCH_MULTI_V6_V7 915 select ARCH_MULTI_V6_V7
914 select CPU_V7 916 select CPU_V7
917 select HAVE_SMP
915 918
916config ARCH_MULTI_V6_V7 919config ARCH_MULTI_V6_V7
917 bool 920 bool
921 select MIGHT_HAVE_CACHE_L2X0
918 922
919config ARCH_MULTI_CPU_AUTO 923config ARCH_MULTI_CPU_AUTO
920 def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7) 924 def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
@@ -922,6 +926,13 @@ config ARCH_MULTI_CPU_AUTO
922 926
923endmenu 927endmenu
924 928
929config ARCH_VIRT
930 bool "Dummy Virtual Machine" if ARCH_MULTI_V7
931 select ARM_AMBA
932 select ARM_GIC
933 select ARM_PSCI
934 select HAVE_ARM_ARCH_TIMER
935
925# 936#
926# This is sorted alphabetically by mach-* pathname. However, plat-* 937# This is sorted alphabetically by mach-* pathname. However, plat-*
927# Kconfigs may be included either alphabetically (according to the 938# Kconfigs may be included either alphabetically (according to the
@@ -1047,8 +1058,6 @@ source "arch/arm/mach-versatile/Kconfig"
1047source "arch/arm/mach-vexpress/Kconfig" 1058source "arch/arm/mach-vexpress/Kconfig"
1048source "arch/arm/plat-versatile/Kconfig" 1059source "arch/arm/plat-versatile/Kconfig"
1049 1060
1050source "arch/arm/mach-virt/Kconfig"
1051
1052source "arch/arm/mach-vt8500/Kconfig" 1061source "arch/arm/mach-vt8500/Kconfig"
1053 1062
1054source "arch/arm/mach-w90x900/Kconfig" 1063source "arch/arm/mach-w90x900/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 51e5bede657f..dd1bd7ed77be 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -200,7 +200,6 @@ machine-$(CONFIG_ARCH_U300) += u300
200machine-$(CONFIG_ARCH_U8500) += ux500 200machine-$(CONFIG_ARCH_U8500) += ux500
201machine-$(CONFIG_ARCH_VERSATILE) += versatile 201machine-$(CONFIG_ARCH_VERSATILE) += versatile
202machine-$(CONFIG_ARCH_VEXPRESS) += vexpress 202machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
203machine-$(CONFIG_ARCH_VIRT) += virt
204machine-$(CONFIG_ARCH_VT8500) += vt8500 203machine-$(CONFIG_ARCH_VT8500) += vt8500
205machine-$(CONFIG_ARCH_W90X900) += w90x900 204machine-$(CONFIG_ARCH_W90X900) += w90x900
206machine-$(CONFIG_ARCH_ZYNQ) += zynq 205machine-$(CONFIG_ARCH_ZYNQ) += zynq
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 3269029a1ce6..4a89023f55ab 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -206,7 +206,8 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
206 omap3-n900.dtb \ 206 omap3-n900.dtb \
207 omap3-n9.dtb \ 207 omap3-n9.dtb \
208 omap3-n950.dtb \ 208 omap3-n950.dtb \
209 omap3-tobi.dtb \ 209 omap3-overo-tobi.dtb \
210 omap3-overo-storm-tobi.dtb \
210 omap3-gta04.dtb \ 211 omap3-gta04.dtb \
211 omap3-igep0020.dtb \ 212 omap3-igep0020.dtb \
212 omap3-igep0030.dtb \ 213 omap3-igep0030.dtb \
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 4718ec4a4dbf..486880b74831 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -121,7 +121,7 @@
121 ti,model = "AM335x-EVMSK"; 121 ti,model = "AM335x-EVMSK";
122 ti,audio-codec = <&tlv320aic3106>; 122 ti,audio-codec = <&tlv320aic3106>;
123 ti,mcasp-controller = <&mcasp1>; 123 ti,mcasp-controller = <&mcasp1>;
124 ti,codec-clock-rate = <24576000>; 124 ti,codec-clock-rate = <24000000>;
125 ti,audio-routing = 125 ti,audio-routing =
126 "Headphone Jack", "HPLOUT", 126 "Headphone Jack", "HPLOUT",
127 "Headphone Jack", "HPROUT"; 127 "Headphone Jack", "HPROUT";
@@ -256,6 +256,12 @@
256 >; 256 >;
257 }; 257 };
258 258
259 mmc1_pins: pinmux_mmc1_pins {
260 pinctrl-single,pins = <
261 0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
262 >;
263 };
264
259 mcasp1_pins: mcasp1_pins { 265 mcasp1_pins: mcasp1_pins {
260 pinctrl-single,pins = < 266 pinctrl-single,pins = <
261 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */ 267 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */
@@ -456,6 +462,9 @@
456 status = "okay"; 462 status = "okay";
457 vmmc-supply = <&vmmc_reg>; 463 vmmc-supply = <&vmmc_reg>;
458 bus-width = <4>; 464 bus-width = <4>;
465 pinctrl-names = "default";
466 pinctrl-0 = <&mmc1_pins>;
467 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
459}; 468};
460 469
461&sham { 470&sham {
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
index 66609684d41b..9480cf891f8c 100644
--- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -23,6 +23,7 @@
23 gpio0 = &gpio0; 23 gpio0 = &gpio0;
24 gpio1 = &gpio1; 24 gpio1 = &gpio1;
25 gpio2 = &gpio2; 25 gpio2 = &gpio2;
26 eth3 = &eth3;
26 }; 27 };
27 28
28 cpus { 29 cpus {
@@ -291,7 +292,7 @@
291 interrupts = <91>; 292 interrupts = <91>;
292 }; 293 };
293 294
294 ethernet@34000 { 295 eth3: ethernet@34000 {
295 compatible = "marvell,armada-370-neta"; 296 compatible = "marvell,armada-370-neta";
296 reg = <0x34000 0x4000>; 297 reg = <0x34000 0x4000>;
297 interrupts = <14>; 298 interrupts = <14>;
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index 2b76524f4aa7..187fd46b7b5e 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -379,15 +379,6 @@
379 #clock-cells = <1>; 379 #clock-cells = <1>;
380 }; 380 };
381 381
382 pmu_intc: pmu-interrupt-ctrl@d0050 {
383 compatible = "marvell,dove-pmu-intc";
384 interrupt-controller;
385 #interrupt-cells = <1>;
386 reg = <0xd0050 0x8>;
387 interrupts = <33>;
388 marvell,#interrupts = <7>;
389 };
390
391 pinctrl: pin-ctrl@d0200 { 382 pinctrl: pin-ctrl@d0200 {
392 compatible = "marvell,dove-pinctrl"; 383 compatible = "marvell,dove-pinctrl";
393 reg = <0xd0200 0x10>; 384 reg = <0xd0200 0x10>;
@@ -610,8 +601,6 @@
610 rtc: real-time-clock@d8500 { 601 rtc: real-time-clock@d8500 {
611 compatible = "marvell,orion-rtc"; 602 compatible = "marvell,orion-rtc";
612 reg = <0xd8500 0x20>; 603 reg = <0xd8500 0x20>;
613 interrupt-parent = <&pmu_intc>;
614 interrupts = <5>;
615 }; 604 };
616 605
617 gpio2: gpio-ctrl@e8400 { 606 gpio2: gpio-ctrl@e8400 {
diff --git a/arch/arm/boot/dts/imx6dl-hummingboard.dts b/arch/arm/boot/dts/imx6dl-hummingboard.dts
index fd8fc7cd53f3..5bfae54fb780 100644
--- a/arch/arm/boot/dts/imx6dl-hummingboard.dts
+++ b/arch/arm/boot/dts/imx6dl-hummingboard.dts
@@ -52,12 +52,6 @@
52 }; 52 };
53 }; 53 };
54 54
55 codec: spdif-transmitter {
56 compatible = "linux,spdif-dit";
57 pinctrl-names = "default";
58 pinctrl-0 = <&pinctrl_hummingboard_spdif>;
59 };
60
61 sound-spdif { 55 sound-spdif {
62 compatible = "fsl,imx-audio-spdif"; 56 compatible = "fsl,imx-audio-spdif";
63 model = "imx-spdif"; 57 model = "imx-spdif";
@@ -111,7 +105,7 @@
111 }; 105 };
112 106
113 pinctrl_hummingboard_spdif: hummingboard-spdif { 107 pinctrl_hummingboard_spdif: hummingboard-spdif {
114 fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0>; 108 fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>;
115 }; 109 };
116 110
117 pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus { 111 pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus {
@@ -142,6 +136,8 @@
142}; 136};
143 137
144&spdif { 138&spdif {
139 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_hummingboard_spdif>;
145 status = "okay"; 141 status = "okay";
146}; 142};
147 143
diff --git a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
index 64daa3b311f6..c2a24888a276 100644
--- a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
@@ -46,12 +46,6 @@
46 }; 46 };
47 }; 47 };
48 48
49 codec: spdif-transmitter {
50 compatible = "linux,spdif-dit";
51 pinctrl-names = "default";
52 pinctrl-0 = <&pinctrl_cubox_i_spdif>;
53 };
54
55 sound-spdif { 49 sound-spdif {
56 compatible = "fsl,imx-audio-spdif"; 50 compatible = "fsl,imx-audio-spdif";
57 model = "imx-spdif"; 51 model = "imx-spdif";
@@ -89,7 +83,7 @@
89 }; 83 };
90 84
91 pinctrl_cubox_i_spdif: cubox-i-spdif { 85 pinctrl_cubox_i_spdif: cubox-i-spdif {
92 fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0>; 86 fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>;
93 }; 87 };
94 88
95 pinctrl_cubox_i_usbh1_vbus: cubox-i-usbh1-vbus { 89 pinctrl_cubox_i_usbh1_vbus: cubox-i-usbh1-vbus {
@@ -121,6 +115,8 @@
121}; 115};
122 116
123&spdif { 117&spdif {
118 pinctrl-names = "default";
119 pinctrl-0 = <&pinctrl_cubox_i_spdif>;
124 status = "okay"; 120 status = "okay";
125}; 121};
126 122
diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
index b9b55c95a566..c551e4af4d83 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -32,7 +32,7 @@
32 aux-button { 32 aux-button {
33 label = "aux"; 33 label = "aux";
34 linux,code = <169>; 34 linux,code = <169>;
35 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; 35 gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
36 gpio-key,wakeup; 36 gpio-key,wakeup;
37 }; 37 };
38 }; 38 };
@@ -92,6 +92,8 @@
92 bmp085@77 { 92 bmp085@77 {
93 compatible = "bosch,bmp085"; 93 compatible = "bosch,bmp085";
94 reg = <0x77>; 94 reg = <0x77>;
95 interrupt-parent = <&gpio4>;
96 interrupts = <17 IRQ_TYPE_EDGE_RISING>;
95 }; 97 };
96 98
97 /* leds */ 99 /* leds */
@@ -141,8 +143,8 @@
141 pinctrl-names = "default"; 143 pinctrl-names = "default";
142 pinctrl-0 = <&mmc1_pins>; 144 pinctrl-0 = <&mmc1_pins>;
143 vmmc-supply = <&vmmc1>; 145 vmmc-supply = <&vmmc1>;
144 vmmc_aux-supply = <&vsim>;
145 bus-width = <4>; 146 bus-width = <4>;
147 ti,non-removable;
146}; 148};
147 149
148&mmc2 { 150&mmc2 {
diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts
index 39828ce464ee..9938b5dc1909 100644
--- a/arch/arm/boot/dts/omap3-n9.dts
+++ b/arch/arm/boot/dts/omap3-n9.dts
@@ -14,5 +14,5 @@
14 14
15/ { 15/ {
16 model = "Nokia N9"; 16 model = "Nokia N9";
17 compatible = "nokia,omap3-n9", "ti,omap3"; 17 compatible = "nokia,omap3-n9", "ti,omap36xx", "ti,omap3";
18}; 18};
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 6fc85f963530..0bf40c90faba 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2013 Pavel Machek <pavel@ucw.cz> 2 * Copyright (C) 2013 Pavel Machek <pavel@ucw.cz>
3 * Copyright 2013 Aaro Koskinen <aaro.koskinen@iki.fi> 3 * Copyright (C) 2013-2014 Aaro Koskinen <aaro.koskinen@iki.fi>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 (or later) as 6 * it under the terms of the GNU General Public License version 2 (or later) as
@@ -13,7 +13,7 @@
13 13
14/ { 14/ {
15 model = "Nokia N900"; 15 model = "Nokia N900";
16 compatible = "nokia,omap3-n900", "ti,omap3"; 16 compatible = "nokia,omap3-n900", "ti,omap3430", "ti,omap3";
17 17
18 cpus { 18 cpus {
19 cpu@0 { 19 cpu@0 {
diff --git a/arch/arm/boot/dts/omap3-n950.dts b/arch/arm/boot/dts/omap3-n950.dts
index b076a526b999..261c5589bfa3 100644
--- a/arch/arm/boot/dts/omap3-n950.dts
+++ b/arch/arm/boot/dts/omap3-n950.dts
@@ -14,5 +14,5 @@
14 14
15/ { 15/ {
16 model = "Nokia N950"; 16 model = "Nokia N950";
17 compatible = "nokia,omap3-n950", "ti,omap3"; 17 compatible = "nokia,omap3-n950", "ti,omap36xx", "ti,omap3";
18}; 18};
diff --git a/arch/arm/boot/dts/omap3-overo-storm-tobi.dts b/arch/arm/boot/dts/omap3-overo-storm-tobi.dts
new file mode 100644
index 000000000000..966b5c9cd96a
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm-tobi.dts
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group
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 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Tobi expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap36xx.dtsi"
16#include "omap3-overo-tobi-common.dtsi"
17
18/ {
19 model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Tobi";
20 compatible = "gumstix,omap3-overo-tobi", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3";
21};
22
diff --git a/arch/arm/boot/dts/omap3-tobi.dts b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi
index 7e4ad2aec37a..4edc013a91c1 100644
--- a/arch/arm/boot/dts/omap3-tobi.dts
+++ b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi
@@ -13,9 +13,6 @@
13#include "omap3-overo.dtsi" 13#include "omap3-overo.dtsi"
14 14
15/ { 15/ {
16 model = "TI OMAP3 Gumstix Overo on Tobi";
17 compatible = "ti,omap3-tobi", "ti,omap3-overo", "ti,omap3";
18
19 leds { 16 leds {
20 compatible = "gpio-leds"; 17 compatible = "gpio-leds";
21 heartbeat { 18 heartbeat {
diff --git a/arch/arm/boot/dts/omap3-overo-tobi.dts b/arch/arm/boot/dts/omap3-overo-tobi.dts
new file mode 100644
index 000000000000..de5653e1b5ca
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-tobi.dts
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group
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 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Tobi expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap34xx.dtsi"
16#include "omap3-overo-tobi-common.dtsi"
17
18/ {
19 model = "OMAP35xx Gumstix Overo on Tobi";
20 compatible = "gumstix,omap3-overo-tobi", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3";
21};
22
diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
index a461d2fd1fb0..597099907f8e 100644
--- a/arch/arm/boot/dts/omap3-overo.dtsi
+++ b/arch/arm/boot/dts/omap3-overo.dtsi
@@ -9,9 +9,6 @@
9/* 9/*
10 * The Gumstix Overo must be combined with an expansion board. 10 * The Gumstix Overo must be combined with an expansion board.
11 */ 11 */
12/dts-v1/;
13
14#include "omap34xx.dtsi"
15 12
16/ { 13/ {
17 pwmleds { 14 pwmleds {
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 389e987ec281..44ec401ec366 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -57,6 +57,8 @@
57 resets = <&tegra_car 27>; 57 resets = <&tegra_car 27>;
58 reset-names = "dc"; 58 reset-names = "dc";
59 59
60 nvidia,head = <0>;
61
60 rgb { 62 rgb {
61 status = "disabled"; 63 status = "disabled";
62 }; 64 };
@@ -72,6 +74,8 @@
72 resets = <&tegra_car 26>; 74 resets = <&tegra_car 26>;
73 reset-names = "dc"; 75 reset-names = "dc";
74 76
77 nvidia,head = <1>;
78
75 rgb { 79 rgb {
76 status = "disabled"; 80 status = "disabled";
77 }; 81 };
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 480ecda3416b..48d2a7f4d0c0 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -94,6 +94,8 @@
94 resets = <&tegra_car 27>; 94 resets = <&tegra_car 27>;
95 reset-names = "dc"; 95 reset-names = "dc";
96 96
97 nvidia,head = <0>;
98
97 rgb { 99 rgb {
98 status = "disabled"; 100 status = "disabled";
99 }; 101 };
@@ -109,6 +111,8 @@
109 resets = <&tegra_car 26>; 111 resets = <&tegra_car 26>;
110 reset-names = "dc"; 112 reset-names = "dc";
111 113
114 nvidia,head = <1>;
115
112 rgb { 116 rgb {
113 status = "disabled"; 117 status = "disabled";
114 }; 118 };
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index 9104224124ee..1e156d9d0506 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -28,7 +28,7 @@
28 compatible = "nvidia,cardhu", "nvidia,tegra30"; 28 compatible = "nvidia,cardhu", "nvidia,tegra30";
29 29
30 aliases { 30 aliases {
31 rtc0 = "/i2c@7000d000/tps6586x@34"; 31 rtc0 = "/i2c@7000d000/tps65911@2d";
32 rtc1 = "/rtc@7000e000"; 32 rtc1 = "/rtc@7000e000";
33 }; 33 };
34 34
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index ed8e7700b46d..19a84e933f4e 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -170,6 +170,8 @@
170 resets = <&tegra_car 27>; 170 resets = <&tegra_car 27>;
171 reset-names = "dc"; 171 reset-names = "dc";
172 172
173 nvidia,head = <0>;
174
173 rgb { 175 rgb {
174 status = "disabled"; 176 status = "disabled";
175 }; 177 };
@@ -185,6 +187,8 @@
185 resets = <&tegra_car 26>; 187 resets = <&tegra_car 26>;
186 reset-names = "dc"; 188 reset-names = "dc";
187 189
190 nvidia,head = <1>;
191
188 rgb { 192 rgb {
189 status = "disabled"; 193 status = "disabled";
190 }; 194 };
diff --git a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi b/arch/arm/boot/dts/testcases/tests-interrupts.dtsi
deleted file mode 100644
index c843720bd3e5..000000000000
--- a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi
+++ /dev/null
@@ -1,58 +0,0 @@
1
2/ {
3 testcase-data {
4 interrupts {
5 #address-cells = <1>;
6 #size-cells = <1>;
7 test_intc0: intc0 {
8 interrupt-controller;
9 #interrupt-cells = <1>;
10 };
11
12 test_intc1: intc1 {
13 interrupt-controller;
14 #interrupt-cells = <3>;
15 };
16
17 test_intc2: intc2 {
18 interrupt-controller;
19 #interrupt-cells = <2>;
20 };
21
22 test_intmap0: intmap0 {
23 #interrupt-cells = <1>;
24 #address-cells = <0>;
25 interrupt-map = <1 &test_intc0 9>,
26 <2 &test_intc1 10 11 12>,
27 <3 &test_intc2 13 14>,
28 <4 &test_intc2 15 16>;
29 };
30
31 test_intmap1: intmap1 {
32 #interrupt-cells = <2>;
33 interrupt-map = <0x5000 1 2 &test_intc0 15>;
34 };
35
36 interrupts0 {
37 interrupt-parent = <&test_intc0>;
38 interrupts = <1>, <2>, <3>, <4>;
39 };
40
41 interrupts1 {
42 interrupt-parent = <&test_intmap0>;
43 interrupts = <1>, <2>, <3>, <4>;
44 };
45
46 interrupts-extended0 {
47 reg = <0x5000 0x100>;
48 interrupts-extended = <&test_intc0 1>,
49 <&test_intc1 2 3 4>,
50 <&test_intc2 5 6>,
51 <&test_intmap0 1>,
52 <&test_intmap0 2>,
53 <&test_intmap0 3>,
54 <&test_intmap1 1 2>;
55 };
56 };
57 };
58};
diff --git a/arch/arm/boot/dts/testcases/tests-phandle.dtsi b/arch/arm/boot/dts/testcases/tests-phandle.dtsi
deleted file mode 100644
index 0007d3cd7dc2..000000000000
--- a/arch/arm/boot/dts/testcases/tests-phandle.dtsi
+++ /dev/null
@@ -1,39 +0,0 @@
1
2/ {
3 testcase-data {
4 phandle-tests {
5 provider0: provider0 {
6 #phandle-cells = <0>;
7 };
8
9 provider1: provider1 {
10 #phandle-cells = <1>;
11 };
12
13 provider2: provider2 {
14 #phandle-cells = <2>;
15 };
16
17 provider3: provider3 {
18 #phandle-cells = <3>;
19 };
20
21 consumer-a {
22 phandle-list = <&provider1 1>,
23 <&provider2 2 0>,
24 <0>,
25 <&provider3 4 4 3>,
26 <&provider2 5 100>,
27 <&provider0>,
28 <&provider1 7>;
29 phandle-list-names = "first", "second", "third";
30
31 phandle-list-bad-phandle = <12345678 0 0>;
32 phandle-list-bad-args = <&provider2 1 0>,
33 <&provider3 0>;
34 empty-property;
35 unterminated-string = [40 41 42 43];
36 };
37 };
38 };
39};
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi
deleted file mode 100644
index 3f123ecc9dd7..000000000000
--- a/arch/arm/boot/dts/testcases/tests.dtsi
+++ /dev/null
@@ -1,2 +0,0 @@
1/include/ "tests-phandle.dtsi"
2/include/ "tests-interrupts.dtsi"
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts
index f43907c40c93..65f657711323 100644
--- a/arch/arm/boot/dts/versatile-pb.dts
+++ b/arch/arm/boot/dts/versatile-pb.dts
@@ -1,4 +1,4 @@
1/include/ "versatile-ab.dts" 1#include <versatile-ab.dts>
2 2
3/ { 3/ {
4 model = "ARM Versatile PB"; 4 model = "ARM Versatile PB";
@@ -47,4 +47,4 @@
47 }; 47 };
48}; 48};
49 49
50/include/ "testcases/tests.dtsi" 50#include <testcases.dtsi>
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index 6309ee52ccfc..f1aeb7d72712 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -154,6 +154,7 @@ CONFIG_USB=y
154CONFIG_USB_EHCI_HCD=y 154CONFIG_USB_EHCI_HCD=y
155CONFIG_USB_EHCI_MXC=y 155CONFIG_USB_EHCI_MXC=y
156CONFIG_MMC=y 156CONFIG_MMC=y
157CONFIG_MMC_UNSAFE_RESUME=y
157CONFIG_MMC_SDHCI=y 158CONFIG_MMC_SDHCI=y
158CONFIG_MMC_SDHCI_PLTFM=y 159CONFIG_MMC_SDHCI_PLTFM=y
159CONFIG_MMC_SDHCI_ESDHC_IMX=y 160CONFIG_MMC_SDHCI_ESDHC_IMX=y
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 53e82c2523eb..09e974392fa1 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -39,6 +39,8 @@ CONFIG_SOC_IMX53=y
39CONFIG_SOC_IMX6Q=y 39CONFIG_SOC_IMX6Q=y
40CONFIG_SOC_IMX6SL=y 40CONFIG_SOC_IMX6SL=y
41CONFIG_SOC_VF610=y 41CONFIG_SOC_VF610=y
42CONFIG_PCI=y
43CONFIG_PCI_IMX6=y
42CONFIG_SMP=y 44CONFIG_SMP=y
43CONFIG_VMSPLIT_2G=y 45CONFIG_VMSPLIT_2G=y
44CONFIG_PREEMPT_VOLUNTARY=y 46CONFIG_PREEMPT_VOLUNTARY=y
@@ -165,6 +167,7 @@ CONFIG_REGULATOR=y
165CONFIG_REGULATOR_FIXED_VOLTAGE=y 167CONFIG_REGULATOR_FIXED_VOLTAGE=y
166CONFIG_REGULATOR_ANATOP=y 168CONFIG_REGULATOR_ANATOP=y
167CONFIG_REGULATOR_DA9052=y 169CONFIG_REGULATOR_DA9052=y
170CONFIG_REGULATOR_GPIO=y
168CONFIG_REGULATOR_MC13783=y 171CONFIG_REGULATOR_MC13783=y
169CONFIG_REGULATOR_MC13892=y 172CONFIG_REGULATOR_MC13892=y
170CONFIG_REGULATOR_PFUZE100=y 173CONFIG_REGULATOR_PFUZE100=y
@@ -186,6 +189,7 @@ CONFIG_LCD_L4F00242T03=y
186CONFIG_LCD_PLATFORM=y 189CONFIG_LCD_PLATFORM=y
187CONFIG_BACKLIGHT_CLASS_DEVICE=y 190CONFIG_BACKLIGHT_CLASS_DEVICE=y
188CONFIG_BACKLIGHT_PWM=y 191CONFIG_BACKLIGHT_PWM=y
192CONFIG_BACKLIGHT_GPIO=y
189CONFIG_FRAMEBUFFER_CONSOLE=y 193CONFIG_FRAMEBUFFER_CONSOLE=y
190CONFIG_LOGO=y 194CONFIG_LOGO=y
191CONFIG_SOUND=y 195CONFIG_SOUND=y
@@ -211,6 +215,7 @@ CONFIG_USB_GADGET=y
211CONFIG_USB_ETH=m 215CONFIG_USB_ETH=m
212CONFIG_USB_MASS_STORAGE=m 216CONFIG_USB_MASS_STORAGE=m
213CONFIG_MMC=y 217CONFIG_MMC=y
218CONFIG_MMC_UNSAFE_RESUME=y
214CONFIG_MMC_SDHCI=y 219CONFIG_MMC_SDHCI=y
215CONFIG_MMC_SDHCI_PLTFM=y 220CONFIG_MMC_SDHCI_PLTFM=y
216CONFIG_MMC_SDHCI_ESDHC_IMX=y 221CONFIG_MMC_SDHCI_ESDHC_IMX=y
@@ -225,6 +230,7 @@ CONFIG_LEDS_TRIGGER_BACKLIGHT=y
225CONFIG_LEDS_TRIGGER_GPIO=y 230CONFIG_LEDS_TRIGGER_GPIO=y
226CONFIG_RTC_CLASS=y 231CONFIG_RTC_CLASS=y
227CONFIG_RTC_INTF_DEV_UIE_EMUL=y 232CONFIG_RTC_INTF_DEV_UIE_EMUL=y
233CONFIG_RTC_DRV_PCF8563=y
228CONFIG_RTC_DRV_MC13XXX=y 234CONFIG_RTC_DRV_MC13XXX=y
229CONFIG_RTC_DRV_MXC=y 235CONFIG_RTC_DRV_MXC=y
230CONFIG_RTC_DRV_SNVS=y 236CONFIG_RTC_DRV_SNVS=y
@@ -277,6 +283,7 @@ CONFIG_NLS_ASCII=y
277CONFIG_NLS_ISO8859_1=y 283CONFIG_NLS_ISO8859_1=y
278CONFIG_NLS_ISO8859_15=m 284CONFIG_NLS_ISO8859_15=m
279CONFIG_NLS_UTF8=y 285CONFIG_NLS_UTF8=y
286CONFIG_DEBUG_FS=y
280CONFIG_MAGIC_SYSRQ=y 287CONFIG_MAGIC_SYSRQ=y
281# CONFIG_SCHED_DEBUG is not set 288# CONFIG_SCHED_DEBUG is not set
282CONFIG_PROVE_LOCKING=y 289CONFIG_PROVE_LOCKING=y
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index e9a49fe0284e..8b8b61685a34 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -212,6 +212,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *,
212static inline void __flush_icache_all(void) 212static inline void __flush_icache_all(void)
213{ 213{
214 __flush_icache_preferred(); 214 __flush_icache_preferred();
215 dsb();
215} 216}
216 217
217/* 218/*
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index 03243f7eeddf..85c60adc8b60 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -120,13 +120,16 @@
120/* 120/*
121 * 2nd stage PTE definitions for LPAE. 121 * 2nd stage PTE definitions for LPAE.
122 */ 122 */
123#define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x5) << 2) /* MemAttr[3:0] */ 123#define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x0) << 2) /* strongly ordered */
124#define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */ 124#define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* normal inner write-through */
125#define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */ 125#define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* normal inner write-back */
126#define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */ 126#define L_PTE_S2_MT_DEV_SHARED (_AT(pteval_t, 0x1) << 2) /* device */
127#define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ 127#define L_PTE_S2_MT_MASK (_AT(pteval_t, 0xf) << 2)
128 128
129#define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */ 129#define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */
130#define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
131
132#define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */
130 133
131/* 134/*
132 * Hyp-mode PL2 PTE definitions for LPAE. 135 * Hyp-mode PL2 PTE definitions for LPAE.
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index ef3c6072aa45..ac4bfae26702 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -37,18 +37,9 @@
37 37
38static inline void dsb_sev(void) 38static inline void dsb_sev(void)
39{ 39{
40#if __LINUX_ARM_ARCH__ >= 7 40
41 __asm__ __volatile__ ( 41 dsb(ishst);
42 "dsb ishst\n" 42 __asm__(SEV);
43 SEV
44 );
45#else
46 __asm__ __volatile__ (
47 "mcr p15, 0, %0, c7, c10, 4\n"
48 SEV
49 : : "r" (0)
50 );
51#endif
52} 43}
53 44
54/* 45/*
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index b0df9761de6d..1e8b030dbefd 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
731 kernel_data.end = virt_to_phys(_end - 1); 731 kernel_data.end = virt_to_phys(_end - 1);
732 732
733 for_each_memblock(memory, region) { 733 for_each_memblock(memory, region) {
734 res = memblock_virt_alloc_low(sizeof(*res), 0); 734 res = memblock_virt_alloc(sizeof(*res), 0);
735 res->name = "System RAM"; 735 res->name = "System RAM";
736 res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); 736 res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
737 res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; 737 res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index b1aa6a9b3bd1..af4f2dfda40c 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -16,12 +16,7 @@ config ARCH_BCM_MOBILE
16 select ARM_ERRATA_754322 16 select ARM_ERRATA_754322
17 select ARM_ERRATA_764369 if SMP 17 select ARM_ERRATA_764369 if SMP
18 select ARM_GIC 18 select ARM_GIC
19 select CPU_V7
20 select CLKSRC_OF
21 select GENERIC_CLOCKEVENTS
22 select GENERIC_TIME
23 select GPIO_BCM_KONA 19 select GPIO_BCM_KONA
24 select SPARSE_IRQ
25 select TICK_ONESHOT 20 select TICK_ONESHOT
26 select CACHE_L2X0 21 select CACHE_L2X0
27 select HAVE_ARM_ARCH_TIMER 22 select HAVE_ARM_ARCH_TIMER
diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig
index d1f9612f8c15..3a369350a26f 100644
--- a/arch/arm/mach-bcm2835/Kconfig
+++ b/arch/arm/mach-bcm2835/Kconfig
@@ -4,10 +4,6 @@ config ARCH_BCM2835
4 select ARM_AMBA 4 select ARM_AMBA
5 select ARM_ERRATA_411920 5 select ARM_ERRATA_411920
6 select ARM_TIMER_SP804 6 select ARM_TIMER_SP804
7 select CLKDEV_LOOKUP
8 select CLKSRC_OF
9 select CPU_V6
10 select GENERIC_CLOCKEVENTS
11 select PINCTRL 7 select PINCTRL
12 select PINCTRL_BCM2835 8 select PINCTRL_BCM2835
13 help 9 help
diff --git a/arch/arm/mach-berlin/Kconfig b/arch/arm/mach-berlin/Kconfig
index 7a02d222c378..b0cb0722acd2 100644
--- a/arch/arm/mach-berlin/Kconfig
+++ b/arch/arm/mach-berlin/Kconfig
@@ -1,9 +1,7 @@
1config ARCH_BERLIN 1config ARCH_BERLIN
2 bool "Marvell Berlin SoCs" if ARCH_MULTI_V7 2 bool "Marvell Berlin SoCs" if ARCH_MULTI_V7
3 select ARM_GIC 3 select ARM_GIC
4 select GENERIC_CLOCKEVENTS
5 select GENERIC_IRQ_CHIP 4 select GENERIC_IRQ_CHIP
6 select COMMON_CLK
7 select DW_APB_ICTL 5 select DW_APB_ICTL
8 select DW_APB_TIMER_OF 6 select DW_APB_TIMER_OF
9 7
@@ -16,12 +14,10 @@ config MACH_BERLIN_BG2
16 select CACHE_L2X0 14 select CACHE_L2X0
17 select CPU_PJ4B 15 select CPU_PJ4B
18 select HAVE_ARM_TWD if SMP 16 select HAVE_ARM_TWD if SMP
19 select HAVE_SMP
20 17
21config MACH_BERLIN_BG2CD 18config MACH_BERLIN_BG2CD
22 bool "Marvell Armada 1500-mini (BG2CD)" 19 bool "Marvell Armada 1500-mini (BG2CD)"
23 select CACHE_L2X0 20 select CACHE_L2X0
24 select CPU_V7
25 select HAVE_ARM_TWD if SMP 21 select HAVE_ARM_TWD if SMP
26 22
27endmenu 23endmenu
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig
index dbf0df8bb0ac..dce8decd5d46 100644
--- a/arch/arm/mach-cns3xxx/Kconfig
+++ b/arch/arm/mach-cns3xxx/Kconfig
@@ -1,9 +1,6 @@
1config ARCH_CNS3XXX 1config ARCH_CNS3XXX
2 bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6 2 bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
3 select ARM_GIC 3 select ARM_GIC
4 select CPU_V6K
5 select GENERIC_CLOCKEVENTS
6 select MIGHT_HAVE_CACHE_L2X0
7 select MIGHT_HAVE_PCI 4 select MIGHT_HAVE_PCI
8 select PCI_DOMAINS if PCI 5 select PCI_DOMAINS if PCI
9 help 6 help
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 0aded64a9ebc..830b76e70250 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -5,7 +5,6 @@ config ARCH_HIGHBANK
5 select ARCH_HAS_HOLES_MEMORYMODEL 5 select ARCH_HAS_HOLES_MEMORYMODEL
6 select ARCH_HAS_OPP 6 select ARCH_HAS_OPP
7 select ARCH_SUPPORTS_BIG_ENDIAN 7 select ARCH_SUPPORTS_BIG_ENDIAN
8 select ARCH_WANT_OPTIONAL_GPIOLIB
9 select ARM_AMBA 8 select ARM_AMBA
10 select ARM_ERRATA_764369 if SMP 9 select ARM_ERRATA_764369 if SMP
11 select ARM_ERRATA_775420 10 select ARM_ERRATA_775420
@@ -14,14 +13,8 @@ config ARCH_HIGHBANK
14 select ARM_PSCI 13 select ARM_PSCI
15 select ARM_TIMER_SP804 14 select ARM_TIMER_SP804
16 select CACHE_L2X0 15 select CACHE_L2X0
17 select COMMON_CLK
18 select CPU_V7
19 select GENERIC_CLOCKEVENTS
20 select HAVE_ARM_SCU 16 select HAVE_ARM_SCU
21 select HAVE_ARM_TWD if SMP 17 select HAVE_ARM_TWD if SMP
22 select HAVE_SMP
23 select MAILBOX 18 select MAILBOX
24 select PL320_MBOX 19 select PL320_MBOX
25 select SPARSE_IRQ
26 select USE_OF
27 select ZONE_DMA if ARM_LPAE 20 select ZONE_DMA if ARM_LPAE
diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig
index 1abae5f6a418..9d0a87b025e3 100644
--- a/arch/arm/mach-hisi/Kconfig
+++ b/arch/arm/mach-hisi/Kconfig
@@ -3,13 +3,9 @@ config ARCH_HI3xxx
3 select ARM_AMBA 3 select ARM_AMBA
4 select ARM_GIC 4 select ARM_GIC
5 select ARM_TIMER_SP804 5 select ARM_TIMER_SP804
6 select ARCH_WANT_OPTIONAL_GPIOLIB
7 select CACHE_L2X0 6 select CACHE_L2X0
8 select CLKSRC_OF
9 select GENERIC_CLOCKEVENTS
10 select HAVE_ARM_SCU 7 select HAVE_ARM_SCU
11 select HAVE_ARM_TWD if SMP 8 select HAVE_ARM_TWD if SMP
12 select HAVE_SMP
13 select PINCTRL 9 select PINCTRL
14 select PINCTRL_SINGLE 10 select PINCTRL_SINGLE
15 help 11 help
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 33567aa5880f..5740296dc429 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,19 +1,15 @@
1config ARCH_MXC 1config ARCH_MXC
2 bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 2 bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
3 select ARCH_HAS_CPUFREQ
4 select ARCH_HAS_OPP
3 select ARCH_REQUIRE_GPIOLIB 5 select ARCH_REQUIRE_GPIOLIB
4 select ARM_CPU_SUSPEND if PM 6 select ARM_CPU_SUSPEND if PM
5 select ARM_PATCH_PHYS_VIRT
6 select CLKSRC_MMIO 7 select CLKSRC_MMIO
7 select COMMON_CLK
8 select GENERIC_ALLOCATOR
9 select GENERIC_CLOCKEVENTS
10 select GENERIC_IRQ_CHIP 8 select GENERIC_IRQ_CHIP
11 select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
12 select MULTI_IRQ_HANDLER
13 select PINCTRL 9 select PINCTRL
10 select PM_OPP if PM
14 select SOC_BUS 11 select SOC_BUS
15 select SPARSE_IRQ 12 select SRAM
16 select USE_OF
17 help 13 help
18 Support for Freescale MXC/iMX-based family of processors 14 Support for Freescale MXC/iMX-based family of processors
19 15
@@ -121,18 +117,16 @@ config SOC_IMX31
121config SOC_IMX35 117config SOC_IMX35
122 bool 118 bool
123 select ARCH_MXC_IOMUX_V3 119 select ARCH_MXC_IOMUX_V3
124 select CPU_V6K
125 select HAVE_EPIT 120 select HAVE_EPIT
126 select MXC_AVIC 121 select MXC_AVIC
122 select PINCTRL_IMX35
127 select SMP_ON_UP if SMP 123 select SMP_ON_UP if SMP
128 select PINCTRL
129 124
130config SOC_IMX5 125config SOC_IMX5
131 bool 126 bool
132 select ARCH_HAS_CPUFREQ 127 select ARCH_HAS_CPUFREQ
133 select ARCH_HAS_OPP 128 select ARCH_HAS_OPP
134 select ARCH_MXC_IOMUX_V3 129 select ARCH_MXC_IOMUX_V3
135 select CPU_V7
136 select MXC_TZIC 130 select MXC_TZIC
137 131
138config SOC_IMX51 132config SOC_IMX51
@@ -777,65 +771,50 @@ config SOC_IMX50
777config SOC_IMX53 771config SOC_IMX53
778 bool "i.MX53 support" 772 bool "i.MX53 support"
779 select HAVE_IMX_SRC 773 select HAVE_IMX_SRC
780 select IMX_HAVE_PLATFORM_IMX2_WDT
781 select PINCTRL_IMX53 774 select PINCTRL_IMX53
782 select SOC_IMX5 775 select SOC_IMX5
783 776
784 help 777 help
785 This enables support for Freescale i.MX53 processor. 778 This enables support for Freescale i.MX53 processor.
786 779
787config SOC_IMX6Q 780config SOC_IMX6
788 bool "i.MX6 Quad/DualLite support" 781 bool
789 select ARCH_HAS_CPUFREQ
790 select ARCH_HAS_OPP
791 select ARM_ERRATA_754322 782 select ARM_ERRATA_754322
792 select ARM_ERRATA_764369 if SMP
793 select ARM_ERRATA_775420 783 select ARM_ERRATA_775420
794 select ARM_GIC 784 select ARM_GIC
795 select CPU_V7
796 select HAVE_ARM_SCU if SMP
797 select HAVE_ARM_TWD if SMP
798 select HAVE_IMX_ANATOP 785 select HAVE_IMX_ANATOP
799 select HAVE_IMX_GPC 786 select HAVE_IMX_GPC
800 select HAVE_IMX_MMDC 787 select HAVE_IMX_MMDC
801 select HAVE_IMX_SRC 788 select HAVE_IMX_SRC
802 select HAVE_SMP
803 select MFD_SYSCON 789 select MFD_SYSCON
804 select MIGHT_HAVE_PCI
805 select PCI_DOMAINS if PCI
806 select PINCTRL_IMX6Q
807 select PL310_ERRATA_588369 if CACHE_PL310 790 select PL310_ERRATA_588369 if CACHE_PL310
808 select PL310_ERRATA_727915 if CACHE_PL310 791 select PL310_ERRATA_727915 if CACHE_PL310
809 select PL310_ERRATA_769419 if CACHE_PL310 792 select PL310_ERRATA_769419 if CACHE_PL310
810 select PM_OPP if PM 793
794config SOC_IMX6Q
795 bool "i.MX6 Quad/DualLite support"
796 select ARM_ERRATA_764369 if SMP
797 select HAVE_ARM_SCU if SMP
798 select HAVE_ARM_TWD if SMP
799 select MIGHT_HAVE_PCI
800 select PCI_DOMAINS if PCI
801 select PINCTRL_IMX6Q
802 select SOC_IMX6
811 803
812 help 804 help
813 This enables support for Freescale i.MX6 Quad processor. 805 This enables support for Freescale i.MX6 Quad processor.
814 806
815config SOC_IMX6SL 807config SOC_IMX6SL
816 bool "i.MX6 SoloLite support" 808 bool "i.MX6 SoloLite support"
817 select ARM_ERRATA_754322
818 select ARM_ERRATA_775420
819 select ARM_GIC
820 select CPU_V7
821 select HAVE_IMX_ANATOP
822 select HAVE_IMX_GPC
823 select HAVE_IMX_MMDC
824 select HAVE_IMX_SRC
825 select MFD_SYSCON
826 select PINCTRL_IMX6SL 809 select PINCTRL_IMX6SL
827 select PL310_ERRATA_588369 if CACHE_PL310 810 select SOC_IMX6
828 select PL310_ERRATA_727915 if CACHE_PL310
829 select PL310_ERRATA_769419 if CACHE_PL310
830 811
831 help 812 help
832 This enables support for Freescale i.MX6 SoloLite processor. 813 This enables support for Freescale i.MX6 SoloLite processor.
833 814
834config SOC_VF610 815config SOC_VF610
835 bool "Vybrid Family VF610 support" 816 bool "Vybrid Family VF610 support"
836 select CPU_V7
837 select ARM_GIC 817 select ARM_GIC
838 select CLKSRC_OF
839 select PINCTRL_VF610 818 select PINCTRL_VF610
840 select VF_PIT_TIMER 819 select VF_PIT_TIMER
841 select PL310_ERRATA_588369 if CACHE_PL310 820 select PL310_ERRATA_588369 if CACHE_PL310
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index befcaf5d0574..f4ed83032dd0 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
30ifeq ($(CONFIG_CPU_IDLE),y) 30ifeq ($(CONFIG_CPU_IDLE),y)
31obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o 31obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o
32obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o 32obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
33obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o
33endif 34endif
34 35
35ifdef CONFIG_SND_IMX_SOC 36ifdef CONFIG_SND_IMX_SOC
@@ -101,11 +102,11 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
101obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o 102obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
102obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o 103obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
103 104
104ifeq ($(CONFIG_PM),y) 105ifeq ($(CONFIG_SUSPEND),y)
105obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o 106AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
106# i.MX6SL reuses i.MX6Q code 107obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o
107obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o
108endif 108endif
109obj-$(CONFIG_SOC_IMX6) += pm-imx6.o
109 110
110# i.MX5 based machines 111# i.MX5 based machines
111obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o 112obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index d7ed66091a2a..bdc2e4630a08 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -149,7 +149,6 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
149 clk_register_clkdev(clk[per1], "per", "imx-gpt.1"); 149 clk_register_clkdev(clk[per1], "per", "imx-gpt.1");
150 clk_register_clkdev(clk[gpt3_ipg_gate], "ipg", "imx-gpt.2"); 150 clk_register_clkdev(clk[gpt3_ipg_gate], "ipg", "imx-gpt.2");
151 clk_register_clkdev(clk[per1], "per", "imx-gpt.2"); 151 clk_register_clkdev(clk[per1], "per", "imx-gpt.2");
152 clk_register_clkdev(clk[pwm_ipg_gate], "pwm", "mxc_pwm.0");
153 clk_register_clkdev(clk[per2], "per", "imx21-cspi.0"); 152 clk_register_clkdev(clk[per2], "per", "imx21-cspi.0");
154 clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx21-cspi.0"); 153 clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx21-cspi.0");
155 clk_register_clkdev(clk[per2], "per", "imx21-cspi.1"); 154 clk_register_clkdev(clk[per2], "per", "imx21-cspi.1");
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 69858c78f40d..dc36e6c2f1da 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -265,14 +265,6 @@ int __init mx25_clocks_init(void)
265 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0"); 265 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0");
266 clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1"); 266 clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1");
267 clk_register_clkdev(clk[cspi3_ipg], NULL, "imx35-cspi.2"); 267 clk_register_clkdev(clk[cspi3_ipg], NULL, "imx35-cspi.2");
268 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.0");
269 clk_register_clkdev(clk[per10], "per", "mxc_pwm.0");
270 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.1");
271 clk_register_clkdev(clk[per10], "per", "mxc_pwm.1");
272 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.2");
273 clk_register_clkdev(clk[per10], "per", "mxc_pwm.2");
274 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.3");
275 clk_register_clkdev(clk[per10], "per", "mxc_pwm.3");
276 clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad"); 268 clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad");
277 clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc"); 269 clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc");
278 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0"); 270 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index c6b40f386786..d2da8908b268 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -231,7 +231,6 @@ int __init mx27_clocks_init(unsigned long fref)
231 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.4"); 231 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.4");
232 clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); 232 clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5");
233 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); 233 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5");
234 clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0");
235 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0"); 234 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0");
236 clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0"); 235 clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0");
237 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1"); 236 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1");
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index 19fca1fdc6fe..568ef0a4de84 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -266,8 +266,6 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
266 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_PER_GATE], "per", "imx51-ecspi.1"); 266 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_PER_GATE], "per", "imx51-ecspi.1");
267 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_IPG_GATE], "ipg", "imx51-ecspi.1"); 267 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_IPG_GATE], "ipg", "imx51-ecspi.1");
268 clk_register_clkdev(clk[IMX5_CLK_CSPI_IPG_GATE], NULL, "imx35-cspi.2"); 268 clk_register_clkdev(clk[IMX5_CLK_CSPI_IPG_GATE], NULL, "imx35-cspi.2");
269 clk_register_clkdev(clk[IMX5_CLK_PWM1_IPG_GATE], "pwm", "mxc_pwm.0");
270 clk_register_clkdev(clk[IMX5_CLK_PWM2_IPG_GATE], "pwm", "mxc_pwm.1");
271 clk_register_clkdev(clk[IMX5_CLK_I2C1_GATE], NULL, "imx21-i2c.0"); 269 clk_register_clkdev(clk[IMX5_CLK_I2C1_GATE], NULL, "imx21-i2c.0");
272 clk_register_clkdev(clk[IMX5_CLK_I2C2_GATE], NULL, "imx21-i2c.1"); 270 clk_register_clkdev(clk[IMX5_CLK_I2C2_GATE], NULL, "imx21-i2c.1");
273 clk_register_clkdev(clk[IMX5_CLK_USBOH3_PER_GATE], "per", "mxc-ehci.0"); 271 clk_register_clkdev(clk[IMX5_CLK_USBOH3_PER_GATE], "per", "mxc-ehci.0");
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 4d677f442539..b0e7f9d2c245 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -437,12 +437,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
437 437
438 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0"); 438 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0");
439 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); 439 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
440 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); 440 clk_register_clkdev(clk[enet_ref], "enet_ref", NULL);
441 clk_register_clkdev(clk[ahb], "ahb", NULL);
442 clk_register_clkdev(clk[cko1], "cko1", NULL);
443 clk_register_clkdev(clk[arm], NULL, "cpu0");
444 clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL);
445 clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL);
446 441
447 if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || 442 if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) ||
448 cpu_is_imx6dl()) { 443 cpu_is_imx6dl()) {
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index 4c86f3035205..f7073c0782fb 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2013 Freescale Semiconductor, Inc. 2 * Copyright 2013-2014 Freescale Semiconductor, Inc.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 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 as 5 * it under the terms of the GNU General Public License version 2 as
@@ -18,27 +18,43 @@
18#include "clk.h" 18#include "clk.h"
19#include "common.h" 19#include "common.h"
20 20
21static const char const *step_sels[] = { "osc", "pll2_pfd2", }; 21#define CCSR 0xc
22static const char const *pll1_sw_sels[] = { "pll1_sys", "step", }; 22#define BM_CCSR_PLL1_SW_CLK_SEL (1 << 2)
23static const char const *ocram_alt_sels[] = { "pll2_pfd2", "pll3_pfd1", }; 23#define CACRR 0x10
24static const char const *ocram_sels[] = { "periph", "ocram_alt_sels", }; 24#define CDHIPR 0x48
25static const char const *pre_periph_sels[] = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", }; 25#define BM_CDHIPR_ARM_PODF_BUSY (1 << 16)
26static const char const *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", "dummy", }; 26#define ARM_WAIT_DIV_396M 2
27static const char const *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", }; 27#define ARM_WAIT_DIV_792M 4
28static const char const *periph_sels[] = { "pre_periph_sel", "periph_clk2_podf", }; 28#define ARM_WAIT_DIV_996M 6
29static const char const *periph2_sels[] = { "pre_periph2_sel", "periph2_clk2_podf", }; 29
30static const char const *csi_lcdif_sels[] = { "mmdc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", }; 30#define PLL_ARM 0x0
31static const char const *usdhc_sels[] = { "pll2_pfd2", "pll2_pfd0", }; 31#define BM_PLL_ARM_DIV_SELECT (0x7f << 0)
32static const char const *ssi_sels[] = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", }; 32#define BM_PLL_ARM_POWERDOWN (1 << 12)
33static const char const *perclk_sels[] = { "ipg", "osc", }; 33#define BM_PLL_ARM_ENABLE (1 << 13)
34static const char const *epdc_pxp_sels[] = { "mmdc", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd1", }; 34#define BM_PLL_ARM_LOCK (1 << 31)
35static const char const *gpu2d_ovg_sels[] = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", }; 35#define PLL_ARM_DIV_792M 66
36static const char const *gpu2d_sels[] = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", }; 36
37static const char const *lcdif_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", }; 37static const char *step_sels[] = { "osc", "pll2_pfd2", };
38static const char const *epdc_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", }; 38static const char *pll1_sw_sels[] = { "pll1_sys", "step", };
39static const char const *audio_sels[] = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", }; 39static const char *ocram_alt_sels[] = { "pll2_pfd2", "pll3_pfd1", };
40static const char const *ecspi_sels[] = { "pll3_60m", "osc", }; 40static const char *ocram_sels[] = { "periph", "ocram_alt_sels", };
41static const char const *uart_sels[] = { "pll3_80m", "osc", }; 41static const char *pre_periph_sels[] = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", };
42static const char *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", "dummy", };
43static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", };
44static const char *periph_sels[] = { "pre_periph_sel", "periph_clk2_podf", };
45static const char *periph2_sels[] = { "pre_periph2_sel", "periph2_clk2_podf", };
46static const char *csi_lcdif_sels[] = { "mmdc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", };
47static const char *usdhc_sels[] = { "pll2_pfd2", "pll2_pfd0", };
48static const char *ssi_sels[] = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", };
49static const char *perclk_sels[] = { "ipg", "osc", };
50static const char *epdc_pxp_sels[] = { "mmdc", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd1", };
51static const char *gpu2d_ovg_sels[] = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", };
52static const char *gpu2d_sels[] = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", };
53static const char *lcdif_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", };
54static const char *epdc_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", };
55static const char *audio_sels[] = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", };
56static const char *ecspi_sels[] = { "pll3_60m", "osc", };
57static const char *uart_sels[] = { "pll3_80m", "osc", };
42 58
43static struct clk_div_table clk_enet_ref_table[] = { 59static struct clk_div_table clk_enet_ref_table[] = {
44 { .val = 0, .div = 20, }, 60 { .val = 0, .div = 20, },
@@ -65,6 +81,89 @@ static struct clk_div_table video_div_table[] = {
65 81
66static struct clk *clks[IMX6SL_CLK_END]; 82static struct clk *clks[IMX6SL_CLK_END];
67static struct clk_onecell_data clk_data; 83static struct clk_onecell_data clk_data;
84static void __iomem *ccm_base;
85static void __iomem *anatop_base;
86
87static const u32 clks_init_on[] __initconst = {
88 IMX6SL_CLK_IPG, IMX6SL_CLK_ARM, IMX6SL_CLK_MMDC_ROOT,
89};
90
91/*
92 * ERR005311 CCM: After exit from WAIT mode, unwanted interrupt(s) taken
93 * during WAIT mode entry process could cause cache memory
94 * corruption.
95 *
96 * Software workaround:
97 * To prevent this issue from occurring, software should ensure that the
98 * ARM to IPG clock ratio is less than 12:5 (that is < 2.4x), before
99 * entering WAIT mode.
100 *
101 * This function will set the ARM clk to max value within the 12:5 limit.
102 * As IPG clock is fixed at 66MHz(so ARM freq must not exceed 158.4MHz),
103 * ARM freq are one of below setpoints: 396MHz, 792MHz and 996MHz, since
104 * the clk APIs can NOT be called in idle thread(may cause kernel schedule
105 * as there is sleep function in PLL wait function), so here we just slow
106 * down ARM to below freq according to previous freq:
107 *
108 * run mode wait mode
109 * 396MHz -> 132MHz;
110 * 792MHz -> 158.4MHz;
111 * 996MHz -> 142.3MHz;
112 */
113static int imx6sl_get_arm_divider_for_wait(void)
114{
115 if (readl_relaxed(ccm_base + CCSR) & BM_CCSR_PLL1_SW_CLK_SEL) {
116 return ARM_WAIT_DIV_396M;
117 } else {
118 if ((readl_relaxed(anatop_base + PLL_ARM) &
119 BM_PLL_ARM_DIV_SELECT) == PLL_ARM_DIV_792M)
120 return ARM_WAIT_DIV_792M;
121 else
122 return ARM_WAIT_DIV_996M;
123 }
124}
125
126static void imx6sl_enable_pll_arm(bool enable)
127{
128 static u32 saved_pll_arm;
129 u32 val;
130
131 if (enable) {
132 saved_pll_arm = val = readl_relaxed(anatop_base + PLL_ARM);
133 val |= BM_PLL_ARM_ENABLE;
134 val &= ~BM_PLL_ARM_POWERDOWN;
135 writel_relaxed(val, anatop_base + PLL_ARM);
136 while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK))
137 ;
138 } else {
139 writel_relaxed(saved_pll_arm, anatop_base + PLL_ARM);
140 }
141}
142
143void imx6sl_set_wait_clk(bool enter)
144{
145 static unsigned long saved_arm_div;
146 int arm_div_for_wait = imx6sl_get_arm_divider_for_wait();
147
148 /*
149 * According to hardware design, arm podf change need
150 * PLL1 clock enabled.
151 */
152 if (arm_div_for_wait == ARM_WAIT_DIV_396M)
153 imx6sl_enable_pll_arm(true);
154
155 if (enter) {
156 saved_arm_div = readl_relaxed(ccm_base + CACRR);
157 writel_relaxed(arm_div_for_wait, ccm_base + CACRR);
158 } else {
159 writel_relaxed(saved_arm_div, ccm_base + CACRR);
160 }
161 while (__raw_readl(ccm_base + CDHIPR) & BM_CDHIPR_ARM_PODF_BUSY)
162 ;
163
164 if (arm_div_for_wait == ARM_WAIT_DIV_396M)
165 imx6sl_enable_pll_arm(false);
166}
68 167
69static void __init imx6sl_clocks_init(struct device_node *ccm_node) 168static void __init imx6sl_clocks_init(struct device_node *ccm_node)
70{ 169{
@@ -72,6 +171,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
72 void __iomem *base; 171 void __iomem *base;
73 int irq; 172 int irq;
74 int i; 173 int i;
174 int ret;
75 175
76 clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0); 176 clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
77 clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0); 177 clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
@@ -80,6 +180,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
80 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop"); 180 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop");
81 base = of_iomap(np, 0); 181 base = of_iomap(np, 0);
82 WARN_ON(!base); 182 WARN_ON(!base);
183 anatop_base = base;
83 184
84 /* type name parent base div_mask */ 185 /* type name parent base div_mask */
85 clks[IMX6SL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f); 186 clks[IMX6SL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f);
@@ -127,6 +228,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
127 np = ccm_node; 228 np = ccm_node;
128 base = of_iomap(np, 0); 229 base = of_iomap(np, 0);
129 WARN_ON(!base); 230 WARN_ON(!base);
231 ccm_base = base;
130 232
131 /* Reuse imx6q pm code */ 233 /* Reuse imx6q pm code */
132 imx6q_pm_set_ccm_base(base); 234 imx6q_pm_set_ccm_base(base);
@@ -258,6 +360,19 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
258 clk_register_clkdev(clks[IMX6SL_CLK_GPT], "ipg", "imx-gpt.0"); 360 clk_register_clkdev(clks[IMX6SL_CLK_GPT], "ipg", "imx-gpt.0");
259 clk_register_clkdev(clks[IMX6SL_CLK_GPT_SERIAL], "per", "imx-gpt.0"); 361 clk_register_clkdev(clks[IMX6SL_CLK_GPT_SERIAL], "per", "imx-gpt.0");
260 362
363 /* Ensure the AHB clk is at 132MHz. */
364 ret = clk_set_rate(clks[IMX6SL_CLK_AHB], 132000000);
365 if (ret)
366 pr_warn("%s: failed to set AHB clock rate %d!\n",
367 __func__, ret);
368
369 /*
370 * Make sure those always on clocks are enabled to maintain the correct
371 * usecount and enabling/disabling of parent PLLs.
372 */
373 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
374 clk_prepare_enable(clks[clks_init_on[i]]);
375
261 if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { 376 if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
262 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]); 377 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
263 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]); 378 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c
index ecd66d8e20b6..22dc3ee21fd4 100644
--- a/arch/arm/mach-imx/clk-vf610.c
+++ b/arch/arm/mach-imx/clk-vf610.c
@@ -63,25 +63,25 @@ static void __iomem *anatop_base;
63static void __iomem *ccm_base; 63static void __iomem *ccm_base;
64 64
65/* sources for multiplexer clocks, this is used multiple times */ 65/* sources for multiplexer clocks, this is used multiple times */
66static const char const *fast_sels[] = { "firc", "fxosc", }; 66static const char *fast_sels[] = { "firc", "fxosc", };
67static const char const *slow_sels[] = { "sirc_32k", "sxosc", }; 67static const char *slow_sels[] = { "sirc_32k", "sxosc", };
68static const char const *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; 68static const char *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", };
69static const char const *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; 69static const char *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", };
70static const char const *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", }; 70static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", };
71static const char const *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; 71static const char *ddr_sels[] = { "pll2_pfd2", "sys_sel", };
72static const char const *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; 72static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", };
73static const char const *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; 73static const char *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", };
74static const char const *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; 74static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", };
75static const char const *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; 75static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", };
76static const char const *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; 76static const char *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", };
77static const char const *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; 77static const char *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", };
78static const char const *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; 78static const char *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", };
79static const char const *dcu_sels[] = { "pll1_pfd2", "pll3_main", }; 79static const char *dcu_sels[] = { "pll1_pfd2", "pll3_main", };
80static const char const *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; 80static const char *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", };
81static const char const *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", }; 81static const char *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", };
82/* FTM counter clock source, not module clock */ 82/* FTM counter clock source, not module clock */
83static const char const *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; 83static const char *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", };
84static const char const *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; 84static const char *ftm_fix_sels[] = { "sxosc", "ipg_bus", };
85 85
86static struct clk_div_table pll4_main_div_table[] = { 86static struct clk_div_table pll4_main_div_table[] = {
87 { .val = 0, .div = 1 }, 87 { .val = 0, .div = 1 },
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index 59c3b9b26bb4..b5241ea76706 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved.
3 */ 3 */
4 4
5/* 5/*
@@ -116,7 +116,6 @@ void imx_enable_cpu(int cpu, bool enable);
116void imx_set_cpu_jump(int cpu, void *jump_addr); 116void imx_set_cpu_jump(int cpu, void *jump_addr);
117u32 imx_get_cpu_arg(int cpu); 117u32 imx_get_cpu_arg(int cpu);
118void imx_set_cpu_arg(int cpu, u32 arg); 118void imx_set_cpu_arg(int cpu, u32 arg);
119void v7_cpu_resume(void);
120#ifdef CONFIG_SMP 119#ifdef CONFIG_SMP
121void v7_secondary_startup(void); 120void v7_secondary_startup(void);
122void imx_scu_map_io(void); 121void imx_scu_map_io(void);
@@ -139,18 +138,28 @@ void imx_anatop_init(void);
139void imx_anatop_pre_suspend(void); 138void imx_anatop_pre_suspend(void);
140void imx_anatop_post_resume(void); 139void imx_anatop_post_resume(void);
141int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); 140int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
142void imx6q_set_chicken_bit(void); 141void imx6q_set_int_mem_clk_lpm(void);
142void imx6sl_set_wait_clk(bool enter);
143 143
144void imx_cpu_die(unsigned int cpu); 144void imx_cpu_die(unsigned int cpu);
145int imx_cpu_kill(unsigned int cpu); 145int imx_cpu_kill(unsigned int cpu);
146 146
147#ifdef CONFIG_PM 147#ifdef CONFIG_SUSPEND
148void v7_cpu_resume(void);
149void imx6_suspend(void __iomem *ocram_vbase);
150#else
151static inline void v7_cpu_resume(void) {}
152static inline void imx6_suspend(void __iomem *ocram_vbase) {}
153#endif
154
148void imx6q_pm_init(void); 155void imx6q_pm_init(void);
156void imx6dl_pm_init(void);
157void imx6sl_pm_init(void);
149void imx6q_pm_set_ccm_base(void __iomem *base); 158void imx6q_pm_set_ccm_base(void __iomem *base);
159
160#ifdef CONFIG_PM
150void imx5_pm_init(void); 161void imx5_pm_init(void);
151#else 162#else
152static inline void imx6q_pm_init(void) {}
153static inline void imx6q_pm_set_ccm_base(void __iomem *base) {}
154static inline void imx5_pm_init(void) {} 163static inline void imx5_pm_init(void) {}
155#endif 164#endif
156 165
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
index 23ddfb693b2d..6bcae0479049 100644
--- a/arch/arm/mach-imx/cpuidle-imx6q.c
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -68,8 +68,8 @@ int __init imx6q_cpuidle_init(void)
68 /* Need to enable SCU standby for entering WAIT modes */ 68 /* Need to enable SCU standby for entering WAIT modes */
69 imx_scu_standby_enable(); 69 imx_scu_standby_enable();
70 70
71 /* Set chicken bit to get a reliable WAIT mode support */ 71 /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */
72 imx6q_set_chicken_bit(); 72 imx6q_set_int_mem_clk_lpm();
73 73
74 return cpuidle_register(&imx6q_cpuidle_driver, NULL); 74 return cpuidle_register(&imx6q_cpuidle_driver, NULL);
75} 75}
diff --git a/arch/arm/mach-imx/cpuidle-imx6sl.c b/arch/arm/mach-imx/cpuidle-imx6sl.c
new file mode 100644
index 000000000000..d4b6b8171fa9
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6sl.c
@@ -0,0 +1,57 @@
1/*
2 * Copyright (C) 2014 Freescale Semiconductor, Inc.
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 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/cpuidle.h>
10#include <linux/module.h>
11#include <asm/cpuidle.h>
12#include <asm/proc-fns.h>
13
14#include "common.h"
15#include "cpuidle.h"
16
17static int imx6sl_enter_wait(struct cpuidle_device *dev,
18 struct cpuidle_driver *drv, int index)
19{
20 imx6q_set_lpm(WAIT_UNCLOCKED);
21 /*
22 * Software workaround for ERR005311, see function
23 * description for details.
24 */
25 imx6sl_set_wait_clk(true);
26 cpu_do_idle();
27 imx6sl_set_wait_clk(false);
28 imx6q_set_lpm(WAIT_CLOCKED);
29
30 return index;
31}
32
33static struct cpuidle_driver imx6sl_cpuidle_driver = {
34 .name = "imx6sl_cpuidle",
35 .owner = THIS_MODULE,
36 .states = {
37 /* WFI */
38 ARM_CPUIDLE_WFI_STATE,
39 /* WAIT */
40 {
41 .exit_latency = 50,
42 .target_residency = 75,
43 .flags = CPUIDLE_FLAG_TIME_VALID |
44 CPUIDLE_FLAG_TIMER_STOP,
45 .enter = imx6sl_enter_wait,
46 .name = "WAIT",
47 .desc = "Clock off",
48 },
49 },
50 .state_count = 2,
51 .safe_state_index = 0,
52};
53
54int __init imx6sl_cpuidle_init(void)
55{
56 return cpuidle_register(&imx6sl_cpuidle_driver, NULL);
57}
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index 786f98ecc145..24e33670417c 100644
--- a/arch/arm/mach-imx/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
@@ -13,6 +13,7 @@
13#ifdef CONFIG_CPU_IDLE 13#ifdef CONFIG_CPU_IDLE
14extern int imx5_cpuidle_init(void); 14extern int imx5_cpuidle_init(void);
15extern int imx6q_cpuidle_init(void); 15extern int imx6q_cpuidle_init(void);
16extern int imx6sl_cpuidle_init(void);
16#else 17#else
17static inline int imx5_cpuidle_init(void) 18static inline int imx5_cpuidle_init(void)
18{ 19{
@@ -22,4 +23,8 @@ static inline int imx6q_cpuidle_init(void)
22{ 23{
23 return 0; 24 return 0;
24} 25}
26static inline int imx6sl_cpuidle_init(void)
27{
28 return 0;
29}
25#endif 30#endif
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index 769563fdeaa0..61a114cddc39 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -83,7 +83,3 @@ extern const struct imx_spi_imx_data imx25_cspi_data[];
83#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) 83#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata)
84#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) 84#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata)
85#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) 85#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata)
86
87extern struct imx_mxc_pwm_data imx25_mxc_pwm_data[];
88#define imx25_add_mxc_pwm(id) \
89 imx_add_mxc_pwm(&imx25_mxc_pwm_data[id])
diff --git a/arch/arm/mach-imx/devices-imx51.h b/arch/arm/mach-imx/devices-imx51.h
index deee5baee88c..26389f35a2b2 100644
--- a/arch/arm/mach-imx/devices-imx51.h
+++ b/arch/arm/mach-imx/devices-imx51.h
@@ -57,10 +57,6 @@ extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[];
57#define imx51_add_imx2_wdt(id) \ 57#define imx51_add_imx2_wdt(id) \
58 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) 58 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id])
59 59
60extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[];
61#define imx51_add_mxc_pwm(id) \
62 imx_add_mxc_pwm(&imx51_mxc_pwm_data[id])
63
64extern const struct imx_imx_keypad_data imx51_imx_keypad_data; 60extern const struct imx_imx_keypad_data imx51_imx_keypad_data;
65#define imx51_add_imx_keypad(pdata) \ 61#define imx51_add_imx_keypad(pdata) \
66 imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) 62 imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index 68c74fb0373c..2d260a5a307c 100644
--- a/arch/arm/mach-imx/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
@@ -67,9 +67,6 @@ config IMX_HAVE_PLATFORM_MXC_MMC
67config IMX_HAVE_PLATFORM_MXC_NAND 67config IMX_HAVE_PLATFORM_MXC_NAND
68 bool 68 bool
69 69
70config IMX_HAVE_PLATFORM_MXC_PWM
71 bool
72
73config IMX_HAVE_PLATFORM_MXC_RNGA 70config IMX_HAVE_PLATFORM_MXC_RNGA
74 bool 71 bool
75 select ARCH_HAS_RNGA 72 select ARCH_HAS_RNGA
diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
index 67416fb1dc69..1cbc14cd80d1 100644
--- a/arch/arm/mach-imx/devices/Makefile
+++ b/arch/arm/mach-imx/devices/Makefile
@@ -23,7 +23,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
23obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o 23obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
24obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o 24obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
25obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o 25obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o
26obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o
27obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o 26obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o
28obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o 27obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o
29obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o 28obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index c13b76b9f6b3..61352a80bb59 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -290,15 +290,6 @@ struct imx_pata_imx_data {
290struct platform_device *__init imx_add_pata_imx( 290struct platform_device *__init imx_add_pata_imx(
291 const struct imx_pata_imx_data *data); 291 const struct imx_pata_imx_data *data);
292 292
293struct imx_mxc_pwm_data {
294 int id;
295 resource_size_t iobase;
296 resource_size_t iosize;
297 resource_size_t irq;
298};
299struct platform_device *__init imx_add_mxc_pwm(
300 const struct imx_mxc_pwm_data *data);
301
302/* mxc_rtc */ 293/* mxc_rtc */
303struct imx_mxc_rtc_data { 294struct imx_mxc_rtc_data {
304 const char *devid; 295 const char *devid;
diff --git a/arch/arm/mach-imx/devices/platform-mxc_pwm.c b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
deleted file mode 100644
index dcd289777687..000000000000
--- a/arch/arm/mach-imx/devices/platform-mxc_pwm.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include "../hardware.h"
10#include "devices-common.h"
11
12#define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \
13 { \
14 .id = _id, \
15 .iobase = soc ## _PWM ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_PWM ## _hwid, \
18 }
19#define imx_mxc_pwm_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size)
21
22#ifdef CONFIG_SOC_IMX21
23const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst =
24 imx_mxc_pwm_data_entry_single(MX21, 0, , SZ_4K);
25#endif /* ifdef CONFIG_SOC_IMX21 */
26
27#ifdef CONFIG_SOC_IMX25
28const struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst = {
29#define imx25_mxc_pwm_data_entry(_id, _hwid) \
30 imx_mxc_pwm_data_entry(MX25, _id, _hwid, SZ_16K)
31 imx25_mxc_pwm_data_entry(0, 1),
32 imx25_mxc_pwm_data_entry(1, 2),
33 imx25_mxc_pwm_data_entry(2, 3),
34 imx25_mxc_pwm_data_entry(3, 4),
35};
36#endif /* ifdef CONFIG_SOC_IMX25 */
37
38#ifdef CONFIG_SOC_IMX27
39const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst =
40 imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K);
41#endif /* ifdef CONFIG_SOC_IMX27 */
42
43#ifdef CONFIG_SOC_IMX51
44const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = {
45#define imx51_mxc_pwm_data_entry(_id, _hwid) \
46 imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K)
47 imx51_mxc_pwm_data_entry(0, 1),
48 imx51_mxc_pwm_data_entry(1, 2),
49};
50#endif /* ifdef CONFIG_SOC_IMX51 */
51
52struct platform_device *__init imx_add_mxc_pwm(
53 const struct imx_mxc_pwm_data *data)
54{
55 struct resource res[] = {
56 {
57 .start = data->iobase,
58 .end = data->iobase + data->iosize - 1,
59 .flags = IORESOURCE_MEM,
60 }, {
61 .start = data->irq,
62 .end = data->irq,
63 .flags = IORESOURCE_IRQ,
64 },
65 };
66
67 return imx_add_platform_device("mxc_pwm", data->id,
68 res, ARRAY_SIZE(res), NULL, 0);
69}
diff --git a/arch/arm/mach-imx/hardware.h b/arch/arm/mach-imx/hardware.h
index a3b0b04b45c9..abf43bb47eca 100644
--- a/arch/arm/mach-imx/hardware.h
+++ b/arch/arm/mach-imx/hardware.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2007, 2014 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -20,7 +20,9 @@
20#ifndef __ASM_ARCH_MXC_HARDWARE_H__ 20#ifndef __ASM_ARCH_MXC_HARDWARE_H__
21#define __ASM_ARCH_MXC_HARDWARE_H__ 21#define __ASM_ARCH_MXC_HARDWARE_H__
22 22
23#ifndef __ASSEMBLY__
23#include <asm/io.h> 24#include <asm/io.h>
25#endif
24#include <asm/sizes.h> 26#include <asm/sizes.h>
25 27
26#define addr_in_module(addr, mod) \ 28#define addr_in_module(addr, mod) \
diff --git a/arch/arm/mach-imx/headsmp.S b/arch/arm/mach-imx/headsmp.S
index 627f16f0e9d1..de5047c8a6c8 100644
--- a/arch/arm/mach-imx/headsmp.S
+++ b/arch/arm/mach-imx/headsmp.S
@@ -12,12 +12,7 @@
12 12
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <asm/asm-offsets.h>
16#include <asm/hardware/cache-l2x0.h>
17 15
18 .section ".text.head", "ax"
19
20#ifdef CONFIG_SMP
21diag_reg_offset: 16diag_reg_offset:
22 .word g_diag_reg - . 17 .word g_diag_reg - .
23 18
@@ -34,38 +29,3 @@ ENTRY(v7_secondary_startup)
34 set_diag_reg 29 set_diag_reg
35 b secondary_startup 30 b secondary_startup
36ENDPROC(v7_secondary_startup) 31ENDPROC(v7_secondary_startup)
37#endif
38
39#ifdef CONFIG_ARM_CPU_SUSPEND
40/*
41 * The following code must assume it is running from physical address
42 * where absolute virtual addresses to the data section have to be
43 * turned into relative ones.
44 */
45
46#ifdef CONFIG_CACHE_L2X0
47 .macro pl310_resume
48 adr r0, l2x0_saved_regs_offset
49 ldr r2, [r0]
50 add r2, r2, r0
51 ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
52 ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
53 str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
54 mov r1, #0x1
55 str r1, [r0, #L2X0_CTRL] @ re-enable L2
56 .endm
57
58l2x0_saved_regs_offset:
59 .word l2x0_saved_regs - .
60
61#else
62 .macro pl310_resume
63 .endm
64#endif
65
66ENTRY(v7_cpu_resume)
67 bl v7_invalidate_l1
68 pl310_resume
69 b cpu_resume
70ENDPROC(v7_cpu_resume)
71#endif
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 76e5db4fce35..e60456d85c9d 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -182,16 +182,83 @@ static void __init imx6q_enet_phy_init(void)
182 182
183static void __init imx6q_1588_init(void) 183static void __init imx6q_1588_init(void)
184{ 184{
185 struct device_node *np;
186 struct clk *ptp_clk;
187 struct clk *enet_ref;
185 struct regmap *gpr; 188 struct regmap *gpr;
189 u32 clksel;
186 190
191 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-fec");
192 if (!np) {
193 pr_warn("%s: failed to find fec node\n", __func__);
194 return;
195 }
196
197 ptp_clk = of_clk_get(np, 2);
198 if (IS_ERR(ptp_clk)) {
199 pr_warn("%s: failed to get ptp clock\n", __func__);
200 goto put_node;
201 }
202
203 enet_ref = clk_get_sys(NULL, "enet_ref");
204 if (IS_ERR(enet_ref)) {
205 pr_warn("%s: failed to get enet clock\n", __func__);
206 goto put_ptp_clk;
207 }
208
209 /*
210 * If enet_ref from ANATOP/CCM is the PTP clock source, we need to
211 * set bit IOMUXC_GPR1[21]. Or the PTP clock must be from pad
212 * (external OSC), and we need to clear the bit.
213 */
214 clksel = ptp_clk == enet_ref ? IMX6Q_GPR1_ENET_CLK_SEL_ANATOP :
215 IMX6Q_GPR1_ENET_CLK_SEL_PAD;
187 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); 216 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
188 if (!IS_ERR(gpr)) 217 if (!IS_ERR(gpr))
189 regmap_update_bits(gpr, IOMUXC_GPR1, 218 regmap_update_bits(gpr, IOMUXC_GPR1,
190 IMX6Q_GPR1_ENET_CLK_SEL_MASK, 219 IMX6Q_GPR1_ENET_CLK_SEL_MASK,
191 IMX6Q_GPR1_ENET_CLK_SEL_ANATOP); 220 clksel);
192 else 221 else
193 pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); 222 pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
194 223
224 clk_put(enet_ref);
225put_ptp_clk:
226 clk_put(ptp_clk);
227put_node:
228 of_node_put(np);
229}
230
231static void __init imx6q_axi_init(void)
232{
233 struct regmap *gpr;
234 unsigned int mask;
235
236 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
237 if (!IS_ERR(gpr)) {
238 /*
239 * Enable the cacheable attribute of VPU and IPU
240 * AXI transactions.
241 */
242 mask = IMX6Q_GPR4_VPU_WR_CACHE_SEL |
243 IMX6Q_GPR4_VPU_RD_CACHE_SEL |
244 IMX6Q_GPR4_VPU_P_WR_CACHE_VAL |
245 IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK |
246 IMX6Q_GPR4_IPU_WR_CACHE_CTL |
247 IMX6Q_GPR4_IPU_RD_CACHE_CTL;
248 regmap_update_bits(gpr, IOMUXC_GPR4, mask, mask);
249
250 /* Increase IPU read QoS priority */
251 regmap_update_bits(gpr, IOMUXC_GPR6,
252 IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK |
253 IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK,
254 (0xf << 16) | (0x7 << 20));
255 regmap_update_bits(gpr, IOMUXC_GPR7,
256 IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK |
257 IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK,
258 (0xf << 16) | (0x7 << 20));
259 } else {
260 pr_warn("failed to find fsl,imx6q-iomuxc-gpr regmap\n");
261 }
195} 262}
196 263
197static void __init imx6q_init_machine(void) 264static void __init imx6q_init_machine(void)
@@ -212,15 +279,18 @@ static void __init imx6q_init_machine(void)
212 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); 279 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
213 280
214 imx_anatop_init(); 281 imx_anatop_init();
215 imx6q_pm_init(); 282 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
216 imx6q_1588_init(); 283 imx6q_1588_init();
284 imx6q_axi_init();
217} 285}
218 286
219#define OCOTP_CFG3 0x440 287#define OCOTP_CFG3 0x440
220#define OCOTP_CFG3_SPEED_SHIFT 16 288#define OCOTP_CFG3_SPEED_SHIFT 16
221#define OCOTP_CFG3_SPEED_1P2GHZ 0x3 289#define OCOTP_CFG3_SPEED_1P2GHZ 0x3
290#define OCOTP_CFG3_SPEED_996MHZ 0x2
291#define OCOTP_CFG3_SPEED_852MHZ 0x1
222 292
223static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev) 293static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev)
224{ 294{
225 struct device_node *np; 295 struct device_node *np;
226 void __iomem *base; 296 void __iomem *base;
@@ -238,11 +308,29 @@ static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev)
238 goto put_node; 308 goto put_node;
239 } 309 }
240 310
311 /*
312 * SPEED_GRADING[1:0] defines the max speed of ARM:
313 * 2b'11: 1200000000Hz;
314 * 2b'10: 996000000Hz;
315 * 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz.
316 * 2b'00: 792000000Hz;
317 * We need to set the max speed of ARM according to fuse map.
318 */
241 val = readl_relaxed(base + OCOTP_CFG3); 319 val = readl_relaxed(base + OCOTP_CFG3);
242 val >>= OCOTP_CFG3_SPEED_SHIFT; 320 val >>= OCOTP_CFG3_SPEED_SHIFT;
243 if ((val & 0x3) != OCOTP_CFG3_SPEED_1P2GHZ) 321 val &= 0x3;
322
323 if (val != OCOTP_CFG3_SPEED_1P2GHZ)
244 if (dev_pm_opp_disable(cpu_dev, 1200000000)) 324 if (dev_pm_opp_disable(cpu_dev, 1200000000))
245 pr_warn("failed to disable 1.2 GHz OPP\n"); 325 pr_warn("failed to disable 1.2 GHz OPP\n");
326 if (val < OCOTP_CFG3_SPEED_996MHZ)
327 if (dev_pm_opp_disable(cpu_dev, 996000000))
328 pr_warn("failed to disable 996 MHz OPP\n");
329 if (cpu_is_imx6q()) {
330 if (val != OCOTP_CFG3_SPEED_852MHZ)
331 if (dev_pm_opp_disable(cpu_dev, 852000000))
332 pr_warn("failed to disable 852 MHz OPP\n");
333 }
246 334
247put_node: 335put_node:
248 of_node_put(np); 336 of_node_put(np);
@@ -268,7 +356,7 @@ static void __init imx6q_opp_init(void)
268 goto put_node; 356 goto put_node;
269 } 357 }
270 358
271 imx6q_opp_check_1p2ghz(cpu_dev); 359 imx6q_opp_check_speed_grading(cpu_dev);
272 360
273put_node: 361put_node:
274 of_node_put(np); 362 of_node_put(np);
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
index 0f4fd4c0ab8e..ad323385115c 100644
--- a/arch/arm/mach-imx/mach-imx6sl.c
+++ b/arch/arm/mach-imx/mach-imx6sl.c
@@ -17,6 +17,7 @@
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18 18
19#include "common.h" 19#include "common.h"
20#include "cpuidle.h"
20 21
21static void __init imx6sl_fec_init(void) 22static void __init imx6sl_fec_init(void)
22{ 23{
@@ -39,6 +40,8 @@ static void __init imx6sl_init_late(void)
39 /* imx6sl reuses imx6q cpufreq driver */ 40 /* imx6sl reuses imx6q cpufreq driver */
40 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) 41 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
41 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); 42 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
43
44 imx6sl_cpuidle_init();
42} 45}
43 46
44static void __init imx6sl_init_machine(void) 47static void __init imx6sl_init_machine(void)
@@ -55,8 +58,7 @@ static void __init imx6sl_init_machine(void)
55 58
56 imx6sl_fec_init(); 59 imx6sl_fec_init();
57 imx_anatop_init(); 60 imx_anatop_init();
58 /* Reuse imx6q pm code */ 61 imx6sl_pm_init();
59 imx6q_pm_init();
60} 62}
61 63
62static void __init imx6sl_init_irq(void) 64static void __init imx6sl_init_irq(void)
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
new file mode 100644
index 000000000000..16f0d249f6a7
--- /dev/null
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -0,0 +1,552 @@
1/*
2 * Copyright 2011-2014 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/delay.h>
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/genalloc.h>
18#include <linux/mfd/syscon.h>
19#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22#include <linux/of_platform.h>
23#include <linux/regmap.h>
24#include <linux/suspend.h>
25#include <asm/cacheflush.h>
26#include <asm/fncpy.h>
27#include <asm/proc-fns.h>
28#include <asm/suspend.h>
29#include <asm/tlb.h>
30
31#include "common.h"
32#include "hardware.h"
33
34#define CCR 0x0
35#define BM_CCR_WB_COUNT (0x7 << 16)
36#define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21)
37#define BM_CCR_RBC_EN (0x1 << 27)
38
39#define CLPCR 0x54
40#define BP_CLPCR_LPM 0
41#define BM_CLPCR_LPM (0x3 << 0)
42#define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2)
43#define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5)
44#define BM_CLPCR_SBYOS (0x1 << 6)
45#define BM_CLPCR_DIS_REF_OSC (0x1 << 7)
46#define BM_CLPCR_VSTBY (0x1 << 8)
47#define BP_CLPCR_STBY_COUNT 9
48#define BM_CLPCR_STBY_COUNT (0x3 << 9)
49#define BM_CLPCR_COSC_PWRDOWN (0x1 << 11)
50#define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16)
51#define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17)
52#define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19)
53#define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21)
54#define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22)
55#define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23)
56#define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24)
57#define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25)
58#define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26)
59#define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27)
60
61#define CGPR 0x64
62#define BM_CGPR_INT_MEM_CLK_LPM (0x1 << 17)
63
64#define MX6Q_SUSPEND_OCRAM_SIZE 0x1000
65#define MX6_MAX_MMDC_IO_NUM 33
66
67static void __iomem *ccm_base;
68static void __iomem *suspend_ocram_base;
69static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
70
71/*
72 * suspend ocram space layout:
73 * ======================== high address ======================
74 * .
75 * .
76 * .
77 * ^
78 * ^
79 * ^
80 * imx6_suspend code
81 * PM_INFO structure(imx6_cpu_pm_info)
82 * ======================== low address =======================
83 */
84
85struct imx6_pm_base {
86 phys_addr_t pbase;
87 void __iomem *vbase;
88};
89
90struct imx6_pm_socdata {
91 u32 cpu_type;
92 const char *mmdc_compat;
93 const char *src_compat;
94 const char *iomuxc_compat;
95 const char *gpc_compat;
96 const u32 mmdc_io_num;
97 const u32 *mmdc_io_offset;
98};
99
100static const u32 imx6q_mmdc_io_offset[] __initconst = {
101 0x5ac, 0x5b4, 0x528, 0x520, /* DQM0 ~ DQM3 */
102 0x514, 0x510, 0x5bc, 0x5c4, /* DQM4 ~ DQM7 */
103 0x56c, 0x578, 0x588, 0x594, /* CAS, RAS, SDCLK_0, SDCLK_1 */
104 0x5a8, 0x5b0, 0x524, 0x51c, /* SDQS0 ~ SDQS3 */
105 0x518, 0x50c, 0x5b8, 0x5c0, /* SDQS4 ~ SDQS7 */
106 0x784, 0x788, 0x794, 0x79c, /* GPR_B0DS ~ GPR_B3DS */
107 0x7a0, 0x7a4, 0x7a8, 0x748, /* GPR_B4DS ~ GPR_B7DS */
108 0x59c, 0x5a0, 0x750, 0x774, /* SODT0, SODT1, MODE_CTL, MODE */
109 0x74c, /* GPR_ADDS */
110};
111
112static const u32 imx6dl_mmdc_io_offset[] __initconst = {
113 0x470, 0x474, 0x478, 0x47c, /* DQM0 ~ DQM3 */
114 0x480, 0x484, 0x488, 0x48c, /* DQM4 ~ DQM7 */
115 0x464, 0x490, 0x4ac, 0x4b0, /* CAS, RAS, SDCLK_0, SDCLK_1 */
116 0x4bc, 0x4c0, 0x4c4, 0x4c8, /* DRAM_SDQS0 ~ DRAM_SDQS3 */
117 0x4cc, 0x4d0, 0x4d4, 0x4d8, /* DRAM_SDQS4 ~ DRAM_SDQS7 */
118 0x764, 0x770, 0x778, 0x77c, /* GPR_B0DS ~ GPR_B3DS */
119 0x780, 0x784, 0x78c, 0x748, /* GPR_B4DS ~ GPR_B7DS */
120 0x4b4, 0x4b8, 0x750, 0x760, /* SODT0, SODT1, MODE_CTL, MODE */
121 0x74c, /* GPR_ADDS */
122};
123
124static const u32 imx6sl_mmdc_io_offset[] __initconst = {
125 0x30c, 0x310, 0x314, 0x318, /* DQM0 ~ DQM3 */
126 0x5c4, 0x5cc, 0x5d4, 0x5d8, /* GPR_B0DS ~ GPR_B3DS */
127 0x300, 0x31c, 0x338, 0x5ac, /* CAS, RAS, SDCLK_0, GPR_ADDS */
128 0x33c, 0x340, 0x5b0, 0x5c0, /* SODT0, SODT1, MODE_CTL, MODE */
129 0x330, 0x334, 0x320, /* SDCKE0, SDCKE1, RESET */
130};
131
132static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
133 .cpu_type = MXC_CPU_IMX6Q,
134 .mmdc_compat = "fsl,imx6q-mmdc",
135 .src_compat = "fsl,imx6q-src",
136 .iomuxc_compat = "fsl,imx6q-iomuxc",
137 .gpc_compat = "fsl,imx6q-gpc",
138 .mmdc_io_num = ARRAY_SIZE(imx6q_mmdc_io_offset),
139 .mmdc_io_offset = imx6q_mmdc_io_offset,
140};
141
142static const struct imx6_pm_socdata imx6dl_pm_data __initconst = {
143 .cpu_type = MXC_CPU_IMX6DL,
144 .mmdc_compat = "fsl,imx6q-mmdc",
145 .src_compat = "fsl,imx6q-src",
146 .iomuxc_compat = "fsl,imx6dl-iomuxc",
147 .gpc_compat = "fsl,imx6q-gpc",
148 .mmdc_io_num = ARRAY_SIZE(imx6dl_mmdc_io_offset),
149 .mmdc_io_offset = imx6dl_mmdc_io_offset,
150};
151
152static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
153 .cpu_type = MXC_CPU_IMX6SL,
154 .mmdc_compat = "fsl,imx6sl-mmdc",
155 .src_compat = "fsl,imx6sl-src",
156 .iomuxc_compat = "fsl,imx6sl-iomuxc",
157 .gpc_compat = "fsl,imx6sl-gpc",
158 .mmdc_io_num = ARRAY_SIZE(imx6sl_mmdc_io_offset),
159 .mmdc_io_offset = imx6sl_mmdc_io_offset,
160};
161
162/*
163 * This structure is for passing necessary data for low level ocram
164 * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct
165 * definition is changed, the offset definition in
166 * arch/arm/mach-imx/suspend-imx6.S must be also changed accordingly,
167 * otherwise, the suspend to ocram function will be broken!
168 */
169struct imx6_cpu_pm_info {
170 phys_addr_t pbase; /* The physical address of pm_info. */
171 phys_addr_t resume_addr; /* The physical resume address for asm code */
172 u32 cpu_type;
173 u32 pm_info_size; /* Size of pm_info. */
174 struct imx6_pm_base mmdc_base;
175 struct imx6_pm_base src_base;
176 struct imx6_pm_base iomuxc_base;
177 struct imx6_pm_base ccm_base;
178 struct imx6_pm_base gpc_base;
179 struct imx6_pm_base l2_base;
180 u32 mmdc_io_num; /* Number of MMDC IOs which need saved/restored. */
181 u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */
182} __aligned(8);
183
184void imx6q_set_int_mem_clk_lpm(void)
185{
186 u32 val = readl_relaxed(ccm_base + CGPR);
187
188 val |= BM_CGPR_INT_MEM_CLK_LPM;
189 writel_relaxed(val, ccm_base + CGPR);
190}
191
192static void imx6q_enable_rbc(bool enable)
193{
194 u32 val;
195
196 /*
197 * need to mask all interrupts in GPC before
198 * operating RBC configurations
199 */
200 imx_gpc_mask_all();
201
202 /* configure RBC enable bit */
203 val = readl_relaxed(ccm_base + CCR);
204 val &= ~BM_CCR_RBC_EN;
205 val |= enable ? BM_CCR_RBC_EN : 0;
206 writel_relaxed(val, ccm_base + CCR);
207
208 /* configure RBC count */
209 val = readl_relaxed(ccm_base + CCR);
210 val &= ~BM_CCR_RBC_BYPASS_COUNT;
211 val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0;
212 writel(val, ccm_base + CCR);
213
214 /*
215 * need to delay at least 2 cycles of CKIL(32K)
216 * due to hardware design requirement, which is
217 * ~61us, here we use 65us for safe
218 */
219 udelay(65);
220
221 /* restore GPC interrupt mask settings */
222 imx_gpc_restore_all();
223}
224
225static void imx6q_enable_wb(bool enable)
226{
227 u32 val;
228
229 /* configure well bias enable bit */
230 val = readl_relaxed(ccm_base + CLPCR);
231 val &= ~BM_CLPCR_WB_PER_AT_LPM;
232 val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0;
233 writel_relaxed(val, ccm_base + CLPCR);
234
235 /* configure well bias count */
236 val = readl_relaxed(ccm_base + CCR);
237 val &= ~BM_CCR_WB_COUNT;
238 val |= enable ? BM_CCR_WB_COUNT : 0;
239 writel_relaxed(val, ccm_base + CCR);
240}
241
242int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
243{
244 struct irq_desc *iomuxc_irq_desc;
245 u32 val = readl_relaxed(ccm_base + CLPCR);
246
247 val &= ~BM_CLPCR_LPM;
248 switch (mode) {
249 case WAIT_CLOCKED:
250 break;
251 case WAIT_UNCLOCKED:
252 val |= 0x1 << BP_CLPCR_LPM;
253 val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
254 break;
255 case STOP_POWER_ON:
256 val |= 0x2 << BP_CLPCR_LPM;
257 break;
258 case WAIT_UNCLOCKED_POWER_OFF:
259 val |= 0x1 << BP_CLPCR_LPM;
260 val &= ~BM_CLPCR_VSTBY;
261 val &= ~BM_CLPCR_SBYOS;
262 break;
263 case STOP_POWER_OFF:
264 val |= 0x2 << BP_CLPCR_LPM;
265 val |= 0x3 << BP_CLPCR_STBY_COUNT;
266 val |= BM_CLPCR_VSTBY;
267 val |= BM_CLPCR_SBYOS;
268 if (cpu_is_imx6sl()) {
269 val |= BM_CLPCR_BYPASS_PMIC_READY;
270 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
271 } else {
272 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
273 }
274 break;
275 default:
276 return -EINVAL;
277 }
278
279 /*
280 * ERR007265: CCM: When improper low-power sequence is used,
281 * the SoC enters low power mode before the ARM core executes WFI.
282 *
283 * Software workaround:
284 * 1) Software should trigger IRQ #32 (IOMUX) to be always pending
285 * by setting IOMUX_GPR1_GINT.
286 * 2) Software should then unmask IRQ #32 in GPC before setting CCM
287 * Low-Power mode.
288 * 3) Software should mask IRQ #32 right after CCM Low-Power mode
289 * is set (set bits 0-1 of CCM_CLPCR).
290 */
291 iomuxc_irq_desc = irq_to_desc(32);
292 imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data);
293 writel_relaxed(val, ccm_base + CLPCR);
294 imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data);
295
296 return 0;
297}
298
299static int imx6q_suspend_finish(unsigned long val)
300{
301 if (!imx6_suspend_in_ocram_fn) {
302 cpu_do_idle();
303 } else {
304 /*
305 * call low level suspend function in ocram,
306 * as we need to float DDR IO.
307 */
308 local_flush_tlb_all();
309 imx6_suspend_in_ocram_fn(suspend_ocram_base);
310 }
311
312 return 0;
313}
314
315static int imx6q_pm_enter(suspend_state_t state)
316{
317 switch (state) {
318 case PM_SUSPEND_MEM:
319 imx6q_set_lpm(STOP_POWER_OFF);
320 imx6q_enable_wb(true);
321 /*
322 * For suspend into ocram, asm code already take care of
323 * RBC setting, so we do NOT need to do that here.
324 */
325 if (!imx6_suspend_in_ocram_fn)
326 imx6q_enable_rbc(true);
327 imx_gpc_pre_suspend();
328 imx_anatop_pre_suspend();
329 imx_set_cpu_jump(0, v7_cpu_resume);
330 /* Zzz ... */
331 cpu_suspend(0, imx6q_suspend_finish);
332 if (cpu_is_imx6q() || cpu_is_imx6dl())
333 imx_smp_prepare();
334 imx_anatop_post_resume();
335 imx_gpc_post_resume();
336 imx6q_enable_rbc(false);
337 imx6q_enable_wb(false);
338 imx6q_set_lpm(WAIT_CLOCKED);
339 break;
340 default:
341 return -EINVAL;
342 }
343
344 return 0;
345}
346
347static const struct platform_suspend_ops imx6q_pm_ops = {
348 .enter = imx6q_pm_enter,
349 .valid = suspend_valid_only_mem,
350};
351
352void __init imx6q_pm_set_ccm_base(void __iomem *base)
353{
354 ccm_base = base;
355}
356
357static int __init imx6_pm_get_base(struct imx6_pm_base *base,
358 const char *compat)
359{
360 struct device_node *node;
361 struct resource res;
362 int ret = 0;
363
364 node = of_find_compatible_node(NULL, NULL, compat);
365 if (!node) {
366 ret = -ENODEV;
367 goto out;
368 }
369
370 ret = of_address_to_resource(node, 0, &res);
371 if (ret)
372 goto put_node;
373
374 base->pbase = res.start;
375 base->vbase = ioremap(res.start, resource_size(&res));
376 if (!base->vbase)
377 ret = -ENOMEM;
378
379put_node:
380 of_node_put(node);
381out:
382 return ret;
383}
384
385static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
386{
387 phys_addr_t ocram_pbase;
388 struct device_node *node;
389 struct platform_device *pdev;
390 struct imx6_cpu_pm_info *pm_info;
391 struct gen_pool *ocram_pool;
392 unsigned long ocram_base;
393 int i, ret = 0;
394 const u32 *mmdc_offset_array;
395
396 suspend_set_ops(&imx6q_pm_ops);
397
398 if (!socdata) {
399 pr_warn("%s: invalid argument!\n", __func__);
400 return -EINVAL;
401 }
402
403 node = of_find_compatible_node(NULL, NULL, "mmio-sram");
404 if (!node) {
405 pr_warn("%s: failed to find ocram node!\n", __func__);
406 return -ENODEV;
407 }
408
409 pdev = of_find_device_by_node(node);
410 if (!pdev) {
411 pr_warn("%s: failed to find ocram device!\n", __func__);
412 ret = -ENODEV;
413 goto put_node;
414 }
415
416 ocram_pool = dev_get_gen_pool(&pdev->dev);
417 if (!ocram_pool) {
418 pr_warn("%s: ocram pool unavailable!\n", __func__);
419 ret = -ENODEV;
420 goto put_node;
421 }
422
423 ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
424 if (!ocram_base) {
425 pr_warn("%s: unable to alloc ocram!\n", __func__);
426 ret = -ENOMEM;
427 goto put_node;
428 }
429
430 ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
431
432 suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
433 MX6Q_SUSPEND_OCRAM_SIZE, false);
434
435 pm_info = suspend_ocram_base;
436 pm_info->pbase = ocram_pbase;
437 pm_info->resume_addr = virt_to_phys(v7_cpu_resume);
438 pm_info->pm_info_size = sizeof(*pm_info);
439
440 /*
441 * ccm physical address is not used by asm code currently,
442 * so get ccm virtual address directly, as we already have
443 * it from ccm driver.
444 */
445 pm_info->ccm_base.vbase = ccm_base;
446
447 ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
448 if (ret) {
449 pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
450 goto put_node;
451 }
452
453 ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
454 if (ret) {
455 pr_warn("%s: failed to get src base %d!\n", __func__, ret);
456 goto src_map_failed;
457 }
458
459 ret = imx6_pm_get_base(&pm_info->iomuxc_base, socdata->iomuxc_compat);
460 if (ret) {
461 pr_warn("%s: failed to get iomuxc base %d!\n", __func__, ret);
462 goto iomuxc_map_failed;
463 }
464
465 ret = imx6_pm_get_base(&pm_info->gpc_base, socdata->gpc_compat);
466 if (ret) {
467 pr_warn("%s: failed to get gpc base %d!\n", __func__, ret);
468 goto gpc_map_failed;
469 }
470
471 ret = imx6_pm_get_base(&pm_info->l2_base, "arm,pl310-cache");
472 if (ret) {
473 pr_warn("%s: failed to get pl310-cache base %d!\n",
474 __func__, ret);
475 goto pl310_cache_map_failed;
476 }
477
478 pm_info->cpu_type = socdata->cpu_type;
479 pm_info->mmdc_io_num = socdata->mmdc_io_num;
480 mmdc_offset_array = socdata->mmdc_io_offset;
481
482 for (i = 0; i < pm_info->mmdc_io_num; i++) {
483 pm_info->mmdc_io_val[i][0] =
484 mmdc_offset_array[i];
485 pm_info->mmdc_io_val[i][1] =
486 readl_relaxed(pm_info->iomuxc_base.vbase +
487 mmdc_offset_array[i]);
488 }
489
490 imx6_suspend_in_ocram_fn = fncpy(
491 suspend_ocram_base + sizeof(*pm_info),
492 &imx6_suspend,
493 MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
494
495 goto put_node;
496
497pl310_cache_map_failed:
498 iounmap(&pm_info->gpc_base.vbase);
499gpc_map_failed:
500 iounmap(&pm_info->iomuxc_base.vbase);
501iomuxc_map_failed:
502 iounmap(&pm_info->src_base.vbase);
503src_map_failed:
504 iounmap(&pm_info->mmdc_base.vbase);
505put_node:
506 of_node_put(node);
507
508 return ret;
509}
510
511static void __init imx6_pm_common_init(const struct imx6_pm_socdata
512 *socdata)
513{
514 struct regmap *gpr;
515 int ret;
516
517 WARN_ON(!ccm_base);
518
519 if (IS_ENABLED(CONFIG_SUSPEND)) {
520 ret = imx6q_suspend_init(socdata);
521 if (ret)
522 pr_warn("%s: No DDR LPM support with suspend %d!\n",
523 __func__, ret);
524 }
525
526 /*
527 * This is for SW workaround step #1 of ERR007265, see comments
528 * in imx6q_set_lpm for details of this errata.
529 * Force IOMUXC irq pending, so that the interrupt to GPC can be
530 * used to deassert dsm_request signal when the signal gets
531 * asserted unexpectedly.
532 */
533 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
534 if (!IS_ERR(gpr))
535 regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT,
536 IMX6Q_GPR1_GINT);
537}
538
539void __init imx6q_pm_init(void)
540{
541 imx6_pm_common_init(&imx6q_pm_data);
542}
543
544void __init imx6dl_pm_init(void)
545{
546 imx6_pm_common_init(&imx6dl_pm_data);
547}
548
549void __init imx6sl_pm_init(void)
550{
551 imx6_pm_common_init(&imx6sl_pm_data);
552}
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
deleted file mode 100644
index 7a9b98589db7..000000000000
--- a/arch/arm/mach-imx/pm-imx6q.c
+++ /dev/null
@@ -1,241 +0,0 @@
1/*
2 * Copyright 2011-2013 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/delay.h>
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/mfd/syscon.h>
18#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
19#include <linux/of.h>
20#include <linux/of_address.h>
21#include <linux/regmap.h>
22#include <linux/suspend.h>
23#include <asm/cacheflush.h>
24#include <asm/proc-fns.h>
25#include <asm/suspend.h>
26#include <asm/hardware/cache-l2x0.h>
27
28#include "common.h"
29#include "hardware.h"
30
31#define CCR 0x0
32#define BM_CCR_WB_COUNT (0x7 << 16)
33#define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21)
34#define BM_CCR_RBC_EN (0x1 << 27)
35
36#define CLPCR 0x54
37#define BP_CLPCR_LPM 0
38#define BM_CLPCR_LPM (0x3 << 0)
39#define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2)
40#define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5)
41#define BM_CLPCR_SBYOS (0x1 << 6)
42#define BM_CLPCR_DIS_REF_OSC (0x1 << 7)
43#define BM_CLPCR_VSTBY (0x1 << 8)
44#define BP_CLPCR_STBY_COUNT 9
45#define BM_CLPCR_STBY_COUNT (0x3 << 9)
46#define BM_CLPCR_COSC_PWRDOWN (0x1 << 11)
47#define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16)
48#define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17)
49#define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19)
50#define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21)
51#define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22)
52#define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23)
53#define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24)
54#define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25)
55#define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26)
56#define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27)
57
58#define CGPR 0x64
59#define BM_CGPR_CHICKEN_BIT (0x1 << 17)
60
61static void __iomem *ccm_base;
62
63void imx6q_set_chicken_bit(void)
64{
65 u32 val = readl_relaxed(ccm_base + CGPR);
66
67 val |= BM_CGPR_CHICKEN_BIT;
68 writel_relaxed(val, ccm_base + CGPR);
69}
70
71static void imx6q_enable_rbc(bool enable)
72{
73 u32 val;
74
75 /*
76 * need to mask all interrupts in GPC before
77 * operating RBC configurations
78 */
79 imx_gpc_mask_all();
80
81 /* configure RBC enable bit */
82 val = readl_relaxed(ccm_base + CCR);
83 val &= ~BM_CCR_RBC_EN;
84 val |= enable ? BM_CCR_RBC_EN : 0;
85 writel_relaxed(val, ccm_base + CCR);
86
87 /* configure RBC count */
88 val = readl_relaxed(ccm_base + CCR);
89 val &= ~BM_CCR_RBC_BYPASS_COUNT;
90 val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0;
91 writel(val, ccm_base + CCR);
92
93 /*
94 * need to delay at least 2 cycles of CKIL(32K)
95 * due to hardware design requirement, which is
96 * ~61us, here we use 65us for safe
97 */
98 udelay(65);
99
100 /* restore GPC interrupt mask settings */
101 imx_gpc_restore_all();
102}
103
104static void imx6q_enable_wb(bool enable)
105{
106 u32 val;
107
108 /* configure well bias enable bit */
109 val = readl_relaxed(ccm_base + CLPCR);
110 val &= ~BM_CLPCR_WB_PER_AT_LPM;
111 val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0;
112 writel_relaxed(val, ccm_base + CLPCR);
113
114 /* configure well bias count */
115 val = readl_relaxed(ccm_base + CCR);
116 val &= ~BM_CCR_WB_COUNT;
117 val |= enable ? BM_CCR_WB_COUNT : 0;
118 writel_relaxed(val, ccm_base + CCR);
119}
120
121int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
122{
123 struct irq_desc *iomuxc_irq_desc;
124 u32 val = readl_relaxed(ccm_base + CLPCR);
125
126 val &= ~BM_CLPCR_LPM;
127 switch (mode) {
128 case WAIT_CLOCKED:
129 break;
130 case WAIT_UNCLOCKED:
131 val |= 0x1 << BP_CLPCR_LPM;
132 val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
133 break;
134 case STOP_POWER_ON:
135 val |= 0x2 << BP_CLPCR_LPM;
136 break;
137 case WAIT_UNCLOCKED_POWER_OFF:
138 val |= 0x1 << BP_CLPCR_LPM;
139 val &= ~BM_CLPCR_VSTBY;
140 val &= ~BM_CLPCR_SBYOS;
141 break;
142 case STOP_POWER_OFF:
143 val |= 0x2 << BP_CLPCR_LPM;
144 val |= 0x3 << BP_CLPCR_STBY_COUNT;
145 val |= BM_CLPCR_VSTBY;
146 val |= BM_CLPCR_SBYOS;
147 if (cpu_is_imx6sl()) {
148 val |= BM_CLPCR_BYPASS_PMIC_READY;
149 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
150 } else {
151 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
152 }
153 break;
154 default:
155 return -EINVAL;
156 }
157
158 /*
159 * ERR007265: CCM: When improper low-power sequence is used,
160 * the SoC enters low power mode before the ARM core executes WFI.
161 *
162 * Software workaround:
163 * 1) Software should trigger IRQ #32 (IOMUX) to be always pending
164 * by setting IOMUX_GPR1_GINT.
165 * 2) Software should then unmask IRQ #32 in GPC before setting CCM
166 * Low-Power mode.
167 * 3) Software should mask IRQ #32 right after CCM Low-Power mode
168 * is set (set bits 0-1 of CCM_CLPCR).
169 */
170 iomuxc_irq_desc = irq_to_desc(32);
171 imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data);
172 writel_relaxed(val, ccm_base + CLPCR);
173 imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data);
174
175 return 0;
176}
177
178static int imx6q_suspend_finish(unsigned long val)
179{
180 cpu_do_idle();
181 return 0;
182}
183
184static int imx6q_pm_enter(suspend_state_t state)
185{
186 switch (state) {
187 case PM_SUSPEND_MEM:
188 imx6q_set_lpm(STOP_POWER_OFF);
189 imx6q_enable_wb(true);
190 imx6q_enable_rbc(true);
191 imx_gpc_pre_suspend();
192 imx_anatop_pre_suspend();
193 imx_set_cpu_jump(0, v7_cpu_resume);
194 /* Zzz ... */
195 cpu_suspend(0, imx6q_suspend_finish);
196 if (cpu_is_imx6q() || cpu_is_imx6dl())
197 imx_smp_prepare();
198 imx_anatop_post_resume();
199 imx_gpc_post_resume();
200 imx6q_enable_rbc(false);
201 imx6q_enable_wb(false);
202 imx6q_set_lpm(WAIT_CLOCKED);
203 break;
204 default:
205 return -EINVAL;
206 }
207
208 return 0;
209}
210
211static const struct platform_suspend_ops imx6q_pm_ops = {
212 .enter = imx6q_pm_enter,
213 .valid = suspend_valid_only_mem,
214};
215
216void __init imx6q_pm_set_ccm_base(void __iomem *base)
217{
218 ccm_base = base;
219}
220
221void __init imx6q_pm_init(void)
222{
223 struct regmap *gpr;
224
225 WARN_ON(!ccm_base);
226
227 /*
228 * This is for SW workaround step #1 of ERR007265, see comments
229 * in imx6q_set_lpm for details of this errata.
230 * Force IOMUXC irq pending, so that the interrupt to GPC can be
231 * used to deassert dsm_request signal when the signal gets
232 * asserted unexpectedly.
233 */
234 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
235 if (!IS_ERR(gpr))
236 regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT,
237 IMX6Q_GPR1_GINT);
238
239
240 suspend_set_ops(&imx6q_pm_ops);
241}
diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S
new file mode 100644
index 000000000000..20048ff05739
--- /dev/null
+++ b/arch/arm/mach-imx/suspend-imx6.S
@@ -0,0 +1,361 @@
1/*
2 * Copyright 2014 Freescale Semiconductor, Inc.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12#include <linux/linkage.h>
13#include <asm/asm-offsets.h>
14#include <asm/hardware/cache-l2x0.h>
15#include "hardware.h"
16
17/*
18 * ==================== low level suspend ====================
19 *
20 * Better to follow below rules to use ARM registers:
21 * r0: pm_info structure address;
22 * r1 ~ r4: for saving pm_info members;
23 * r5 ~ r10: free registers;
24 * r11: io base address.
25 *
26 * suspend ocram space layout:
27 * ======================== high address ======================
28 * .
29 * .
30 * .
31 * ^
32 * ^
33 * ^
34 * imx6_suspend code
35 * PM_INFO structure(imx6_cpu_pm_info)
36 * ======================== low address =======================
37 */
38
39/*
40 * Below offsets are based on struct imx6_cpu_pm_info
41 * which defined in arch/arm/mach-imx/pm-imx6q.c, this
42 * structure contains necessary pm info for low level
43 * suspend related code.
44 */
45#define PM_INFO_PBASE_OFFSET 0x0
46#define PM_INFO_RESUME_ADDR_OFFSET 0x4
47#define PM_INFO_CPU_TYPE_OFFSET 0x8
48#define PM_INFO_PM_INFO_SIZE_OFFSET 0xC
49#define PM_INFO_MX6Q_MMDC_P_OFFSET 0x10
50#define PM_INFO_MX6Q_MMDC_V_OFFSET 0x14
51#define PM_INFO_MX6Q_SRC_P_OFFSET 0x18
52#define PM_INFO_MX6Q_SRC_V_OFFSET 0x1C
53#define PM_INFO_MX6Q_IOMUXC_P_OFFSET 0x20
54#define PM_INFO_MX6Q_IOMUXC_V_OFFSET 0x24
55#define PM_INFO_MX6Q_CCM_P_OFFSET 0x28
56#define PM_INFO_MX6Q_CCM_V_OFFSET 0x2C
57#define PM_INFO_MX6Q_GPC_P_OFFSET 0x30
58#define PM_INFO_MX6Q_GPC_V_OFFSET 0x34
59#define PM_INFO_MX6Q_L2_P_OFFSET 0x38
60#define PM_INFO_MX6Q_L2_V_OFFSET 0x3C
61#define PM_INFO_MMDC_IO_NUM_OFFSET 0x40
62#define PM_INFO_MMDC_IO_VAL_OFFSET 0x44
63
64#define MX6Q_SRC_GPR1 0x20
65#define MX6Q_SRC_GPR2 0x24
66#define MX6Q_MMDC_MAPSR 0x404
67#define MX6Q_MMDC_MPDGCTRL0 0x83c
68#define MX6Q_GPC_IMR1 0x08
69#define MX6Q_GPC_IMR2 0x0c
70#define MX6Q_GPC_IMR3 0x10
71#define MX6Q_GPC_IMR4 0x14
72#define MX6Q_CCM_CCR 0x0
73
74 .align 3
75
76 .macro sync_l2_cache
77
78 /* sync L2 cache to drain L2's buffers to DRAM. */
79#ifdef CONFIG_CACHE_L2X0
80 ldr r11, [r0, #PM_INFO_MX6Q_L2_V_OFFSET]
81 mov r6, #0x0
82 str r6, [r11, #L2X0_CACHE_SYNC]
831:
84 ldr r6, [r11, #L2X0_CACHE_SYNC]
85 ands r6, r6, #0x1
86 bne 1b
87#endif
88
89 .endm
90
91 .macro resume_mmdc
92
93 /* restore MMDC IO */
94 cmp r5, #0x0
95 ldreq r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET]
96 ldrne r11, [r0, #PM_INFO_MX6Q_IOMUXC_P_OFFSET]
97
98 ldr r6, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET]
99 ldr r7, =PM_INFO_MMDC_IO_VAL_OFFSET
100 add r7, r7, r0
1011:
102 ldr r8, [r7], #0x4
103 ldr r9, [r7], #0x4
104 str r9, [r11, r8]
105 subs r6, r6, #0x1
106 bne 1b
107
108 cmp r5, #0x0
109 ldreq r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET]
110 ldrne r11, [r0, #PM_INFO_MX6Q_MMDC_P_OFFSET]
111
112 cmp r3, #MXC_CPU_IMX6SL
113 bne 4f
114
115 /* reset read FIFO, RST_RD_FIFO */
116 ldr r7, =MX6Q_MMDC_MPDGCTRL0
117 ldr r6, [r11, r7]
118 orr r6, r6, #(1 << 31)
119 str r6, [r11, r7]
1202:
121 ldr r6, [r11, r7]
122 ands r6, r6, #(1 << 31)
123 bne 2b
124
125 /* reset FIFO a second time */
126 ldr r6, [r11, r7]
127 orr r6, r6, #(1 << 31)
128 str r6, [r11, r7]
1293:
130 ldr r6, [r11, r7]
131 ands r6, r6, #(1 << 31)
132 bne 3b
1334:
134 /* let DDR out of self-refresh */
135 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
136 bic r7, r7, #(1 << 21)
137 str r7, [r11, #MX6Q_MMDC_MAPSR]
1385:
139 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
140 ands r7, r7, #(1 << 25)
141 bne 5b
142
143 /* enable DDR auto power saving */
144 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
145 bic r7, r7, #0x1
146 str r7, [r11, #MX6Q_MMDC_MAPSR]
147
148 .endm
149
150ENTRY(imx6_suspend)
151 ldr r1, [r0, #PM_INFO_PBASE_OFFSET]
152 ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET]
153 ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET]
154 ldr r4, [r0, #PM_INFO_PM_INFO_SIZE_OFFSET]
155
156 /*
157 * counting the resume address in iram
158 * to set it in SRC register.
159 */
160 ldr r6, =imx6_suspend
161 ldr r7, =resume
162 sub r7, r7, r6
163 add r8, r1, r4
164 add r9, r8, r7
165
166 /*
167 * make sure TLB contain the addr we want,
168 * as we will access them after MMDC IO floated.
169 */
170
171 ldr r11, [r0, #PM_INFO_MX6Q_CCM_V_OFFSET]
172 ldr r6, [r11, #0x0]
173 ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
174 ldr r6, [r11, #0x0]
175
176 /* use r11 to store the IO address */
177 ldr r11, [r0, #PM_INFO_MX6Q_SRC_V_OFFSET]
178 /* store physical resume addr and pm_info address. */
179 str r9, [r11, #MX6Q_SRC_GPR1]
180 str r1, [r11, #MX6Q_SRC_GPR2]
181
182 /* need to sync L2 cache before DSM. */
183 sync_l2_cache
184
185 ldr r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET]
186 /*
187 * put DDR explicitly into self-refresh and
188 * disable automatic power savings.
189 */
190 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
191 orr r7, r7, #0x1
192 str r7, [r11, #MX6Q_MMDC_MAPSR]
193
194 /* make the DDR explicitly enter self-refresh. */
195 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
196 orr r7, r7, #(1 << 21)
197 str r7, [r11, #MX6Q_MMDC_MAPSR]
198
199poll_dvfs_set:
200 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
201 ands r7, r7, #(1 << 25)
202 beq poll_dvfs_set
203
204 ldr r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET]
205 ldr r6, =0x0
206 ldr r7, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET]
207 ldr r8, =PM_INFO_MMDC_IO_VAL_OFFSET
208 add r8, r8, r0
209 /* i.MX6SL's last 3 IOs need special setting */
210 cmp r3, #MXC_CPU_IMX6SL
211 subeq r7, r7, #0x3
212set_mmdc_io_lpm:
213 ldr r9, [r8], #0x8
214 str r6, [r11, r9]
215 subs r7, r7, #0x1
216 bne set_mmdc_io_lpm
217
218 cmp r3, #MXC_CPU_IMX6SL
219 bne set_mmdc_io_lpm_done
220 ldr r6, =0x1000
221 ldr r9, [r8], #0x8
222 str r6, [r11, r9]
223 ldr r9, [r8], #0x8
224 str r6, [r11, r9]
225 ldr r6, =0x80000
226 ldr r9, [r8]
227 str r6, [r11, r9]
228set_mmdc_io_lpm_done:
229
230 /*
231 * mask all GPC interrupts before
232 * enabling the RBC counters to
233 * avoid the counter starting too
234 * early if an interupt is already
235 * pending.
236 */
237 ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
238 ldr r6, [r11, #MX6Q_GPC_IMR1]
239 ldr r7, [r11, #MX6Q_GPC_IMR2]
240 ldr r8, [r11, #MX6Q_GPC_IMR3]
241 ldr r9, [r11, #MX6Q_GPC_IMR4]
242
243 ldr r10, =0xffffffff
244 str r10, [r11, #MX6Q_GPC_IMR1]
245 str r10, [r11, #MX6Q_GPC_IMR2]
246 str r10, [r11, #MX6Q_GPC_IMR3]
247 str r10, [r11, #MX6Q_GPC_IMR4]
248
249 /*
250 * enable the RBC bypass counter here
251 * to hold off the interrupts. RBC counter
252 * = 32 (1ms), Minimum RBC delay should be
253 * 400us for the analog LDOs to power down.
254 */
255 ldr r11, [r0, #PM_INFO_MX6Q_CCM_V_OFFSET]
256 ldr r10, [r11, #MX6Q_CCM_CCR]
257 bic r10, r10, #(0x3f << 21)
258 orr r10, r10, #(0x20 << 21)
259 str r10, [r11, #MX6Q_CCM_CCR]
260
261 /* enable the counter. */
262 ldr r10, [r11, #MX6Q_CCM_CCR]
263 orr r10, r10, #(0x1 << 27)
264 str r10, [r11, #MX6Q_CCM_CCR]
265
266 /* unmask all the GPC interrupts. */
267 ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
268 str r6, [r11, #MX6Q_GPC_IMR1]
269 str r7, [r11, #MX6Q_GPC_IMR2]
270 str r8, [r11, #MX6Q_GPC_IMR3]
271 str r9, [r11, #MX6Q_GPC_IMR4]
272
273 /*
274 * now delay for a short while (3usec)
275 * ARM is at 1GHz at this point
276 * so a short loop should be enough.
277 * this delay is required to ensure that
278 * the RBC counter can start counting in
279 * case an interrupt is already pending
280 * or in case an interrupt arrives just
281 * as ARM is about to assert DSM_request.
282 */
283 ldr r6, =2000
284rbc_loop:
285 subs r6, r6, #0x1
286 bne rbc_loop
287
288 /* Zzz, enter stop mode */
289 wfi
290 nop
291 nop
292 nop
293 nop
294
295 /*
296 * run to here means there is pending
297 * wakeup source, system should auto
298 * resume, we need to restore MMDC IO first
299 */
300 mov r5, #0x0
301 resume_mmdc
302
303 /* return to suspend finish */
304 mov pc, lr
305
306resume:
307 /* invalidate L1 I-cache first */
308 mov r6, #0x0
309 mcr p15, 0, r6, c7, c5, 0
310 mcr p15, 0, r6, c7, c5, 6
311 /* enable the Icache and branch prediction */
312 mov r6, #0x1800
313 mcr p15, 0, r6, c1, c0, 0
314 isb
315
316 /* get physical resume address from pm_info. */
317 ldr lr, [r0, #PM_INFO_RESUME_ADDR_OFFSET]
318 /* clear core0's entry and parameter */
319 ldr r11, [r0, #PM_INFO_MX6Q_SRC_P_OFFSET]
320 mov r7, #0x0
321 str r7, [r11, #MX6Q_SRC_GPR1]
322 str r7, [r11, #MX6Q_SRC_GPR2]
323
324 ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET]
325 mov r5, #0x1
326 resume_mmdc
327
328 mov pc, lr
329ENDPROC(imx6_suspend)
330
331/*
332 * The following code must assume it is running from physical address
333 * where absolute virtual addresses to the data section have to be
334 * turned into relative ones.
335 */
336
337#ifdef CONFIG_CACHE_L2X0
338 .macro pl310_resume
339 adr r0, l2x0_saved_regs_offset
340 ldr r2, [r0]
341 add r2, r2, r0
342 ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
343 ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
344 str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
345 mov r1, #0x1
346 str r1, [r0, #L2X0_CTRL] @ re-enable L2
347 .endm
348
349l2x0_saved_regs_offset:
350 .word l2x0_saved_regs - .
351
352#else
353 .macro pl310_resume
354 .endm
355#endif
356
357ENTRY(v7_cpu_resume)
358 bl v7_invalidate_l1
359 pl310_resume
360 b cpu_resume
361ENDPROC(v7_cpu_resume)
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 1a3a5f615770..65222ea0df6d 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -25,6 +25,7 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/delay.h>
28#include <linux/err.h> 29#include <linux/err.h>
29#include <linux/sched_clock.h> 30#include <linux/sched_clock.h>
30 31
@@ -116,11 +117,22 @@ static u64 notrace mxc_read_sched_clock(void)
116 return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0; 117 return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
117} 118}
118 119
120static struct delay_timer imx_delay_timer;
121
122static unsigned long imx_read_current_timer(void)
123{
124 return __raw_readl(sched_clock_reg);
125}
126
119static int __init mxc_clocksource_init(struct clk *timer_clk) 127static int __init mxc_clocksource_init(struct clk *timer_clk)
120{ 128{
121 unsigned int c = clk_get_rate(timer_clk); 129 unsigned int c = clk_get_rate(timer_clk);
122 void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN); 130 void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN);
123 131
132 imx_delay_timer.read_current_timer = &imx_read_current_timer;
133 imx_delay_timer.freq = c;
134 register_current_timer_delay(&imx_delay_timer);
135
124 sched_clock_reg = reg; 136 sched_clock_reg = reg;
125 137
126 sched_clock_register(mxc_read_sched_clock, 32, c); 138 sched_clock_register(mxc_read_sched_clock, 32, c);
diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
index 90a708fef541..f50bc936cb84 100644
--- a/arch/arm/mach-keystone/Kconfig
+++ b/arch/arm/mach-keystone/Kconfig
@@ -1,13 +1,9 @@
1config ARCH_KEYSTONE 1config ARCH_KEYSTONE
2 bool "Texas Instruments Keystone Devices" 2 bool "Texas Instruments Keystone Devices"
3 depends on ARCH_MULTI_V7 3 depends on ARCH_MULTI_V7
4 select CPU_V7
5 select ARM_GIC 4 select ARM_GIC
6 select HAVE_ARM_ARCH_TIMER 5 select HAVE_ARM_ARCH_TIMER
7 select HAVE_SMP
8 select CLKSRC_MMIO 6 select CLKSRC_MMIO
9 select GENERIC_CLOCKEVENTS
10 select ARCH_WANT_OPTIONAL_GPIOLIB
11 select ARM_ERRATA_798181 if SMP 7 select ARM_ERRATA_798181 if SMP
12 select COMMON_CLK_KEYSTONE 8 select COMMON_CLK_KEYSTONE
13 select ARCH_SUPPORTS_BIG_ENDIAN 9 select ARCH_SUPPORTS_BIG_ENDIAN
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
index 3795ae28a613..95a6a4b43c37 100644
--- a/arch/arm/mach-moxart/Kconfig
+++ b/arch/arm/mach-moxart/Kconfig
@@ -2,14 +2,9 @@ config ARCH_MOXART
2 bool "MOXA ART SoC" if ARCH_MULTI_V4T 2 bool "MOXA ART SoC" if ARCH_MULTI_V4T
3 select CPU_FA526 3 select CPU_FA526
4 select ARM_DMA_MEM_BUFFERABLE 4 select ARM_DMA_MEM_BUFFERABLE
5 select USE_OF
6 select CLKSRC_OF
7 select CLKSRC_MMIO 5 select CLKSRC_MMIO
8 select HAVE_CLK
9 select COMMON_CLK
10 select GENERIC_IRQ_CHIP 6 select GENERIC_IRQ_CHIP
11 select ARCH_REQUIRE_GPIOLIB 7 select ARCH_REQUIRE_GPIOLIB
12 select GENERIC_CLOCKEVENTS
13 select PHYLIB if NETDEVICES 8 select PHYLIB if NETDEVICES
14 help 9 help
15 Say Y here if you want to run your kernel on hardware with a 10 Say Y here if you want to run your kernel on hardware with a
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 884b275ab056..f961ae4ec4ee 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -2,15 +2,10 @@ config ARCH_MVEBU
2 bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 2 bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7
3 select ARCH_SUPPORTS_BIG_ENDIAN 3 select ARCH_SUPPORTS_BIG_ENDIAN
4 select CLKSRC_MMIO 4 select CLKSRC_MMIO
5 select COMMON_CLK
6 select GENERIC_CLOCKEVENTS
7 select GENERIC_IRQ_CHIP 5 select GENERIC_IRQ_CHIP
8 select IRQ_DOMAIN 6 select IRQ_DOMAIN
9 select MULTI_IRQ_HANDLER
10 select PINCTRL 7 select PINCTRL
11 select PLAT_ORION 8 select PLAT_ORION
12 select SPARSE_IRQ
13 select CLKDEV_LOOKUP
14 select MVEBU_MBUS 9 select MVEBU_MBUS
15 select ZONE_DMA if ARM_LPAE 10 select ZONE_DMA if ARM_LPAE
16 select ARCH_REQUIRE_GPIOLIB 11 select ARCH_REQUIRE_GPIOLIB
@@ -24,7 +19,6 @@ menu "Marvell SOC with device tree"
24config MACH_MVEBU_V7 19config MACH_MVEBU_V7
25 bool 20 bool
26 select ARMADA_370_XP_TIMER 21 select ARMADA_370_XP_TIMER
27 select HAVE_SMP
28 select CACHE_L2X0 22 select CACHE_L2X0
29 23
30config MACH_ARMADA_370 24config MACH_ARMADA_370
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 8cde9e05b5d6..84794137b175 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -16,11 +16,7 @@ config ARCH_MXS
16 bool "Freescale MXS (i.MX23, i.MX28) support" 16 bool "Freescale MXS (i.MX23, i.MX28) support"
17 depends on ARCH_MULTI_V5 17 depends on ARCH_MULTI_V5
18 select ARCH_REQUIRE_GPIOLIB 18 select ARCH_REQUIRE_GPIOLIB
19 select CLKDEV_LOOKUP
20 select CLKSRC_MMIO 19 select CLKSRC_MMIO
21 select CLKSRC_OF
22 select GENERIC_CLOCKEVENTS
23 select HAVE_CLK_PREPARE
24 select PINCTRL 20 select PINCTRL
25 select SOC_BUS 21 select SOC_BUS
26 select SOC_IMX23 22 select SOC_IMX23
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 4d42da49753c..486d301f43fd 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -6,16 +6,11 @@ config ARCH_NOMADIK
6 select ARM_VIC 6 select ARM_VIC
7 select CLKSRC_NOMADIK_MTU 7 select CLKSRC_NOMADIK_MTU
8 select CLKSRC_NOMADIK_MTU_SCHED_CLOCK 8 select CLKSRC_NOMADIK_MTU_SCHED_CLOCK
9 select CLKSRC_OF
10 select COMMON_CLK
11 select CPU_ARM926T 9 select CPU_ARM926T
12 select GENERIC_CLOCKEVENTS
13 select MIGHT_HAVE_CACHE_L2X0 10 select MIGHT_HAVE_CACHE_L2X0
14 select PINCTRL 11 select PINCTRL
15 select PINCTRL_NOMADIK 12 select PINCTRL_NOMADIK
16 select PINCTRL_STN8815 13 select PINCTRL_STN8815
17 select SPARSE_IRQ
18 select USE_OF
19 help 14 help
20 Support for the Nomadik platform by ST-Ericsson 15 Support for the Nomadik platform by ST-Ericsson
21 16
diff --git a/arch/arm/mach-nspire/Kconfig b/arch/arm/mach-nspire/Kconfig
index 59d8f0a70919..bc41f26c1a12 100644
--- a/arch/arm/mach-nspire/Kconfig
+++ b/arch/arm/mach-nspire/Kconfig
@@ -3,14 +3,9 @@ config ARCH_NSPIRE
3 depends on ARCH_MULTI_V4_V5 3 depends on ARCH_MULTI_V4_V5
4 depends on MMU 4 depends on MMU
5 select CPU_ARM926T 5 select CPU_ARM926T
6 select COMMON_CLK
7 select GENERIC_CLOCKEVENTS
8 select GENERIC_IRQ_CHIP 6 select GENERIC_IRQ_CHIP
9 select SPARSE_IRQ
10 select ARM_AMBA 7 select ARM_AMBA
11 select ARM_VIC 8 select ARM_VIC
12 select ARM_TIMER_SP804 9 select ARM_TIMER_SP804
13 select USE_OF
14 select CLKSRC_OF
15 help 10 help
16 This enables support for systems using the TI-NSPIRE CPU 11 This enables support for systems using the TI-NSPIRE CPU
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 91449c5cb70f..85089d821982 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -156,6 +156,7 @@ static struct omap_usb_config nokia770_usb_config __initdata = {
156 .register_dev = 1, 156 .register_dev = 1,
157 .hmc_mode = 16, 157 .hmc_mode = 16,
158 .pins[0] = 6, 158 .pins[0] = 6,
159 .extcon = "tahvo-usb",
159}; 160};
160 161
161#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 162#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 40fd5c31b594..e55ae63bb030 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -6,7 +6,6 @@ config ARCH_OMAP2
6 depends on ARCH_MULTI_V6 6 depends on ARCH_MULTI_V6
7 select ARCH_OMAP2PLUS 7 select ARCH_OMAP2PLUS
8 select CPU_V6 8 select CPU_V6
9 select MULTI_IRQ_HANDLER
10 select SOC_HAS_OMAP2_SDRC 9 select SOC_HAS_OMAP2_SDRC
11 10
12config ARCH_OMAP3 11config ARCH_OMAP3
@@ -15,8 +14,6 @@ config ARCH_OMAP3
15 select ARCH_OMAP2PLUS 14 select ARCH_OMAP2PLUS
16 select ARCH_HAS_OPP 15 select ARCH_HAS_OPP
17 select ARM_CPU_SUSPEND if PM 16 select ARM_CPU_SUSPEND if PM
18 select CPU_V7
19 select MULTI_IRQ_HANDLER
20 select OMAP_INTERCONNECT 17 select OMAP_INTERCONNECT
21 select PM_OPP if PM 18 select PM_OPP if PM
22 select PM_RUNTIME if CPU_IDLE 19 select PM_RUNTIME if CPU_IDLE
@@ -33,10 +30,8 @@ config ARCH_OMAP4
33 select ARM_ERRATA_720789 30 select ARM_ERRATA_720789
34 select ARM_GIC 31 select ARM_GIC
35 select CACHE_L2X0 32 select CACHE_L2X0
36 select CPU_V7
37 select HAVE_ARM_SCU if SMP 33 select HAVE_ARM_SCU if SMP
38 select HAVE_ARM_TWD if SMP 34 select HAVE_ARM_TWD if SMP
39 select HAVE_SMP
40 select OMAP_INTERCONNECT 35 select OMAP_INTERCONNECT
41 select PL310_ERRATA_588369 36 select PL310_ERRATA_588369
42 select PL310_ERRATA_727915 37 select PL310_ERRATA_727915
@@ -50,12 +45,11 @@ config SOC_OMAP5
50 bool "TI OMAP5" 45 bool "TI OMAP5"
51 depends on ARCH_MULTI_V7 46 depends on ARCH_MULTI_V7
52 select ARCH_OMAP2PLUS 47 select ARCH_OMAP2PLUS
48 select ARCH_HAS_OPP
53 select ARM_CPU_SUSPEND if PM 49 select ARM_CPU_SUSPEND if PM
54 select ARM_GIC 50 select ARM_GIC
55 select CPU_V7
56 select HAVE_ARM_SCU if SMP 51 select HAVE_ARM_SCU if SMP
57 select HAVE_ARM_TWD if SMP 52 select HAVE_ARM_TWD if SMP
58 select HAVE_SMP
59 select HAVE_ARM_ARCH_TIMER 53 select HAVE_ARM_ARCH_TIMER
60 select ARM_ERRATA_798181 if SMP 54 select ARM_ERRATA_798181 if SMP
61 55
@@ -63,16 +57,14 @@ config SOC_AM33XX
63 bool "TI AM33XX" 57 bool "TI AM33XX"
64 depends on ARCH_MULTI_V7 58 depends on ARCH_MULTI_V7
65 select ARCH_OMAP2PLUS 59 select ARCH_OMAP2PLUS
60 select ARCH_HAS_OPP
66 select ARM_CPU_SUSPEND if PM 61 select ARM_CPU_SUSPEND if PM
67 select CPU_V7
68 select MULTI_IRQ_HANDLER
69 62
70config SOC_AM43XX 63config SOC_AM43XX
71 bool "TI AM43x" 64 bool "TI AM43x"
72 depends on ARCH_MULTI_V7 65 depends on ARCH_MULTI_V7
73 select CPU_V7
74 select ARCH_OMAP2PLUS 66 select ARCH_OMAP2PLUS
75 select MULTI_IRQ_HANDLER 67 select ARCH_HAS_OPP
76 select ARM_GIC 68 select ARM_GIC
77 select MACH_OMAP_GENERIC 69 select MACH_OMAP_GENERIC
78 70
@@ -80,10 +72,9 @@ config SOC_DRA7XX
80 bool "TI DRA7XX" 72 bool "TI DRA7XX"
81 depends on ARCH_MULTI_V7 73 depends on ARCH_MULTI_V7
82 select ARCH_OMAP2PLUS 74 select ARCH_OMAP2PLUS
75 select ARCH_HAS_OPP
83 select ARM_CPU_SUSPEND if PM 76 select ARM_CPU_SUSPEND if PM
84 select ARM_GIC 77 select ARM_GIC
85 select CPU_V7
86 select HAVE_SMP
87 select HAVE_ARM_ARCH_TIMER 78 select HAVE_ARM_ARCH_TIMER
88 79
89config ARCH_OMAP2PLUS 80config ARCH_OMAP2PLUS
@@ -94,17 +85,13 @@ config ARCH_OMAP2PLUS
94 select ARCH_OMAP 85 select ARCH_OMAP
95 select ARCH_REQUIRE_GPIOLIB 86 select ARCH_REQUIRE_GPIOLIB
96 select CLKSRC_MMIO 87 select CLKSRC_MMIO
97 select COMMON_CLK
98 select GENERIC_CLOCKEVENTS
99 select GENERIC_IRQ_CHIP 88 select GENERIC_IRQ_CHIP
100 select MACH_OMAP_GENERIC 89 select MACH_OMAP_GENERIC
101 select OMAP_DM_TIMER 90 select OMAP_DM_TIMER
102 select PINCTRL 91 select PINCTRL
103 select PROC_DEVICETREE if PROC_FS 92 select PROC_DEVICETREE if PROC_FS
104 select SOC_BUS 93 select SOC_BUS
105 select SPARSE_IRQ
106 select TI_PRIV_EDMA 94 select TI_PRIV_EDMA
107 select USE_OF
108 help 95 help
109 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 96 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
110 97
@@ -262,9 +249,6 @@ config MACH_OMAP_3430SDP
262 default y 249 default y
263 select OMAP_PACKAGE_CBB 250 select OMAP_PACKAGE_CBB
264 251
265config MACH_NOKIA_N800
266 bool
267
268config MACH_NOKIA_N810 252config MACH_NOKIA_N810
269 bool 253 bool
270 254
@@ -275,7 +259,6 @@ config MACH_NOKIA_N8X0
275 bool "Nokia N800/N810" 259 bool "Nokia N800/N810"
276 depends on SOC_OMAP2420 260 depends on SOC_OMAP2420
277 default y 261 default y
278 select MACH_NOKIA_N800
279 select MACH_NOKIA_N810 262 select MACH_NOKIA_N810
280 select MACH_NOKIA_N810_WIMAX 263 select MACH_NOKIA_N810_WIMAX
281 264
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index d24926e6340f..ab43755364f5 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1339,7 +1339,7 @@ static void __maybe_unused gpmc_read_timings_dt(struct device_node *np,
1339 of_property_read_bool(np, "gpmc,time-para-granularity"); 1339 of_property_read_bool(np, "gpmc,time-para-granularity");
1340} 1340}
1341 1341
1342#ifdef CONFIG_MTD_NAND 1342#if IS_ENABLED(CONFIG_MTD_NAND)
1343 1343
1344static const char * const nand_xfer_types[] = { 1344static const char * const nand_xfer_types[] = {
1345 [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled", 1345 [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled",
@@ -1429,7 +1429,7 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
1429} 1429}
1430#endif 1430#endif
1431 1431
1432#ifdef CONFIG_MTD_ONENAND 1432#if IS_ENABLED(CONFIG_MTD_ONENAND)
1433static int gpmc_probe_onenand_child(struct platform_device *pdev, 1433static int gpmc_probe_onenand_child(struct platform_device *pdev,
1434 struct device_node *child) 1434 struct device_node *child)
1435{ 1435{
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index d9714113a01a..f14f9ac2dca1 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -179,15 +179,6 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
179 .length = L4_EMU_34XX_SIZE, 179 .length = L4_EMU_34XX_SIZE,
180 .type = MT_DEVICE 180 .type = MT_DEVICE
181 }, 181 },
182#if defined(CONFIG_DEBUG_LL) && \
183 (defined(CONFIG_MACH_OMAP_ZOOM2) || defined(CONFIG_MACH_OMAP_ZOOM3))
184 {
185 .virtual = ZOOM_UART_VIRT,
186 .pfn = __phys_to_pfn(ZOOM_UART_BASE),
187 .length = SZ_1M,
188 .type = MT_DEVICE
189 },
190#endif
191}; 182};
192#endif 183#endif
193 184
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
index b1022f4315f7..eca9eb1c5931 100644
--- a/arch/arm/mach-picoxcell/Kconfig
+++ b/arch/arm/mach-picoxcell/Kconfig
@@ -1,12 +1,7 @@
1config ARCH_PICOXCELL 1config ARCH_PICOXCELL
2 bool "Picochip PicoXcell" if ARCH_MULTI_V6 2 bool "Picochip PicoXcell" if ARCH_MULTI_V6
3 select ARCH_REQUIRE_GPIOLIB 3 select ARCH_REQUIRE_GPIOLIB
4 select ARM_PATCH_PHYS_VIRT
5 select ARM_VIC 4 select ARM_VIC
6 select CPU_V6K
7 select DW_APB_TIMER_OF 5 select DW_APB_TIMER_OF
8 select GENERIC_CLOCKEVENTS
9 select HAVE_TCM 6 select HAVE_TCM
10 select NO_IOPORT 7 select NO_IOPORT
11 select SPARSE_IRQ
12 select USE_OF
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 6988b117fc17..2c726b4f9356 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -1,9 +1,7 @@
1config ARCH_SIRF 1config ARCH_SIRF
2 bool "CSR SiRF" if ARCH_MULTI_V7 2 bool "CSR SiRF" if ARCH_MULTI_V7
3 select ARCH_REQUIRE_GPIOLIB 3 select ARCH_REQUIRE_GPIOLIB
4 select GENERIC_CLOCKEVENTS
5 select GENERIC_IRQ_CHIP 4 select GENERIC_IRQ_CHIP
6 select MIGHT_HAVE_CACHE_L2X0
7 select NO_IOPORT 5 select NO_IOPORT
8 select PINCTRL 6 select PINCTRL
9 select PINCTRL_SIRF 7 select PINCTRL_SIRF
@@ -17,7 +15,6 @@ menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features"
17config ARCH_ATLAS6 15config ARCH_ATLAS6
18 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" 16 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
19 default y 17 default y
20 select CPU_V7
21 select SIRF_IRQ 18 select SIRF_IRQ
22 help 19 help
23 Support for CSR SiRFSoC ARM Cortex A9 Platform 20 Support for CSR SiRFSoC ARM Cortex A9 Platform
@@ -25,7 +22,6 @@ config ARCH_ATLAS6
25config ARCH_PRIMA2 22config ARCH_PRIMA2
26 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 23 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
27 default y 24 default y
28 select CPU_V7
29 select SIRF_IRQ 25 select SIRF_IRQ
30 select ZONE_DMA 26 select ZONE_DMA
31 help 27 help
@@ -35,9 +31,7 @@ config ARCH_MARCO
35 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform" 31 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
36 default y 32 default y
37 select ARM_GIC 33 select ARM_GIC
38 select CPU_V7
39 select HAVE_ARM_SCU if SMP 34 select HAVE_ARM_SCU if SMP
40 select HAVE_SMP
41 select SMP_ON_UP if SMP 35 select SMP_ON_UP if SMP
42 help 36 help
43 Support for CSR SiRFSoC ARM Cortex A9 Platform 37 Support for CSR SiRFSoC ARM Cortex A9 Platform
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index f70583fee59f..29997bde277d 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -38,6 +38,7 @@
38#include <linux/mtd/physmap.h> 38#include <linux/mtd/physmap.h>
39#include <linux/usb/gpio_vbus.h> 39#include <linux/usb/gpio_vbus.h>
40#include <linux/reboot.h> 40#include <linux/reboot.h>
41#include <linux/regulator/fixed.h>
41#include <linux/regulator/max1586.h> 42#include <linux/regulator/max1586.h>
42#include <linux/slab.h> 43#include <linux/slab.h>
43#include <linux/i2c/pxa-i2c.h> 44#include <linux/i2c/pxa-i2c.h>
@@ -714,6 +715,10 @@ static struct gpio global_gpios[] = {
714 { GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" }, 715 { GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" },
715}; 716};
716 717
718static struct regulator_consumer_supply fixed_5v0_consumers[] = {
719 REGULATOR_SUPPLY("power", "pwm-backlight"),
720};
721
717static void __init mioa701_machine_init(void) 722static void __init mioa701_machine_init(void)
718{ 723{
719 int rc; 724 int rc;
@@ -753,6 +758,10 @@ static void __init mioa701_machine_init(void)
753 pxa_set_i2c_info(&i2c_pdata); 758 pxa_set_i2c_info(&i2c_pdata);
754 pxa27x_set_i2c_power_info(NULL); 759 pxa27x_set_i2c_power_info(NULL);
755 pxa_set_camera_info(&mioa701_pxacamera_platform_data); 760 pxa_set_camera_info(&mioa701_pxacamera_platform_data);
761
762 regulator_register_always_on(0, "fixed-5.0V", fixed_5v0_consumers,
763 ARRAY_SIZE(fixed_5v0_consumers),
764 5000000);
756} 765}
757 766
758static void mioa701_machine_exit(void) 767static void mioa701_machine_exit(void)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 133410e178a7..1caee6d548b8 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -7,9 +7,6 @@ config ARCH_ROCKCHIP
7 select CACHE_L2X0 7 select CACHE_L2X0
8 select HAVE_ARM_SCU if SMP 8 select HAVE_ARM_SCU if SMP
9 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
10 select HAVE_SMP
11 select COMMON_CLK
12 select GENERIC_CLOCKEVENTS
13 select DW_APB_TIMER_OF 10 select DW_APB_TIMER_OF
14 select ARM_GLOBAL_TIMER 11 select ARM_GLOBAL_TIMER
15 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 12 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 05fa505df585..8a685edf3bbc 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -5,18 +5,13 @@ config ARCH_SHMOBILE_MULTI
5 bool "Renesas ARM SoCs" if ARCH_MULTI_V7 5 bool "Renesas ARM SoCs" if ARCH_MULTI_V7
6 depends on MMU 6 depends on MMU
7 select ARCH_SHMOBILE 7 select ARCH_SHMOBILE
8 select CPU_V7
9 select GENERIC_CLOCKEVENTS
10 select HAVE_ARM_SCU if SMP 8 select HAVE_ARM_SCU if SMP
11 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
12 select HAVE_SMP
13 select ARM_GIC 10 select ARM_GIC
14 select MIGHT_HAVE_CACHE_L2X0
15 select MIGHT_HAVE_PCI 11 select MIGHT_HAVE_PCI
16 select NO_IOPORT 12 select NO_IOPORT
17 select PINCTRL 13 select PINCTRL
18 select ARCH_REQUIRE_GPIOLIB 14 select ARCH_REQUIRE_GPIOLIB
19 select CLKDEV_LOOKUP
20 15
21if ARCH_SHMOBILE_MULTI 16if ARCH_SHMOBILE_MULTI
22 17
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index aee77f06f887..b5f8d75d51a0 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -1,17 +1,10 @@
1config ARCH_SOCFPGA 1config ARCH_SOCFPGA
2 bool "Altera SOCFPGA family" if ARCH_MULTI_V7 2 bool "Altera SOCFPGA family" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_AMBA 3 select ARM_AMBA
5 select ARM_GIC 4 select ARM_GIC
6 select CACHE_L2X0 5 select CACHE_L2X0
7 select COMMON_CLK
8 select CPU_V7
9 select DW_APB_TIMER_OF 6 select DW_APB_TIMER_OF
10 select GENERIC_CLOCKEVENTS
11 select GPIO_PL061 if GPIOLIB 7 select GPIO_PL061 if GPIOLIB
12 select HAVE_ARM_SCU 8 select HAVE_ARM_SCU
13 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
14 select HAVE_SMP
15 select MFD_SYSCON 10 select MFD_SYSCON
16 select SPARSE_IRQ
17 select USE_OF
diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
index ac1710e64d9a..5c57262b97e9 100644
--- a/arch/arm/mach-spear/Kconfig
+++ b/arch/arm/mach-spear/Kconfig
@@ -8,8 +8,6 @@ menuconfig PLAT_SPEAR
8 select ARCH_REQUIRE_GPIOLIB 8 select ARCH_REQUIRE_GPIOLIB
9 select ARM_AMBA 9 select ARM_AMBA
10 select CLKSRC_MMIO 10 select CLKSRC_MMIO
11 select COMMON_CLK
12 select GENERIC_CLOCKEVENTS
13 11
14if PLAT_SPEAR 12if PLAT_SPEAR
15 13
@@ -18,14 +16,10 @@ config ARCH_SPEAR13XX
18 depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE 16 depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE
19 select ARCH_HAS_CPUFREQ 17 select ARCH_HAS_CPUFREQ
20 select ARM_GIC 18 select ARM_GIC
21 select CPU_V7
22 select GPIO_SPEAR_SPICS 19 select GPIO_SPEAR_SPICS
23 select HAVE_ARM_SCU if SMP 20 select HAVE_ARM_SCU if SMP
24 select HAVE_ARM_TWD if SMP 21 select HAVE_ARM_TWD if SMP
25 select HAVE_SMP
26 select MIGHT_HAVE_CACHE_L2X0
27 select PINCTRL 22 select PINCTRL
28 select USE_OF
29 help 23 help
30 Supports for ARM's SPEAR13XX family 24 Supports for ARM's SPEAR13XX family
31 25
@@ -50,9 +44,7 @@ config ARCH_SPEAR3XX
50 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE 44 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
51 depends on !ARCH_SPEAR13XX 45 depends on !ARCH_SPEAR13XX
52 select ARM_VIC 46 select ARM_VIC
53 select CPU_ARM926T
54 select PINCTRL 47 select PINCTRL
55 select USE_OF
56 help 48 help
57 Supports for ARM's SPEAR3XX family 49 Supports for ARM's SPEAR3XX family
58 50
@@ -83,14 +75,12 @@ config ARCH_SPEAR6XX
83 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE 75 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
84 depends on !ARCH_SPEAR13XX 76 depends on !ARCH_SPEAR13XX
85 select ARM_VIC 77 select ARM_VIC
86 select CPU_ARM926T
87 help 78 help
88 Supports for ARM's SPEAR6XX family 79 Supports for ARM's SPEAR6XX family
89 80
90config MACH_SPEAR600 81config MACH_SPEAR600
91 def_bool y 82 def_bool y
92 depends on ARCH_SPEAR6XX 83 depends on ARCH_SPEAR6XX
93 select USE_OF
94 help 84 help
95 Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig" 85 Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig"
96 86
diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
index d71654bc8d54..d2c13ba1190b 100644
--- a/arch/arm/mach-sti/Kconfig
+++ b/arch/arm/mach-sti/Kconfig
@@ -1,14 +1,10 @@
1menuconfig ARCH_STI 1menuconfig ARCH_STI
2 bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7 2 bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7
3 select GENERIC_CLOCKEVENTS
4 select CLKDEV_LOOKUP
5 select ARM_GIC 3 select ARM_GIC
6 select ARM_GLOBAL_TIMER 4 select ARM_GLOBAL_TIMER
7 select PINCTRL 5 select PINCTRL
8 select PINCTRL_ST 6 select PINCTRL_ST
9 select MFD_SYSCON 7 select MFD_SYSCON
10 select MIGHT_HAVE_CACHE_L2X0
11 select HAVE_SMP
12 select HAVE_ARM_SCU if SMP 8 select HAVE_ARM_SCU if SMP
13 select ARCH_REQUIRE_GPIOLIB 9 select ARCH_REQUIRE_GPIOLIB
14 select ARM_ERRATA_754322 10 select ARM_ERRATA_754322
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index b9d6cad8669b..9de27cfa688f 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -5,14 +5,9 @@ config ARCH_SUNXI
5 select ARM_GIC 5 select ARM_GIC
6 select ARM_PSCI 6 select ARM_PSCI
7 select CLKSRC_MMIO 7 select CLKSRC_MMIO
8 select CLKSRC_OF
9 select COMMON_CLK
10 select GENERIC_CLOCKEVENTS
11 select GENERIC_IRQ_CHIP 8 select GENERIC_IRQ_CHIP
12 select HAVE_SMP
13 select PINCTRL 9 select PINCTRL
14 select PINCTRL_SUNXI 10 select PINCTRL_SUNXI
15 select RESET_CONTROLLER 11 select RESET_CONTROLLER
16 select SPARSE_IRQ
17 select SUN4I_TIMER 12 select SUN4I_TIMER
18 select SUN5I_HSTIMER 13 select SUN5I_HSTIMER
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index b1232d8be6f5..f61cd5b9f103 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -5,24 +5,16 @@ config ARCH_TEGRA
5 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 5 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
6 select ARM_GIC 6 select ARM_GIC
7 select CLKSRC_MMIO 7 select CLKSRC_MMIO
8 select CLKSRC_OF
9 select COMMON_CLK
10 select CPU_V7
11 select GENERIC_CLOCKEVENTS
12 select HAVE_ARM_SCU if SMP 8 select HAVE_ARM_SCU if SMP
13 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
14 select HAVE_SMP
15 select MIGHT_HAVE_CACHE_L2X0
16 select MIGHT_HAVE_PCI 10 select MIGHT_HAVE_PCI
17 select PINCTRL 11 select PINCTRL
18 select ARCH_HAS_RESET_CONTROLLER 12 select ARCH_HAS_RESET_CONTROLLER
19 select RESET_CONTROLLER 13 select RESET_CONTROLLER
20 select SOC_BUS 14 select SOC_BUS
21 select SPARSE_IRQ
22 select USB_ARCH_HAS_EHCI if USB_SUPPORT 15 select USB_ARCH_HAS_EHCI if USB_SUPPORT
23 select USB_ULPI if USB_PHY 16 select USB_ULPI if USB_PHY
24 select USB_ULPI_VIEWPORT if USB_PHY 17 select USB_ULPI_VIEWPORT if USB_PHY
25 select USE_OF
26 help 18 help
27 This enables support for NVIDIA Tegra based systems. 19 This enables support for NVIDIA Tegra based systems.
28 20
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 4ae0286b468d..f55b05a29b55 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -24,6 +24,7 @@
24#include <linux/cpu_pm.h> 24#include <linux/cpu_pm.h>
25#include <linux/suspend.h> 25#include <linux/suspend.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/slab.h>
27#include <linux/clk/tegra.h> 28#include <linux/clk/tegra.h>
28 29
29#include <asm/smp_plat.h> 30#include <asm/smp_plat.h>
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 303a285d80fd..6191603379e1 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -73,10 +73,20 @@ u32 tegra_uart_config[3] = {
73static void __init tegra_init_cache(void) 73static void __init tegra_init_cache(void)
74{ 74{
75#ifdef CONFIG_CACHE_L2X0 75#ifdef CONFIG_CACHE_L2X0
76 static const struct of_device_id pl310_ids[] __initconst = {
77 { .compatible = "arm,pl310-cache", },
78 {}
79 };
80
81 struct device_node *np;
76 int ret; 82 int ret;
77 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000; 83 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
78 u32 aux_ctrl, cache_type; 84 u32 aux_ctrl, cache_type;
79 85
86 np = of_find_matching_node(NULL, pl310_ids);
87 if (!np)
88 return;
89
80 cache_type = readl(p + L2X0_CACHE_TYPE); 90 cache_type = readl(p + L2X0_CACHE_TYPE);
81 aux_ctrl = (cache_type & 0x700) << (17-8); 91 aux_ctrl = (cache_type & 0x700) << (17-8);
82 aux_ctrl |= 0x7C400001; 92 aux_ctrl |= 0x7C400001;
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index 8e23071bd1b3..e3a96d7302e9 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -3,20 +3,14 @@ config ARCH_U300
3 depends on MMU 3 depends on MMU
4 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
5 select ARM_AMBA 5 select ARM_AMBA
6 select ARM_PATCH_PHYS_VIRT
7 select ARM_VIC 6 select ARM_VIC
8 select CLKSRC_MMIO 7 select CLKSRC_MMIO
9 select CLKSRC_OF
10 select COMMON_CLK
11 select CPU_ARM926T 8 select CPU_ARM926T
12 select GENERIC_CLOCKEVENTS
13 select HAVE_TCM 9 select HAVE_TCM
14 select PINCTRL 10 select PINCTRL
15 select PINCTRL_COH901 11 select PINCTRL_COH901
16 select PINCTRL_U300 12 select PINCTRL_U300
17 select SPARSE_IRQ
18 select MFD_SYSCON 13 select MFD_SYSCON
19 select USE_OF
20 help 14 help
21 Support for ST-Ericsson U300 series mobile platforms. 15 Support for ST-Ericsson U300 series mobile platforms.
22 16
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 0034d2cd6973..8052bd52450d 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -11,13 +11,8 @@ config ARCH_U8500
11 select ARM_GIC 11 select ARM_GIC
12 select CACHE_L2X0 12 select CACHE_L2X0
13 select CLKSRC_NOMADIK_MTU 13 select CLKSRC_NOMADIK_MTU
14 select COMMON_CLK
15 select CPU_V7
16 select GENERIC_CLOCKEVENTS
17 select HAVE_ARM_SCU if SMP 14 select HAVE_ARM_SCU if SMP
18 select HAVE_ARM_TWD if SMP 15 select HAVE_ARM_TWD if SMP
19 select HAVE_SMP
20 select MIGHT_HAVE_CACHE_L2X0
21 select PINCTRL 16 select PINCTRL
22 select PINCTRL_ABX500 17 select PINCTRL_ABX500
23 select PINCTRL_NOMADIK 18 select PINCTRL_NOMADIK
@@ -76,7 +71,6 @@ config UX500_AUTO_PLATFORM
76config MACH_UX500_DT 71config MACH_UX500_DT
77 bool "Generic U8500 support using device tree" 72 bool "Generic U8500 support using device tree"
78 depends on MACH_MOP500 73 depends on MACH_MOP500
79 select USE_OF
80 74
81endmenu 75endmenu
82 76
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 4a70be485ff8..80b4be36f10a 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -5,16 +5,11 @@ config ARCH_VEXPRESS
5 select ARM_AMBA 5 select ARM_AMBA
6 select ARM_GIC 6 select ARM_GIC
7 select ARM_TIMER_SP804 7 select ARM_TIMER_SP804
8 select COMMON_CLK
9 select COMMON_CLK_VERSATILE 8 select COMMON_CLK_VERSATILE
10 select CPU_V7
11 select GENERIC_CLOCKEVENTS
12 select HAVE_ARM_SCU if SMP 9 select HAVE_ARM_SCU if SMP
13 select HAVE_ARM_TWD if SMP 10 select HAVE_ARM_TWD if SMP
14 select HAVE_PATA_PLATFORM 11 select HAVE_PATA_PLATFORM
15 select HAVE_SMP
16 select ICST 12 select ICST
17 select MIGHT_HAVE_CACHE_L2X0
18 select NO_IOPORT 13 select NO_IOPORT
19 select PLAT_VERSATILE 14 select PLAT_VERSATILE
20 select PLAT_VERSATILE_CLCD 15 select PLAT_VERSATILE_CLCD
diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig
deleted file mode 100644
index 081d46929436..000000000000
--- a/arch/arm/mach-virt/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
1config ARCH_VIRT
2 bool "Dummy Virtual Machine" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_GIC
5 select HAVE_ARM_ARCH_TIMER
6 select ARM_PSCI
7 select HAVE_SMP
8 select CPU_V7
9 select SPARSE_IRQ
10 select USE_OF
diff --git a/arch/arm/mach-virt/Makefile b/arch/arm/mach-virt/Makefile
deleted file mode 100644
index 7ddbfa60227f..000000000000
--- a/arch/arm/mach-virt/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := virt.o
diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c
deleted file mode 100644
index b184e57d1854..000000000000
--- a/arch/arm/mach-virt/virt.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * Dummy Virtual Machine - does what it says on the tin.
3 *
4 * Copyright (C) 2012 ARM Ltd
5 * Authors: Will Deacon <will.deacon@arm.com>,
6 * Marc Zyngier <marc.zyngier@arm.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <linux/of_irq.h>
22#include <linux/of_platform.h>
23#include <linux/smp.h>
24
25#include <asm/mach/arch.h>
26
27static void __init virt_init(void)
28{
29 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
30}
31
32static const char *virt_dt_match[] = {
33 "linux,dummy-virt",
34 "xen,xenvm",
35 NULL
36};
37
38DT_MACHINE_START(VIRT, "Dummy Virtual Machine")
39 .init_machine = virt_init,
40 .dt_compat = virt_dt_match,
41MACHINE_END
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
index 927be93b692e..08f56a41cb55 100644
--- a/arch/arm/mach-vt8500/Kconfig
+++ b/arch/arm/mach-vt8500/Kconfig
@@ -3,8 +3,6 @@ config ARCH_VT8500
3 select ARCH_HAS_CPUFREQ 3 select ARCH_HAS_CPUFREQ
4 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
5 select CLKDEV_LOOKUP 5 select CLKDEV_LOOKUP
6 select CLKSRC_OF
7 select GENERIC_CLOCKEVENTS
8 select VT8500_TIMER 6 select VT8500_TIMER
9 select PINCTRL 7 select PINCTRL
10 help 8 help
@@ -21,7 +19,6 @@ config ARCH_WM8750
21 bool "WonderMedia WM8750" 19 bool "WonderMedia WM8750"
22 depends on ARCH_MULTI_V6 20 depends on ARCH_MULTI_V6
23 select ARCH_VT8500 21 select ARCH_VT8500
24 select CPU_V6
25 help 22 help
26 Support for WonderMedia WM8750 System-on-Chip. 23 Support for WonderMedia WM8750 System-on-Chip.
27 24
@@ -29,6 +26,5 @@ config ARCH_WM8850
29 bool "WonderMedia WM8850" 26 bool "WonderMedia WM8850"
30 depends on ARCH_MULTI_V7 27 depends on ARCH_MULTI_V7
31 select ARCH_VT8500 28 select ARCH_VT8500
32 select CPU_V7
33 help 29 help
34 Support for WonderMedia WM8850 System-on-Chip. 30 Support for WonderMedia WM8850 System-on-Chip.
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index 6b04260aa142..105d39b72a25 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -2,16 +2,9 @@ config ARCH_ZYNQ
2 bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 2 bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
3 select ARM_AMBA 3 select ARM_AMBA
4 select ARM_GIC 4 select ARM_GIC
5 select COMMON_CLK
6 select CPU_V7
7 select GENERIC_CLOCKEVENTS
8 select HAVE_ARM_SCU if SMP 5 select HAVE_ARM_SCU if SMP
9 select HAVE_ARM_TWD if SMP 6 select HAVE_ARM_TWD if SMP
10 select ICST 7 select ICST
11 select MIGHT_HAVE_CACHE_L2X0
12 select USE_OF
13 select HAVE_SMP
14 select SPARSE_IRQ
15 select CADENCE_TTC_TIMER 8 select CADENCE_TTC_TIMER
16 select ARM_GLOBAL_TIMER 9 select ARM_GLOBAL_TIMER
17 help 10 help
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 1a77450e728a..11b3914660d2 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1358,7 +1358,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
1358 *handle = DMA_ERROR_CODE; 1358 *handle = DMA_ERROR_CODE;
1359 size = PAGE_ALIGN(size); 1359 size = PAGE_ALIGN(size);
1360 1360
1361 if (gfp & GFP_ATOMIC) 1361 if (!(gfp & __GFP_WAIT))
1362 return __iommu_alloc_atomic(dev, size, handle); 1362 return __iommu_alloc_atomic(dev, size, handle);
1363 1363
1364 /* 1364 /*
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index d5a982d15a88..7ea641b7aa7d 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -38,6 +38,7 @@ static inline pmd_t *pmd_off_k(unsigned long virt)
38 38
39struct mem_type { 39struct mem_type {
40 pteval_t prot_pte; 40 pteval_t prot_pte;
41 pteval_t prot_pte_s2;
41 pmdval_t prot_l1; 42 pmdval_t prot_l1;
42 pmdval_t prot_sect; 43 pmdval_t prot_sect;
43 unsigned int domain; 44 unsigned int domain;
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 4f08c133cc25..a623cb3ad012 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -232,12 +232,16 @@ __setup("noalign", noalign_setup);
232#endif /* ifdef CONFIG_CPU_CP15 / else */ 232#endif /* ifdef CONFIG_CPU_CP15 / else */
233 233
234#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN 234#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN
235#define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE
235#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE 236#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE
236 237
237static struct mem_type mem_types[] = { 238static struct mem_type mem_types[] = {
238 [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ 239 [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */
239 .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | 240 .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED |
240 L_PTE_SHARED, 241 L_PTE_SHARED,
242 .prot_pte_s2 = s2_policy(PROT_PTE_S2_DEVICE) |
243 s2_policy(L_PTE_S2_MT_DEV_SHARED) |
244 L_PTE_SHARED,
241 .prot_l1 = PMD_TYPE_TABLE, 245 .prot_l1 = PMD_TYPE_TABLE,
242 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S, 246 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S,
243 .domain = DOMAIN_IO, 247 .domain = DOMAIN_IO,
@@ -508,7 +512,8 @@ static void __init build_mem_type_table(void)
508 cp = &cache_policies[cachepolicy]; 512 cp = &cache_policies[cachepolicy];
509 vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; 513 vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
510 s2_pgprot = cp->pte_s2; 514 s2_pgprot = cp->pte_s2;
511 hyp_device_pgprot = s2_device_pgprot = mem_types[MT_DEVICE].prot_pte; 515 hyp_device_pgprot = mem_types[MT_DEVICE].prot_pte;
516 s2_device_pgprot = mem_types[MT_DEVICE].prot_pte_s2;
512 517
513 /* 518 /*
514 * ARMv6 and above have extended page tables. 519 * ARMv6 and above have extended page tables.
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 45dc29f85d56..32b3558321c4 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -208,7 +208,6 @@ __v6_setup:
208 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache 208 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache
209 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache 209 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
210 mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache 210 mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache
211 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
212#ifdef CONFIG_MMU 211#ifdef CONFIG_MMU
213 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs 212 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs
214 mcr p15, 0, r0, c2, c0, 2 @ TTB control register 213 mcr p15, 0, r0, c2, c0, 2 @ TTB control register
@@ -218,6 +217,8 @@ __v6_setup:
218 ALT_UP(orr r8, r8, #TTB_FLAGS_UP) 217 ALT_UP(orr r8, r8, #TTB_FLAGS_UP)
219 mcr p15, 0, r8, c2, c0, 1 @ load TTB1 218 mcr p15, 0, r8, c2, c0, 1 @ load TTB1
220#endif /* CONFIG_MMU */ 219#endif /* CONFIG_MMU */
220 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer and
221 @ complete invalidations
221 adr r5, v6_crval 222 adr r5, v6_crval
222 ldmia r5, {r5, r6} 223 ldmia r5, {r5, r6}
223 ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables 224 ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index bd1781979a39..74f6033e76dd 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -351,7 +351,6 @@ __v7_setup:
351 351
3524: mov r10, #0 3524: mov r10, #0
353 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate 353 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
354 dsb
355#ifdef CONFIG_MMU 354#ifdef CONFIG_MMU
356 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs 355 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
357 v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup 356 v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup
@@ -360,6 +359,7 @@ __v7_setup:
360 mcr p15, 0, r5, c10, c2, 0 @ write PRRR 359 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
361 mcr p15, 0, r6, c10, c2, 1 @ write NMRR 360 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
362#endif 361#endif
362 dsb @ Complete invalidations
363#ifndef CONFIG_ARM_THUMBEE 363#ifndef CONFIG_ARM_THUMBEE
364 mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE 364 mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE
365 and r0, r0, #(0xf << 12) @ ThumbEE enabled field 365 and r0, r0, #(0xf << 12) @ ThumbEE enabled field