imx: mx6: correct enable_fec_anatop_clock
authorPeng Fan <Peng.Fan@freescale.com>
Sun, 6 Sep 2015 09:15:47 +0000 (17:15 +0800)
committerStefano Babic <sbabic@denx.de>
Fri, 2 Oct 2015 08:42:31 +0000 (10:42 +0200)
We should follow 'read->set/clr bit->write' flow for enable_fec_anatop_clock,
otherwise we may overridden configuration before enable_fec_anatop_clock.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Cc: Fabio Estevam <fabio.estevam@freescale.com>
arch/arm/cpu/armv7/mx6/clock.c

index ba6cc75a7b21193e51f5d17e651c1a3a61afda1c..11efd12c9a7764770f1fbedab2cf47a66f9c4ef3 100644 (file)
@@ -535,6 +535,8 @@ int enable_fec_anatop_clock(int fec_id, enum enet_freq freq)
        if (freq < ENET_25MHZ || freq > ENET_125MHZ)
                return -EINVAL;
 
+       reg = readl(&anatop->pll_enet);
+
        if (fec_id == 0) {
                reg &= ~BM_ANADIG_PLL_ENET_DIV_SELECT;
                reg |= BF_ANADIG_PLL_ENET_DIV_SELECT(freq);