Commit 6b5756e8 authored by Tomasz Figa's avatar Tomasz Figa Committed by Kukjin Kim

clk: exynos4: Add support for SoC-specific register save list

This patch extends suspend/resume support for SoC-specific registers to
handle differences in register sets on particular SoCs.
Signed-off-by: default avatarTomasz Figa <t.figa@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: default avatarThomas Abraham <thomas.abraham@linaro.org>
Acked-by: default avatarMike Turquette <mturquette@linaro.org>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent fb948f74
...@@ -183,6 +183,26 @@ enum exynos4_clks { ...@@ -183,6 +183,26 @@ enum exynos4_clks {
* list of controller registers to be saved and restored during a * list of controller registers to be saved and restored during a
* suspend/resume cycle. * suspend/resume cycle.
*/ */
static __initdata unsigned long exynos4210_clk_save[] = {
E4210_SRC_IMAGE,
E4210_SRC_LCD1,
E4210_SRC_MASK_LCD1,
E4210_DIV_LCD1,
E4210_GATE_IP_IMAGE,
E4210_GATE_IP_LCD1,
E4210_GATE_IP_PERIR,
E4210_MPLL_CON0,
};
static __initdata unsigned long exynos4x12_clk_save[] = {
E4X12_GATE_IP_IMAGE,
E4X12_GATE_IP_PERIR,
E4X12_SRC_CAM1,
E4X12_DIV_ISP,
E4X12_DIV_CAM1,
E4X12_MPLL_CON0,
};
static __initdata unsigned long exynos4_clk_regs[] = { static __initdata unsigned long exynos4_clk_regs[] = {
SRC_LEFTBUS, SRC_LEFTBUS,
DIV_LEFTBUS, DIV_LEFTBUS,
...@@ -986,8 +1006,14 @@ void __init exynos4_clk_init(struct device_node *np) ...@@ -986,8 +1006,14 @@ void __init exynos4_clk_init(struct device_node *np)
panic("%s: unable to determine soc\n", __func__); panic("%s: unable to determine soc\n", __func__);
} }
if (exynos4_soc == EXYNOS4210)
samsung_clk_init(np, reg_base, nr_clks,
exynos4_clk_regs, ARRAY_SIZE(exynos4_clk_regs),
exynos4210_clk_save, ARRAY_SIZE(exynos4210_clk_save));
else
samsung_clk_init(np, reg_base, nr_clks, samsung_clk_init(np, reg_base, nr_clks,
exynos4_clk_regs, ARRAY_SIZE(exynos4_clk_regs)); exynos4_clk_regs, ARRAY_SIZE(exynos4_clk_regs),
exynos4x12_clk_save, ARRAY_SIZE(exynos4x12_clk_save));
if (np) if (np)
samsung_clk_of_register_fixed_ext(exynos4_fixed_rate_ext_clks, samsung_clk_of_register_fixed_ext(exynos4_fixed_rate_ext_clks,
......
...@@ -477,7 +477,8 @@ void __init exynos5250_clk_init(struct device_node *np) ...@@ -477,7 +477,8 @@ void __init exynos5250_clk_init(struct device_node *np)
} }
samsung_clk_init(np, reg_base, nr_clks, samsung_clk_init(np, reg_base, nr_clks,
exynos5250_clk_regs, ARRAY_SIZE(exynos5250_clk_regs)); exynos5250_clk_regs, ARRAY_SIZE(exynos5250_clk_regs),
NULL, 0);
samsung_clk_of_register_fixed_ext(exynos5250_fixed_rate_ext_clks, samsung_clk_of_register_fixed_ext(exynos5250_fixed_rate_ext_clks,
ARRAY_SIZE(exynos5250_fixed_rate_ext_clks), ARRAY_SIZE(exynos5250_fixed_rate_ext_clks),
ext_clk_match); ext_clk_match);
......
...@@ -115,7 +115,7 @@ void __init exynos5440_clk_init(struct device_node *np) ...@@ -115,7 +115,7 @@ void __init exynos5440_clk_init(struct device_node *np)
return; return;
} }
samsung_clk_init(np, reg_base, nr_clks, NULL, 0); samsung_clk_init(np, reg_base, nr_clks, NULL, 0, NULL, 0);
samsung_clk_of_register_fixed_ext(exynos5440_fixed_rate_ext_clks, samsung_clk_of_register_fixed_ext(exynos5440_fixed_rate_ext_clks,
ARRAY_SIZE(exynos5440_fixed_rate_ext_clks), ext_clk_match); ARRAY_SIZE(exynos5440_fixed_rate_ext_clks), ext_clk_match);
......
...@@ -54,7 +54,8 @@ static struct syscore_ops samsung_clk_syscore_ops = { ...@@ -54,7 +54,8 @@ static struct syscore_ops samsung_clk_syscore_ops = {
/* setup the essentials required to support clock lookup using ccf */ /* setup the essentials required to support clock lookup using ccf */
void __init samsung_clk_init(struct device_node *np, void __iomem *base, void __init samsung_clk_init(struct device_node *np, void __iomem *base,
unsigned long nr_clks, unsigned long *rdump, unsigned long nr_clks, unsigned long *rdump,
unsigned long nr_rdump) unsigned long nr_rdump, unsigned long *soc_rdump,
unsigned long nr_soc_rdump)
{ {
reg_base = base; reg_base = base;
...@@ -62,7 +63,7 @@ void __init samsung_clk_init(struct device_node *np, void __iomem *base, ...@@ -62,7 +63,7 @@ void __init samsung_clk_init(struct device_node *np, void __iomem *base,
if (rdump && nr_rdump) { if (rdump && nr_rdump) {
unsigned int idx; unsigned int idx;
reg_dump = kzalloc(sizeof(struct samsung_clk_reg_dump) reg_dump = kzalloc(sizeof(struct samsung_clk_reg_dump)
* nr_rdump, GFP_KERNEL); * (nr_rdump + nr_soc_rdump), GFP_KERNEL);
if (!reg_dump) { if (!reg_dump) {
pr_err("%s: memory alloc for register dump failed\n", pr_err("%s: memory alloc for register dump failed\n",
__func__); __func__);
...@@ -71,7 +72,9 @@ void __init samsung_clk_init(struct device_node *np, void __iomem *base, ...@@ -71,7 +72,9 @@ void __init samsung_clk_init(struct device_node *np, void __iomem *base,
for (idx = 0; idx < nr_rdump; idx++) for (idx = 0; idx < nr_rdump; idx++)
reg_dump[idx].offset = rdump[idx]; reg_dump[idx].offset = rdump[idx];
nr_reg_dump = nr_rdump; for (idx = 0; idx < nr_soc_rdump; idx++)
reg_dump[nr_rdump + idx].offset = soc_rdump[idx];
nr_reg_dump = nr_rdump + nr_soc_rdump;
register_syscore_ops(&samsung_clk_syscore_ops); register_syscore_ops(&samsung_clk_syscore_ops);
} }
#endif #endif
......
...@@ -262,7 +262,8 @@ struct samsung_clk_reg_dump { ...@@ -262,7 +262,8 @@ struct samsung_clk_reg_dump {
extern void __init samsung_clk_init(struct device_node *np, void __iomem *base, extern void __init samsung_clk_init(struct device_node *np, void __iomem *base,
unsigned long nr_clks, unsigned long *rdump, unsigned long nr_clks, unsigned long *rdump,
unsigned long nr_rdump); unsigned long nr_rdump, unsigned long *soc_rdump,
unsigned long nr_soc_rdump);
extern void __init samsung_clk_of_register_fixed_ext( extern void __init samsung_clk_of_register_fixed_ext(
struct samsung_fixed_rate_clock *fixed_rate_clk, struct samsung_fixed_rate_clock *fixed_rate_clk,
unsigned int nr_fixed_rate_clk, unsigned int nr_fixed_rate_clk,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment