imx: mx6sx: Disable ENET clock before switching clock parent
authorYe.Li <ye.li@nxp.com>
Sat, 8 Oct 2016 08:58:29 +0000 (16:58 +0800)
committerStefano Babic <sbabic@denx.de>
Wed, 16 Nov 2016 19:53:55 +0000 (20:53 +0100)
Need to gate ENET clock when switching to a new clock parent, because
the mux is not glitchless.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye.Li <ye.li@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
arch/arm/cpu/armv7/mx6/clock.c

index ae3143c760716906ac8f660114967c43ec0ce2c6..96fbd81d0814766bba5717b0c49dcca70f3ce41e 100644 (file)
@@ -881,6 +881,11 @@ int enable_fec_anatop_clock(int fec_id, enum enet_freq freq)
        writel(reg, &anatop->pll_enet);
 
 #ifdef CONFIG_MX6SX
+       /* Disable enet system clcok before switching clock parent */
+       reg = readl(&imx_ccm->CCGR3);
+       reg &= ~MXC_CCM_CCGR3_ENET_MASK;
+       writel(reg, &imx_ccm->CCGR3);
+
        /*
         * Set enet ahb clock to 200MHz
         * pll2_pfd2_396m-> ENET_PODF-> ENET_AHB