diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-03-31 10:39:22 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-04-12 07:28:13 -0400 |
commit | 7006ba24c26313631f21fff5a087c971f5c7d2ef (patch) | |
tree | aaa63c87e3c201ca9a1ebf92cc03dabf23cc7488 /arch/arm/mach-imx/anatop.c | |
parent | 32f3b8da222b0817e0544acd888071aff674b629 (diff) |
ARM: imx: do not use regmap_read for ANADIG_DIGPROG
Function imx_anatop_get_digprog() that reads register ANADIG_DIGPROG is
called to identify silicon version. Users might query silicon version
earlier than regmap subsystem is ready. For example, imx6q clock driver
query revision in mx6q_clocks_init(), where regmap is not initialized
yet.
Change imx_anatop_get_digprog() to map anatop block and read
ANADIG_DIGPROG in the native way, so that the function can work at very
early stage.
While at it, let's move imx_print_silicon_rev() back to
imx6q_timer_init() to have the message show up a little earlier.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/anatop.c')
-rw-r--r-- | arch/arm/mach-imx/anatop.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c index 472beee9cd98..0cfa07dd9aa4 100644 --- a/arch/arm/mach-imx/anatop.c +++ b/arch/arm/mach-imx/anatop.c | |||
@@ -78,10 +78,19 @@ void imx_anatop_usb_chrg_detect_disable(void) | |||
78 | 78 | ||
79 | u32 imx_anatop_get_digprog(void) | 79 | u32 imx_anatop_get_digprog(void) |
80 | { | 80 | { |
81 | u32 val; | 81 | struct device_node *np; |
82 | void __iomem *anatop_base; | ||
83 | static u32 digprog; | ||
82 | 84 | ||
83 | regmap_read(anatop, ANADIG_DIGPROG, &val); | 85 | if (digprog) |
84 | return val; | 86 | return digprog; |
87 | |||
88 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop"); | ||
89 | anatop_base = of_iomap(np, 0); | ||
90 | WARN_ON(!anatop_base); | ||
91 | digprog = readl_relaxed(anatop_base + ANADIG_DIGPROG); | ||
92 | |||
93 | return digprog; | ||
85 | } | 94 | } |
86 | 95 | ||
87 | void __init imx_anatop_init(void) | 96 | void __init imx_anatop_init(void) |