From 6f04955aa81e688087ed6cf73802f8acfe065fe5 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Thu, 23 May 2013 10:24:51 +0800 Subject: ENGR00264076-3 i.mx6:gate/ungate PFD before using it Per the IC design, we need to gate/ungate all the unused PFDs to make sure PFD is working correctly, otherwise, PFDs may not not output clock after reset. Signed-off-by: Anson Huang Signed-off-by: Jason Liu --- arch/arm/cpu/armv7/mx6/soc.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index 05e165e..2e84d89 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -289,6 +289,42 @@ void check_cpu_temperature(void) printf("CPU: Temperature: can't get valid data!\n"); } +static void imx_reset_pfd(void) +{ + struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; + + /* + * Per the IC design, we need to gate/ungate all the unused PFDs + * to make sure PFD is working correctly, otherwise, PFDs may not + * not output clock after reset. + */ + + writel(BM_ANADIG_PFD_480_PFD3_CLKGATE | + BM_ANADIG_PFD_480_PFD2_CLKGATE | + BM_ANADIG_PFD_480_PFD1_CLKGATE | + BM_ANADIG_PFD_480_PFD0_CLKGATE, &anatop->pfd_480_set); +#ifdef CONFIG_MX6Q + writel(BM_ANADIG_PFD_528_PFD2_CLKGATE | + BM_ANADIG_PFD_528_PFD1_CLKGATE | + BM_ANADIG_PFD_528_PFD0_CLKGATE, &anatop->pfd_528_set); +#else + writel(BM_ANADIG_PFD_528_PFD1_CLKGATE | + BM_ANADIG_PFD_528_PFD0_CLKGATE, &anatop->pfd_528_set); +#endif + writel(BM_ANADIG_PFD_480_PFD3_CLKGATE | + BM_ANADIG_PFD_480_PFD2_CLKGATE | + BM_ANADIG_PFD_480_PFD1_CLKGATE | + BM_ANADIG_PFD_480_PFD0_CLKGATE, &anatop->pfd_480_clr); +#ifdef CONFIG_MX6Q + writel(BM_ANADIG_PFD_528_PFD2_CLKGATE | + BM_ANADIG_PFD_528_PFD1_CLKGATE | + BM_ANADIG_PFD_528_PFD0_CLKGATE, &anatop->pfd_528_clr); +#else + writel(BM_ANADIG_PFD_528_PFD1_CLKGATE | + BM_ANADIG_PFD_528_PFD0_CLKGATE, &anatop->pfd_528_clr); +#endif +} + int arch_cpu_init(void) { init_aips(); @@ -296,6 +332,8 @@ int arch_cpu_init(void) imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */ + imx_reset_pfd(); + #ifdef CONFIG_APBH_DMA /* Start APBH DMA */ mxs_dma_init(); -- cgit v1.1