aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-20 10:21:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-20 10:21:54 -0500
commit1ffab3d4139533eff6e27b7568825307e575faa6 (patch)
treeeca25b2ef6b9b7c8168625c2a5dea6b08fd37756
parentddedec28b1d5144bc2c765d97003997f3505fd3a (diff)
parent4d1839138220e7e35bf9e31c854e4e0196dea7a1 (diff)
Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC fixes from Olof Johansson: "This is a batch of fixes for arm-soc platforms, most of it is for OMAP but there are others too (i.MX, Tegra, ep93xx). Fixes warnings, some broken platforms and drivers, etc. A bit all over the map really." There was some concern about commit 68136b10 ("RM: sunxi: Change device tree naming scheme for sunxi"), but Tony says: "Looks like that's trivial to fix as needed, no need to rebuild the branch to fix that AFAIK. The fix can be done once Olof is available online again. Linus, I suggest that you go ahead and pull this if there are no other issues with this branch." * tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (32 commits) ARM: sunxi: Change device tree naming scheme for sunxi ARM: ux500: fix missing include ARM: u300: delete custom pin hog code ARM: davinci: fix build break due to missing include ARM: exynos: Fix warning due to missing 'inline' in stub ARM: imx: Move platform-mx2-emma to arch/arm/mach-imx/devices ARM i.MX51 clock: Fix regression since enabling MIPI/HSP clocks ARM: dts: mx27: Fix the AIPI bus for FEC ARM: OMAP2+: common: remove use of vram ARM: OMAP3/4: cpuidle: fix sparse and checkpatch warnings ARM: OMAP4: clock data: DPLLs are missing bypass clocks in their parent lists ARM: OMAP4: clock data: div_iva_hs_clk is a power-of-two divider ARM: OMAP4: Fix EMU clock domain always on ARM: OMAP4460: Workaround ABE DPLL failing to turn-on ARM: OMAP4: Enhance support for DPLLs with 4X multiplier ARM: OMAP4: Add function table for non-M4X dplls ARM: OMAP4: Update timer clock aliases ARM: OMAP: Move plat/omap-serial.h to include/linux/platform_data/serial-omap.h ARM: dts: Add build target for omap4-panda-a4 ARM: dts: OMAP2420: Correct H4 board memory size ...
-rw-r--r--arch/arm/boot/dts/Makefile5
-rw-r--r--arch/arm/boot/dts/imx27-3ds.dts8
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycore.dts13
-rw-r--r--arch/arm/boot/dts/imx27.dtsi11
-rw-r--r--arch/arm/boot/dts/omap2420-h4.dts2
-rw-r--r--arch/arm/boot/dts/sun4i-cubieboard.dts4
-rw-r--r--arch/arm/boot/dts/sun5i-olinuxino.dts4
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/uncompress.h10
-rw-r--r--arch/arm/mach-exynos/common.h2
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c16
-rw-r--r--arch/arm/mach-imx/devices/platform-mx2-emma.c (renamed from arch/arm/plat-mxc/devices/platform-mx2-emma.c)4
-rw-r--r--arch/arm/mach-omap2/Kconfig3
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c1
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c1
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c1
-rw-r--r--arch/arm/mach-omap2/board-h4.c83
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c1
-rw-r--r--arch/arm/mach-omap2/cclock44xx_data.c78
-rw-r--r--arch/arm/mach-omap2/clock.h10
-rw-r--r--arch/arm/mach-omap2/clockdomain.c3
-rw-r--r--arch/arm/mach-omap2/common.c3
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c14
-rw-r--r--arch/arm/mach-omap2/cpuidle44xx.c28
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c46
-rw-r--r--arch/arm/mach-omap2/dpll44xx.c64
-rw-r--r--arch/arm/mach-omap2/mux.c10
-rw-r--r--arch/arm/mach-omap2/mux.h20
-rw-r--r--arch/arm/mach-omap2/mux34xx.c2
-rw-r--r--arch/arm/mach-omap2/serial.c3
-rw-r--r--arch/arm/mach-omap2/timer.c6
-rw-r--r--arch/arm/mach-omap2/usb-host.c4
-rw-r--r--arch/arm/mach-tegra/common.c2
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.c4
-rw-r--r--arch/arm/mach-u300/core.c34
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h1
-rw-r--r--arch/arm/plat-omap/Makefile1
-rw-r--r--arch/arm/plat-omap/debug-devices.c92
-rw-r--r--arch/arm/plat-omap/include/plat/debug-devices.h2
-rw-r--r--drivers/amba/tegra-ahb.c2
-rw-r--r--drivers/mfd/omap-usb-host.c3
-rw-r--r--drivers/tty/serial/omap-serial.c3
-rw-r--r--include/linux/platform_data/serial-omap.h (renamed from arch/arm/plat-omap/include/plat/omap-serial.h)0
-rw-r--r--include/linux/platform_data/usb-omap.h3
-rw-r--r--include/video/omap-panel-tfp410.h2
47 files changed, 308 insertions, 304 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0f441740c22a..d077ef8426df 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -107,6 +107,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
107 omap3-evm.dtb \ 107 omap3-evm.dtb \
108 omap3-tobi.dtb \ 108 omap3-tobi.dtb \
109 omap4-panda.dtb \ 109 omap4-panda.dtb \
110 omap4-panda-a4.dtb \
110 omap4-panda-es.dtb \ 111 omap4-panda-es.dtb \
111 omap4-var-som.dtb \ 112 omap4-var-som.dtb \
112 omap4-sdp.dtb \ 113 omap4-sdp.dtb \
@@ -131,8 +132,8 @@ dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
131 spear320-evb.dtb \ 132 spear320-evb.dtb \
132 spear320-hmi.dtb 133 spear320-hmi.dtb
133dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb 134dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb
134dtb-$(CONFIG_ARCH_SUNXI) += sun4i-cubieboard.dtb \ 135dtb-$(CONFIG_ARCH_SUNXI) += sun4i-a10-cubieboard.dtb \
135 sun5i-olinuxino.dtb 136 sun5i-a13-olinuxino.dtb
136dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ 137dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
137 tegra20-medcom-wide.dtb \ 138 tegra20-medcom-wide.dtb \
138 tegra20-paz00.dtb \ 139 tegra20-paz00.dtb \
diff --git a/arch/arm/boot/dts/imx27-3ds.dts b/arch/arm/boot/dts/imx27-3ds.dts
index b01c0d745fc5..fa04c7b18bcb 100644
--- a/arch/arm/boot/dts/imx27-3ds.dts
+++ b/arch/arm/boot/dts/imx27-3ds.dts
@@ -21,17 +21,17 @@
21 }; 21 };
22 22
23 soc { 23 soc {
24 aipi@10000000 { /* aipi */ 24 aipi@10000000 { /* aipi1 */
25
26 uart1: serial@1000a000 { 25 uart1: serial@1000a000 {
27 fsl,uart-has-rtscts; 26 fsl,uart-has-rtscts;
28 status = "okay"; 27 status = "okay";
29 }; 28 };
29 };
30 30
31 fec@1002b000 { 31 aipi@10020000 { /* aipi2 */
32 ethernet@1002b000 {
32 status = "okay"; 33 status = "okay";
33 }; 34 };
34 }; 35 };
35 }; 36 };
36
37}; 37};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore.dts b/arch/arm/boot/dts/imx27-phytec-phycore.dts
index af50469e34b2..53b0ec0c228e 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore.dts
+++ b/arch/arm/boot/dts/imx27-phytec-phycore.dts
@@ -21,8 +21,7 @@
21 }; 21 };
22 22
23 soc { 23 soc {
24 aipi@10000000 { /* aipi */ 24 aipi@10000000 { /* aipi1 */
25
26 serial@1000a000 { 25 serial@1000a000 {
27 fsl,uart-has-rtscts; 26 fsl,uart-has-rtscts;
28 status = "okay"; 27 status = "okay";
@@ -38,10 +37,6 @@
38 status = "okay"; 37 status = "okay";
39 }; 38 };
40 39
41 ethernet@1002b000 {
42 status = "okay";
43 };
44
45 i2c@1001d000 { 40 i2c@1001d000 {
46 clock-frequency = <400000>; 41 clock-frequency = <400000>;
47 status = "okay"; 42 status = "okay";
@@ -60,6 +55,12 @@
60 }; 55 };
61 }; 56 };
62 }; 57 };
58
59 aipi@10020000 { /* aipi2 */
60 ethernet@1002b000 {
61 status = "okay";
62 };
63 };
63 }; 64 };
64 65
65 nor_flash@c0000000 { 66 nor_flash@c0000000 {
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index b8d3905915ac..5a82cb5707a8 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -55,7 +55,7 @@
55 compatible = "fsl,aipi-bus", "simple-bus"; 55 compatible = "fsl,aipi-bus", "simple-bus";
56 #address-cells = <1>; 56 #address-cells = <1>;
57 #size-cells = <1>; 57 #size-cells = <1>;
58 reg = <0x10000000 0x10000000>; 58 reg = <0x10000000 0x20000>;
59 ranges; 59 ranges;
60 60
61 wdog: wdog@10002000 { 61 wdog: wdog@10002000 {
@@ -211,6 +211,15 @@
211 status = "disabled"; 211 status = "disabled";
212 }; 212 };
213 213
214 };
215
216 aipi@10020000 { /* AIPI2 */
217 compatible = "fsl,aipi-bus", "simple-bus";
218 #address-cells = <1>;
219 #size-cells = <1>;
220 reg = <0x10020000 0x20000>;
221 ranges;
222
214 fec: ethernet@1002b000 { 223 fec: ethernet@1002b000 {
215 compatible = "fsl,imx27-fec"; 224 compatible = "fsl,imx27-fec";
216 reg = <0x1002b000 0x4000>; 225 reg = <0x1002b000 0x4000>;
diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts
index 77b84e17c477..9b0d07746cba 100644
--- a/arch/arm/boot/dts/omap2420-h4.dts
+++ b/arch/arm/boot/dts/omap2420-h4.dts
@@ -15,6 +15,6 @@
15 15
16 memory { 16 memory {
17 device_type = "memory"; 17 device_type = "memory";
18 reg = <0x80000000 0x84000000>; /* 64 MB */ 18 reg = <0x80000000 0x4000000>; /* 64 MB */
19 }; 19 };
20}; 20};
diff --git a/arch/arm/boot/dts/sun4i-cubieboard.dts b/arch/arm/boot/dts/sun4i-cubieboard.dts
index f4ca126ad994..5cab82540437 100644
--- a/arch/arm/boot/dts/sun4i-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-cubieboard.dts
@@ -11,11 +11,11 @@
11 */ 11 */
12 12
13/dts-v1/; 13/dts-v1/;
14/include/ "sun4i.dtsi" 14/include/ "sun4i-a10.dtsi"
15 15
16/ { 16/ {
17 model = "Cubietech Cubieboard"; 17 model = "Cubietech Cubieboard";
18 compatible = "cubietech,cubieboard", "allwinner,sun4i"; 18 compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10";
19 19
20 aliases { 20 aliases {
21 serial0 = &uart0; 21 serial0 = &uart0;
diff --git a/arch/arm/boot/dts/sun5i-olinuxino.dts b/arch/arm/boot/dts/sun5i-olinuxino.dts
index d6ff889a5d87..498a091a4ea2 100644
--- a/arch/arm/boot/dts/sun5i-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-olinuxino.dts
@@ -12,11 +12,11 @@
12 */ 12 */
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun5i.dtsi" 15/include/ "sun5i-a13.dtsi"
16 16
17/ { 17/ {
18 model = "Olimex A13-Olinuxino"; 18 model = "Olimex A13-Olinuxino";
19 compatible = "olimex,a13-olinuxino", "allwinner,sun5i"; 19 compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13";
20 20
21 chosen { 21 chosen {
22 bootargs = "earlyprintk console=ttyS0,115200"; 22 bootargs = "earlyprintk console=ttyS0,115200";
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 7211772edd9d..0299915575a8 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -41,6 +41,7 @@
41#include <mach/cp_intc.h> 41#include <mach/cp_intc.h>
42#include <mach/da8xx.h> 42#include <mach/da8xx.h>
43#include <mach/mux.h> 43#include <mach/mux.h>
44#include <mach/sram.h>
44 45
45#include <asm/mach-types.h> 46#include <asm/mach-types.h>
46#include <asm/mach/arch.h> 47#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index 16026c2b1c8c..d64274fc5760 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -47,13 +47,9 @@ static void __raw_writel(unsigned int value, unsigned int ptr)
47 47
48static inline void putc(int c) 48static inline void putc(int c)
49{ 49{
50 int i; 50 /* Transmit fifo not full? */
51 51 while (__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)
52 for (i = 0; i < 1000; i++) { 52 ;
53 /* Transmit fifo not full? */
54 if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF))
55 break;
56 }
57 53
58 __raw_writeb(c, PHYS_UART_DATA); 54 __raw_writeb(c, PHYS_UART_DATA);
59} 55}
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index dac146df79ac..04744f9c120f 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -25,7 +25,7 @@ void exynos_init_late(void);
25#ifdef CONFIG_PM_GENERIC_DOMAINS 25#ifdef CONFIG_PM_GENERIC_DOMAINS
26int exynos_pm_late_initcall(void); 26int exynos_pm_late_initcall(void);
27#else 27#else
28static int exynos_pm_late_initcall(void) { return 0; } 28static inline int exynos_pm_late_initcall(void) { return 0; }
29#endif 29#endif
30 30
31#ifdef CONFIG_ARCH_EXYNOS4 31#ifdef CONFIG_ARCH_EXYNOS4
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index e8c0473c7568..579023f59dc1 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -319,6 +319,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
319 unsigned long rate_ckih1, unsigned long rate_ckih2) 319 unsigned long rate_ckih1, unsigned long rate_ckih2)
320{ 320{
321 int i; 321 int i;
322 u32 val;
322 struct device_node *np; 323 struct device_node *np;
323 324
324 clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX51_DPLL1_BASE); 325 clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX51_DPLL1_BASE);
@@ -390,6 +391,21 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
390 imx_print_silicon_rev("i.MX51", mx51_revision()); 391 imx_print_silicon_rev("i.MX51", mx51_revision());
391 clk_disable_unprepare(clk[iim_gate]); 392 clk_disable_unprepare(clk[iim_gate]);
392 393
394 /*
395 * Reference Manual says: Functionality of CCDR[18] and CLPCR[23] is no
396 * longer supported. Set to one for better power saving.
397 *
398 * The effect of not setting these bits is that MIPI clocks can't be
399 * enabled without the IPU clock being enabled aswell.
400 */
401 val = readl(MXC_CCM_CCDR);
402 val |= 1 << 18;
403 writel(val, MXC_CCM_CCDR);
404
405 val = readl(MXC_CCM_CLPCR);
406 val |= 1 << 23;
407 writel(val, MXC_CCM_CLPCR);
408
393 return 0; 409 return 0;
394} 410}
395 411
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-emma.c b/arch/arm/mach-imx/devices/platform-mx2-emma.c
index 508404ddd4ea..11bd01d402f2 100644
--- a/arch/arm/plat-mxc/devices/platform-mx2-emma.c
+++ b/arch/arm/mach-imx/devices/platform-mx2-emma.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_mx2_emmaprp_data_entry_single(soc) \ 12#define imx_mx2_emmaprp_data_entry_single(soc) \
13 { \ 13 { \
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index be0f62bf9037..41b581fd0213 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC
26 26
27config SOC_HAS_REALTIME_COUNTER 27config SOC_HAS_REALTIME_COUNTER
28 bool "Real time free running counter" 28 bool "Real time free running counter"
29 depends on SOC_OMAP5
30 default y
29 31
30config ARCH_OMAP2 32config ARCH_OMAP2
31 bool "TI OMAP2" 33 bool "TI OMAP2"
@@ -79,7 +81,6 @@ config SOC_OMAP5
79 select ARM_GIC 81 select ARM_GIC
80 select CPU_V7 82 select CPU_V7
81 select HAVE_SMP 83 select HAVE_SMP
82 select SOC_HAS_REALTIME_COUNTER
83 select COMMON_CLK 84 select COMMON_CLK
84 85
85comment "OMAP Core Type" 86comment "OMAP Core Type"
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 7b201546834d..bb73afc9ac17 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -157,6 +157,7 @@ static struct omap_dss_device sdp3430_lcd_device = {
157 157
158static struct tfp410_platform_data dvi_panel = { 158static struct tfp410_platform_data dvi_panel = {
159 .power_down_gpio = -1, 159 .power_down_gpio = -1,
160 .i2c_bus_num = -1,
160}; 161};
161 162
162static struct omap_dss_device sdp3430_dvi_device = { 163static struct omap_dss_device sdp3430_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 4be58fd071f6..f81a303b87ff 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -208,6 +208,7 @@ static struct omap_dss_device am3517_evm_tv_device = {
208 208
209static struct tfp410_platform_data dvi_panel = { 209static struct tfp410_platform_data dvi_panel = {
210 .power_down_gpio = -1, 210 .power_down_gpio = -1,
211 .i2c_bus_num = -1,
211}; 212};
212 213
213static struct omap_dss_device am3517_evm_dvi_device = { 214static struct omap_dss_device am3517_evm_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index c8e37dc00892..b3102c2f4a3c 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -241,6 +241,7 @@ static struct omap_dss_device cm_t35_lcd_device = {
241 241
242static struct tfp410_platform_data dvi_panel = { 242static struct tfp410_platform_data dvi_panel = {
243 .power_down_gpio = CM_T35_DVI_EN_GPIO, 243 .power_down_gpio = CM_T35_DVI_EN_GPIO,
244 .i2c_bus_num = -1,
244}; 245};
245 246
246static struct omap_dss_device cm_t35_dvi_device = { 247static struct omap_dss_device cm_t35_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 7667eb749522..12865af25d3a 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -141,6 +141,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
141 141
142static struct tfp410_platform_data dvi_panel = { 142static struct tfp410_platform_data dvi_panel = {
143 .power_down_gpio = -1, 143 .power_down_gpio = -1,
144 .i2c_bus_num = 1,
144}; 145};
145 146
146static struct omap_dss_device devkit8000_dvi_device = { 147static struct omap_dss_device devkit8000_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 9a3878ec2256..3be1311f9e33 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -27,14 +27,12 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29#include <linux/mfd/menelaus.h> 29#include <linux/mfd/menelaus.h>
30#include <linux/omap-dma.h>
30 31
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 34#include <asm/mach/map.h>
34 35
35#include <linux/omap-dma.h>
36#include <plat/debug-devices.h>
37
38#include <video/omapdss.h> 36#include <video/omapdss.h>
39#include <video/omap-panel-generic-dpi.h> 37#include <video/omap-panel-generic-dpi.h>
40 38
@@ -42,11 +40,9 @@
42#include "mux.h" 40#include "mux.h"
43#include "control.h" 41#include "control.h"
44#include "gpmc.h" 42#include "gpmc.h"
43#include "gpmc-smc91x.h"
45 44
46#define H4_FLASH_CS 0 45#define H4_FLASH_CS 0
47#define H4_SMC91X_CS 1
48
49#define H4_ETHR_GPIO_IRQ 92
50 46
51#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE) 47#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)
52static const uint32_t board_matrix_keys[] = { 48static const uint32_t board_matrix_keys[] = {
@@ -250,71 +246,31 @@ static u32 is_gpmc_muxed(void)
250 return 0; 246 return 0;
251} 247}
252 248
253static inline void __init h4_init_debug(void) 249#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)
254{
255 int eth_cs;
256 unsigned long cs_mem_base;
257 unsigned int muxed, rate;
258 struct clk *gpmc_fck;
259
260 eth_cs = H4_SMC91X_CS;
261 250
262 gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */ 251static struct omap_smc91x_platform_data board_smc91x_data = {
263 if (IS_ERR(gpmc_fck)) { 252 .cs = 1,
264 WARN_ON(1); 253 .gpio_irq = 92,
265 return; 254 .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_LOWLEVEL,
266 } 255};
267
268 clk_prepare_enable(gpmc_fck);
269 rate = clk_get_rate(gpmc_fck);
270 clk_disable_unprepare(gpmc_fck);
271 clk_put(gpmc_fck);
272 256
257static void __init board_smc91x_init(void)
258{
273 if (is_gpmc_muxed()) 259 if (is_gpmc_muxed())
274 muxed = 0x200; 260 board_smc91x_data.flags |= GPMC_MUX_ADD_DATA;
275 else
276 muxed = 0;
277
278 /* Make sure CS1 timings are correct */
279 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1,
280 0x00011000 | muxed);
281
282 if (rate >= 160000000) {
283 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
284 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
285 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
286 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
287 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
288 } else if (rate >= 130000000) {
289 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
290 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
291 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
292 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
293 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
294 } else {/* rate = 100000000 */
295 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
296 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
297 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
298 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
299 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
300 }
301
302 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
303 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
304 goto out;
305 }
306 261
307 udelay(100); 262 omap_mux_init_gpio(board_smc91x_data.gpio_irq, OMAP_PIN_INPUT);
263 gpmc_smc91x_init(&board_smc91x_data);
264}
308 265
309 omap_mux_init_gpio(92, 0); 266#else
310 if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0)
311 gpmc_cs_free(eth_cs);
312 267
313out: 268static inline void board_smc91x_init(void)
314 clk_disable_unprepare(gpmc_fck); 269{
315 clk_put(gpmc_fck);
316} 270}
317 271
272#endif
273
318static void __init h4_init_flash(void) 274static void __init h4_init_flash(void)
319{ 275{
320 unsigned long base; 276 unsigned long base;
@@ -371,6 +327,7 @@ static void __init omap_h4_init(void)
371 omap_serial_init(); 327 omap_serial_init();
372 omap_sdrc_init(NULL, NULL); 328 omap_sdrc_init(NULL, NULL);
373 h4_init_flash(); 329 h4_init_flash();
330 board_smc91x_init();
374 331
375 omap_display_init(&h4_dss_data); 332 omap_display_init(&h4_dss_data);
376} 333}
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 54647d6286b4..3985f35aee06 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -240,6 +240,7 @@ static struct omap_dss_device omap3_evm_tv_device = {
240 240
241static struct tfp410_platform_data dvi_panel = { 241static struct tfp410_platform_data dvi_panel = {
242 .power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO, 242 .power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO,
243 .i2c_bus_num = -1,
243}; 244};
244 245
245static struct omap_dss_device omap3_evm_dvi_device = { 246static struct omap_dss_device omap3_evm_dvi_device = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index d8638b3b4f94..53a6cbcf9747 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -118,6 +118,7 @@ static struct omap_dss_device omap3_stalker_tv_device = {
118 118
119static struct tfp410_platform_data dvi_panel = { 119static struct tfp410_platform_data dvi_panel = {
120 .power_down_gpio = DSS_ENABLE_GPIO, 120 .power_down_gpio = DSS_ENABLE_GPIO,
121 .i2c_bus_num = -1,
121}; 122};
122 123
123static struct omap_dss_device omap3_stalker_dvi_device = { 124static struct omap_dss_device omap3_stalker_dvi_device = {
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
index aa56c3e5bb34..5789a5e25563 100644
--- a/arch/arm/mach-omap2/cclock44xx_data.c
+++ b/arch/arm/mach-omap2/cclock44xx_data.c
@@ -40,6 +40,14 @@
40#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0 40#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0
41#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1 41#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1
42 42
43/*
44 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
45 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
46 * must be set to 196.608 MHz" and hence, the DPLL locked frequency is
47 * half of this value.
48 */
49#define OMAP4_DPLL_ABE_DEFFREQ 98304000
50
43/* Root clocks */ 51/* Root clocks */
44 52
45DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0); 53DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
@@ -124,6 +132,8 @@ static struct dpll_data dpll_abe_dd = {
124 .enable_mask = OMAP4430_DPLL_EN_MASK, 132 .enable_mask = OMAP4430_DPLL_EN_MASK,
125 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, 133 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
126 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, 134 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
135 .m4xen_mask = OMAP4430_DPLL_REGM4XEN_MASK,
136 .lpmode_mask = OMAP4430_DPLL_LPMODE_EN_MASK,
127 .max_multiplier = 2047, 137 .max_multiplier = 2047,
128 .max_divider = 128, 138 .max_divider = 128,
129 .min_divider = 1, 139 .min_divider = 1,
@@ -233,7 +243,7 @@ static struct dpll_data dpll_core_dd = {
233 243
234 244
235static const char *dpll_core_ck_parents[] = { 245static const char *dpll_core_ck_parents[] = {
236 "sys_clkin_ck", 246 "sys_clkin_ck", "core_hsd_byp_clk_mux_ck"
237}; 247};
238 248
239static struct clk dpll_core_ck; 249static struct clk dpll_core_ck;
@@ -286,9 +296,9 @@ DEFINE_CLK_DIVIDER(div_core_ck, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 0x0,
286 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT, 296 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT,
287 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL); 297 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL);
288 298
289DEFINE_CLK_OMAP_HSDIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", 299DEFINE_CLK_DIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
290 &dpll_core_m5x2_ck, 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, 300 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, OMAP4430_CLKSEL_0_1_SHIFT,
291 OMAP4430_CLKSEL_0_1_MASK); 301 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
292 302
293DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 303DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
294 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT, 304 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT,
@@ -363,8 +373,21 @@ static struct dpll_data dpll_iva_dd = {
363 .min_divider = 1, 373 .min_divider = 1,
364}; 374};
365 375
376static const char *dpll_iva_ck_parents[] = {
377 "sys_clkin_ck", "iva_hsd_byp_clk_mux_ck"
378};
379
366static struct clk dpll_iva_ck; 380static struct clk dpll_iva_ck;
367 381
382static const struct clk_ops dpll_ck_ops = {
383 .enable = &omap3_noncore_dpll_enable,
384 .disable = &omap3_noncore_dpll_disable,
385 .recalc_rate = &omap3_dpll_recalc,
386 .round_rate = &omap2_dpll_round_rate,
387 .set_rate = &omap3_noncore_dpll_set_rate,
388 .get_parent = &omap2_init_dpll_parent,
389};
390
368static struct clk_hw_omap dpll_iva_ck_hw = { 391static struct clk_hw_omap dpll_iva_ck_hw = {
369 .hw = { 392 .hw = {
370 .clk = &dpll_iva_ck, 393 .clk = &dpll_iva_ck,
@@ -373,7 +396,7 @@ static struct clk_hw_omap dpll_iva_ck_hw = {
373 .ops = &clkhwops_omap3_dpll, 396 .ops = &clkhwops_omap3_dpll,
374}; 397};
375 398
376DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 399DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_iva_ck_parents, dpll_ck_ops);
377 400
378static const char *dpll_iva_x2_ck_parents[] = { 401static const char *dpll_iva_x2_ck_parents[] = {
379 "dpll_iva_ck", 402 "dpll_iva_ck",
@@ -416,6 +439,10 @@ static struct dpll_data dpll_mpu_dd = {
416 .min_divider = 1, 439 .min_divider = 1,
417}; 440};
418 441
442static const char *dpll_mpu_ck_parents[] = {
443 "sys_clkin_ck", "div_mpu_hs_clk"
444};
445
419static struct clk dpll_mpu_ck; 446static struct clk dpll_mpu_ck;
420 447
421static struct clk_hw_omap dpll_mpu_ck_hw = { 448static struct clk_hw_omap dpll_mpu_ck_hw = {
@@ -426,7 +453,7 @@ static struct clk_hw_omap dpll_mpu_ck_hw = {
426 .ops = &clkhwops_omap3_dpll, 453 .ops = &clkhwops_omap3_dpll,
427}; 454};
428 455
429DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 456DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_mpu_ck_parents, dpll_ck_ops);
430 457
431DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2); 458DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2);
432 459
@@ -464,6 +491,9 @@ static struct dpll_data dpll_per_dd = {
464 .min_divider = 1, 491 .min_divider = 1,
465}; 492};
466 493
494static const char *dpll_per_ck_parents[] = {
495 "sys_clkin_ck", "per_hsd_byp_clk_mux_ck"
496};
467 497
468static struct clk dpll_per_ck; 498static struct clk dpll_per_ck;
469 499
@@ -475,7 +505,7 @@ static struct clk_hw_omap dpll_per_ck_hw = {
475 .ops = &clkhwops_omap3_dpll, 505 .ops = &clkhwops_omap3_dpll,
476}; 506};
477 507
478DEFINE_STRUCT_CLK(dpll_per_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 508DEFINE_STRUCT_CLK(dpll_per_ck, dpll_per_ck_parents, dpll_ck_ops);
479 509
480DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0, 510DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,
481 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT, 511 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
@@ -559,6 +589,10 @@ static struct dpll_data dpll_usb_dd = {
559 .min_divider = 1, 589 .min_divider = 1,
560}; 590};
561 591
592static const char *dpll_usb_ck_parents[] = {
593 "sys_clkin_ck", "usb_hs_clk_div_ck"
594};
595
562static struct clk dpll_usb_ck; 596static struct clk dpll_usb_ck;
563 597
564static struct clk_hw_omap dpll_usb_ck_hw = { 598static struct clk_hw_omap dpll_usb_ck_hw = {
@@ -569,7 +603,7 @@ static struct clk_hw_omap dpll_usb_ck_hw = {
569 .ops = &clkhwops_omap3_dpll, 603 .ops = &clkhwops_omap3_dpll,
570}; 604};
571 605
572DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 606DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops);
573 607
574static const char *dpll_usb_clkdcoldo_ck_parents[] = { 608static const char *dpll_usb_clkdcoldo_ck_parents[] = {
575 "dpll_usb_ck", 609 "dpll_usb_ck",
@@ -696,9 +730,13 @@ DEFINE_CLK_DIVIDER(syc_clk_div_ck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
696 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT, 730 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
697 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL); 731 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
698 732
733static const char *dbgclk_mux_ck_parents[] = {
734 "sys_clkin_ck"
735};
736
699static struct clk dbgclk_mux_ck; 737static struct clk dbgclk_mux_ck;
700DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL); 738DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL);
701DEFINE_STRUCT_CLK(dbgclk_mux_ck, dpll_core_ck_parents, 739DEFINE_STRUCT_CLK(dbgclk_mux_ck, dbgclk_mux_ck_parents,
702 dpll_usb_clkdcoldo_ck_ops); 740 dpll_usb_clkdcoldo_ck_ops);
703 741
704/* Leaf clocks controlled by modules */ 742/* Leaf clocks controlled by modules */
@@ -1935,10 +1973,10 @@ static struct omap_clk omap44xx_clks[] = {
1935 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X), 1973 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1936 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X), 1974 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1937 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X), 1975 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1938 CLK("49038000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1976 CLK("40138000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1939 CLK("4903a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1977 CLK("4013a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1940 CLK("4903c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1978 CLK("4013c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1941 CLK("4903e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1979 CLK("4013e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1942 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X), 1980 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
1943}; 1981};
1944 1982
@@ -1955,6 +1993,7 @@ int __init omap4xxx_clk_init(void)
1955{ 1993{
1956 u32 cpu_clkflg; 1994 u32 cpu_clkflg;
1957 struct omap_clk *c; 1995 struct omap_clk *c;
1996 int rc;
1958 1997
1959 if (cpu_is_omap443x()) { 1998 if (cpu_is_omap443x()) {
1960 cpu_mask = RATE_IN_4430; 1999 cpu_mask = RATE_IN_4430;
@@ -1983,5 +2022,18 @@ int __init omap4xxx_clk_init(void)
1983 omap2_clk_enable_init_clocks(enable_init_clks, 2022 omap2_clk_enable_init_clocks(enable_init_clks,
1984 ARRAY_SIZE(enable_init_clks)); 2023 ARRAY_SIZE(enable_init_clks));
1985 2024
2025 /*
2026 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
2027 * state when turning the ABE clock domain. Workaround this by
2028 * locking the ABE DPLL on boot.
2029 */
2030 if (cpu_is_omap446x()) {
2031 rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
2032 if (!rc)
2033 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
2034 if (rc)
2035 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
2036 }
2037
1986 return 0; 2038 return 0;
1987} 2039}
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 9917f793c3b6..b40204837bd7 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -195,6 +195,10 @@ struct clksel {
195 * @enable_mask: mask of the DPLL mode bitfield in @control_reg 195 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
196 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() 196 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
197 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() 197 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
198 * @last_rounded_m4xen: cache of the last M4X result of
199 * omap4_dpll_regm4xen_round_rate()
200 * @last_rounded_lpmode: cache of the last lpmode result of
201 * omap4_dpll_lpmode_recalc()
198 * @max_multiplier: maximum valid non-bypass multiplier value (actual) 202 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
199 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate() 203 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
200 * @min_divider: minimum valid non-bypass divider value (actual) 204 * @min_divider: minimum valid non-bypass divider value (actual)
@@ -205,6 +209,8 @@ struct clksel {
205 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg 209 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
206 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg 210 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
207 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg 211 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
212 * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
213 * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
208 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg 214 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
209 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs 215 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
210 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs 216 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
@@ -233,6 +239,8 @@ struct dpll_data {
233 u32 enable_mask; 239 u32 enable_mask;
234 unsigned long last_rounded_rate; 240 unsigned long last_rounded_rate;
235 u16 last_rounded_m; 241 u16 last_rounded_m;
242 u8 last_rounded_m4xen;
243 u8 last_rounded_lpmode;
236 u16 max_multiplier; 244 u16 max_multiplier;
237 u8 last_rounded_n; 245 u8 last_rounded_n;
238 u8 min_divider; 246 u8 min_divider;
@@ -245,6 +253,8 @@ struct dpll_data {
245 u32 idlest_mask; 253 u32 idlest_mask;
246 u32 dco_mask; 254 u32 dco_mask;
247 u32 sddiv_mask; 255 u32 sddiv_mask;
256 u32 lpmode_mask;
257 u32 m4xen_mask;
248 u8 auto_recal_bit; 258 u8 auto_recal_bit;
249 u8 recal_en_bit; 259 u8 recal_en_bit;
250 u8 recal_st_bit; 260 u8 recal_st_bit;
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 384873580b23..7faf82d4e85c 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -998,7 +998,8 @@ int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
998 spin_lock_irqsave(&clkdm->lock, flags); 998 spin_lock_irqsave(&clkdm->lock, flags);
999 999
1000 /* corner case: disabling unused clocks */ 1000 /* corner case: disabling unused clocks */
1001 if (__clk_get_enable_count(clk) == 0) 1001 if ((__clk_get_enable_count(clk) == 0) &&
1002 (atomic_read(&clkdm->usecount) == 0))
1002 goto ccd_exit; 1003 goto ccd_exit;
1003 1004
1004 if (atomic_read(&clkdm->usecount) == 0) { 1005 if (atomic_read(&clkdm->usecount) == 0) {
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 5c2fd4863b2b..2dabb9ecb986 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -16,8 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_data/dsp-omap.h> 17#include <linux/platform_data/dsp-omap.h>
18 18
19#include <plat/vram.h>
20
21#include "common.h" 19#include "common.h"
22#include "omap-secure.h" 20#include "omap-secure.h"
23 21
@@ -32,7 +30,6 @@ int __weak omap_secure_ram_reserve_memblock(void)
32 30
33void __init omap_reserve(void) 31void __init omap_reserve(void)
34{ 32{
35 omap_vram_reserve_sdram_memblock();
36 omap_dsp_reserve_sdram_memblock(); 33 omap_dsp_reserve_sdram_memblock();
37 omap_secure_ram_reserve_memblock(); 34 omap_secure_ram_reserve_memblock();
38 omap_barrier_reserve_memblock(); 35 omap_barrier_reserve_memblock();
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index bca7a8885703..22590dbe8f14 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -40,6 +40,8 @@ struct omap3_idle_statedata {
40 u32 core_state; 40 u32 core_state;
41}; 41};
42 42
43static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
44
43static struct omap3_idle_statedata omap3_idle_data[] = { 45static struct omap3_idle_statedata omap3_idle_data[] = {
44 { 46 {
45 .mpu_state = PWRDM_POWER_ON, 47 .mpu_state = PWRDM_POWER_ON,
@@ -71,7 +73,7 @@ static struct omap3_idle_statedata omap3_idle_data[] = {
71 }, 73 },
72}; 74};
73 75
74static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; 76/* Private functions */
75 77
76static int __omap3_enter_idle(struct cpuidle_device *dev, 78static int __omap3_enter_idle(struct cpuidle_device *dev,
77 struct cpuidle_driver *drv, 79 struct cpuidle_driver *drv,
@@ -260,11 +262,11 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
260 return ret; 262 return ret;
261} 263}
262 264
263DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); 265static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
264 266
265struct cpuidle_driver omap3_idle_driver = { 267static struct cpuidle_driver omap3_idle_driver = {
266 .name = "omap3_idle", 268 .name = "omap3_idle",
267 .owner = THIS_MODULE, 269 .owner = THIS_MODULE,
268 .states = { 270 .states = {
269 { 271 {
270 .enter = omap3_enter_idle_bm, 272 .enter = omap3_enter_idle_bm,
@@ -327,6 +329,8 @@ struct cpuidle_driver omap3_idle_driver = {
327 .safe_state_index = 0, 329 .safe_state_index = 0,
328}; 330};
329 331
332/* Public functions */
333
330/** 334/**
331 * omap3_idle_init - Init routine for OMAP3 idle 335 * omap3_idle_init - Init routine for OMAP3 idle
332 * 336 *
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 288bee6cbb76..d639aef0deda 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -54,6 +54,8 @@ static struct clockdomain *cpu_clkdm[NR_CPUS];
54static atomic_t abort_barrier; 54static atomic_t abort_barrier;
55static bool cpu_done[NR_CPUS]; 55static bool cpu_done[NR_CPUS];
56 56
57/* Private functions */
58
57/** 59/**
58 * omap4_enter_idle_coupled_[simple/coupled] - OMAP4 cpuidle entry functions 60 * omap4_enter_idle_coupled_[simple/coupled] - OMAP4 cpuidle entry functions
59 * @dev: cpuidle device 61 * @dev: cpuidle device
@@ -161,9 +163,19 @@ fail:
161 return index; 163 return index;
162} 164}
163 165
164DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev); 166/*
167 * For each cpu, setup the broadcast timer because local timers
168 * stops for the states above C1.
169 */
170static void omap_setup_broadcast_timer(void *arg)
171{
172 int cpu = smp_processor_id();
173 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
174}
175
176static DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
165 177
166struct cpuidle_driver omap4_idle_driver = { 178static struct cpuidle_driver omap4_idle_driver = {
167 .name = "omap4_idle", 179 .name = "omap4_idle",
168 .owner = THIS_MODULE, 180 .owner = THIS_MODULE,
169 .en_core_tk_irqen = 1, 181 .en_core_tk_irqen = 1,
@@ -178,7 +190,7 @@ struct cpuidle_driver omap4_idle_driver = {
178 .desc = "MPUSS ON" 190 .desc = "MPUSS ON"
179 }, 191 },
180 { 192 {
181 /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ 193 /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
182 .exit_latency = 328 + 440, 194 .exit_latency = 328 + 440,
183 .target_residency = 960, 195 .target_residency = 960,
184 .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, 196 .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED,
@@ -200,15 +212,7 @@ struct cpuidle_driver omap4_idle_driver = {
200 .safe_state_index = 0, 212 .safe_state_index = 0,
201}; 213};
202 214
203/* 215/* Public functions */
204 * For each cpu, setup the broadcast timer because local timers
205 * stops for the states above C1.
206 */
207static void omap_setup_broadcast_timer(void *arg)
208{
209 int cpu = smp_processor_id();
210 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
211}
212 216
213/** 217/**
214 * omap4_idle_init - Init routine for OMAP4 idle 218 * omap4_idle_init - Init routine for OMAP4 idle
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index fafb28c0dcbc..2bb18838cba9 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -291,16 +291,13 @@ static void _lookup_sddiv(struct clk_hw_omap *clk, u8 *sd_div, u16 m, u8 n)
291 291
292/* 292/*
293 * _omap3_noncore_dpll_program - set non-core DPLL M,N values directly 293 * _omap3_noncore_dpll_program - set non-core DPLL M,N values directly
294 * @clk: struct clk * of DPLL to set 294 * @clk: struct clk * of DPLL to set
295 * @m: DPLL multiplier to set 295 * @freqsel: FREQSEL value to set
296 * @n: DPLL divider to set
297 * @freqsel: FREQSEL value to set
298 * 296 *
299 * Program the DPLL with the supplied M, N values, and wait for the DPLL to 297 * Program the DPLL with the last M, N values calculated, and wait for
300 * lock.. Returns -EINVAL upon error, or 0 upon success. 298 * the DPLL to lock. Returns -EINVAL upon error, or 0 upon success.
301 */ 299 */
302static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 m, u8 n, 300static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
303 u16 freqsel)
304{ 301{
305 struct dpll_data *dd = clk->dpll_data; 302 struct dpll_data *dd = clk->dpll_data;
306 u8 dco, sd_div; 303 u8 dco, sd_div;
@@ -323,23 +320,45 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 m, u8 n,
323 /* Set DPLL multiplier, divider */ 320 /* Set DPLL multiplier, divider */
324 v = __raw_readl(dd->mult_div1_reg); 321 v = __raw_readl(dd->mult_div1_reg);
325 v &= ~(dd->mult_mask | dd->div1_mask); 322 v &= ~(dd->mult_mask | dd->div1_mask);
326 v |= m << __ffs(dd->mult_mask); 323 v |= dd->last_rounded_m << __ffs(dd->mult_mask);
327 v |= (n - 1) << __ffs(dd->div1_mask); 324 v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask);
328 325
329 /* Configure dco and sd_div for dplls that have these fields */ 326 /* Configure dco and sd_div for dplls that have these fields */
330 if (dd->dco_mask) { 327 if (dd->dco_mask) {
331 _lookup_dco(clk, &dco, m, n); 328 _lookup_dco(clk, &dco, dd->last_rounded_m, dd->last_rounded_n);
332 v &= ~(dd->dco_mask); 329 v &= ~(dd->dco_mask);
333 v |= dco << __ffs(dd->dco_mask); 330 v |= dco << __ffs(dd->dco_mask);
334 } 331 }
335 if (dd->sddiv_mask) { 332 if (dd->sddiv_mask) {
336 _lookup_sddiv(clk, &sd_div, m, n); 333 _lookup_sddiv(clk, &sd_div, dd->last_rounded_m,
334 dd->last_rounded_n);
337 v &= ~(dd->sddiv_mask); 335 v &= ~(dd->sddiv_mask);
338 v |= sd_div << __ffs(dd->sddiv_mask); 336 v |= sd_div << __ffs(dd->sddiv_mask);
339 } 337 }
340 338
341 __raw_writel(v, dd->mult_div1_reg); 339 __raw_writel(v, dd->mult_div1_reg);
342 340
341 /* Set 4X multiplier and low-power mode */
342 if (dd->m4xen_mask || dd->lpmode_mask) {
343 v = __raw_readl(dd->control_reg);
344
345 if (dd->m4xen_mask) {
346 if (dd->last_rounded_m4xen)
347 v |= dd->m4xen_mask;
348 else
349 v &= ~dd->m4xen_mask;
350 }
351
352 if (dd->lpmode_mask) {
353 if (dd->last_rounded_lpmode)
354 v |= dd->lpmode_mask;
355 else
356 v &= ~dd->lpmode_mask;
357 }
358
359 __raw_writel(v, dd->control_reg);
360 }
361
343 /* We let the clock framework set the other output dividers later */ 362 /* We let the clock framework set the other output dividers later */
344 363
345 /* REVISIT: Set ramp-up delay? */ 364 /* REVISIT: Set ramp-up delay? */
@@ -492,8 +511,7 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
492 pr_debug("%s: %s: set rate: locking rate to %lu.\n", 511 pr_debug("%s: %s: set rate: locking rate to %lu.\n",
493 __func__, __clk_get_name(hw->clk), rate); 512 __func__, __clk_get_name(hw->clk), rate);
494 513
495 ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m, 514 ret = omap3_noncore_dpll_program(clk, freqsel);
496 dd->last_rounded_n, freqsel);
497 if (!ret) 515 if (!ret)
498 new_parent = dd->clk_ref; 516 new_parent = dd->clk_ref;
499 } 517 }
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c
index d3326c474fdc..d28b0f726715 100644
--- a/arch/arm/mach-omap2/dpll44xx.c
+++ b/arch/arm/mach-omap2/dpll44xx.c
@@ -20,6 +20,15 @@
20#include "clock44xx.h" 20#include "clock44xx.h"
21#include "cm-regbits-44xx.h" 21#include "cm-regbits-44xx.h"
22 22
23/*
24 * Maximum DPLL input frequency (FINT) and output frequency (FOUT) that
25 * can supported when using the DPLL low-power mode. Frequencies are
26 * defined in OMAP4430/60 Public TRM section 3.6.3.3.2 "Enable Control,
27 * Status, and Low-Power Operation Mode".
28 */
29#define OMAP4_DPLL_LP_FINT_MAX 1000000
30#define OMAP4_DPLL_LP_FOUT_MAX 100000000
31
23/* Supported only on OMAP4 */ 32/* Supported only on OMAP4 */
24int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk) 33int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk)
25{ 34{
@@ -82,6 +91,31 @@ const struct clk_hw_omap_ops clkhwops_omap4_dpllmx = {
82}; 91};
83 92
84/** 93/**
94 * omap4_dpll_lpmode_recalc - compute DPLL low-power setting
95 * @dd: pointer to the dpll data structure
96 *
97 * Calculates if low-power mode can be enabled based upon the last
98 * multiplier and divider values calculated. If low-power mode can be
99 * enabled, then the bit to enable low-power mode is stored in the
100 * last_rounded_lpmode variable. This implementation is based upon the
101 * criteria for enabling low-power mode as described in the OMAP4430/60
102 * Public TRM section 3.6.3.3.2 "Enable Control, Status, and Low-Power
103 * Operation Mode".
104 */
105static void omap4_dpll_lpmode_recalc(struct dpll_data *dd)
106{
107 long fint, fout;
108
109 fint = __clk_get_rate(dd->clk_ref) / (dd->last_rounded_n + 1);
110 fout = fint * dd->last_rounded_m;
111
112 if ((fint < OMAP4_DPLL_LP_FINT_MAX) && (fout < OMAP4_DPLL_LP_FOUT_MAX))
113 dd->last_rounded_lpmode = 1;
114 else
115 dd->last_rounded_lpmode = 0;
116}
117
118/**
85 * omap4_dpll_regm4xen_recalc - compute DPLL rate, considering REGM4XEN bit 119 * omap4_dpll_regm4xen_recalc - compute DPLL rate, considering REGM4XEN bit
86 * @clk: struct clk * of the DPLL to compute the rate for 120 * @clk: struct clk * of the DPLL to compute the rate for
87 * 121 *
@@ -130,7 +164,6 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
130 unsigned long *parent_rate) 164 unsigned long *parent_rate)
131{ 165{
132 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 166 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
133 u32 v;
134 struct dpll_data *dd; 167 struct dpll_data *dd;
135 long r; 168 long r;
136 169
@@ -139,18 +172,31 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
139 172
140 dd = clk->dpll_data; 173 dd = clk->dpll_data;
141 174
142 /* regm4xen adds a multiplier of 4 to DPLL calculations */ 175 dd->last_rounded_m4xen = 0;
143 v = __raw_readl(dd->control_reg) & OMAP4430_DPLL_REGM4XEN_MASK;
144
145 if (v)
146 target_rate = target_rate / OMAP4430_REGM4XEN_MULT;
147 176
177 /*
178 * First try to compute the DPLL configuration for
179 * target rate without using the 4X multiplier.
180 */
148 r = omap2_dpll_round_rate(hw, target_rate, NULL); 181 r = omap2_dpll_round_rate(hw, target_rate, NULL);
182 if (r != ~0)
183 goto out;
184
185 /*
186 * If we did not find a valid DPLL configuration, try again, but
187 * this time see if using the 4X multiplier can help. Enabling the
188 * 4X multiplier is equivalent to dividing the target rate by 4.
189 */
190 r = omap2_dpll_round_rate(hw, target_rate / OMAP4430_REGM4XEN_MULT,
191 NULL);
149 if (r == ~0) 192 if (r == ~0)
150 return r; 193 return r;
151 194
152 if (v) 195 dd->last_rounded_rate *= OMAP4430_REGM4XEN_MULT;
153 clk->dpll_data->last_rounded_rate *= OMAP4430_REGM4XEN_MULT; 196 dd->last_rounded_m4xen = 1;
197
198out:
199 omap4_dpll_lpmode_recalc(dd);
154 200
155 return clk->dpll_data->last_rounded_rate; 201 return dd->last_rounded_rate;
156} 202}
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 26126343d6ac..6a217c98db54 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -135,10 +135,7 @@ static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition,
135 135
136 old_mode = omap_mux_read(partition, gpio_mux->reg_offset); 136 old_mode = omap_mux_read(partition, gpio_mux->reg_offset);
137 mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); 137 mux_mode = val & ~(OMAP_MUX_NR_MODES - 1);
138 if (partition->flags & OMAP_MUX_GPIO_IN_MODE3) 138 mux_mode |= partition->gpio;
139 mux_mode |= OMAP_MUX_MODE3;
140 else
141 mux_mode |= OMAP_MUX_MODE4;
142 pr_debug("%s: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", __func__, 139 pr_debug("%s: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", __func__,
143 gpio_mux->muxnames[0], gpio, old_mode, mux_mode); 140 gpio_mux->muxnames[0], gpio, old_mode, mux_mode);
144 omap_mux_write(partition, mux_mode, gpio_mux->reg_offset); 141 omap_mux_write(partition, mux_mode, gpio_mux->reg_offset);
@@ -800,7 +797,7 @@ int __init omap_mux_late_init(void)
800 struct omap_mux *m = &e->mux; 797 struct omap_mux *m = &e->mux;
801 u16 mode = omap_mux_read(partition, m->reg_offset); 798 u16 mode = omap_mux_read(partition, m->reg_offset);
802 799
803 if (OMAP_MODE_GPIO(mode)) 800 if (OMAP_MODE_GPIO(partition, mode))
804 continue; 801 continue;
805 802
806#ifndef CONFIG_DEBUG_FS 803#ifndef CONFIG_DEBUG_FS
@@ -1065,7 +1062,7 @@ static void __init omap_mux_init_list(struct omap_mux_partition *partition,
1065 } 1062 }
1066#else 1063#else
1067 /* Skip pins that are not muxed as GPIO by bootloader */ 1064 /* Skip pins that are not muxed as GPIO by bootloader */
1068 if (!OMAP_MODE_GPIO(omap_mux_read(partition, 1065 if (!OMAP_MODE_GPIO(partition, omap_mux_read(partition,
1069 superset->reg_offset))) { 1066 superset->reg_offset))) {
1070 superset++; 1067 superset++;
1071 continue; 1068 continue;
@@ -1132,6 +1129,7 @@ int __init omap_mux_init(const char *name, u32 flags,
1132 1129
1133 partition->name = name; 1130 partition->name = name;
1134 partition->flags = flags; 1131 partition->flags = flags;
1132 partition->gpio = flags & OMAP_MUX_MODE7;
1135 partition->size = mux_size; 1133 partition->size = mux_size;
1136 partition->phys = mux_pbase; 1134 partition->phys = mux_pbase;
1137 partition->base = ioremap(mux_pbase, mux_size); 1135 partition->base = ioremap(mux_pbase, mux_size);
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 76f9b3c2f586..fdb22f14021f 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -58,7 +58,8 @@
58#define OMAP_PIN_OFF_INPUT_PULLDOWN (OMAP_OFF_EN | OMAP_OFF_PULL_EN) 58#define OMAP_PIN_OFF_INPUT_PULLDOWN (OMAP_OFF_EN | OMAP_OFF_PULL_EN)
59#define OMAP_PIN_OFF_WAKEUPENABLE OMAP_WAKEUP_EN 59#define OMAP_PIN_OFF_WAKEUPENABLE OMAP_WAKEUP_EN
60 60
61#define OMAP_MODE_GPIO(x) (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE4) 61#define OMAP_MODE_GPIO(partition, x) (((x) & OMAP_MUX_MODE7) == \
62 partition->gpio)
62#define OMAP_MODE_UART(x) (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE0) 63#define OMAP_MODE_UART(x) (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE0)
63 64
64/* Flags for omapX_mux_init */ 65/* Flags for omapX_mux_init */
@@ -79,13 +80,20 @@
79/* 80/*
80 * omap_mux_init flags definition: 81 * omap_mux_init flags definition:
81 * 82 *
83 * OMAP_GPIO_MUX_MODE, bits 0-2: gpio muxing mode, same like pad control
84 * register which includes values from 0-7.
82 * OMAP_MUX_REG_8BIT: Ensure that access to padconf is done in 8 bits. 85 * OMAP_MUX_REG_8BIT: Ensure that access to padconf is done in 8 bits.
83 * The default value is 16 bits. 86 * The default value is 16 bits.
84 * OMAP_MUX_GPIO_IN_MODE3: The GPIO is selected in mode3.
85 * The default is mode4.
86 */ 87 */
87#define OMAP_MUX_REG_8BIT (1 << 0) 88#define OMAP_MUX_GPIO_IN_MODE0 OMAP_MUX_MODE0
88#define OMAP_MUX_GPIO_IN_MODE3 (1 << 1) 89#define OMAP_MUX_GPIO_IN_MODE1 OMAP_MUX_MODE1
90#define OMAP_MUX_GPIO_IN_MODE2 OMAP_MUX_MODE2
91#define OMAP_MUX_GPIO_IN_MODE3 OMAP_MUX_MODE3
92#define OMAP_MUX_GPIO_IN_MODE4 OMAP_MUX_MODE4
93#define OMAP_MUX_GPIO_IN_MODE5 OMAP_MUX_MODE5
94#define OMAP_MUX_GPIO_IN_MODE6 OMAP_MUX_MODE6
95#define OMAP_MUX_GPIO_IN_MODE7 OMAP_MUX_MODE7
96#define OMAP_MUX_REG_8BIT (1 << 3)
89 97
90/** 98/**
91 * struct omap_board_data - board specific device data 99 * struct omap_board_data - board specific device data
@@ -105,6 +113,7 @@ struct omap_board_data {
105 * struct mux_partition - contain partition related information 113 * struct mux_partition - contain partition related information
106 * @name: name of the current partition 114 * @name: name of the current partition
107 * @flags: flags specific to this partition 115 * @flags: flags specific to this partition
116 * @gpio: gpio mux mode
108 * @phys: physical address 117 * @phys: physical address
109 * @size: partition size 118 * @size: partition size
110 * @base: virtual address after ioremap 119 * @base: virtual address after ioremap
@@ -114,6 +123,7 @@ struct omap_board_data {
114struct omap_mux_partition { 123struct omap_mux_partition {
115 const char *name; 124 const char *name;
116 u32 flags; 125 u32 flags;
126 u32 gpio;
117 u32 phys; 127 u32 phys;
118 u32 size; 128 u32 size;
119 void __iomem *base; 129 void __iomem *base;
diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c
index c47140bbbec4..c53609f46294 100644
--- a/arch/arm/mach-omap2/mux34xx.c
+++ b/arch/arm/mach-omap2/mux34xx.c
@@ -2053,7 +2053,7 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)
2053 return -EINVAL; 2053 return -EINVAL;
2054 } 2054 }
2055 2055
2056 return omap_mux_init("core", 0, 2056 return omap_mux_init("core", OMAP_MUX_GPIO_IN_MODE4,
2057 OMAP3_CONTROL_PADCONF_MUX_PBASE, 2057 OMAP3_CONTROL_PADCONF_MUX_PBASE,
2058 OMAP3_CONTROL_PADCONF_MUX_SIZE, 2058 OMAP3_CONTROL_PADCONF_MUX_SIZE,
2059 omap3_muxmodes, package_subset, board_subset, 2059 omap3_muxmodes, package_subset, board_subset,
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 93d102535c85..04fdbc4c499b 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -27,8 +27,7 @@
27#include <linux/pm_runtime.h> 27#include <linux/pm_runtime.h>
28#include <linux/console.h> 28#include <linux/console.h>
29#include <linux/omap-dma.h> 29#include <linux/omap-dma.h>
30 30#include <linux/platform_data/serial-omap.h>
31#include <plat/omap-serial.h>
32 31
33#include "common.h" 32#include "common.h"
34#include "omap_hwmod.h" 33#include "omap_hwmod.h"
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 7016637b531c..06e141543623 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -190,7 +190,7 @@ static struct device_node * __init omap_get_timer_dt(struct of_device_id *match,
190 * kernel registering these devices remove them dynamically from the device 190 * kernel registering these devices remove them dynamically from the device
191 * tree on boot. 191 * tree on boot.
192 */ 192 */
193void __init omap_dmtimer_init(void) 193static void __init omap_dmtimer_init(void)
194{ 194{
195 struct device_node *np; 195 struct device_node *np;
196 196
@@ -210,7 +210,7 @@ void __init omap_dmtimer_init(void)
210 * 210 *
211 * Get the timer errata flags that are specific to the OMAP device being used. 211 * Get the timer errata flags that are specific to the OMAP device being used.
212 */ 212 */
213u32 __init omap_dm_timer_get_errata(void) 213static u32 __init omap_dm_timer_get_errata(void)
214{ 214{
215 if (cpu_is_omap24xx()) 215 if (cpu_is_omap24xx())
216 return 0; 216 return 0;
@@ -392,7 +392,7 @@ static struct of_device_id omap_counter_match[] __initdata = {
392}; 392};
393 393
394/* Setup free-running counter for clocksource */ 394/* Setup free-running counter for clocksource */
395static int __init omap2_sync32k_clocksource_init(void) 395static int __init __maybe_unused omap2_sync32k_clocksource_init(void)
396{ 396{
397 int ret; 397 int ret;
398 struct device_node *np = NULL; 398 struct device_node *np = NULL;
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index d1dbe125b34f..2e44e8a22884 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -508,6 +508,10 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
508 if (cpu_is_omap34xx()) { 508 if (cpu_is_omap34xx()) {
509 setup_ehci_io_mux(pdata->port_mode); 509 setup_ehci_io_mux(pdata->port_mode);
510 setup_ohci_io_mux(pdata->port_mode); 510 setup_ohci_io_mux(pdata->port_mode);
511
512 if (omap_rev() <= OMAP3430_REV_ES2_1)
513 usbhs_data.single_ulpi_bypass = true;
514
511 } else if (cpu_is_omap44xx()) { 515 } else if (cpu_is_omap44xx()) {
512 setup_4430ehci_io_mux(pdata->port_mode); 516 setup_4430ehci_io_mux(pdata->port_mode);
513 setup_4430ohci_io_mux(pdata->port_mode); 517 setup_4430ohci_io_mux(pdata->port_mode);
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 0816562725f6..d54cfc54b9fe 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -104,7 +104,7 @@ static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {
104static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = { 104static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = {
105 /* name parent rate enabled */ 105 /* name parent rate enabled */
106 { "clk_m", NULL, 0, true }, 106 { "clk_m", NULL, 0, true },
107 { "pll_p", "clk_m", 408000000, true }, 107 { "pll_p", "pll_ref", 408000000, true },
108 { "pll_p_out1", "pll_p", 9600000, true }, 108 { "pll_p_out1", "pll_p", 9600000, true },
109 { "pll_p_out4", "pll_p", 102000000, true }, 109 { "pll_p_out4", "pll_p", 102000000, true },
110 { "sclk", "pll_p_out4", 102000000, true }, 110 { "sclk", "pll_p_out4", 102000000, true },
diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c
index efc000e32e1c..d7147779f8ea 100644
--- a/arch/arm/mach-tegra/tegra30_clocks.c
+++ b/arch/arm/mach-tegra/tegra30_clocks.c
@@ -2045,9 +2045,7 @@ struct clk_ops tegra30_periph_clk_ops = {
2045static int tegra30_dsib_clk_set_parent(struct clk_hw *hw, u8 index) 2045static int tegra30_dsib_clk_set_parent(struct clk_hw *hw, u8 index)
2046{ 2046{
2047 struct clk *d = clk_get_sys(NULL, "pll_d"); 2047 struct clk *d = clk_get_sys(NULL, "pll_d");
2048 /* The DSIB parent selection bit is in PLLD base 2048 /* The DSIB parent selection bit is in PLLD base register */
2049 register - can not do direct r-m-w, must be
2050 protected by PLLD lock */
2051 tegra_clk_cfg_ex( 2049 tegra_clk_cfg_ex(
2052 d, TEGRA_CLK_PLLD_MIPI_MUX_SEL, index); 2050 d, TEGRA_CLK_PLLD_MIPI_MUX_SEL, index);
2053 2051
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 8b204ae69002..4ce77cdc31cc 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -27,7 +27,6 @@
27#include <linux/mtd/nand.h> 27#include <linux/mtd/nand.h>
28#include <linux/mtd/fsmc.h> 28#include <linux/mtd/fsmc.h>
29#include <linux/pinctrl/machine.h> 29#include <linux/pinctrl/machine.h>
30#include <linux/pinctrl/consumer.h>
31#include <linux/pinctrl/pinconf-generic.h> 30#include <linux/pinctrl/pinconf-generic.h>
32#include <linux/dma-mapping.h> 31#include <linux/dma-mapping.h>
33#include <linux/platform_data/clk-u300.h> 32#include <linux/platform_data/clk-u300.h>
@@ -1553,39 +1552,6 @@ static struct pinctrl_map __initdata u300_pinmux_map[] = {
1553 pin_highz_conf), 1552 pin_highz_conf),
1554}; 1553};
1555 1554
1556struct u300_mux_hog {
1557 struct device *dev;
1558 struct pinctrl *p;
1559};
1560
1561static struct u300_mux_hog u300_mux_hogs[] = {
1562 {
1563 .dev = &uart0_device.dev,
1564 },
1565 {
1566 .dev = &mmcsd_device.dev,
1567 },
1568};
1569
1570static int __init u300_pinctrl_fetch(void)
1571{
1572 int i;
1573
1574 for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) {
1575 struct pinctrl *p;
1576
1577 p = pinctrl_get_select_default(u300_mux_hogs[i].dev);
1578 if (IS_ERR(p)) {
1579 pr_err("u300: could not get pinmux hog for dev %s\n",
1580 dev_name(u300_mux_hogs[i].dev));
1581 continue;
1582 }
1583 u300_mux_hogs[i].p = p;
1584 }
1585 return 0;
1586}
1587subsys_initcall(u300_pinctrl_fetch);
1588
1589/* 1555/*
1590 * Notice that AMBA devices are initialized before platform devices. 1556 * Notice that AMBA devices are initialized before platform devices.
1591 * 1557 *
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index 4b24c9992654..a5e05f6e256f 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -8,6 +8,7 @@
8#ifndef __DEVICES_DB8500_H 8#ifndef __DEVICES_DB8500_H
9#define __DEVICES_DB8500_H 9#define __DEVICES_DB8500_H
10 10
11#include <linux/platform_data/usb-musb-ux500.h>
11#include <mach/irqs.h> 12#include <mach/irqs.h>
12#include "devices-common.h" 13#include "devices-common.h"
13 14
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 8d885848600a..9d9aa2f55129 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -11,7 +11,6 @@ obj- :=
11# omap_device support (OMAP2+ only at the moment) 11# omap_device support (OMAP2+ only at the moment)
12 12
13obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o 13obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
14obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
15obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o 14obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
16i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o 15i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
17obj-y += $(i2c-omap-m) $(i2c-omap-y) 16obj-y += $(i2c-omap-m) $(i2c-omap-y)
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c
deleted file mode 100644
index a609e2161817..000000000000
--- a/arch/arm/plat-omap/debug-devices.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * linux/arch/arm/plat-omap/debug-devices.c
3 *
4 * Copyright (C) 2005 Nokia Corporation
5 * Modified from mach-omap2/board-h4.c
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/gpio.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/smc91x.h>
17
18#include <plat/debug-devices.h>
19
20/* Many OMAP development platforms reuse the same "debug board"; these
21 * platforms include H2, H3, H4, and Perseus2.
22 */
23
24static struct smc91x_platdata smc91x_info = {
25 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
26 .leda = RPC_LED_100_10,
27 .ledb = RPC_LED_TX_RX,
28};
29
30static struct resource smc91x_resources[] = {
31 [0] = {
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
36 },
37};
38
39static struct platform_device smc91x_device = {
40 .name = "smc91x",
41 .id = -1,
42 .dev = {
43 .platform_data = &smc91x_info,
44 },
45 .num_resources = ARRAY_SIZE(smc91x_resources),
46 .resource = smc91x_resources,
47};
48
49static struct resource led_resources[] = {
50 [0] = {
51 .flags = IORESOURCE_MEM,
52 },
53};
54
55static struct platform_device led_device = {
56 .name = "omap_dbg_led",
57 .id = -1,
58 .num_resources = ARRAY_SIZE(led_resources),
59 .resource = led_resources,
60};
61
62static struct platform_device *debug_devices[] __initdata = {
63 &smc91x_device,
64 &led_device,
65 /* ps2 kbd + mouse ports */
66 /* 4 extra uarts */
67 /* 6 input dip switches */
68 /* 8 output pins */
69};
70
71int __init debug_card_init(u32 addr, unsigned gpio)
72{
73 int status;
74
75 smc91x_resources[0].start = addr + 0x300;
76 smc91x_resources[0].end = addr + 0x30f;
77
78 smc91x_resources[1].start = gpio_to_irq(gpio);
79 smc91x_resources[1].end = gpio_to_irq(gpio);
80
81 status = gpio_request(gpio, "SMC91x irq");
82 if (status < 0) {
83 printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio);
84 return status;
85 }
86 gpio_direction_input(gpio);
87
88 led_resources[0].start = addr;
89 led_resources[0].end = addr + SZ_4K - 1;
90
91 return platform_add_devices(debug_devices, ARRAY_SIZE(debug_devices));
92}
diff --git a/arch/arm/plat-omap/include/plat/debug-devices.h b/arch/arm/plat-omap/include/plat/debug-devices.h
deleted file mode 100644
index 8fc4287222dd..000000000000
--- a/arch/arm/plat-omap/include/plat/debug-devices.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* for TI reference platforms sharing the same debug card */
2extern int debug_card_init(u32 addr, unsigned gpio);
diff --git a/drivers/amba/tegra-ahb.c b/drivers/amba/tegra-ahb.c
index bd5de08ad6fd..0576a7dd32a5 100644
--- a/drivers/amba/tegra-ahb.c
+++ b/drivers/amba/tegra-ahb.c
@@ -157,6 +157,7 @@ int tegra_ahb_enable_smmu(struct device_node *dn)
157EXPORT_SYMBOL(tegra_ahb_enable_smmu); 157EXPORT_SYMBOL(tegra_ahb_enable_smmu);
158#endif 158#endif
159 159
160#ifdef CONFIG_PM_SLEEP
160static int tegra_ahb_suspend(struct device *dev) 161static int tegra_ahb_suspend(struct device *dev)
161{ 162{
162 int i; 163 int i;
@@ -176,6 +177,7 @@ static int tegra_ahb_resume(struct device *dev)
176 gizmo_writel(ahb, ahb->ctx[i], tegra_ahb_gizmo[i]); 177 gizmo_writel(ahb, ahb->ctx[i], tegra_ahb_gizmo[i]);
177 return 0; 178 return 0;
178} 179}
180#endif
179 181
180static UNIVERSAL_DEV_PM_OPS(tegra_ahb_pm, 182static UNIVERSAL_DEV_PM_OPS(tegra_ahb_pm,
181 tegra_ahb_suspend, 183 tegra_ahb_suspend,
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 770a0d01e0b9..05164d7f054b 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -25,7 +25,6 @@
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <plat/cpu.h>
29#include <linux/platform_device.h> 28#include <linux/platform_device.h>
30#include <linux/platform_data/usb-omap.h> 29#include <linux/platform_data/usb-omap.h>
31#include <linux/pm_runtime.h> 30#include <linux/pm_runtime.h>
@@ -384,7 +383,7 @@ static void omap_usbhs_init(struct device *dev)
384 reg &= ~OMAP_UHH_HOSTCONFIG_P3_CONNECT_STATUS; 383 reg &= ~OMAP_UHH_HOSTCONFIG_P3_CONNECT_STATUS;
385 384
386 /* Bypass the TLL module for PHY mode operation */ 385 /* Bypass the TLL module for PHY mode operation */
387 if (cpu_is_omap3430() && (omap_rev() <= OMAP3430_REV_ES2_1)) { 386 if (pdata->single_ulpi_bypass) {
388 dev_dbg(dev, "OMAP3 ES version <= ES2.1\n"); 387 dev_dbg(dev, "OMAP3 ES version <= ES2.1\n");
389 if (is_ehci_phy_mode(pdata->port_mode[0]) || 388 if (is_ehci_phy_mode(pdata->port_mode[0]) ||
390 is_ehci_phy_mode(pdata->port_mode[1]) || 389 is_ehci_phy_mode(pdata->port_mode[1]) ||
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 23f797eb7a28..57d6b29c039c 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -41,8 +41,7 @@
41#include <linux/of.h> 41#include <linux/of.h>
42#include <linux/gpio.h> 42#include <linux/gpio.h>
43#include <linux/pinctrl/consumer.h> 43#include <linux/pinctrl/consumer.h>
44 44#include <linux/platform_data/serial-omap.h>
45#include <plat/omap-serial.h>
46 45
47#define OMAP_MAX_HSUART_PORTS 6 46#define OMAP_MAX_HSUART_PORTS 6
48 47
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/include/linux/platform_data/serial-omap.h
index ff9b0aab5281..ff9b0aab5281 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/include/linux/platform_data/serial-omap.h
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
index 8570bcfe6311..ef65b67c56c3 100644
--- a/include/linux/platform_data/usb-omap.h
+++ b/include/linux/platform_data/usb-omap.h
@@ -59,6 +59,9 @@ struct usbhs_omap_platform_data {
59 59
60 struct ehci_hcd_omap_platform_data *ehci_data; 60 struct ehci_hcd_omap_platform_data *ehci_data;
61 struct ohci_hcd_omap_platform_data *ohci_data; 61 struct ohci_hcd_omap_platform_data *ohci_data;
62
63 /* OMAP3 <= ES2.1 have a single ulpi bypass control bit */
64 unsigned single_ulpi_bypass:1;
62}; 65};
63 66
64/*-------------------------------------------------------------------------*/ 67/*-------------------------------------------------------------------------*/
diff --git a/include/video/omap-panel-tfp410.h b/include/video/omap-panel-tfp410.h
index 68c31d79c571..aef35e48bc7e 100644
--- a/include/video/omap-panel-tfp410.h
+++ b/include/video/omap-panel-tfp410.h
@@ -28,7 +28,7 @@ struct omap_dss_device;
28 * @power_down_gpio: gpio number for PD pin (or -1 if not available) 28 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
29 */ 29 */
30struct tfp410_platform_data { 30struct tfp410_platform_data {
31 u16 i2c_bus_num; 31 int i2c_bus_num;
32 int power_down_gpio; 32 int power_down_gpio;
33}; 33};
34 34