aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-11-21 13:24:20 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 13:24:59 -0500
commit1f1ba836455b94494aaee9381ed9197ade2f770f (patch)
treec66d7d1084245b3e8c2eb36c9ec5289dd842adc2
parent97b129be91bc978a205db24241840b95cfa28325 (diff)
parentb8edec0f4e5e1452c2a3ff8cd0de64967ab1b2ae (diff)
Merge branch 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc2
From Kukjin Kim: This includes supporting legacy i2c controller and ARM down clock support for exynos5 and small changes. [olof: It contains a dependency on samsung/hdmi for HDMI DT bindings, for some reason.] * 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: ARM: EXYNOS: Clock settings for SATA and SATA PHY ARM: EXYNOS: Add ARM down clock support ARM: EXYNOS: Fix i2c suspend/resume for legacy controller ARM: EXYNOS: Add aliases for i2c controller ARM: EXYNOS: Setup legacy i2c controller interrupts ARM: EXYNOS: removing exynos-drm device registration from non-dt platforms ARM: EXYNOS: add clocks for exynos5 hdmi ARM: dts: add device tree support for exynos5 hdmiddc ARM: dts: add device tree support for exynos5 hdmiphy ARM: dts: add device tree support for exynos5 mixer ARM: dts: add device tree support for exynos5 hdmi ARM: EXYNOS: Add dp clock support for EXYNOS5 ARM: SAMSUNG: call clk_get_rate for debugfs rate files ARM: SAMSUNG: add clock_tree debugfs file in clock Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--Documentation/devicetree/bindings/drm/exynos/hdmi.txt22
-rw-r--r--Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt12
-rw-r--r--Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt12
-rw-r--r--Documentation/devicetree/bindings/drm/exynos/mixer.txt15
-rw-r--r--arch/arm/boot/dts/exynos5250-smdk5250.dts24
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi45
-rw-r--r--arch/arm/mach-exynos/Makefile1
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c42
-rw-r--r--arch/arm/mach-exynos/cpuidle.c36
-rw-r--r--arch/arm/mach-exynos/dev-drm.c29
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-clock.h19
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-pmu.h2
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c32
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c3
-rw-r--r--arch/arm/mach-exynos/mach-origen.c3
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c3
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c3
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c3
-rw-r--r--arch/arm/mach-exynos/pm.c9
-rw-r--r--arch/arm/plat-samsung/clock.c75
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h2
21 files changed, 329 insertions, 63 deletions
diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
new file mode 100644
index 000000000000..589edee37394
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
@@ -0,0 +1,22 @@
1Device-Tree bindings for drm hdmi driver
2
3Required properties:
4- compatible: value should be "samsung,exynos5-hdmi".
5- reg: physical base address of the hdmi and length of memory mapped
6 region.
7- interrupts: interrupt number to the cpu.
8- hpd-gpio: following information about the hotplug gpio pin.
9 a) phandle of the gpio controller node.
10 b) pin number within the gpio controller.
11 c) pin function mode.
12 d) optional flags and pull up/down.
13 e) drive strength.
14
15Example:
16
17 hdmi {
18 compatible = "samsung,exynos5-hdmi";
19 reg = <0x14530000 0x100000>;
20 interrupts = <0 95 0>;
21 hpd-gpio = <&gpx3 7 0xf 1 3>;
22 };
diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt b/Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
new file mode 100644
index 000000000000..fa166d945809
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
@@ -0,0 +1,12 @@
1Device-Tree bindings for hdmiddc driver
2
3Required properties:
4- compatible: value should be "samsung,exynos5-hdmiddc".
5- reg: I2C address of the hdmiddc device.
6
7Example:
8
9 hdmiddc {
10 compatible = "samsung,exynos5-hdmiddc";
11 reg = <0x50>;
12 };
diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt b/Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
new file mode 100644
index 000000000000..858f4f9b902f
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
@@ -0,0 +1,12 @@
1Device-Tree bindings for hdmiphy driver
2
3Required properties:
4- compatible: value should be "samsung,exynos5-hdmiphy".
5- reg: I2C address of the hdmiphy device.
6
7Example:
8
9 hdmiphy {
10 compatible = "samsung,exynos5-hdmiphy";
11 reg = <0x38>;
12 };
diff --git a/Documentation/devicetree/bindings/drm/exynos/mixer.txt b/Documentation/devicetree/bindings/drm/exynos/mixer.txt
new file mode 100644
index 000000000000..9b2ea0343566
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/mixer.txt
@@ -0,0 +1,15 @@
1Device-Tree bindings for mixer driver
2
3Required properties:
4- compatible: value should be "samsung,exynos5-mixer".
5- reg: physical base address of the mixer and length of memory mapped
6 region.
7- interrupts: interrupt number to the cpu.
8
9Example:
10
11 mixer {
12 compatible = "samsung,exynos5-mixer";
13 reg = <0x14450000 0x10000>;
14 interrupts = <0 94 0>;
15 };
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index a352df403b7a..7212d538086d 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -56,7 +56,15 @@
56 }; 56 };
57 57
58 i2c@12C80000 { 58 i2c@12C80000 {
59 status = "disabled"; 59 samsung,i2c-sda-delay = <100>;
60 samsung,i2c-max-bus-freq = <66000>;
61 gpios = <&gpa0 6 3 3 0>,
62 <&gpa0 7 3 3 0>;
63
64 hdmiddc@50 {
65 compatible = "samsung,exynos5-hdmiddc";
66 reg = <0x50>;
67 };
60 }; 68 };
61 69
62 i2c@12C90000 { 70 i2c@12C90000 {
@@ -79,6 +87,16 @@
79 status = "disabled"; 87 status = "disabled";
80 }; 88 };
81 89
90 i2c@12CE0000 {
91 samsung,i2c-sda-delay = <100>;
92 samsung,i2c-max-bus-freq = <66000>;
93
94 hdmiphy@38 {
95 compatible = "samsung,exynos5-hdmiphy";
96 reg = <0x38>;
97 };
98 };
99
82 dwmmc_0: dwmmc0@12200000 { 100 dwmmc_0: dwmmc0@12200000 {
83 num-slots = <1>; 101 num-slots = <1>;
84 supports-highspeed; 102 supports-highspeed;
@@ -166,4 +184,8 @@
166 spi_2: spi@12d40000 { 184 spi_2: spi@12d40000 {
167 status = "disabled"; 185 status = "disabled";
168 }; 186 };
187
188 hdmi {
189 hpd-gpio = <&gpx3 7 0xf 1 3>;
190 };
169}; 191};
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index dddfd6e444dc..04d93ecd1484 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -31,6 +31,15 @@
31 gsc1 = &gsc_1; 31 gsc1 = &gsc_1;
32 gsc2 = &gsc_2; 32 gsc2 = &gsc_2;
33 gsc3 = &gsc_3; 33 gsc3 = &gsc_3;
34 i2c0 = &i2c_0;
35 i2c1 = &i2c_1;
36 i2c2 = &i2c_2;
37 i2c3 = &i2c_3;
38 i2c4 = &i2c_4;
39 i2c5 = &i2c_5;
40 i2c6 = &i2c_6;
41 i2c7 = &i2c_7;
42 i2c8 = &i2c_8;
34 }; 43 };
35 44
36 gic:interrupt-controller@10481000 { 45 gic:interrupt-controller@10481000 {
@@ -92,7 +101,7 @@
92 interrupts = <0 54 0>; 101 interrupts = <0 54 0>;
93 }; 102 };
94 103
95 i2c@12C60000 { 104 i2c_0: i2c@12C60000 {
96 compatible = "samsung,s3c2440-i2c"; 105 compatible = "samsung,s3c2440-i2c";
97 reg = <0x12C60000 0x100>; 106 reg = <0x12C60000 0x100>;
98 interrupts = <0 56 0>; 107 interrupts = <0 56 0>;
@@ -100,7 +109,7 @@
100 #size-cells = <0>; 109 #size-cells = <0>;
101 }; 110 };
102 111
103 i2c@12C70000 { 112 i2c_1: i2c@12C70000 {
104 compatible = "samsung,s3c2440-i2c"; 113 compatible = "samsung,s3c2440-i2c";
105 reg = <0x12C70000 0x100>; 114 reg = <0x12C70000 0x100>;
106 interrupts = <0 57 0>; 115 interrupts = <0 57 0>;
@@ -108,7 +117,7 @@
108 #size-cells = <0>; 117 #size-cells = <0>;
109 }; 118 };
110 119
111 i2c@12C80000 { 120 i2c_2: i2c@12C80000 {
112 compatible = "samsung,s3c2440-i2c"; 121 compatible = "samsung,s3c2440-i2c";
113 reg = <0x12C80000 0x100>; 122 reg = <0x12C80000 0x100>;
114 interrupts = <0 58 0>; 123 interrupts = <0 58 0>;
@@ -116,7 +125,7 @@
116 #size-cells = <0>; 125 #size-cells = <0>;
117 }; 126 };
118 127
119 i2c@12C90000 { 128 i2c_3: i2c@12C90000 {
120 compatible = "samsung,s3c2440-i2c"; 129 compatible = "samsung,s3c2440-i2c";
121 reg = <0x12C90000 0x100>; 130 reg = <0x12C90000 0x100>;
122 interrupts = <0 59 0>; 131 interrupts = <0 59 0>;
@@ -124,7 +133,7 @@
124 #size-cells = <0>; 133 #size-cells = <0>;
125 }; 134 };
126 135
127 i2c@12CA0000 { 136 i2c_4: i2c@12CA0000 {
128 compatible = "samsung,s3c2440-i2c"; 137 compatible = "samsung,s3c2440-i2c";
129 reg = <0x12CA0000 0x100>; 138 reg = <0x12CA0000 0x100>;
130 interrupts = <0 60 0>; 139 interrupts = <0 60 0>;
@@ -132,7 +141,7 @@
132 #size-cells = <0>; 141 #size-cells = <0>;
133 }; 142 };
134 143
135 i2c@12CB0000 { 144 i2c_5: i2c@12CB0000 {
136 compatible = "samsung,s3c2440-i2c"; 145 compatible = "samsung,s3c2440-i2c";
137 reg = <0x12CB0000 0x100>; 146 reg = <0x12CB0000 0x100>;
138 interrupts = <0 61 0>; 147 interrupts = <0 61 0>;
@@ -140,7 +149,7 @@
140 #size-cells = <0>; 149 #size-cells = <0>;
141 }; 150 };
142 151
143 i2c@12CC0000 { 152 i2c_6: i2c@12CC0000 {
144 compatible = "samsung,s3c2440-i2c"; 153 compatible = "samsung,s3c2440-i2c";
145 reg = <0x12CC0000 0x100>; 154 reg = <0x12CC0000 0x100>;
146 interrupts = <0 62 0>; 155 interrupts = <0 62 0>;
@@ -148,7 +157,7 @@
148 #size-cells = <0>; 157 #size-cells = <0>;
149 }; 158 };
150 159
151 i2c@12CD0000 { 160 i2c_7: i2c@12CD0000 {
152 compatible = "samsung,s3c2440-i2c"; 161 compatible = "samsung,s3c2440-i2c";
153 reg = <0x12CD0000 0x100>; 162 reg = <0x12CD0000 0x100>;
154 interrupts = <0 63 0>; 163 interrupts = <0 63 0>;
@@ -156,6 +165,14 @@
156 #size-cells = <0>; 165 #size-cells = <0>;
157 }; 166 };
158 167
168 i2c_8: i2c@12CE0000 {
169 compatible = "samsung,s3c2440-hdmiphy-i2c";
170 reg = <0x12CE0000 0x1000>;
171 interrupts = <0 64 0>;
172 #address-cells = <1>;
173 #size-cells = <0>;
174 };
175
159 spi_0: spi@12d20000 { 176 spi_0: spi@12d20000 {
160 compatible = "samsung,exynos4210-spi"; 177 compatible = "samsung,exynos4210-spi";
161 reg = <0x12d20000 0x100>; 178 reg = <0x12d20000 0x100>;
@@ -520,4 +537,16 @@
520 reg = <0x13e30000 0x1000>; 537 reg = <0x13e30000 0x1000>;
521 interrupts = <0 88 0>; 538 interrupts = <0 88 0>;
522 }; 539 };
540
541 hdmi {
542 compatible = "samsung,exynos5-hdmi";
543 reg = <0x14530000 0x100000>;
544 interrupts = <0 95 0>;
545 };
546
547 mixer {
548 compatible = "samsung,exynos5-mixer";
549 reg = <0x14450000 0x10000>;
550 interrupts = <0 94 0>;
551 };
523}; 552};
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 9b58024f7d43..1797dee88a0d 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
53obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o 53obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
54obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o 54obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o
55obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o 55obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
56obj-$(CONFIG_EXYNOS_DEV_DRM) += dev-drm.o
57obj-$(CONFIG_EXYNOS_DEV_SYSMMU) += dev-sysmmu.o 56obj-$(CONFIG_EXYNOS_DEV_SYSMMU) += dev-sysmmu.o
58 57
59obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o 58obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index c44ca1ee1b8d..0d0c93f6595c 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -80,6 +80,8 @@ static struct sleep_save exynos5_clock_save[] = {
80 SAVE_ITEM(EXYNOS5_VPLL_CON0), 80 SAVE_ITEM(EXYNOS5_VPLL_CON0),
81 SAVE_ITEM(EXYNOS5_VPLL_CON1), 81 SAVE_ITEM(EXYNOS5_VPLL_CON1),
82 SAVE_ITEM(EXYNOS5_VPLL_CON2), 82 SAVE_ITEM(EXYNOS5_VPLL_CON2),
83 SAVE_ITEM(EXYNOS5_PWR_CTRL1),
84 SAVE_ITEM(EXYNOS5_PWR_CTRL2),
83}; 85};
84#endif 86#endif
85 87
@@ -196,6 +198,11 @@ static int exynos5_clk_ip_isp1_ctrl(struct clk *clk, int enable)
196 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable); 198 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable);
197} 199}
198 200
201static int exynos5_clk_hdmiphy_ctrl(struct clk *clk, int enable)
202{
203 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
204}
205
199/* Core list of CMU_CPU side */ 206/* Core list of CMU_CPU side */
200 207
201static struct clksrc_clk exynos5_clk_mout_apll = { 208static struct clksrc_clk exynos5_clk_mout_apll = {
@@ -651,15 +658,20 @@ static struct clk exynos5_init_clocks_off[] = {
651 .ctrlbit = (1 << 15), 658 .ctrlbit = (1 << 15),
652 }, { 659 }, {
653 .name = "sata", 660 .name = "sata",
654 .devname = "ahci", 661 .devname = "exynos5-sata",
662 .parent = &exynos5_clk_aclk_200.clk,
655 .enable = exynos5_clk_ip_fsys_ctrl, 663 .enable = exynos5_clk_ip_fsys_ctrl,
656 .ctrlbit = (1 << 6), 664 .ctrlbit = (1 << 6),
657 }, { 665 }, {
658 .name = "sata_phy", 666 .name = "sata-phy",
667 .devname = "exynos5-sata-phy",
668 .parent = &exynos5_clk_aclk_200.clk,
659 .enable = exynos5_clk_ip_fsys_ctrl, 669 .enable = exynos5_clk_ip_fsys_ctrl,
660 .ctrlbit = (1 << 24), 670 .ctrlbit = (1 << 24),
661 }, { 671 }, {
662 .name = "sata_phy_i2c", 672 .name = "i2c",
673 .devname = "exynos5-sata-phy-i2c",
674 .parent = &exynos5_clk_aclk_200.clk,
663 .enable = exynos5_clk_ip_fsys_ctrl, 675 .enable = exynos5_clk_ip_fsys_ctrl,
664 .ctrlbit = (1 << 25), 676 .ctrlbit = (1 << 25),
665 }, { 677 }, {
@@ -669,15 +681,25 @@ static struct clk exynos5_init_clocks_off[] = {
669 .ctrlbit = (1 << 0), 681 .ctrlbit = (1 << 0),
670 }, { 682 }, {
671 .name = "hdmi", 683 .name = "hdmi",
672 .devname = "exynos4-hdmi", 684 .devname = "exynos5-hdmi",
673 .enable = exynos5_clk_ip_disp1_ctrl, 685 .enable = exynos5_clk_ip_disp1_ctrl,
674 .ctrlbit = (1 << 6), 686 .ctrlbit = (1 << 6),
675 }, { 687 }, {
688 .name = "hdmiphy",
689 .devname = "exynos5-hdmi",
690 .enable = exynos5_clk_hdmiphy_ctrl,
691 .ctrlbit = (1 << 0),
692 }, {
676 .name = "mixer", 693 .name = "mixer",
677 .devname = "s5p-mixer", 694 .devname = "exynos5-mixer",
678 .enable = exynos5_clk_ip_disp1_ctrl, 695 .enable = exynos5_clk_ip_disp1_ctrl,
679 .ctrlbit = (1 << 5), 696 .ctrlbit = (1 << 5),
680 }, { 697 }, {
698 .name = "dp",
699 .devname = "exynos-dp",
700 .enable = exynos5_clk_ip_disp1_ctrl,
701 .ctrlbit = (1 << 4),
702 }, {
681 .name = "jpeg", 703 .name = "jpeg",
682 .enable = exynos5_clk_ip_gen_ctrl, 704 .enable = exynos5_clk_ip_gen_ctrl,
683 .ctrlbit = (1 << 2), 705 .ctrlbit = (1 << 2),
@@ -1226,6 +1248,16 @@ static struct clksrc_clk exynos5_clksrcs[] = {
1226 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 24, .size = 3 }, 1248 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 24, .size = 3 },
1227 }, { 1249 }, {
1228 .clk = { 1250 .clk = {
1251 .name = "sclk_sata",
1252 .devname = "exynos5-sata",
1253 .enable = exynos5_clksrc_mask_fsys_ctrl,
1254 .ctrlbit = (1 << 24),
1255 },
1256 .sources = &exynos5_clkset_aclk,
1257 .reg_src = { .reg = EXYNOS5_CLKSRC_FSYS, .shift = 24, .size = 1 },
1258 .reg_div = { .reg = EXYNOS5_CLKDIV_FSYS0, .shift = 20, .size = 4 },
1259 }, {
1260 .clk = {
1229 .name = "sclk_gscl_wrap", 1261 .name = "sclk_gscl_wrap",
1230 .devname = "s5p-mipi-csis.0", 1262 .devname = "s5p-mipi-csis.0",
1231 .enable = exynos5_clksrc_mask_gscl_ctrl, 1263 .enable = exynos5_clksrc_mask_gscl_ctrl,
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index cff0595d0d35..4ddda9122ecc 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -21,6 +21,7 @@
21#include <asm/suspend.h> 21#include <asm/suspend.h>
22#include <asm/unified.h> 22#include <asm/unified.h>
23#include <asm/cpuidle.h> 23#include <asm/cpuidle.h>
24#include <mach/regs-clock.h>
24#include <mach/regs-pmu.h> 25#include <mach/regs-pmu.h>
25#include <mach/pmu.h> 26#include <mach/pmu.h>
26 27
@@ -156,12 +157,47 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev,
156 return exynos4_enter_core0_aftr(dev, drv, new_index); 157 return exynos4_enter_core0_aftr(dev, drv, new_index);
157} 158}
158 159
160static void __init exynos5_core_down_clk(void)
161{
162 unsigned int tmp;
163
164 /*
165 * Enable arm clock down (in idle) and set arm divider
166 * ratios in WFI/WFE state.
167 */
168 tmp = PWR_CTRL1_CORE2_DOWN_RATIO | \
169 PWR_CTRL1_CORE1_DOWN_RATIO | \
170 PWR_CTRL1_DIV2_DOWN_EN | \
171 PWR_CTRL1_DIV1_DOWN_EN | \
172 PWR_CTRL1_USE_CORE1_WFE | \
173 PWR_CTRL1_USE_CORE0_WFE | \
174 PWR_CTRL1_USE_CORE1_WFI | \
175 PWR_CTRL1_USE_CORE0_WFI;
176 __raw_writel(tmp, EXYNOS5_PWR_CTRL1);
177
178 /*
179 * Enable arm clock up (on exiting idle). Set arm divider
180 * ratios when not in idle along with the standby duration
181 * ratios.
182 */
183 tmp = PWR_CTRL2_DIV2_UP_EN | \
184 PWR_CTRL2_DIV1_UP_EN | \
185 PWR_CTRL2_DUR_STANDBY2_VAL | \
186 PWR_CTRL2_DUR_STANDBY1_VAL | \
187 PWR_CTRL2_CORE2_UP_RATIO | \
188 PWR_CTRL2_CORE1_UP_RATIO;
189 __raw_writel(tmp, EXYNOS5_PWR_CTRL2);
190}
191
159static int __init exynos4_init_cpuidle(void) 192static int __init exynos4_init_cpuidle(void)
160{ 193{
161 int i, max_cpuidle_state, cpu_id; 194 int i, max_cpuidle_state, cpu_id;
162 struct cpuidle_device *device; 195 struct cpuidle_device *device;
163 struct cpuidle_driver *drv = &exynos4_idle_driver; 196 struct cpuidle_driver *drv = &exynos4_idle_driver;
164 197
198 if (soc_is_exynos5250())
199 exynos5_core_down_clk();
200
165 /* Setup cpuidle driver */ 201 /* Setup cpuidle driver */
166 drv->state_count = (sizeof(exynos4_cpuidle_set) / 202 drv->state_count = (sizeof(exynos4_cpuidle_set) /
167 sizeof(struct cpuidle_state)); 203 sizeof(struct cpuidle_state));
diff --git a/arch/arm/mach-exynos/dev-drm.c b/arch/arm/mach-exynos/dev-drm.c
deleted file mode 100644
index 17c9c6ecc2e0..000000000000
--- a/arch/arm/mach-exynos/dev-drm.c
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * linux/arch/arm/mach-exynos/dev-drm.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * EXYNOS - core DRM device
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15#include <linux/kernel.h>
16#include <linux/dma-mapping.h>
17#include <linux/platform_device.h>
18
19#include <plat/devs.h>
20
21static u64 exynos_drm_dma_mask = DMA_BIT_MASK(32);
22
23struct platform_device exynos_device_drm = {
24 .name = "exynos-drm",
25 .dev = {
26 .dma_mask = &exynos_drm_dma_mask,
27 .coherent_dma_mask = DMA_BIT_MASK(32),
28 }
29};
diff --git a/arch/arm/mach-exynos/include/mach/regs-clock.h b/arch/arm/mach-exynos/include/mach/regs-clock.h
index 8c9b38c9c504..d36ad76ad6a4 100644
--- a/arch/arm/mach-exynos/include/mach/regs-clock.h
+++ b/arch/arm/mach-exynos/include/mach/regs-clock.h
@@ -267,6 +267,9 @@
267#define EXYNOS5_CLKDIV_STATCPU0 EXYNOS_CLKREG(0x00600) 267#define EXYNOS5_CLKDIV_STATCPU0 EXYNOS_CLKREG(0x00600)
268#define EXYNOS5_CLKDIV_STATCPU1 EXYNOS_CLKREG(0x00604) 268#define EXYNOS5_CLKDIV_STATCPU1 EXYNOS_CLKREG(0x00604)
269 269
270#define EXYNOS5_PWR_CTRL1 EXYNOS_CLKREG(0x01020)
271#define EXYNOS5_PWR_CTRL2 EXYNOS_CLKREG(0x01024)
272
270#define EXYNOS5_MPLL_CON0 EXYNOS_CLKREG(0x04100) 273#define EXYNOS5_MPLL_CON0 EXYNOS_CLKREG(0x04100)
271#define EXYNOS5_CLKSRC_CORE1 EXYNOS_CLKREG(0x04204) 274#define EXYNOS5_CLKSRC_CORE1 EXYNOS_CLKREG(0x04204)
272 275
@@ -344,6 +347,22 @@
344 347
345#define EXYNOS5_EPLLCON0_LOCKED_SHIFT (29) 348#define EXYNOS5_EPLLCON0_LOCKED_SHIFT (29)
346 349
350#define PWR_CTRL1_CORE2_DOWN_RATIO (7 << 28)
351#define PWR_CTRL1_CORE1_DOWN_RATIO (7 << 16)
352#define PWR_CTRL1_DIV2_DOWN_EN (1 << 9)
353#define PWR_CTRL1_DIV1_DOWN_EN (1 << 8)
354#define PWR_CTRL1_USE_CORE1_WFE (1 << 5)
355#define PWR_CTRL1_USE_CORE0_WFE (1 << 4)
356#define PWR_CTRL1_USE_CORE1_WFI (1 << 1)
357#define PWR_CTRL1_USE_CORE0_WFI (1 << 0)
358
359#define PWR_CTRL2_DIV2_UP_EN (1 << 25)
360#define PWR_CTRL2_DIV1_UP_EN (1 << 24)
361#define PWR_CTRL2_DUR_STANDBY2_VAL (1 << 16)
362#define PWR_CTRL2_DUR_STANDBY1_VAL (1 << 8)
363#define PWR_CTRL2_CORE2_UP_RATIO (1 << 4)
364#define PWR_CTRL2_CORE1_UP_RATIO (1 << 0)
365
347/* Compatibility defines and inclusion */ 366/* Compatibility defines and inclusion */
348 367
349#include <mach/regs-pmu.h> 368#include <mach/regs-pmu.h>
diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h
index d4e392b811a3..684625ad3f39 100644
--- a/arch/arm/mach-exynos/include/mach/regs-pmu.h
+++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h
@@ -15,6 +15,7 @@
15#include <mach/map.h> 15#include <mach/map.h>
16 16
17#define S5P_PMUREG(x) (S5P_VA_PMU + (x)) 17#define S5P_PMUREG(x) (S5P_VA_PMU + (x))
18#define S5P_SYSREG(x) (S3C_VA_SYS + (x))
18 19
19#define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200) 20#define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200)
20 21
@@ -230,6 +231,7 @@
230 231
231/* For EXYNOS5 */ 232/* For EXYNOS5 */
232 233
234#define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234)
233#define EXYNOS5_USB_CFG S5P_PMUREG(0x0230) 235#define EXYNOS5_USB_CFG S5P_PMUREG(0x0230)
234 236
235#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408) 237#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408)
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index db1cd8eacf28..f906f599a141 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -11,10 +11,12 @@
11 11
12#include <linux/of_platform.h> 12#include <linux/of_platform.h>
13#include <linux/serial_core.h> 13#include <linux/serial_core.h>
14#include <linux/io.h>
14 15
15#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
16#include <asm/hardware/gic.h> 17#include <asm/hardware/gic.h>
17#include <mach/map.h> 18#include <mach/map.h>
19#include <mach/regs-pmu.h>
18 20
19#include <plat/cpu.h> 21#include <plat/cpu.h>
20#include <plat/regs-serial.h> 22#include <plat/regs-serial.h>
@@ -47,6 +49,10 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
47 "s3c2440-i2c.0", NULL), 49 "s3c2440-i2c.0", NULL),
48 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1), 50 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
49 "s3c2440-i2c.1", NULL), 51 "s3c2440-i2c.1", NULL),
52 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(2),
53 "s3c2440-i2c.2", NULL),
54 OF_DEV_AUXDATA("samsung,s3c2440-hdmiphy-i2c", EXYNOS5_PA_IIC(8),
55 "s3c2440-hdmiphy-i2c", NULL),
50 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0, 56 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
51 "dw_mmc.0", NULL), 57 "dw_mmc.0", NULL),
52 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1, 58 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1,
@@ -72,6 +78,10 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
72 "exynos-gsc.2", NULL), 78 "exynos-gsc.2", NULL),
73 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3, 79 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
74 "exynos-gsc.3", NULL), 80 "exynos-gsc.3", NULL),
81 OF_DEV_AUXDATA("samsung,exynos5-hdmi", 0x14530000,
82 "exynos5-hdmi", NULL),
83 OF_DEV_AUXDATA("samsung,exynos5-mixer", 0x14450000,
84 "exynos5-mixer", NULL),
75 {}, 85 {},
76}; 86};
77 87
@@ -83,6 +93,28 @@ static void __init exynos5250_dt_map_io(void)
83 93
84static void __init exynos5250_dt_machine_init(void) 94static void __init exynos5250_dt_machine_init(void)
85{ 95{
96 struct device_node *i2c_np;
97 const char *i2c_compat = "samsung,s3c2440-i2c";
98 unsigned int tmp;
99
100 /*
101 * Exynos5's legacy i2c controller and new high speed i2c
102 * controller have muxed interrupt sources. By default the
103 * interrupts for 4-channel HS-I2C controller are enabled.
104 * If node for first four channels of legacy i2c controller
105 * are available then re-configure the interrupts via the
106 * system register.
107 */
108 for_each_compatible_node(i2c_np, NULL, i2c_compat) {
109 if (of_device_is_available(i2c_np)) {
110 if (of_alias_get_id(i2c_np, "i2c") < 4) {
111 tmp = readl(EXYNOS5_SYS_I2C_CFG);
112 writel(tmp & ~(0x1 << of_alias_get_id(i2c_np, "i2c")),
113 EXYNOS5_SYS_I2C_CFG);
114 }
115 }
116 }
117
86 of_platform_populate(NULL, of_default_bus_match_table, 118 of_platform_populate(NULL, of_default_bus_match_table,
87 exynos5250_auxdata_lookup, NULL); 119 exynos5250_auxdata_lookup, NULL);
88} 120}
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index c05d7aa84031..94970602df61 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1327,9 +1327,6 @@ static struct platform_device *nuri_devices[] __initdata = {
1327 &cam_vdda_fixed_rdev, 1327 &cam_vdda_fixed_rdev,
1328 &cam_8m_12v_fixed_rdev, 1328 &cam_8m_12v_fixed_rdev,
1329 &exynos4_bus_devfreq, 1329 &exynos4_bus_devfreq,
1330#ifdef CONFIG_DRM_EXYNOS
1331 &exynos_device_drm,
1332#endif
1333}; 1330};
1334 1331
1335static void __init nuri_map_io(void) 1332static void __init nuri_map_io(void)
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 9adf491674ea..d8dc6d7f0c00 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -709,9 +709,6 @@ static struct platform_device *origen_devices[] __initdata = {
709 &s5p_device_mfc_l, 709 &s5p_device_mfc_l,
710 &s5p_device_mfc_r, 710 &s5p_device_mfc_r,
711 &s5p_device_mixer, 711 &s5p_device_mixer,
712#ifdef CONFIG_DRM_EXYNOS
713 &exynos_device_drm,
714#endif
715 &exynos4_device_ohci, 712 &exynos4_device_ohci,
716 &origen_device_gpiokeys, 713 &origen_device_gpiokeys,
717 &origen_lcd_hv070wsa, 714 &origen_lcd_hv070wsa,
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index 730f1ac65928..17b9ca48722e 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -317,9 +317,6 @@ static struct platform_device *smdk4x12_devices[] __initdata = {
317 &s5p_device_mfc, 317 &s5p_device_mfc,
318 &s5p_device_mfc_l, 318 &s5p_device_mfc_l,
319 &s5p_device_mfc_r, 319 &s5p_device_mfc_r,
320#ifdef CONFIG_DRM_EXYNOS
321 &exynos_device_drm,
322#endif
323 &samsung_device_keypad, 320 &samsung_device_keypad,
324}; 321};
325 322
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index ee4fb1a9cb72..4f0ac5397ba3 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -300,9 +300,6 @@ static struct platform_device *smdkv310_devices[] __initdata = {
300 &s5p_device_fimc_md, 300 &s5p_device_fimc_md,
301 &s5p_device_g2d, 301 &s5p_device_g2d,
302 &s5p_device_jpeg, 302 &s5p_device_jpeg,
303#ifdef CONFIG_DRM_EXYNOS
304 &exynos_device_drm,
305#endif
306 &exynos4_device_ac97, 303 &exynos4_device_ac97,
307 &exynos4_device_i2s0, 304 &exynos4_device_i2s0,
308 &exynos4_device_ohci, 305 &exynos4_device_ohci,
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index ebc9dd339a38..cfdf876a8626 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -1081,9 +1081,6 @@ static struct platform_device *universal_devices[] __initdata = {
1081 &s5p_device_onenand, 1081 &s5p_device_onenand,
1082 &s5p_device_fimd0, 1082 &s5p_device_fimd0,
1083 &s5p_device_jpeg, 1083 &s5p_device_jpeg,
1084#ifdef CONFIG_DRM_EXYNOS
1085 &exynos_device_drm,
1086#endif
1087 &s3c_device_usb_hsotg, 1084 &s3c_device_usb_hsotg,
1088 &s5p_device_mfc, 1085 &s5p_device_mfc,
1089 &s5p_device_mfc_l, 1086 &s5p_device_mfc_l,
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index c06c992943a1..8306c5276d1c 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -62,6 +62,10 @@ static struct sleep_save exynos4_vpll_save[] = {
62 SAVE_ITEM(EXYNOS4_VPLL_CON1), 62 SAVE_ITEM(EXYNOS4_VPLL_CON1),
63}; 63};
64 64
65static struct sleep_save exynos5_sys_save[] = {
66 SAVE_ITEM(EXYNOS5_SYS_I2C_CFG),
67};
68
65static struct sleep_save exynos_core_save[] = { 69static struct sleep_save exynos_core_save[] = {
66 /* SROM side */ 70 /* SROM side */
67 SAVE_ITEM(S5P_SROM_BW), 71 SAVE_ITEM(S5P_SROM_BW),
@@ -98,6 +102,7 @@ static void exynos_pm_prepare(void)
98 s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save)); 102 s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save));
99 s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save)); 103 s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save));
100 } else { 104 } else {
105 s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save));
101 /* Disable USE_RETENTION of JPEG_MEM_OPTION */ 106 /* Disable USE_RETENTION of JPEG_MEM_OPTION */
102 tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION); 107 tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION);
103 tmp &= ~EXYNOS5_OPTION_USE_RETENTION; 108 tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
@@ -301,6 +306,10 @@ static void exynos_pm_resume(void)
301 __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION); 306 __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION);
302 __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION); 307 __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION);
303 308
309 if (soc_is_exynos5250())
310 s3c_pm_do_restore(exynos5_sys_save,
311 ARRAY_SIZE(exynos5_sys_save));
312
304 s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save)); 313 s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
305 314
306 if (!soc_is_exynos5250()) { 315 if (!soc_is_exynos5250()) {
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 012bbd0b8d81..47c9fad43f00 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -389,6 +389,72 @@ int __init s3c24xx_register_baseclocks(unsigned long xtal)
389 389
390static struct dentry *clk_debugfs_root; 390static struct dentry *clk_debugfs_root;
391 391
392static void clock_tree_show_one(struct seq_file *s, struct clk *c, int level)
393{
394 struct clk *child;
395 const char *state;
396 char buf[255] = { 0 };
397 int n = 0;
398
399 if (c->name)
400 n = snprintf(buf, sizeof(buf) - 1, "%s", c->name);
401
402 if (c->devname)
403 n += snprintf(buf + n, sizeof(buf) - 1 - n, ":%s", c->devname);
404
405 state = (c->usage > 0) ? "on" : "off";
406
407 seq_printf(s, "%*s%-*s %-6s %-3d %-10lu\n",
408 level * 3 + 1, "",
409 50 - level * 3, buf,
410 state, c->usage, clk_get_rate(c));
411
412 list_for_each_entry(child, &clocks, list) {
413 if (child->parent != c)
414 continue;
415
416 clock_tree_show_one(s, child, level + 1);
417 }
418}
419
420static int clock_tree_show(struct seq_file *s, void *data)
421{
422 struct clk *c;
423 unsigned long flags;
424
425 seq_printf(s, " clock state ref rate\n");
426 seq_printf(s, "----------------------------------------------------\n");
427
428 spin_lock_irqsave(&clocks_lock, flags);
429
430 list_for_each_entry(c, &clocks, list)
431 if (c->parent == NULL)
432 clock_tree_show_one(s, c, 0);
433
434 spin_unlock_irqrestore(&clocks_lock, flags);
435 return 0;
436}
437
438static int clock_tree_open(struct inode *inode, struct file *file)
439{
440 return single_open(file, clock_tree_show, inode->i_private);
441}
442
443static const struct file_operations clock_tree_fops = {
444 .open = clock_tree_open,
445 .read = seq_read,
446 .llseek = seq_lseek,
447 .release = single_release,
448};
449
450static int clock_rate_show(void *data, u64 *val)
451{
452 struct clk *c = data;
453 *val = clk_get_rate(c);
454 return 0;
455}
456DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_rate_show, NULL, "%llu\n");
457
392static int clk_debugfs_register_one(struct clk *c) 458static int clk_debugfs_register_one(struct clk *c)
393{ 459{
394 int err; 460 int err;
@@ -411,7 +477,7 @@ static int clk_debugfs_register_one(struct clk *c)
411 goto err_out; 477 goto err_out;
412 } 478 }
413 479
414 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 480 d = debugfs_create_file("rate", S_IRUGO, c->dent, c, &clock_rate_fops);
415 if (!d) { 481 if (!d) {
416 err = -ENOMEM; 482 err = -ENOMEM;
417 goto err_out; 483 goto err_out;
@@ -446,13 +512,18 @@ static int __init clk_debugfs_init(void)
446{ 512{
447 struct clk *c; 513 struct clk *c;
448 struct dentry *d; 514 struct dentry *d;
449 int err; 515 int err = -ENOMEM;
450 516
451 d = debugfs_create_dir("clock", NULL); 517 d = debugfs_create_dir("clock", NULL);
452 if (!d) 518 if (!d)
453 return -ENOMEM; 519 return -ENOMEM;
454 clk_debugfs_root = d; 520 clk_debugfs_root = d;
455 521
522 d = debugfs_create_file("clock_tree", S_IRUGO, clk_debugfs_root, NULL,
523 &clock_tree_fops);
524 if (!d)
525 goto err_out;
526
456 list_for_each_entry(c, &clocks, list) { 527 list_for_each_entry(c, &clocks, list) {
457 err = clk_debugfs_register(c); 528 err = clk_debugfs_register(c);
458 if (err) 529 if (err)
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 5da4b4f38f40..133e3e4170fb 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -133,8 +133,6 @@ extern struct platform_device exynos4_device_pcm1;
133extern struct platform_device exynos4_device_pcm2; 133extern struct platform_device exynos4_device_pcm2;
134extern struct platform_device exynos4_device_spdif; 134extern struct platform_device exynos4_device_spdif;
135 135
136extern struct platform_device exynos_device_drm;
137
138extern struct platform_device samsung_asoc_dma; 136extern struct platform_device samsung_asoc_dma;
139extern struct platform_device samsung_asoc_idma; 137extern struct platform_device samsung_asoc_idma;
140extern struct platform_device samsung_device_keypad; 138extern struct platform_device samsung_device_keypad;