Skip to contentSkip to conversation

clk: ti: dra7: fix parent for gmac_clkctrl

PATCH Applied Grygorii Strashko 2 participants 5 messages Dec 21, 2019 – Jan 21, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: ti: dra7: fix parent for gmac_clkctrl

The parent clk for gmac clk ctrl has to be gmac_main_clk (125MHz) instead of dpll_gmac_ck (1GHz). This is caused incorrect CPSW MDIO operation. Hence, fix it.

Fixes dffa9051d546 ('clk: ti: dra7: add new clkctrl data')
---
 drivers/clk/ti/clk-7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +1 -1
index 9dd6185a4b4e..66e4b2b9ec60 100644
@@ -405,7 +405,7 @@ static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = {
 };
 
 static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
-	{ DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "dpll_gmac_ck" },
+	{ DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "gmac_main_clk" },
 	{ 0 },
 };
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 15 lines · Grygorii Strashko

The parent clk for gmac clk ctrl has to be gmac_main_clk (125MHz) instead of dpll_gmac_ck (1GHz). This is caused incorrect CPSW MDIO operation. Hence, fix it.

Fixes dffa9051d546 ('clk: ti: dra7: add new clkctrl data')
---
  drivers/clk/ti/clk-7xx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +0 -0
index 9dd6185a4b4e..66e4b2b9ec60 100644

drivers/clk/ti/clk-7xx.c static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = { · line 408

Quoted 5 lines
drivers/clk/ti/clk-7xx.c +1 -1
@@ -405,7 +405,7 @@ static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = {
  };
 
  static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
-	{ DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "dpll_gmac_ck" },
+	{ DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "gmac_main_clk" },

I think the gmac clk path is still somehow wrong after this change. This only fixes it partially imo.

Looking at TRM, gmac_main_clk is fed from dpll_gmac_x2_h12, but looking at the existing clock data, gmac_main_clk comes out from dpll_gmac_m2_ck. This potentially applies one extra divider to the path which appears wrong. Can you take a look at fixing the DTS side for this also?

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

#2 lore raw
Quoted 23 lines · Tero Kristo
Quoted 15 lines · Grygorii Strashko

The parent clk for gmac clk ctrl has to be gmac_main_clk (125MHz) instead of dpll_gmac_ck (1GHz). This is caused incorrect CPSW MDIO operation. Hence, fix it.

Fixes dffa9051d546 ('clk: ti: dra7: add new clkctrl data')

---
  drivers/clk/ti/clk-7xx.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +0 -0
index 9dd6185a4b4e..66e4b2b9ec60 100644

drivers/clk/ti/clk-7xx.c static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = { · line 407

Quoted 4 lines
drivers/clk/ti/clk-7xx.c +1 -1
@@ -405,7 +405,7 @@ static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = {
   };
   static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
-    { DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "dpll_gmac_ck" },
+    { DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "gmac_main_clk" },

I think the gmac clk path is still somehow wrong after this change. This only fixes it partially imo.

Quoted 1 line

Looking at TRM, gmac_main_clk is fed from dpll_gmac_x2_h12,

No, it seems not.
DPLL_GMAC.CLKOUT_M2 -> GMAC_250M_CLK -> 1/2 -> GMAC_MAIN_CLK

http://www.ti.com/lit/ug/sprui30f/sprui30f.pdf
3.6.3.12.1 DPLL_GMAC Overview
Figure 3-41. CM_CORE_AON Overview (b)
Figure 24-185. GMAC_SW Integration

but looking at the existing clock data, gmac_main_clk comes out from dpll_gmac_m2_ck. This potentially applies one extra divider to the path which appears wrong. Can you take a look at fixing the DTS side for this also?

Quoted 4 lines

-Tero

Signature · 1 line
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Signature · 2 lines
Best regards,
grygorii
#3 lore raw
Quoted 29 lines · Grygorii Strashko
Quoted 26 lines · Tero Kristo
Quoted 15 lines · Grygorii Strashko

The parent clk for gmac clk ctrl has to be gmac_main_clk (125MHz) instead of dpll_gmac_ck (1GHz). This is caused incorrect CPSW MDIO operation. Hence, fix it.

Fixes dffa9051d546 ('clk: ti: dra7: add new clkctrl data')

---
  drivers/clk/ti/clk-7xx.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +0 -0
index 9dd6185a4b4e..66e4b2b9ec60 100644

drivers/clk/ti/clk-7xx.c static const struct omap_clkctrl_bit_data · line 410

Quoted 7 lines
drivers/clk/ti/clk-7xx.c +1 -1
@@ -405,7 +405,7 @@ static const struct omap_clkctrl_bit_data 
 dra7_gmac_bit_data[] __initconst = {
   };
   static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
-    { DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, 
 "dpll_gmac_ck" },
+    { DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, 
 "gmac_main_clk" },

I think the gmac clk path is still somehow wrong after this change. This only fixes it partially imo.

Quoted 4 lines
Quoted 1 line

Looking at TRM, gmac_main_clk is fed from dpll_gmac_x2_h12,

No, it seems not.
DPLL_GMAC.CLKOUT_M2 -> GMAC_250M_CLK -> 1/2 -> GMAC_MAIN_CLK

Hmm ok, yeah looking at the GMAC IP details shows how it actually goes, I got confused with the clkdm mapping in 3.6.3.12.1. So no DT changes needed after all and this patch alone is fine.

-Tero

Quoted 11 lines

http://www.ti.com/lit/ug/sprui30f/sprui30f.pdf
3.6.3.12.1 DPLL_GMAC Overview
Figure 3-41. CM_CORE_AON Overview (b)
Figure 24-185. GMAC_SW Integration

but looking at the existing clock data, gmac_main_clk comes out from dpll_gmac_m2_ck. This potentially applies one extra divider to the path which appears wrong. Can you take a look at fixing the DTS side for this also?

Quoted 3 lines

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Applied
#4 lore raw
In reply to Grygorii Strashko
Quoted 6 lines · Grygorii Strashko

The parent clk for gmac clk ctrl has to be gmac_main_clk (125MHz) instead of dpll_gmac_ck (1GHz). This is caused incorrect CPSW MDIO operation. Hence, fix it.

Fixes dffa9051d546 ('clk: ti: dra7: add new clkctrl data')

Queued up for 5.6, thanks.

-Tero

Quoted 10 lines
---
  drivers/clk/ti/clk-7xx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +0 -0
index 9dd6185a4b4e..66e4b2b9ec60 100644

drivers/clk/ti/clk-7xx.c static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = { · line 411

Quoted 8 lines
drivers/clk/ti/clk-7xx.c +1 -1
@@ -405,7 +405,7 @@ static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = {
  };
 
  static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
-	{ DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "dpll_gmac_ck" },
+	{ DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "gmac_main_clk" },
  	{ 0 },
  };
 

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki