devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII
@ 2025-07-14 16:36 Ryan.Wanner
  2025-07-14 16:36 ` [PATCH v2 1/5] dt-bindings: net: cdns,macb: Add external REFCLK property Ryan.Wanner
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-14 16:36 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel, Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

This set allows the REFCLK property to be exposed as a dt-property to
properly reflect the correct RMII layout. RMII can take an external or
internal provided REFCLK, since this is not SoC dependent but board
dependent this must be exposed as a DT property for the macb driver.

This set also enables RMII mode for the SAMA7 SoCs gigabit mac.

V1 is here [1]

changes v1 -> v2:
- Add device tree changes to use the new REFCLK property.
- Remove USARIO_HAS_CLKEN from the sama7g54 emac node to use the exposed
  REFCLK propterty.
- Use property_read_bool() instead of property_present check.
- Adjust variables to follow reverse xmas tree

1) https://lore.kernel.org/all/cover.1750346271.git.Ryan.Wanner@microchip.com/

Ryan Wanner (5):
  dt-bindings: net: cdns,macb: Add external REFCLK property
  net: cadence: macb: Expose REFCLK as a device tree property
  net: cadence: macb: Enable RMII for SAMA7 gem
  net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  ARM: dts: microchip: sama7g5: Add RMII ext refclk flag

 Documentation/devicetree/bindings/net/cdns,macb.yaml |  7 +++++++
 arch/arm/boot/dts/microchip/at91-sama7g5ek.dts       |  1 +
 drivers/net/ethernet/cadence/macb_main.c             | 11 +++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

-- 
2.43.0


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

* [PATCH v2 1/5] dt-bindings: net: cdns,macb: Add external REFCLK property
  2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
@ 2025-07-14 16:36 ` Ryan.Wanner
  2025-07-14 16:37 ` [PATCH v2 2/5] net: cadence: macb: Expose REFCLK as a device tree property Ryan.Wanner
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-14 16:36 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel, Ryan Wanner,
	Conor Dooley

From: Ryan Wanner <Ryan.Wanner@microchip.com>

REFCLK can be provided by an external source so this should be exposed
by a DT property. The REFCLK is used for RMII and in some SoCs that use
this driver the RGMII 125MHz clk can also be provided by an external
source.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
 Documentation/devicetree/bindings/net/cdns,macb.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
index 8d69846b2e09..e69f60c37793 100644
--- a/Documentation/devicetree/bindings/net/cdns,macb.yaml
+++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
@@ -114,6 +114,13 @@ properties:
   power-domains:
     maxItems: 1
 
+  cdns,refclk-ext:
+    type: boolean
+    description:
+      This selects if the REFCLK for RMII is provided by an external source.
+      For RGMII mode this selects if the 125MHz REF clock is provided by an external
+      source.
+
   cdns,rx-watermark:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
-- 
2.43.0


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

* [PATCH v2 2/5] net: cadence: macb: Expose REFCLK as a device tree property
  2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
  2025-07-14 16:36 ` [PATCH v2 1/5] dt-bindings: net: cdns,macb: Add external REFCLK property Ryan.Wanner
@ 2025-07-14 16:37 ` Ryan.Wanner
  2025-07-14 16:37 ` [PATCH v2 3/5] net: cadence: macb: Enable RMII for SAMA7 gem Ryan.Wanner
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-14 16:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel, Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

The RMII and RGMII can both support internal or external provided
REFCLKs 50MHz and 125MHz respectively. Since this is dependent on
the board that the SoC is on this needs to be set via the device tree.

This property flag is checked in the MACB DT node so the REFCLK cap is
configured the correct way for the RMII or RGMII is configured on the
board.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index d1f1ae5ea161..9ebe1062b359 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4109,8 +4109,12 @@ static const struct net_device_ops macb_netdev_ops = {
 static void macb_configure_caps(struct macb *bp,
 				const struct macb_config *dt_conf)
 {
+	struct device_node *np = bp->pdev->dev.of_node;
+	bool refclk_ext;
 	u32 dcfg;
 
+	refclk_ext = of_property_read_bool(np, "cdns,refclk-ext");
+
 	if (dt_conf)
 		bp->caps = dt_conf->caps;
 
@@ -4141,6 +4145,9 @@ static void macb_configure_caps(struct macb *bp,
 		}
 	}
 
+	if (refclk_ext)
+		bp->caps |= MACB_CAPS_USRIO_HAS_CLKEN;
+
 	dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps);
 }
 
-- 
2.43.0


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

* [PATCH v2 3/5] net: cadence: macb: Enable RMII for SAMA7 gem
  2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
  2025-07-14 16:36 ` [PATCH v2 1/5] dt-bindings: net: cdns,macb: Add external REFCLK property Ryan.Wanner
  2025-07-14 16:37 ` [PATCH v2 2/5] net: cadence: macb: Expose REFCLK as a device tree property Ryan.Wanner
@ 2025-07-14 16:37 ` Ryan.Wanner
  2025-07-14 16:37 ` [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag Ryan.Wanner
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-14 16:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel, Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

This macro enables the RMII mode bit in the USRIO register when RMII
mode is requested.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 9ebe1062b359..51667263c01d 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5103,6 +5103,7 @@ static const struct macb_config mpfs_config = {
 
 static const struct macb_config sama7g5_gem_config = {
 	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
+		MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
 		MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
 	.dma_burst_length = 16,
 	.clk_init = macb_clk_init,
-- 
2.43.0


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

* [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
                   ` (2 preceding siblings ...)
  2025-07-14 16:37 ` [PATCH v2 3/5] net: cadence: macb: Enable RMII for SAMA7 gem Ryan.Wanner
@ 2025-07-14 16:37 ` Ryan.Wanner
  2025-07-18 11:00   ` Claudiu Beznea
  2025-07-14 16:37 ` [PATCH v2 5/5] ARM: dts: microchip: sama7g5: Add RMII ext refclk flag Ryan.Wanner
  2025-07-17  0:40 ` [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII patchwork-bot+netdevbpf
  5 siblings, 1 reply; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-14 16:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel, Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

Remove USARIO_CLKEN flag since this is now a device tree argument and
not fixed to the SoC.

This will instead be selected by the "cdns,refclk-ext"
device tree property.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 51667263c01d..cd54e4065690 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5113,8 +5113,7 @@ static const struct macb_config sama7g5_gem_config = {
 
 static const struct macb_config sama7g5_emac_config = {
 	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
-		MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
-		MACB_CAPS_GEM_HAS_PTP,
+		MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
 	.dma_burst_length = 16,
 	.clk_init = macb_clk_init,
 	.init = macb_init,
-- 
2.43.0


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

* [PATCH v2 5/5] ARM: dts: microchip: sama7g5: Add RMII ext refclk flag
  2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
                   ` (3 preceding siblings ...)
  2025-07-14 16:37 ` [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag Ryan.Wanner
@ 2025-07-14 16:37 ` Ryan.Wanner
  2025-07-17  0:40 ` [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII patchwork-bot+netdevbpf
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-14 16:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel, Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

The REFCLK for the RMII interface is provided by an extrenal source.

This flag matches the change in the macb driver to determine the REFCLK
source.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 arch/arm/boot/dts/microchip/at91-sama7g5ek.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
index 2543599013b1..3c898afdc313 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
@@ -542,6 +542,7 @@ &pinctrl_gmac1_mdio_default
 	phy-mode = "rmii";
 	nvmem-cells = <&eeprom1_eui48>;
 	nvmem-cell-names = "mac-address";
+	cdns,refclk-ext;
 	status = "okay"; /* Conflict with pdmc0. */
 
 	ethernet-phy@0 {
-- 
2.43.0


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

* Re: [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII
  2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
                   ` (4 preceding siblings ...)
  2025-07-14 16:37 ` [PATCH v2 5/5] ARM: dts: microchip: sama7g5: Add RMII ext refclk flag Ryan.Wanner
@ 2025-07-17  0:40 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-17  0:40 UTC (permalink / raw)
  To: Ryan Wanner
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	netdev, devicetree, linux-kernel, linux-arm-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 14 Jul 2025 09:36:58 -0700 you wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> This set allows the REFCLK property to be exposed as a dt-property to
> properly reflect the correct RMII layout. RMII can take an external or
> internal provided REFCLK, since this is not SoC dependent but board
> dependent this must be exposed as a DT property for the macb driver.
> 
> [...]

Here is the summary with links:
  - [v2,1/5] dt-bindings: net: cdns,macb: Add external REFCLK property
    https://git.kernel.org/netdev/net-next/c/1b7531c094c8
  - [v2,2/5] net: cadence: macb: Expose REFCLK as a device tree property
    https://git.kernel.org/netdev/net-next/c/dce32ece3bb8
  - [v2,3/5] net: cadence: macb: Enable RMII for SAMA7 gem
    https://git.kernel.org/netdev/net-next/c/eb4f50ddfdd3
  - [v2,4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
    https://git.kernel.org/netdev/net-next/c/db400061b5e7
  - [v2,5/5] ARM: dts: microchip: sama7g5: Add RMII ext refclk flag
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  2025-07-14 16:37 ` [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag Ryan.Wanner
@ 2025-07-18 11:00   ` Claudiu Beznea
  2025-07-21 15:39     ` Ryan.Wanner
  0 siblings, 1 reply; 12+ messages in thread
From: Claudiu Beznea @ 2025-07-18 11:00 UTC (permalink / raw)
  To: Ryan.Wanner, andrew+netdev, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Hi, Ryan,

On 14.07.2025 19:37, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Remove USARIO_CLKEN flag since this is now a device tree argument and

s/USARIO_CLKEN/USRIO_HAS_CLKEN here and in title as well.

> not fixed to the SoC.
> 
> This will instead be selected by the "cdns,refclk-ext"
> device tree property.
> 
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 51667263c01d..cd54e4065690 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -5113,8 +5113,7 @@ static const struct macb_config sama7g5_gem_config = {
>  
>  static const struct macb_config sama7g5_emac_config = {
>  	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
> -		MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |

Will old DTBs still work with new kernels with this change?

Thank you,
Claudiu

> -		MACB_CAPS_GEM_HAS_PTP,
> +		MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
>  	.dma_burst_length = 16,
>  	.clk_init = macb_clk_init,
>  	.init = macb_init,


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

* Re: [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  2025-07-18 11:00   ` Claudiu Beznea
@ 2025-07-21 15:39     ` Ryan.Wanner
  2025-07-26 12:56       ` claudiu beznea
  0 siblings, 1 reply; 12+ messages in thread
From: Ryan.Wanner @ 2025-07-21 15:39 UTC (permalink / raw)
  To: claudiu.beznea, andrew+netdev, davem, edumazet, kuba, pabeni,
	robh, krzk+dt, conor+dt, Nicolas.Ferre, alexandre.belloni
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

On 7/18/25 04:00, Claudiu Beznea wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Hi, Ryan,
> 
> On 14.07.2025 19:37, Ryan.Wanner@microchip.com wrote:
>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>
>> Remove USARIO_CLKEN flag since this is now a device tree argument and
> 
> s/USARIO_CLKEN/USRIO_HAS_CLKEN here and in title as well.
> 
>> not fixed to the SoC.
>>
>> This will instead be selected by the "cdns,refclk-ext"
>> device tree property.
>>
>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
>> ---
>>  drivers/net/ethernet/cadence/macb_main.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
>> index 51667263c01d..cd54e4065690 100644
>> --- a/drivers/net/ethernet/cadence/macb_main.c
>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>> @@ -5113,8 +5113,7 @@ static const struct macb_config sama7g5_gem_config = {
>>
>>  static const struct macb_config sama7g5_emac_config = {
>>       .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
>> -             MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
> 
> Will old DTBs still work with new kernels with this change?

That was my assumption, but it seems it would be safer to keep this
property for this IP and implement this dt flag property on IPs that do
not already have  MACB_CAPS_USRIO_HAS_CLKEN property.

Ryan
> 
> Thank you,
> Claudiu
> 
>> -             MACB_CAPS_GEM_HAS_PTP,
>> +             MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
>>       .dma_burst_length = 16,
>>       .clk_init = macb_clk_init,
>>       .init = macb_init,
> 


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

* Re: [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  2025-07-21 15:39     ` Ryan.Wanner
@ 2025-07-26 12:56       ` claudiu beznea
  2025-07-29 15:51         ` Ryan Wanner
  0 siblings, 1 reply; 12+ messages in thread
From: claudiu beznea @ 2025-07-26 12:56 UTC (permalink / raw)
  To: Ryan.Wanner, andrew+netdev, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, Nicolas.Ferre, alexandre.belloni
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

Hi, Ryan,

On 7/21/25 18:39, Ryan.Wanner@microchip.com wrote:
> On 7/18/25 04:00, Claudiu Beznea wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> Hi, Ryan,
>>
>> On 14.07.2025 19:37, Ryan.Wanner@microchip.com wrote:
>>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>>
>>> Remove USARIO_CLKEN flag since this is now a device tree argument and
>>
>> s/USARIO_CLKEN/USRIO_HAS_CLKEN here and in title as well.
>>
>>> not fixed to the SoC.
>>>
>>> This will instead be selected by the "cdns,refclk-ext"
>>> device tree property.
>>>
>>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
>>> ---
>>>   drivers/net/ethernet/cadence/macb_main.c | 3 +--
>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
>>> index 51667263c01d..cd54e4065690 100644
>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>> @@ -5113,8 +5113,7 @@ static const struct macb_config sama7g5_gem_config = {
>>>
>>>   static const struct macb_config sama7g5_emac_config = {
>>>        .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
>>> -             MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
>>
>> Will old DTBs still work with new kernels with this change?
> 
> That was my assumption, but it seems it would be safer to keep this
> property for this IP and implement this dt flag property on IPs that do
> not already have  MACB_CAPS_USRIO_HAS_CLKEN property.

So, this patch should be reverted, right?

Thank you,
Claudiu

> 
> Ryan
>>
>> Thank you,
>> Claudiu
>>
>>> -             MACB_CAPS_GEM_HAS_PTP,
>>> +             MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
>>>        .dma_burst_length = 16,
>>>        .clk_init = macb_clk_init,
>>>        .init = macb_init,
>>
> 


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

* Re: [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  2025-07-26 12:56       ` claudiu beznea
@ 2025-07-29 15:51         ` Ryan Wanner
  2025-07-31  8:33           ` Claudiu Beznea
  0 siblings, 1 reply; 12+ messages in thread
From: Ryan Wanner @ 2025-07-29 15:51 UTC (permalink / raw)
  To: claudiu beznea, andrew+netdev, davem, edumazet, kuba, pabeni,
	robh, krzk+dt, conor+dt, Nicolas.Ferre, alexandre.belloni
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

On 7/26/25 05:56, claudiu beznea wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know
> the content is safe
> 
> Hi, Ryan,
> 
> On 7/21/25 18:39, Ryan.Wanner@microchip.com wrote:
>> On 7/18/25 04:00, Claudiu Beznea wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you
>>> know the content is safe
>>>
>>> Hi, Ryan,
>>>
>>> On 14.07.2025 19:37, Ryan.Wanner@microchip.com wrote:
>>>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>>>
>>>> Remove USARIO_CLKEN flag since this is now a device tree argument and
>>>
>>> s/USARIO_CLKEN/USRIO_HAS_CLKEN here and in title as well.
>>>
>>>> not fixed to the SoC.
>>>>
>>>> This will instead be selected by the "cdns,refclk-ext"
>>>> device tree property.
>>>>
>>>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
>>>> ---
>>>>   drivers/net/ethernet/cadence/macb_main.c | 3 +--
>>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/
>>>> ethernet/cadence/macb_main.c
>>>> index 51667263c01d..cd54e4065690 100644
>>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>>> @@ -5113,8 +5113,7 @@ static const struct macb_config
>>>> sama7g5_gem_config = {
>>>>
>>>>   static const struct macb_config sama7g5_emac_config = {
>>>>        .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
>>>> -             MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
>>>
>>> Will old DTBs still work with new kernels with this change?
>>
>> That was my assumption, but it seems it would be safer to keep this
>> property for this IP and implement this dt flag property on IPs that do
>> not already have  MACB_CAPS_USRIO_HAS_CLKEN property.
> 
> So, this patch should be reverted, right?

Yes you are right, more testing I see that this could break older DTs. I
am new to reverting patches, do I send a patch to revert this and would
it be an issue now?

Ryan
> 
> Thank you,
> Claudiu
> 
>>
>> Ryan
>>>
>>> Thank you,
>>> Claudiu
>>>
>>>> -             MACB_CAPS_GEM_HAS_PTP,
>>>> +             MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
>>>>        .dma_burst_length = 16,
>>>>        .clk_init = macb_clk_init,
>>>>        .init = macb_init,
>>>
>>
> 


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

* Re: [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag
  2025-07-29 15:51         ` Ryan Wanner
@ 2025-07-31  8:33           ` Claudiu Beznea
  0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2025-07-31  8:33 UTC (permalink / raw)
  To: Ryan Wanner, andrew+netdev, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, Nicolas.Ferre, alexandre.belloni
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel



On 29.07.2025 18:51, Ryan Wanner wrote:
> On 7/26/25 05:56, claudiu beznea wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know
>> the content is safe
>>
>> Hi, Ryan,
>>
>> On 7/21/25 18:39, Ryan.Wanner@microchip.com wrote:
>>> On 7/18/25 04:00, Claudiu Beznea wrote:
>>>> EXTERNAL EMAIL: Do not click links or open attachments unless you
>>>> know the content is safe
>>>>
>>>> Hi, Ryan,
>>>>
>>>> On 14.07.2025 19:37, Ryan.Wanner@microchip.com wrote:
>>>>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>>>>
>>>>> Remove USARIO_CLKEN flag since this is now a device tree argument and
>>>>
>>>> s/USARIO_CLKEN/USRIO_HAS_CLKEN here and in title as well.
>>>>
>>>>> not fixed to the SoC.
>>>>>
>>>>> This will instead be selected by the "cdns,refclk-ext"
>>>>> device tree property.
>>>>>
>>>>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
>>>>> ---
>>>>>   drivers/net/ethernet/cadence/macb_main.c | 3 +--
>>>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/
>>>>> ethernet/cadence/macb_main.c
>>>>> index 51667263c01d..cd54e4065690 100644
>>>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>>>> @@ -5113,8 +5113,7 @@ static const struct macb_config
>>>>> sama7g5_gem_config = {
>>>>>
>>>>>   static const struct macb_config sama7g5_emac_config = {
>>>>>        .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
>>>>> -             MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
>>>>
>>>> Will old DTBs still work with new kernels with this change?
>>>
>>> That was my assumption, but it seems it would be safer to keep this
>>> property for this IP and implement this dt flag property on IPs that do
>>> not already have  MACB_CAPS_USRIO_HAS_CLKEN property.
>>
>> So, this patch should be reverted, right?
> 
> Yes you are right, more testing I see that this could break older DTs. I
> am new to reverting patches, do I send a patch to revert this and would
> it be an issue now?

Not sure about the approach now! Looks like this has already been merged
https://lore.kernel.org/all/20250727013451.2436467-1-kuba@kernel.org/

Thank you,
Claudiu

> 
> Ryan
>>
>> Thank you,
>> Claudiu
>>
>>>
>>> Ryan
>>>>
>>>> Thank you,
>>>> Claudiu
>>>>
>>>>> -             MACB_CAPS_GEM_HAS_PTP,
>>>>> +             MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
>>>>>        .dma_burst_length = 16,
>>>>>        .clk_init = macb_clk_init,
>>>>>        .init = macb_init,
>>>>
>>>
>>
> 


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

end of thread, other threads:[~2025-07-31  8:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 16:36 [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII Ryan.Wanner
2025-07-14 16:36 ` [PATCH v2 1/5] dt-bindings: net: cdns,macb: Add external REFCLK property Ryan.Wanner
2025-07-14 16:37 ` [PATCH v2 2/5] net: cadence: macb: Expose REFCLK as a device tree property Ryan.Wanner
2025-07-14 16:37 ` [PATCH v2 3/5] net: cadence: macb: Enable RMII for SAMA7 gem Ryan.Wanner
2025-07-14 16:37 ` [PATCH v2 4/5] net: cadence: macb: sama7g5_emac: Remove USARIO CLKEN flag Ryan.Wanner
2025-07-18 11:00   ` Claudiu Beznea
2025-07-21 15:39     ` Ryan.Wanner
2025-07-26 12:56       ` claudiu beznea
2025-07-29 15:51         ` Ryan Wanner
2025-07-31  8:33           ` Claudiu Beznea
2025-07-14 16:37 ` [PATCH v2 5/5] ARM: dts: microchip: sama7g5: Add RMII ext refclk flag Ryan.Wanner
2025-07-17  0:40 ` [PATCH v2 0/5] Expose REFCLK for RMII and enable RMII patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).