Skip to contentSkip to conversation

clk: ti: dra7: fix parent for gmac_clkctrl

PATCH Superseded Grygorii Strashko 3 participants 7 messages Nov 9, 2019 – Dec 18, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 commit 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 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 commit dffa9051d546 ('clk: ti: dra7: add new clkctrl data')

Hmm is there a mux for the source though?

In that case using assigned-clocks and assigned-clock-parents in addition to a related clk-7xx.c fix would be needed.

Regards,

Tony

Quoted 20 lines
---
 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
#2 lore raw
Quoted 9 lines · Tony Lindgren
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 commit dffa9051d546 ('clk: ti: dra7: add new clkctrl data')

Hmm is there a mux for the source though?

Not sure what do you mean here :(

fck clock for CPSW and MDIO is "gmac_main_clk" which is 125MHz and that what need to be passed to drivers and enabled through the clock tree. The TI specific PM is handled by gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0 which required sysc programming and child modules dosn't need to even know that.

So, this patch is simply correct clock tree for dra7:
dpll_gmac_ck -> .... -> gmac_main_clk -> gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0

Seems MDIO dt also need to be fixed to use:
gmac_main_clk as "fck". I'll try and send patch.

By the way, the patch follows am3/am4 (am4_cpsw_125mhz_clkctrl_regs,
am3_cpsw_125mhz_clkctrl_regs)

Quoted 28 lines

In that case using assigned-clocks and assigned-clock-parents in addition to a related clk-7xx.c fix would be needed.

Regards,

Tony

Quoted 20 lines
---
  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
Signature · 2 lines
Best regards,
grygorii
#3 lore raw
Quoted 11 lines · Grygorii Strashko
Quoted 8 lines · Tony Lindgren
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 commit dffa9051d546 ('clk: ti: dra7: add new clkctrl data')
Quoted 8 lines
Quoted 1 line

Hmm is there a mux for the source though?

Not sure what do you mean here :(

fck clock for CPSW and MDIO is "gmac_main_clk" which is 125MHz and that what need to be passed to drivers and enabled through the clock tree. The TI specific PM is handled by gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0 which required sysc programming and child modules dosn't need to even know that.

OK

Quoted 2 lines

So, this patch is simply correct clock tree for dra7:
dpll_gmac_ck -> .... -> gmac_main_clk -> gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0

So I guess there's no mux clock for DRA7_GMAC_GMAC_CLKCTRL 0.

What I meant is maybe check also that no top level mux is needed similar to what we have for these configured with assigned-clocks:

$ git grep -C3 assigned-clock arch/arm/boot/dts/dra7*
Quoted 2 lines

Seems MDIO dt also need to be fixed to use:
gmac_main_clk as "fck". I'll try and send patch.

OK

Quoted 2 lines

By the way, the patch follows am3/am4 (am4_cpsw_125mhz_clkctrl_regs,
am3_cpsw_125mhz_clkctrl_regs)

OK

Tony

#4 lore raw
Quoted 26 lines · Tony Lindgren
Quoted 11 lines · Grygorii Strashko
Quoted 8 lines · Tony Lindgren
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 commit dffa9051d546 ('clk: ti: dra7: add new clkctrl data')
Quoted 8 lines
Quoted 1 line

Hmm is there a mux for the source though?

Not sure what do you mean here :(

fck clock for CPSW and MDIO is "gmac_main_clk" which is 125MHz and that what need to be passed to drivers and enabled through the clock tree. The TI specific PM is handled by gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0 which required sysc programming and child modules dosn't need to even know that.

OK

Quoted 2 lines

So, this patch is simply correct clock tree for dra7:
dpll_gmac_ck -> .... -> gmac_main_clk -> gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0

Quoted 6 lines

So I guess there's no mux clock for DRA7_GMAC_GMAC_CLKCTRL 0.

What I meant is maybe check also that no top level mux is needed similar to what we have for these configured with assigned-clocks:

$ git grep -C3 assigned-clock arch/arm/boot/dts/dra7*

No. No muxes here.

[...]

Signature · 2 lines
Best regards,
grygorii
#5 lore raw
Quoted 29 lines · Grygorii Strashko
Quoted 26 lines · Tony Lindgren
Quoted 11 lines · Grygorii Strashko
Quoted 8 lines · Tony Lindgren
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 commit dffa9051d546 ('clk: ti: dra7: add new clkctrl data')
Quoted 8 lines
Quoted 1 line

Hmm is there a mux for the source though?

Not sure what do you mean here :(

fck clock for CPSW and MDIO is "gmac_main_clk" which is 125MHz and that what need to be passed to drivers and enabled through the clock tree. The TI specific PM is handled by gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0 which required sysc programming and child modules dosn't need to even know that.

OK

Quoted 2 lines

So, this patch is simply correct clock tree for dra7:
dpll_gmac_ck -> .... -> gmac_main_clk -> gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0

Quoted 8 lines
Quoted 6 lines

So I guess there's no mux clock for DRA7_GMAC_GMAC_CLKCTRL 0.

What I meant is maybe check also that no top level mux is needed similar to what we have for these configured with assigned-clocks:

$ git grep -C3 assigned-clock arch/arm/boot/dts/dra7*

No. No muxes here.

OK thanks for checking.

Tony

maintainer
#6 lore raw
In reply to Grygorii Strashko

Quoting Grygorii Strashko (2019-11-09 06:20:17)

Quoted 5 lines

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 commit dffa9051d546 ('clk: ti: dra7: add new clkctrl data')

There shouldn't be 'commit' in a Fixes: line.