aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-14 17:38:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-14 17:38:28 -0500
commit6a57d104c8cb5b6adad6784b4ce6e2f7f9961a3a (patch)
treec3ff93b006d7483ccee09799d215b03b1bbc3f1b /arch/arm/mach-exynos
parentcebfa85eb86d92bf85d3b041c6b044184517a988 (diff)
parentc91321e8ff338a88a9272dcd938f085955cd5846 (diff)
Merge tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM Soc updates, take 2, from Olof Johansson: "This is the second batch of SoC updates for the 3.8 merge window, containing parts that had dependencies on earlier branches such that we couldn't include them with the first branch. These are general updates for Samsung Exynos, Renesas/shmobile and a topic branch that adds SMP support to Altera's socfpga platform." Fix up conflicts mostly as per Olof. * tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: 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 sh: clkfwk: fixup unsed variable warning Revert "ARM: shmobile: r8a7779: Replace modify_scu_cpu_psr with scu_power_mode" Revert "ARM: shmobile: sh73a0: Replace modify_scu_cpu_psr with scu_power_mode" Revert "ARM: shmobile: emev2: Replace modify_scu_cpu_psr with scu_power_mode" ARM: highbank: use common debug_ll_io_init ARM: shmobile: sh7372: sh7372_fsiXck_clk become non-global ARM: shmobile: sh7372: remove fsidivx clock ARM: socfpga: mark secondary_trampoline as cpuinit socfpga: map uart into virtual address space so that early_printk() works ARM: socfpga: fix build break for allyesconfig ARM: socfpga: Enable SMP for socfpga 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
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c28
-rw-r--r--arch/arm/mach-exynos/cpuidle.c36
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-clock.h19
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-pmu.h3
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c25
-rw-r--r--arch/arm/mach-exynos/pm.c9
6 files changed, 116 insertions, 4 deletions
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 7652f5d78a56..e9d7b80bae49 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
@@ -661,15 +663,20 @@ static struct clk exynos5_init_clocks_off[] = {
661 .ctrlbit = (1 << 15), 663 .ctrlbit = (1 << 15),
662 }, { 664 }, {
663 .name = "sata", 665 .name = "sata",
664 .devname = "ahci", 666 .devname = "exynos5-sata",
667 .parent = &exynos5_clk_aclk_200.clk,
665 .enable = exynos5_clk_ip_fsys_ctrl, 668 .enable = exynos5_clk_ip_fsys_ctrl,
666 .ctrlbit = (1 << 6), 669 .ctrlbit = (1 << 6),
667 }, { 670 }, {
668 .name = "sata_phy", 671 .name = "sata-phy",
672 .devname = "exynos5-sata-phy",
673 .parent = &exynos5_clk_aclk_200.clk,
669 .enable = exynos5_clk_ip_fsys_ctrl, 674 .enable = exynos5_clk_ip_fsys_ctrl,
670 .ctrlbit = (1 << 24), 675 .ctrlbit = (1 << 24),
671 }, { 676 }, {
672 .name = "sata_phy_i2c", 677 .name = "i2c",
678 .devname = "exynos5-sata-phy-i2c",
679 .parent = &exynos5_clk_aclk_200.clk,
673 .enable = exynos5_clk_ip_fsys_ctrl, 680 .enable = exynos5_clk_ip_fsys_ctrl,
674 .ctrlbit = (1 << 25), 681 .ctrlbit = (1 << 25),
675 }, { 682 }, {
@@ -693,6 +700,11 @@ static struct clk exynos5_init_clocks_off[] = {
693 .enable = exynos5_clk_ip_disp1_ctrl, 700 .enable = exynos5_clk_ip_disp1_ctrl,
694 .ctrlbit = (1 << 5), 701 .ctrlbit = (1 << 5),
695 }, { 702 }, {
703 .name = "dp",
704 .devname = "exynos-dp",
705 .enable = exynos5_clk_ip_disp1_ctrl,
706 .ctrlbit = (1 << 4),
707 }, {
696 .name = "jpeg", 708 .name = "jpeg",
697 .enable = exynos5_clk_ip_gen_ctrl, 709 .enable = exynos5_clk_ip_gen_ctrl,
698 .ctrlbit = (1 << 2), 710 .ctrlbit = (1 << 2),
@@ -1241,6 +1253,16 @@ static struct clksrc_clk exynos5_clksrcs[] = {
1241 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 24, .size = 3 }, 1253 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 24, .size = 3 },
1242 }, { 1254 }, {
1243 .clk = { 1255 .clk = {
1256 .name = "sclk_sata",
1257 .devname = "exynos5-sata",
1258 .enable = exynos5_clksrc_mask_fsys_ctrl,
1259 .ctrlbit = (1 << 24),
1260 },
1261 .sources = &exynos5_clkset_aclk,
1262 .reg_src = { .reg = EXYNOS5_CLKSRC_FSYS, .shift = 24, .size = 1 },
1263 .reg_div = { .reg = EXYNOS5_CLKDIV_FSYS0, .shift = 20, .size = 4 },
1264 }, {
1265 .clk = {
1244 .name = "sclk_gscl_wrap", 1266 .name = "sclk_gscl_wrap",
1245 .devname = "s5p-mipi-csis.0", 1267 .devname = "s5p-mipi-csis.0",
1246 .enable = exynos5_clksrc_mask_gscl_ctrl, 1268 .enable = exynos5_clksrc_mask_gscl_ctrl,
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 8e4ec21ef2cf..050924152776 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
@@ -157,12 +158,47 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev,
157 return exynos4_enter_core0_aftr(dev, drv, new_index); 158 return exynos4_enter_core0_aftr(dev, drv, new_index);
158} 159}
159 160
161static void __init exynos5_core_down_clk(void)
162{
163 unsigned int tmp;
164
165 /*
166 * Enable arm clock down (in idle) and set arm divider
167 * ratios in WFI/WFE state.
168 */
169 tmp = PWR_CTRL1_CORE2_DOWN_RATIO | \
170 PWR_CTRL1_CORE1_DOWN_RATIO | \
171 PWR_CTRL1_DIV2_DOWN_EN | \
172 PWR_CTRL1_DIV1_DOWN_EN | \
173 PWR_CTRL1_USE_CORE1_WFE | \
174 PWR_CTRL1_USE_CORE0_WFE | \
175 PWR_CTRL1_USE_CORE1_WFI | \
176 PWR_CTRL1_USE_CORE0_WFI;
177 __raw_writel(tmp, EXYNOS5_PWR_CTRL1);
178
179 /*
180 * Enable arm clock up (on exiting idle). Set arm divider
181 * ratios when not in idle along with the standby duration
182 * ratios.
183 */
184 tmp = PWR_CTRL2_DIV2_UP_EN | \
185 PWR_CTRL2_DIV1_UP_EN | \
186 PWR_CTRL2_DUR_STANDBY2_VAL | \
187 PWR_CTRL2_DUR_STANDBY1_VAL | \
188 PWR_CTRL2_CORE2_UP_RATIO | \
189 PWR_CTRL2_CORE1_UP_RATIO;
190 __raw_writel(tmp, EXYNOS5_PWR_CTRL2);
191}
192
160static int __init exynos4_init_cpuidle(void) 193static int __init exynos4_init_cpuidle(void)
161{ 194{
162 int i, max_cpuidle_state, cpu_id; 195 int i, max_cpuidle_state, cpu_id;
163 struct cpuidle_device *device; 196 struct cpuidle_device *device;
164 struct cpuidle_driver *drv = &exynos4_idle_driver; 197 struct cpuidle_driver *drv = &exynos4_idle_driver;
165 198
199 if (soc_is_exynos5250())
200 exynos5_core_down_clk();
201
166 /* Setup cpuidle driver */ 202 /* Setup cpuidle driver */
167 drv->state_count = (sizeof(exynos4_cpuidle_set) / 203 drv->state_count = (sizeof(exynos4_cpuidle_set) /
168 sizeof(struct cpuidle_state)); 204 sizeof(struct cpuidle_state));
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 84428e72cf5e..3f30aa1ae354 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
@@ -231,6 +232,8 @@
231 232
232/* For EXYNOS5 */ 233/* For EXYNOS5 */
233 234
235#define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234)
236
234#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408) 237#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408)
235#define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C) 238#define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C)
236 239
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index 929de766d490..f038c8cadca4 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -13,11 +13,12 @@
13#include <linux/of_fdt.h> 13#include <linux/of_fdt.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/memblock.h> 15#include <linux/memblock.h>
16#include <linux/of_fdt.h> 16#include <linux/io.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h> 19#include <asm/hardware/gic.h>
20#include <mach/map.h> 20#include <mach/map.h>
21#include <mach/regs-pmu.h>
21 22
22#include <plat/cpu.h> 23#include <plat/cpu.h>
23#include <plat/regs-serial.h> 24#include <plat/regs-serial.h>
@@ -124,6 +125,28 @@ static void __init exynos5_dt_map_io(void)
124 125
125static void __init exynos5_dt_machine_init(void) 126static void __init exynos5_dt_machine_init(void)
126{ 127{
128 struct device_node *i2c_np;
129 const char *i2c_compat = "samsung,s3c2440-i2c";
130 unsigned int tmp;
131
132 /*
133 * Exynos5's legacy i2c controller and new high speed i2c
134 * controller have muxed interrupt sources. By default the
135 * interrupts for 4-channel HS-I2C controller are enabled.
136 * If node for first four channels of legacy i2c controller
137 * are available then re-configure the interrupts via the
138 * system register.
139 */
140 for_each_compatible_node(i2c_np, NULL, i2c_compat) {
141 if (of_device_is_available(i2c_np)) {
142 if (of_alias_get_id(i2c_np, "i2c") < 4) {
143 tmp = readl(EXYNOS5_SYS_I2C_CFG);
144 writel(tmp & ~(0x1 << of_alias_get_id(i2c_np, "i2c")),
145 EXYNOS5_SYS_I2C_CFG);
146 }
147 }
148 }
149
127 if (of_machine_is_compatible("samsung,exynos5250")) 150 if (of_machine_is_compatible("samsung,exynos5250"))
128 of_platform_populate(NULL, of_default_bus_match_table, 151 of_platform_populate(NULL, of_default_bus_match_table,
129 exynos5250_auxdata_lookup, NULL); 152 exynos5250_auxdata_lookup, NULL);
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 8df6ec547f78..b9b539cac81e 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),
@@ -101,6 +105,7 @@ static void exynos_pm_prepare(void)
101 s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save)); 105 s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save));
102 s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save)); 106 s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save));
103 } else { 107 } else {
108 s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save));
104 /* Disable USE_RETENTION of JPEG_MEM_OPTION */ 109 /* Disable USE_RETENTION of JPEG_MEM_OPTION */
105 tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION); 110 tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION);
106 tmp &= ~EXYNOS5_OPTION_USE_RETENTION; 111 tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
@@ -304,6 +309,10 @@ static void exynos_pm_resume(void)
304 __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION); 309 __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION);
305 __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION); 310 __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION);
306 311
312 if (soc_is_exynos5250())
313 s3c_pm_do_restore(exynos5_sys_save,
314 ARRAY_SIZE(exynos5_sys_save));
315
307 s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save)); 316 s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
308 317
309 if (!soc_is_exynos5250()) { 318 if (!soc_is_exynos5250()) {