aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/samsung/clk-exynos5250.c
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.daniel@samsung.com>2014-05-08 17:43:26 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-05-25 16:21:06 -0400
commit9a8f39950d276bc77d3eb22bfc798c4612ee3c29 (patch)
tree8180a5bde70143b74aa7f9233eb3aa26846a8d38 /drivers/clk/samsung/clk-exynos5250.c
parent985326c9f65a4c1a3b5ab875e6ce0c97c39449ec (diff)
ARM: EXYNOS: Move arm core power down clock to exynos5250 common clock
Now with common clock support added for exynos5250 it is necessary to move this code to exynos5250 common clock driver as clock registers should be handled there. This change is tested in exynos5250 based arndale platform. Cc: Abhilash Kesavan <a.kesavan@samsung.com> Cc: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Kukjin Kim <kgene.kim@samsugn.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> [t.figa: Rebased onto current kernel sources.] Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/clk/samsung/clk-exynos5250.c')
-rw-r--r--drivers/clk/samsung/clk-exynos5250.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index 88488596c00b..1416c9703266 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -24,6 +24,8 @@
24#define APLL_CON0 0x100 24#define APLL_CON0 0x100
25#define SRC_CPU 0x200 25#define SRC_CPU 0x200
26#define DIV_CPU0 0x500 26#define DIV_CPU0 0x500
27#define PWR_CTRL1 0x1020
28#define PWR_CTRL2 0x1024
27#define MPLL_LOCK 0x4000 29#define MPLL_LOCK 0x4000
28#define MPLL_CON0 0x4100 30#define MPLL_CON0 0x4100
29#define SRC_CORE1 0x4204 31#define SRC_CORE1 0x4204
@@ -82,6 +84,23 @@
82#define SRC_CDREX 0x20200 84#define SRC_CDREX 0x20200
83#define PLL_DIV2_SEL 0x20a24 85#define PLL_DIV2_SEL 0x20a24
84 86
87/*Below definitions are used for PWR_CTRL settings*/
88#define PWR_CTRL1_CORE2_DOWN_RATIO (7 << 28)
89#define PWR_CTRL1_CORE1_DOWN_RATIO (7 << 16)
90#define PWR_CTRL1_DIV2_DOWN_EN (1 << 9)
91#define PWR_CTRL1_DIV1_DOWN_EN (1 << 8)
92#define PWR_CTRL1_USE_CORE1_WFE (1 << 5)
93#define PWR_CTRL1_USE_CORE0_WFE (1 << 4)
94#define PWR_CTRL1_USE_CORE1_WFI (1 << 1)
95#define PWR_CTRL1_USE_CORE0_WFI (1 << 0)
96
97#define PWR_CTRL2_DIV2_UP_EN (1 << 25)
98#define PWR_CTRL2_DIV1_UP_EN (1 << 24)
99#define PWR_CTRL2_DUR_STANDBY2_VAL (1 << 16)
100#define PWR_CTRL2_DUR_STANDBY1_VAL (1 << 8)
101#define PWR_CTRL2_CORE2_UP_RATIO (1 << 4)
102#define PWR_CTRL2_CORE1_UP_RATIO (1 << 0)
103
85/* list of PLLs to be registered */ 104/* list of PLLs to be registered */
86enum exynos5250_plls { 105enum exynos5250_plls {
87 apll, mpll, cpll, epll, vpll, gpll, bpll, 106 apll, mpll, cpll, epll, vpll, gpll, bpll,
@@ -100,6 +119,8 @@ static struct samsung_clk_reg_dump *exynos5250_save;
100static unsigned long exynos5250_clk_regs[] __initdata = { 119static unsigned long exynos5250_clk_regs[] __initdata = {
101 SRC_CPU, 120 SRC_CPU,
102 DIV_CPU0, 121 DIV_CPU0,
122 PWR_CTRL1,
123 PWR_CTRL2,
103 SRC_CORE1, 124 SRC_CORE1,
104 SRC_TOP0, 125 SRC_TOP0,
105 SRC_TOP1, 126 SRC_TOP1,
@@ -701,6 +722,7 @@ static struct of_device_id ext_clk_match[] __initdata = {
701static void __init exynos5250_clk_init(struct device_node *np) 722static void __init exynos5250_clk_init(struct device_node *np)
702{ 723{
703 struct samsung_clk_provider *ctx; 724 struct samsung_clk_provider *ctx;
725 unsigned int tmp;
704 726
705 if (np) { 727 if (np) {
706 reg_base = of_iomap(np, 0); 728 reg_base = of_iomap(np, 0);
@@ -741,6 +763,26 @@ static void __init exynos5250_clk_init(struct device_node *np)
741 samsung_clk_register_gate(ctx, exynos5250_gate_clks, 763 samsung_clk_register_gate(ctx, exynos5250_gate_clks,
742 ARRAY_SIZE(exynos5250_gate_clks)); 764 ARRAY_SIZE(exynos5250_gate_clks));
743 765
766 /*
767 * Enable arm clock down (in idle) and set arm divider
768 * ratios in WFI/WFE state.
769 */
770 tmp = (PWR_CTRL1_CORE2_DOWN_RATIO | PWR_CTRL1_CORE1_DOWN_RATIO |
771 PWR_CTRL1_DIV2_DOWN_EN | PWR_CTRL1_DIV1_DOWN_EN |
772 PWR_CTRL1_USE_CORE1_WFE | PWR_CTRL1_USE_CORE0_WFE |
773 PWR_CTRL1_USE_CORE1_WFI | PWR_CTRL1_USE_CORE0_WFI);
774 __raw_writel(tmp, reg_base + PWR_CTRL1);
775
776 /*
777 * Enable arm clock up (on exiting idle). Set arm divider
778 * ratios when not in idle along with the standby duration
779 * ratios.
780 */
781 tmp = (PWR_CTRL2_DIV2_UP_EN | PWR_CTRL2_DIV1_UP_EN |
782 PWR_CTRL2_DUR_STANDBY2_VAL | PWR_CTRL2_DUR_STANDBY1_VAL |
783 PWR_CTRL2_CORE2_UP_RATIO | PWR_CTRL2_CORE1_UP_RATIO);
784 __raw_writel(tmp, reg_base + PWR_CTRL2);
785
744 exynos5250_clk_sleep_init(); 786 exynos5250_clk_sleep_init();
745 787
746 pr_info("Exynos5250: clock setup completed, armclk=%ld\n", 788 pr_info("Exynos5250: clock setup completed, armclk=%ld\n",