Skip to contentSkip to conversation

imx: mx6sx: Disable ENET clock before switching clock parent

PATCH New Peng Fan 3 participants 3 messages Oct 8, 2016 – Nov 14, 2016 Arm (32-bit)

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 imx: mx6sx: Disable ENET clock before switching clock parent

From: "Ye.Li" <[email protected]>

Need to gate ENET clock when switching to a new clock parent, because the mux is not glitchless.

---
 arch/arm/cpu/armv7/mx6/clock.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/cpu/armv7/mx6/clock.c +5 -0
index ae3143c..96fbd81 100644
@@ -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
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 imx: mx6sx: Disable ENET clock before switching clock parent

Hi Stefano,

Ping..

Thanks,
Peng.

Quoted 31 lines · Peng Fan

From: "Ye.Li" <[email protected]>

Need to gate ENET clock when switching to a new clock parent, because the mux is not glitchless.

---
arch/arm/cpu/armv7/mx6/clock.c | 5 +++++

1 file changed, 5 insertions(+)
arch/arm/cpu/armv7/mx6/clock.c +5 -0
index ae3143c..96fbd81 100644
@@ -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
Signature · 1 line
2.6.2
#2 lore raw

PATCH 1/1 imx: mx6sx: Disable ENET clock before switching clock parent

In reply to Peng Fan

Hi Peng,

Quoted 19 lines · Peng Fan

From: "Ye.Li" <[email protected]>

Need to gate ENET clock when switching to a new clock parent, because the mux is not glitchless.

---
 arch/arm/cpu/armv7/mx6/clock.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/cpu/armv7/mx6/clock.c +0 -0
index ae3143c..96fbd81 100644
@@ -881,6 +881,11 @@ int enable_fec_anatop_clock(int fec_id, enum enet_freq freq)
 	writel(reg, &anatop->pll_enet);

arch/arm/cpu/armv7/mx6/clock.c int enable_fec_anatop_clock(int fec_id, enum enet_freq freq) · line 891

Quoted 10 lines
arch/arm/cpu/armv7/mx6/clock.c +5 -0
 
 #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

Applied to u-boot-imx, -next branch, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================