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>
This commit is contained in:
parent
32f3b8da22
commit
7006ba24c2
|
@ -78,10 +78,19 @@ void imx_anatop_usb_chrg_detect_disable(void)
|
||||||
|
|
||||||
u32 imx_anatop_get_digprog(void)
|
u32 imx_anatop_get_digprog(void)
|
||||||
{
|
{
|
||||||
u32 val;
|
struct device_node *np;
|
||||||
|
void __iomem *anatop_base;
|
||||||
|
static u32 digprog;
|
||||||
|
|
||||||
regmap_read(anatop, ANADIG_DIGPROG, &val);
|
if (digprog)
|
||||||
return val;
|
return digprog;
|
||||||
|
|
||||||
|
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
|
||||||
|
anatop_base = of_iomap(np, 0);
|
||||||
|
WARN_ON(!anatop_base);
|
||||||
|
digprog = readl_relaxed(anatop_base + ANADIG_DIGPROG);
|
||||||
|
|
||||||
|
return digprog;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init imx_anatop_init(void)
|
void __init imx_anatop_init(void)
|
||||||
|
|
|
@ -164,7 +164,6 @@ static void __init imx6q_init_machine(void)
|
||||||
imx6q_pm_init();
|
imx6q_pm_init();
|
||||||
imx6q_usb_init();
|
imx6q_usb_init();
|
||||||
imx6q_1588_init();
|
imx6q_1588_init();
|
||||||
imx_print_silicon_rev("i.MX6Q", imx6q_revision());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OCOTP_CFG3 0x440
|
#define OCOTP_CFG3 0x440
|
||||||
|
@ -258,6 +257,7 @@ static void __init imx6q_timer_init(void)
|
||||||
{
|
{
|
||||||
mx6q_clocks_init();
|
mx6q_clocks_init();
|
||||||
twd_local_timer_of_register();
|
twd_local_timer_of_register();
|
||||||
|
imx_print_silicon_rev("i.MX6Q", imx6q_revision());
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *imx6q_dt_compat[] __initdata = {
|
static const char *imx6q_dt_compat[] __initdata = {
|
||||||
|
|
Loading…
Reference in New Issue