diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-08-13 02:10:29 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-10-20 21:12:51 -0400 |
commit | 3f75978b3742157853618c5c6dd4a5f49aa950b1 (patch) | |
tree | b8a87c92a3e258034cebe93a42f4cf47fba0b354 /arch/arm/mach-imx | |
parent | bfefdff8f91aa0a9ff1291d18d54498af276a6e5 (diff) |
ARM: imx6q: use common soc revision helpers
It calls imx_set_soc_revision() to set up soc revision in
imx6q_init_revision(), and replaces all the occurrences of
imx6q_revision() with common helper imx_get_soc_revision().
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/clk-imx6q.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 13 |
3 files changed, 7 insertions, 12 deletions
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 913ad85ad621..c68156621cc8 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -300,7 +300,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
300 | WARN_ON(!base); | 300 | WARN_ON(!base); |
301 | 301 | ||
302 | /* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */ | 302 | /* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */ |
303 | if (cpu_is_imx6q() && imx6q_revision() == IMX_CHIP_REVISION_1_0) { | 303 | if (cpu_is_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0) { |
304 | post_div_table[1].div = 1; | 304 | post_div_table[1].div = 1; |
305 | post_div_table[2].div = 1; | 305 | post_div_table[2].div = 1; |
306 | video_div_table[1].div = 1; | 306 | video_div_table[1].div = 1; |
@@ -574,7 +574,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
574 | clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL); | 574 | clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL); |
575 | clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL); | 575 | clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL); |
576 | 576 | ||
577 | if ((imx6q_revision() != IMX_CHIP_REVISION_1_0) || cpu_is_imx6dl()) { | 577 | if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || |
578 | cpu_is_imx6dl()) { | ||
578 | clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]); | 579 | clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]); |
579 | clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); | 580 | clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); |
580 | } | 581 | } |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 6ac25f68a6bc..cac12870efb3 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -73,7 +73,6 @@ extern void mxc_restart(enum reboot_mode, const char *); | |||
73 | extern void mxc_arch_reset_init(void __iomem *); | 73 | extern void mxc_arch_reset_init(void __iomem *); |
74 | extern void mxc_arch_reset_init_dt(void); | 74 | extern void mxc_arch_reset_init_dt(void); |
75 | extern int mx53_revision(void); | 75 | extern int mx53_revision(void); |
76 | extern int imx6q_revision(void); | ||
77 | extern int mx53_display_revision(void); | 76 | extern int mx53_display_revision(void); |
78 | extern void imx_set_aips(void __iomem *); | 77 | extern void imx_set_aips(void __iomem *); |
79 | extern int mxc_device_init(void); | 78 | extern int mxc_device_init(void); |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 3be0fa0e9796..f260aad9850b 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -38,16 +38,10 @@ | |||
38 | #include "cpuidle.h" | 38 | #include "cpuidle.h" |
39 | #include "hardware.h" | 39 | #include "hardware.h" |
40 | 40 | ||
41 | static u32 chip_revision; | ||
42 | |||
43 | int imx6q_revision(void) | ||
44 | { | ||
45 | return chip_revision; | ||
46 | } | ||
47 | |||
48 | static void __init imx6q_init_revision(void) | 41 | static void __init imx6q_init_revision(void) |
49 | { | 42 | { |
50 | u32 rev = imx_anatop_get_digprog(); | 43 | u32 rev = imx_anatop_get_digprog(); |
44 | u32 chip_revision; | ||
51 | 45 | ||
52 | switch (rev & 0xff) { | 46 | switch (rev & 0xff) { |
53 | case 0: | 47 | case 0: |
@@ -64,6 +58,7 @@ static void __init imx6q_init_revision(void) | |||
64 | } | 58 | } |
65 | 59 | ||
66 | mxc_set_cpu_type(rev >> 16 & 0xff); | 60 | mxc_set_cpu_type(rev >> 16 & 0xff); |
61 | imx_set_soc_revision(chip_revision); | ||
67 | } | 62 | } |
68 | 63 | ||
69 | static void imx6q_restart(enum reboot_mode mode, const char *cmd) | 64 | static void imx6q_restart(enum reboot_mode mode, const char *cmd) |
@@ -191,7 +186,7 @@ static void __init imx6q_1588_init(void) | |||
191 | static void __init imx6q_init_machine(void) | 186 | static void __init imx6q_init_machine(void) |
192 | { | 187 | { |
193 | imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", | 188 | imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", |
194 | imx6q_revision()); | 189 | imx_get_soc_revision()); |
195 | 190 | ||
196 | imx6q_enet_phy_init(); | 191 | imx6q_enet_phy_init(); |
197 | 192 | ||
@@ -270,7 +265,7 @@ static void __init imx6q_init_late(void) | |||
270 | * WAIT mode is broken on TO 1.0 and 1.1, so there is no point | 265 | * WAIT mode is broken on TO 1.0 and 1.1, so there is no point |
271 | * to run cpuidle on them. | 266 | * to run cpuidle on them. |
272 | */ | 267 | */ |
273 | if (imx6q_revision() > IMX_CHIP_REVISION_1_1) | 268 | if (imx_get_soc_revision() > IMX_CHIP_REVISION_1_1) |
274 | imx6q_cpuidle_init(); | 269 | imx6q_cpuidle_init(); |
275 | 270 | ||
276 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { | 271 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { |