diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-08-13 02:59:43 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-10-20 21:13:12 -0400 |
commit | f1c6f314727c7595e249c7da3933ba2bc6219e58 (patch) | |
tree | 8e2550fbc365162f7914cb4410118207118005c7 /arch/arm/mach-imx/mach-imx6q.c | |
parent | 3f75978b3742157853618c5c6dd4a5f49aa950b1 (diff) |
ARM: imx: add a common function to initialize revision from anatop
The patch creates a common function imx_init_revision_from_anatop() by
merging imx6q_init_revision() and imx_anatop_get_digprog(), so that any
SoC that encodes revision info in anatop can use it to initialize
revision.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index f260aad9850b..1bdd0be429b9 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -38,29 +38,6 @@ | |||
38 | #include "cpuidle.h" | 38 | #include "cpuidle.h" |
39 | #include "hardware.h" | 39 | #include "hardware.h" |
40 | 40 | ||
41 | static void __init imx6q_init_revision(void) | ||
42 | { | ||
43 | u32 rev = imx_anatop_get_digprog(); | ||
44 | u32 chip_revision; | ||
45 | |||
46 | switch (rev & 0xff) { | ||
47 | case 0: | ||
48 | chip_revision = IMX_CHIP_REVISION_1_0; | ||
49 | break; | ||
50 | case 1: | ||
51 | chip_revision = IMX_CHIP_REVISION_1_1; | ||
52 | break; | ||
53 | case 2: | ||
54 | chip_revision = IMX_CHIP_REVISION_1_2; | ||
55 | break; | ||
56 | default: | ||
57 | chip_revision = IMX_CHIP_REVISION_UNKNOWN; | ||
58 | } | ||
59 | |||
60 | mxc_set_cpu_type(rev >> 16 & 0xff); | ||
61 | imx_set_soc_revision(chip_revision); | ||
62 | } | ||
63 | |||
64 | static void imx6q_restart(enum reboot_mode mode, const char *cmd) | 41 | static void imx6q_restart(enum reboot_mode mode, const char *cmd) |
65 | { | 42 | { |
66 | struct device_node *np; | 43 | struct device_node *np; |
@@ -282,7 +259,7 @@ static void __init imx6q_map_io(void) | |||
282 | 259 | ||
283 | static void __init imx6q_init_irq(void) | 260 | static void __init imx6q_init_irq(void) |
284 | { | 261 | { |
285 | imx6q_init_revision(); | 262 | imx_init_revision_from_anatop(); |
286 | imx_init_l2cache(); | 263 | imx_init_l2cache(); |
287 | imx_src_init(); | 264 | imx_src_init(); |
288 | imx_gpc_init(); | 265 | imx_gpc_init(); |