public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu
@ 2026-02-02 10:40 Mihai Sain
  2026-02-02 10:40 ` [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67 Mihai Sain
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Mihai Sain @ 2026-02-02 10:40 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	ryan.wanner, Mihai Sain

This series updates the GMAC clock configuration for the
SAM9X7 family. The current clock definitions contain inconsistencies
around the GMAC peripheral and its associated generic clock IDs, which
lead to incorrect wiring in both the clock driver and the devicetree.

Mihai Sain (5):
  clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67
  clk: at91: sam9x7: Rename macb0_clk to gmac_clk
  clk: at91: sam9x7: Add gmac generic clock entry with ID 24
  ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node
  ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24

 arch/arm/boot/dts/microchip/sam9x7.dtsi |  6 +++---
 drivers/clk/at91/sam9x7.c               | 21 ++++++++++-----------
 2 files changed, 13 insertions(+), 14 deletions(-)


base-commit: 18f7fcd5e69a04df57b563360b88be72471d6b62
-- 
2.52.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67
  2026-02-02 10:40 [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu Mihai Sain
@ 2026-02-02 10:40 ` Mihai Sain
  2026-02-02 13:55   ` Andrew Lunn
  2026-02-02 10:40 ` [PATCH 2/5] clk: at91: sam9x7: Rename macb0_clk to gmac_clk Mihai Sain
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Mihai Sain @ 2026-02-02 10:40 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	ryan.wanner, Mihai Sain

According with datasheet table 12.1 the instance ID 67 is reserved.
This change drops the gmactsu_clk and gmac_gclk entries from
the SAM9X7 clock description tables.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 drivers/clk/at91/sam9x7.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index 89868a0aeaba..d9603f1124d0 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -420,7 +420,6 @@ static const struct {
 	{ .n = "lvdsc_clk",	.id = 56, },
 	{ .n = "pit64b1_clk",	.id = 58, },
 	{ .n = "puf_clk",	.id = 59, },
-	{ .n = "gmactsu_clk",	.id = 67, },
 };
 
 /*
@@ -702,15 +701,6 @@ static const struct {
 		.pp_count = 1,
 		.pp_chg_id = INT_MIN,
 	},
-
-	{
-		.n = "gmac_gclk",
-		.id = 67,
-		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
-		.pp_mux_table = { 6, 8, },
-		.pp_count = 2,
-		.pp_chg_id = INT_MIN,
-	},
 };
 
 static void __init sam9x7_pmc_setup(struct device_node *np)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] clk: at91: sam9x7: Rename macb0_clk to gmac_clk
  2026-02-02 10:40 [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu Mihai Sain
  2026-02-02 10:40 ` [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67 Mihai Sain
@ 2026-02-02 10:40 ` Mihai Sain
  2026-02-02 10:40 ` [PATCH 3/5] clk: at91: sam9x7: Add gmac generic clock entry with ID 24 Mihai Sain
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Mihai Sain @ 2026-02-02 10:40 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	ryan.wanner, Mihai Sain

Update the peripheral clock name for ID 24 from macb0_clk to gmac_clk
to match the actual GMAC hardware block present on SAM9X7 SoCs.
This aligns the clock naming with the device tree and avoids confusion
with legacy MACB controllers.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 drivers/clk/at91/sam9x7.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index d9603f1124d0..68e569bd70f5 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -387,7 +387,7 @@ static const struct {
 	{ .n = "dma0_clk",	.id = 20, },
 	{ .n = "uhphs_clk",	.id = 22, },
 	{ .n = "udphs_clk",	.id = 23, },
-	{ .n = "macb0_clk",	.id = 24, },
+	{ .n = "gmac_clk",	.id = 24, },
 	{ .n = "lcd_clk",	.id = 25, },
 	{ .n = "sdmmc1_clk",	.id = 26, },
 	{ .n = "ssc_clk",	.id = 28, },
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] clk: at91: sam9x7: Add gmac generic clock entry with ID 24
  2026-02-02 10:40 [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu Mihai Sain
  2026-02-02 10:40 ` [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67 Mihai Sain
  2026-02-02 10:40 ` [PATCH 2/5] clk: at91: sam9x7: Rename macb0_clk to gmac_clk Mihai Sain
@ 2026-02-02 10:40 ` Mihai Sain
  2026-02-02 10:40 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node Mihai Sain
  2026-02-02 10:40 ` [PATCH 5/5] ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24 Mihai Sain
  4 siblings, 0 replies; 9+ messages in thread
From: Mihai Sain @ 2026-02-02 10:40 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	ryan.wanner, Mihai Sain

According with datasheet table 12.1 the instance ID 24 is used
for gmac generic clock.
This change adds the gmac_gclk entry in SAM9X7 clock description
table.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 drivers/clk/at91/sam9x7.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index 68e569bd70f5..8b52da194849 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -568,6 +568,15 @@ static const struct {
 		.pp_chg_id = INT_MIN,
 	},
 
+	{
+		.n = "gmac_gclk",
+		.id = 24,
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
 	{
 		.n = "lcd_gclk",
 		.id = 25,
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node
  2026-02-02 10:40 [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu Mihai Sain
                   ` (2 preceding siblings ...)
  2026-02-02 10:40 ` [PATCH 3/5] clk: at91: sam9x7: Add gmac generic clock entry with ID 24 Mihai Sain
@ 2026-02-02 10:40 ` Mihai Sain
  2026-02-02 13:59   ` Andrew Lunn
  2026-02-02 10:40 ` [PATCH 5/5] ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24 Mihai Sain
  4 siblings, 1 reply; 9+ messages in thread
From: Mihai Sain @ 2026-02-02 10:40 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	ryan.wanner, Mihai Sain

The gmac controller on sam9x7 has no internal pll to generate
the 125MHz clock source for rgmii mode.
This clock is generated on external board by eth-phy or
clock oscillator.
This change drops the tx_clk entry from gmac node.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 arch/arm/boot/dts/microchip/sam9x7.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
index 46dacbbd201d..da94865c57e9 100644
--- a/arch/arm/boot/dts/microchip/sam9x7.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
@@ -991,7 +991,7 @@ gmac: ethernet@f802c000 {
 				     <63 IRQ_TYPE_LEVEL_HIGH 3>,	/* Queue 4 */
 				     <64 IRQ_TYPE_LEVEL_HIGH 3>;	/* Queue 5 */
 			clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>, <&pmc PMC_TYPE_GCK 67>;
-			clock-names = "hclk", "pclk", "tx_clk", "tsu_clk";
+			clock-names = "hclk", "pclk", "tsu_clk";
 			assigned-clocks = <&pmc PMC_TYPE_GCK 67>;
 			assigned-clock-rates = <266666666>;
 			status = "disabled";
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24
  2026-02-02 10:40 [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu Mihai Sain
                   ` (3 preceding siblings ...)
  2026-02-02 10:40 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node Mihai Sain
@ 2026-02-02 10:40 ` Mihai Sain
  2026-02-02 14:00   ` Andrew Lunn
  4 siblings, 1 reply; 9+ messages in thread
From: Mihai Sain @ 2026-02-02 10:40 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	ryan.wanner, Mihai Sain

Update the tsu_clk to use the generic clock with ID 24 instead
of ID 67.

[root@SAM9X75 ~]$ cat /sys/kernel/debug/clk/clk_summary | grep gmac

gmac_gclk      1       1        1        266666666   0          0     50000      Y         f802c000.ethernet           tsu_clk
                                                                                           f802c000.ethernet           tsu_clk
gmac_clk       2       2        0        266666666   0          0     50000      Y         f802c000.ethernet           hclk
                                                                                           f802c000.ethernet           pclk

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 arch/arm/boot/dts/microchip/sam9x7.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
index da94865c57e9..a42716e18da3 100644
--- a/arch/arm/boot/dts/microchip/sam9x7.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
@@ -990,9 +990,9 @@ gmac: ethernet@f802c000 {
 				     <62 IRQ_TYPE_LEVEL_HIGH 3>,	/* Queue 3 */
 				     <63 IRQ_TYPE_LEVEL_HIGH 3>,	/* Queue 4 */
 				     <64 IRQ_TYPE_LEVEL_HIGH 3>;	/* Queue 5 */
-			clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>, <&pmc PMC_TYPE_GCK 67>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>;
 			clock-names = "hclk", "pclk", "tsu_clk";
-			assigned-clocks = <&pmc PMC_TYPE_GCK 67>;
+			assigned-clocks = <&pmc PMC_TYPE_GCK 24>;
 			assigned-clock-rates = <266666666>;
 			status = "disabled";
 		};
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67
  2026-02-02 10:40 ` [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67 Mihai Sain
@ 2026-02-02 13:55   ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2026-02-02 13:55 UTC (permalink / raw)
  To: Mihai Sain
  Cc: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt, linux-clk,
	linux-arm-kernel, linux-kernel, devicetree, ryan.wanner

On Mon, Feb 02, 2026 at 12:40:21PM +0200, Mihai Sain wrote:
> According with datasheet table 12.1 the instance ID 67 is reserved.
> This change drops the gmactsu_clk and gmac_gclk entries from
> the SAM9X7 clock description tables.

It would be nice to mention in the commit message that there are no
users of these clocks in mainline, so there are no backwards
compatibility issues.

	Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/5] ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node
  2026-02-02 10:40 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node Mihai Sain
@ 2026-02-02 13:59   ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2026-02-02 13:59 UTC (permalink / raw)
  To: Mihai Sain
  Cc: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt, linux-clk,
	linux-arm-kernel, linux-kernel, devicetree, ryan.wanner

On Mon, Feb 02, 2026 at 12:40:24PM +0200, Mihai Sain wrote:
> The gmac controller on sam9x7 has no internal pll to generate
> the 125MHz clock source for rgmii mode.
> This clock is generated on external board by eth-phy or
> clock oscillator.
> This change drops the tx_clk entry from gmac node.
> 
> Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
> ---
>  arch/arm/boot/dts/microchip/sam9x7.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
> index 46dacbbd201d..da94865c57e9 100644
> --- a/arch/arm/boot/dts/microchip/sam9x7.dtsi
> +++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
> @@ -991,7 +991,7 @@ gmac: ethernet@f802c000 {
>  				     <63 IRQ_TYPE_LEVEL_HIGH 3>,	/* Queue 4 */
>  				     <64 IRQ_TYPE_LEVEL_HIGH 3>;	/* Queue 5 */
>  			clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>, <&pmc PMC_TYPE_GCK 67>;
> -			clock-names = "hclk", "pclk", "tx_clk", "tsu_clk";
> +			clock-names = "hclk", "pclk", "tsu_clk";

You drop a clock name, but not a clock?

    Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 5/5] ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24
  2026-02-02 10:40 ` [PATCH 5/5] ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24 Mihai Sain
@ 2026-02-02 14:00   ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2026-02-02 14:00 UTC (permalink / raw)
  To: Mihai Sain
  Cc: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, cristian.birsan,
	balamanikandan.gunasundar, robh, krzk+dt, conor+dt, linux-clk,
	linux-arm-kernel, linux-kernel, devicetree, ryan.wanner

On Mon, Feb 02, 2026 at 12:40:25PM +0200, Mihai Sain wrote:
> Update the tsu_clk to use the generic clock with ID 24 instead
> of ID 67.

The commit message should explain the "Why?" of a change, not the
what.

	Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-02 14:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 10:40 [PATCH 0/5] Update gmac clocks and devicetree for sam9x7 mpu Mihai Sain
2026-02-02 10:40 ` [PATCH 1/5] clk: at91: sam9x7: Remove gmac peripheral and generic clock entries with ID 67 Mihai Sain
2026-02-02 13:55   ` Andrew Lunn
2026-02-02 10:40 ` [PATCH 2/5] clk: at91: sam9x7: Rename macb0_clk to gmac_clk Mihai Sain
2026-02-02 10:40 ` [PATCH 3/5] clk: at91: sam9x7: Add gmac generic clock entry with ID 24 Mihai Sain
2026-02-02 10:40 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: Remove the tx_clk from gmac node Mihai Sain
2026-02-02 13:59   ` Andrew Lunn
2026-02-02 10:40 ` [PATCH 5/5] ARM: dts: microchip: sam9x7: Update the tsu_clk to use the generic clock with ID 24 Mihai Sain
2026-02-02 14:00   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox