[PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller

Stanimir Varbanov posted 5 patches 1 month, 1 week ago
[PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Stanimir Varbanov 1 month, 1 week ago
From: Dave Stevenson <dave.stevenson@raspberrypi.com>

The RP1 chip has the Cadence GEM block, but wants the tx_clock
to always run at 125MHz, in the same way as sama7g5.
Add the relevant configuration.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 36717e7e5811..260fdac46f4b 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5135,6 +5135,17 @@ static const struct macb_config versal_config = {
 	.usrio = &macb_default_usrio,
 };
 
+static const struct macb_config raspberrypi_rp1_config = {
+	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
+		MACB_CAPS_JUMBO |
+		MACB_CAPS_GEM_HAS_PTP,
+	.dma_burst_length = 16,
+	.clk_init = macb_clk_init,
+	.init = macb_init,
+	.usrio = &macb_default_usrio,
+	.jumbo_max_len = 10240,
+};
+
 static const struct of_device_id macb_dt_ids[] = {
 	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
 	{ .compatible = "cdns,macb" },
@@ -5155,6 +5166,7 @@ static const struct of_device_id macb_dt_ids[] = {
 	{ .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
 	{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
 	{ .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },
+	{ .compatible = "raspberrypi,rp1-gem", .data = &raspberrypi_rp1_config },
 	{ .compatible = "xlnx,zynqmp-gem", .data = &zynqmp_config},
 	{ .compatible = "xlnx,zynq-gem", .data = &zynq_config },
 	{ .compatible = "xlnx,versal-gem", .data = &versal_config},
-- 
2.47.0
Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Stanimir Varbanov 3 weeks, 2 days ago
Hi Jakub,

On 8/22/25 12:34 PM, Stanimir Varbanov wrote:
> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> 
> The RP1 chip has the Cadence GEM block, but wants the tx_clock
> to always run at 125MHz, in the same way as sama7g5.
> Add the relevant configuration.
> 
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 

This patch is missing in net-next but ("dt-bindings: net: cdns,macb: Add
compatible for Raspberry Pi RP1") from this series has been applied.

Could you take this patch as well, please.

reagrds,
~Stan
Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Stanimir Varbanov 2 weeks, 4 days ago

On 9/10/25 2:32 PM, Stanimir Varbanov wrote:
> Hi Jakub,
> 
> On 8/22/25 12:34 PM, Stanimir Varbanov wrote:
>> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
>>
>> The RP1 chip has the Cadence GEM block, but wants the tx_clock
>> to always run at 125MHz, in the same way as sama7g5.
>> Add the relevant configuration.
>>
>> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>> ---
>>  drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
> 
> This patch is missing in net-next but ("dt-bindings: net: cdns,macb: Add
> compatible for Raspberry Pi RP1") from this series has been applied.
> 
> Could you take this patch as well, please.

Gentle ping.

~Stan
Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Andrew Lunn 2 weeks, 4 days ago
On Mon, Sep 15, 2025 at 02:27:34PM +0300, Stanimir Varbanov wrote:
> 
> 
> On 9/10/25 2:32 PM, Stanimir Varbanov wrote:
> > Hi Jakub,
> > 
> > On 8/22/25 12:34 PM, Stanimir Varbanov wrote:
> >> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> >>
> >> The RP1 chip has the Cadence GEM block, but wants the tx_clock
> >> to always run at 125MHz, in the same way as sama7g5.
> >> Add the relevant configuration.
> >>
> >> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> >> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> >> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> >> ---
> >>  drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
> >>  1 file changed, 12 insertions(+)
> >>
> > 
> > This patch is missing in net-next but ("dt-bindings: net: cdns,macb: Add
> > compatible for Raspberry Pi RP1") from this series has been applied.
> > 
> > Could you take this patch as well, please.
> 
> Gentle ping.

Such pings are ignored. Please rebase the patch to net-next and submit
it again.

	Andrew
Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Stanimir Varbanov 2 weeks, 4 days ago
Hi Andrew,

Thank you the answer!

On 9/15/25 4:34 PM, Andrew Lunn wrote:
> On Mon, Sep 15, 2025 at 02:27:34PM +0300, Stanimir Varbanov wrote:
>>
>>
>> On 9/10/25 2:32 PM, Stanimir Varbanov wrote:
>>> Hi Jakub,
>>>
>>> On 8/22/25 12:34 PM, Stanimir Varbanov wrote:
>>>> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
>>>>
>>>> The RP1 chip has the Cadence GEM block, but wants the tx_clock
>>>> to always run at 125MHz, in the same way as sama7g5.
>>>> Add the relevant configuration.
>>>>
>>>> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
>>>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>>> ---
>>>>  drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
>>>>  1 file changed, 12 insertions(+)
>>>>
>>>
>>> This patch is missing in net-next but ("dt-bindings: net: cdns,macb: Add
>>> compatible for Raspberry Pi RP1") from this series has been applied.
>>>
>>> Could you take this patch as well, please.
>>
>> Gentle ping.
> 
> Such pings are ignored. Please rebase the patch to net-next and submit
> it again.

Sorry about that.

I did not realized that if it applies cleanly on net-next I need to
re-send it.

I will send it as a separate one with version v3.

~Stan
Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Claudiu Beznea 1 month, 1 week ago

On 22.08.2025 12:34, Stanimir Varbanov wrote:
> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> 
> The RP1 chip has the Cadence GEM block, but wants the tx_clock
> to always run at 125MHz, in the same way as sama7g5.
> Add the relevant configuration.
> 
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
Posted by Nicolas Ferre 1 month, 1 week ago
On 22/08/2025 at 11:34, Stanimir Varbanov wrote:
> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> 
> The RP1 chip has the Cadence GEM block, but wants the tx_clock
> to always run at 125MHz, in the same way as sama7g5.
> Add the relevant configuration.
> 
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
>   drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 36717e7e5811..260fdac46f4b 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -5135,6 +5135,17 @@ static const struct macb_config versal_config = {
>          .usrio = &macb_default_usrio,
>   };
> 
> +static const struct macb_config raspberrypi_rp1_config = {
> +       .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
> +               MACB_CAPS_JUMBO |
> +               MACB_CAPS_GEM_HAS_PTP,
> +       .dma_burst_length = 16,
> +       .clk_init = macb_clk_init,
> +       .init = macb_init,
> +       .usrio = &macb_default_usrio,
> +       .jumbo_max_len = 10240,
> +};
> +
>   static const struct of_device_id macb_dt_ids[] = {
>          { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
>          { .compatible = "cdns,macb" },
> @@ -5155,6 +5166,7 @@ static const struct of_device_id macb_dt_ids[] = {
>          { .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
>          { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
>          { .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },
> +       { .compatible = "raspberrypi,rp1-gem", .data = &raspberrypi_rp1_config },
>          { .compatible = "xlnx,zynqmp-gem", .data = &zynqmp_config},
>          { .compatible = "xlnx,zynq-gem", .data = &zynq_config },
>          { .compatible = "xlnx,versal-gem", .data = &versal_config},
> --
> 2.47.0
>