aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/samsung
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-02 19:35:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-02 19:35:49 -0400
commita727eaf64ff084a50b983fc506810c7a576b7ce3 (patch)
treecb82642227ed590ebc43b12cfad285a2d7681d5d /drivers/clk/samsung
parent755a9ba7bf24a45b6dbf8bb15a5a56c8ed12461a (diff)
parent45e70b7d48d53d5eb193c6b3f012b31ca135fb4c (diff)
Merge tag 'drivers-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc into next
Pull ARM SoC driver changes from Olof Johansson: "SoC-near driver changes that we're merging through our tree. Mostly because they depend on other changes we have staged, but in some cases because the driver maintainers preferred that we did it this way. This contains a largeish cleanup series of the omap_l3_noc bus driver, cpuidle rework for Exynos, some reset driver conversions and a long branch of TI EDMA fixes and cleanups, with more to come next release. The TI EDMA cleanups is a shared branch with the dmaengine tree, with a handful of Davinci-specific fixes on top. After discussion at last year's KS (and some more on the mailing lists), we are here adding a drivers/soc directory. The purpose of this is to keep per-vendor shared code that's needed by different drivers but that doesn't fit into the MFD (nor drivers/platform) model. We expect to keep merging contents for this hierarchy through arm-soc so we can keep an eye on what the vendors keep adding here and not making it a free-for-all to shove in crazy stuff" * tag 'drivers-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (101 commits) cpufreq: exynos: Fix driver compilation with ARCH_MULTIPLATFORM tty: serial: msm: Remove direct access to GSBI power: reset: keystone-reset: introduce keystone reset driver Documentation: dt: add bindings for keystone pll control controller Documentation: dt: add bindings for keystone reset driver soc: qcom: fix of_device_id table ARM: EXYNOS: Fix kernel panic when unplugging CPU1 on exynos ARM: EXYNOS: Move the driver to drivers/cpuidle directory ARM: EXYNOS: Cleanup all unneeded headers from cpuidle.c ARM: EXYNOS: Pass the AFTR callback to the platform_data ARM: EXYNOS: Move S5P_CHECK_SLEEP into pm.c ARM: EXYNOS: Move the power sequence call in the cpu_pm notifier ARM: EXYNOS: Move the AFTR state function into pm.c ARM: EXYNOS: Encapsulate the AFTR code into a function ARM: EXYNOS: Disable cpuidle for exynos5440 ARM: EXYNOS: Encapsulate boot vector code into a function for cpuidle ARM: EXYNOS: Pass wakeup mask parameter to function for cpuidle ARM: EXYNOS: Remove ifdef for scu_enable in pm ARM: EXYNOS: Move scu_enable in the cpu_pm notifier ARM: EXYNOS: Use the cpu_pm notifier for pm ...
Diffstat (limited to 'drivers/clk/samsung')
-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 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 */
88enum exynos5250_plls { 107enum 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;
102static unsigned long exynos5250_clk_regs[] __initdata = { 121static 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 = {
736static void __init exynos5250_clk_init(struct device_node *np) 757static 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",