diff options
Diffstat (limited to 'drivers/clk/samsung/clk-exynos5250.c')
-rw-r--r-- | drivers/clk/samsung/clk-exynos5250.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 870e18b9a687..1fad4c5e3f5d 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 |
@@ -84,6 +86,23 @@ | |||
84 | #define SRC_CDREX 0x20200 | 86 | #define SRC_CDREX 0x20200 |
85 | #define PLL_DIV2_SEL 0x20a24 | 87 | #define PLL_DIV2_SEL 0x20a24 |
86 | 88 | ||
89 | /*Below definitions are used for PWR_CTRL settings*/ | ||
90 | #define PWR_CTRL1_CORE2_DOWN_RATIO (7 << 28) | ||
91 | #define PWR_CTRL1_CORE1_DOWN_RATIO (7 << 16) | ||
92 | #define PWR_CTRL1_DIV2_DOWN_EN (1 << 9) | ||
93 | #define PWR_CTRL1_DIV1_DOWN_EN (1 << 8) | ||
94 | #define PWR_CTRL1_USE_CORE1_WFE (1 << 5) | ||
95 | #define PWR_CTRL1_USE_CORE0_WFE (1 << 4) | ||
96 | #define PWR_CTRL1_USE_CORE1_WFI (1 << 1) | ||
97 | #define PWR_CTRL1_USE_CORE0_WFI (1 << 0) | ||
98 | |||
99 | #define PWR_CTRL2_DIV2_UP_EN (1 << 25) | ||
100 | #define PWR_CTRL2_DIV1_UP_EN (1 << 24) | ||
101 | #define PWR_CTRL2_DUR_STANDBY2_VAL (1 << 16) | ||
102 | #define PWR_CTRL2_DUR_STANDBY1_VAL (1 << 8) | ||
103 | #define PWR_CTRL2_CORE2_UP_RATIO (1 << 4) | ||
104 | #define PWR_CTRL2_CORE1_UP_RATIO (1 << 0) | ||
105 | |||
87 | /* list of PLLs to be registered */ | 106 | /* list of PLLs to be registered */ |
88 | enum exynos5250_plls { | 107 | enum exynos5250_plls { |
89 | apll, mpll, cpll, epll, vpll, gpll, bpll, | 108 | apll, mpll, cpll, epll, vpll, gpll, bpll, |
@@ -102,6 +121,8 @@ static struct samsung_clk_reg_dump *exynos5250_save; | |||
102 | static unsigned long exynos5250_clk_regs[] __initdata = { | 121 | static unsigned long exynos5250_clk_regs[] __initdata = { |
103 | SRC_CPU, | 122 | SRC_CPU, |
104 | DIV_CPU0, | 123 | DIV_CPU0, |
124 | PWR_CTRL1, | ||
125 | PWR_CTRL2, | ||
105 | SRC_CORE1, | 126 | SRC_CORE1, |
106 | SRC_TOP0, | 127 | SRC_TOP0, |
107 | SRC_TOP1, | 128 | SRC_TOP1, |
@@ -736,6 +757,7 @@ static struct of_device_id ext_clk_match[] __initdata = { | |||
736 | static void __init exynos5250_clk_init(struct device_node *np) | 757 | static void __init exynos5250_clk_init(struct device_node *np) |
737 | { | 758 | { |
738 | struct samsung_clk_provider *ctx; | 759 | struct samsung_clk_provider *ctx; |
760 | unsigned int tmp; | ||
739 | 761 | ||
740 | if (np) { | 762 | if (np) { |
741 | reg_base = of_iomap(np, 0); | 763 | reg_base = of_iomap(np, 0); |
@@ -776,6 +798,26 @@ static void __init exynos5250_clk_init(struct device_node *np) | |||
776 | samsung_clk_register_gate(ctx, exynos5250_gate_clks, | 798 | samsung_clk_register_gate(ctx, exynos5250_gate_clks, |
777 | ARRAY_SIZE(exynos5250_gate_clks)); | 799 | ARRAY_SIZE(exynos5250_gate_clks)); |
778 | 800 | ||
801 | /* | ||
802 | * Enable arm clock down (in idle) and set arm divider | ||
803 | * ratios in WFI/WFE state. | ||
804 | */ | ||
805 | tmp = (PWR_CTRL1_CORE2_DOWN_RATIO | PWR_CTRL1_CORE1_DOWN_RATIO | | ||
806 | PWR_CTRL1_DIV2_DOWN_EN | PWR_CTRL1_DIV1_DOWN_EN | | ||
807 | PWR_CTRL1_USE_CORE1_WFE | PWR_CTRL1_USE_CORE0_WFE | | ||
808 | PWR_CTRL1_USE_CORE1_WFI | PWR_CTRL1_USE_CORE0_WFI); | ||
809 | __raw_writel(tmp, reg_base + PWR_CTRL1); | ||
810 | |||
811 | /* | ||
812 | * Enable arm clock up (on exiting idle). Set arm divider | ||
813 | * ratios when not in idle along with the standby duration | ||
814 | * ratios. | ||
815 | */ | ||
816 | tmp = (PWR_CTRL2_DIV2_UP_EN | PWR_CTRL2_DIV1_UP_EN | | ||
817 | PWR_CTRL2_DUR_STANDBY2_VAL | PWR_CTRL2_DUR_STANDBY1_VAL | | ||
818 | PWR_CTRL2_CORE2_UP_RATIO | PWR_CTRL2_CORE1_UP_RATIO); | ||
819 | __raw_writel(tmp, reg_base + PWR_CTRL2); | ||
820 | |||
779 | exynos5250_clk_sleep_init(); | 821 | exynos5250_clk_sleep_init(); |
780 | 822 | ||
781 | pr_info("Exynos5250: clock setup completed, armclk=%ld\n", | 823 | pr_info("Exynos5250: clock setup completed, armclk=%ld\n", |