devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] dd ethernet support for RPi5
@ 2025-08-22  9:34 Stanimir Varbanov
  2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-22  9:34 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre,
	Claudiu Beznea, Phil Elwell, Jonathan Bell, Dave Stevenson,
	Stanimir Varbanov

Hello,

Changes in v2:
 - In 1/5 updates according to review comments (Nicolas)
 - In 1/5 added Fixes tag (Nicolas)
 - Added Reviewed-by and Acked-by tags.

v1 can found at [1].

Comments are welcome!

regards,
~Stan

[1] www.spinics.net/lists/netdev/msg1115266.html

Dave Stevenson (2):
  dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1
  net: cadence: macb: Add support for Raspberry Pi RP1 ethernet
    controller

Stanimir Varbanov (3):
  net: cadence: macb: Set upper 32bits of DMA ring buffer
  arm64: dts: rp1: Add ethernet DT node
  arm64: dts: broadcom: Enable RP1 ethernet for Raspberry Pi 5

 .../devicetree/bindings/net/cdns,macb.yaml     |  1 +
 .../boot/dts/broadcom/bcm2712-rpi-5-b.dts      | 18 ++++++++++++++++++
 arch/arm64/boot/dts/broadcom/rp1-common.dtsi   | 16 ++++++++++++++++
 drivers/net/ethernet/cadence/macb_main.c       | 18 +++++++++++++++++-
 4 files changed, 52 insertions(+), 1 deletion(-)

-- 
2.47.0


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

* [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-22  9:34 [PATCH v2 0/5] dd ethernet support for RPi5 Stanimir Varbanov
@ 2025-08-22  9:34 ` Stanimir Varbanov
  2025-08-22  9:42   ` Nicolas Ferre
                     ` (2 more replies)
  2025-08-22  9:34 ` [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1 Stanimir Varbanov
                   ` (3 subsequent siblings)
  4 siblings, 3 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-22  9:34 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre,
	Claudiu Beznea, Phil Elwell, Jonathan Bell, Dave Stevenson,
	Stanimir Varbanov, stable, Andrew Lunn

In case of rx queue reset and 64bit capable hardware, set the upper
32bits of DMA ring buffer address.

Cc: stable@vger.kernel.org # v4.6+
Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
Credits-to: Phil Elwell <phil@raspberrypi.com>
Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
v1 -> v2: 
 - Added credits.
 - Use lower_32_bits() for RBQP register writes for consistency (Nicolas).
 - Added Fixes tag.

 drivers/net/ethernet/cadence/macb_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index ce95fad8cedd..36717e7e5811 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
 		macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
 
 		macb_init_rx_ring(queue);
-		queue_writel(queue, RBQP, queue->rx_ring_dma);
+		queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma));
+#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
+		if (bp->hw_dma_cap & HW_DMA_CAP_64B)
+			macb_writel(bp, RBQPH, upper_32_bits(queue->rx_ring_dma));
+#endif
 
 		macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
 
-- 
2.47.0


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

* [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1
  2025-08-22  9:34 [PATCH v2 0/5] dd ethernet support for RPi5 Stanimir Varbanov
  2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
@ 2025-08-22  9:34 ` Stanimir Varbanov
  2025-08-22 12:15   ` Nicolas Ferre
  2025-08-22 15:17   ` Claudiu Beznea
  2025-08-22  9:34 ` [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller Stanimir Varbanov
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-22  9:34 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre,
	Claudiu Beznea, Phil Elwell, Jonathan Bell, Dave Stevenson,
	Stanimir Varbanov, Andrew Lunn, Conor Dooley

From: Dave Stevenson <dave.stevenson@raspberrypi.com>

The Raspberry Pi RP1 chip has the Cadence GEM ethernet
controller, so add a compatible string for it.

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: Conor Dooley <conor.dooley@microchip.com>
---
 Documentation/devicetree/bindings/net/cdns,macb.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
index 559d0f733e7e..0591da97d434 100644
--- a/Documentation/devicetree/bindings/net/cdns,macb.yaml
+++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
@@ -54,6 +54,7 @@ properties:
           - cdns,np4-macb             # NP4 SoC devices
           - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
           - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
+          - raspberrypi,rp1-gem       # Raspberry Pi RP1 gigabit ethernet interface
           - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC
           - cdns,emac                 # Generic
           - cdns,gem                  # Generic
-- 
2.47.0


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

* [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
  2025-08-22  9:34 [PATCH v2 0/5] dd ethernet support for RPi5 Stanimir Varbanov
  2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
  2025-08-22  9:34 ` [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1 Stanimir Varbanov
@ 2025-08-22  9:34 ` Stanimir Varbanov
  2025-08-22 12:13   ` Nicolas Ferre
  2025-08-22 15:17   ` Claudiu Beznea
  2025-08-22  9:34 ` [PATCH v2 4/5] arm64: dts: rp1: Add ethernet DT node Stanimir Varbanov
  2025-08-22  9:34 ` [PATCH v2 5/5] arm64: dts: broadcom: Enable RP1 ethernet for Raspberry Pi 5 Stanimir Varbanov
  4 siblings, 2 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-22  9:34 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre,
	Claudiu Beznea, Phil Elwell, Jonathan Bell, Dave Stevenson,
	Stanimir Varbanov, Andrew Lunn

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


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

* [PATCH v2 4/5] arm64: dts: rp1: Add ethernet DT node
  2025-08-22  9:34 [PATCH v2 0/5] dd ethernet support for RPi5 Stanimir Varbanov
                   ` (2 preceding siblings ...)
  2025-08-22  9:34 ` [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller Stanimir Varbanov
@ 2025-08-22  9:34 ` Stanimir Varbanov
  2025-08-22  9:34 ` [PATCH v2 5/5] arm64: dts: broadcom: Enable RP1 ethernet for Raspberry Pi 5 Stanimir Varbanov
  4 siblings, 0 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-22  9:34 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre,
	Claudiu Beznea, Phil Elwell, Jonathan Bell, Dave Stevenson,
	Stanimir Varbanov, Andrew Lunn

Add macb GEM ethernet DT node.

Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm64/boot/dts/broadcom/rp1-common.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/broadcom/rp1-common.dtsi b/arch/arm64/boot/dts/broadcom/rp1-common.dtsi
index 5002a375eb0b..6bdc304c5f24 100644
--- a/arch/arm64/boot/dts/broadcom/rp1-common.dtsi
+++ b/arch/arm64/boot/dts/broadcom/rp1-common.dtsi
@@ -39,4 +39,20 @@ rp1_gpio: pinctrl@400d0000 {
 			     <1 IRQ_TYPE_LEVEL_HIGH>,
 			     <2 IRQ_TYPE_LEVEL_HIGH>;
 	};
+
+	rp1_eth: ethernet@40100000 {
+		compatible = "raspberrypi,rp1-gem";
+		reg = <0x00 0x40100000  0x0 0x4000>;
+		interrupts = <6 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&rp1_clocks RP1_CLK_SYS>,
+			 <&rp1_clocks RP1_CLK_SYS>,
+			 <&rp1_clocks RP1_CLK_ETH>,
+			 <&rp1_clocks RP1_CLK_ETH_TSU>;
+		clock-names = "pclk", "hclk", "tx_clk", "tsu_clk";
+		local-mac-address = [00 00 00 00 00 00];
+		status = "disabled";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
 };
-- 
2.47.0


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

* [PATCH v2 5/5] arm64: dts: broadcom: Enable RP1 ethernet for Raspberry Pi 5
  2025-08-22  9:34 [PATCH v2 0/5] dd ethernet support for RPi5 Stanimir Varbanov
                   ` (3 preceding siblings ...)
  2025-08-22  9:34 ` [PATCH v2 4/5] arm64: dts: rp1: Add ethernet DT node Stanimir Varbanov
@ 2025-08-22  9:34 ` Stanimir Varbanov
  4 siblings, 0 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-22  9:34 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre,
	Claudiu Beznea, Phil Elwell, Jonathan Bell, Dave Stevenson,
	Stanimir Varbanov, Andrew Lunn

Enable RP1 ethernet DT node for Raspberry Pi 5.

Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 .../boot/dts/broadcom/bcm2712-rpi-5-b.dts      | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts
index a70a9b158df3..c70d1cb7f3b6 100644
--- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts
+++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts
@@ -23,3 +23,21 @@ &pcie1 {
 &pcie2 {
 	status = "okay";
 };
+
+&rp1_eth {
+	status = "okay";
+	phy-mode = "rgmii-id";
+	phy-handle = <&phy1>;
+
+	mdio {
+		reg = <0x1>;
+		reset-gpios = <&rp1_gpio 32 GPIO_ACTIVE_LOW>;
+		reset-delay-us = <5000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		phy1: ethernet-phy@1 {
+			reg = <0x1>;
+		};
+	};
+};
-- 
2.47.0


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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
@ 2025-08-22  9:42   ` Nicolas Ferre
  2025-08-22 15:16   ` Claudiu Beznea
  2025-08-25 23:53   ` Jakub Kicinski
  2 siblings, 0 replies; 18+ messages in thread
From: Nicolas Ferre @ 2025-08-22  9:42 UTC (permalink / raw)
  To: Stanimir Varbanov, netdev, linux-kernel, devicetree,
	linux-arm-kernel, linux-rpi-kernel,
	Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Claudiu Beznea, Phil Elwell,
	Jonathan Bell, Dave Stevenson, stable, Andrew Lunn

On 22/08/2025 at 11:34, Stanimir Varbanov wrote:
> In case of rx queue reset and 64bit capable hardware, set the upper
> 32bits of DMA ring buffer address.
> 
> Cc: stable@vger.kernel.org # v4.6+
> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
> Credits-to: Phil Elwell <phil@raspberrypi.com>
> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Looks good to me: thanks!
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
> v1 -> v2:
>   - Added credits.
>   - Use lower_32_bits() for RBQP register writes for consistency (Nicolas).
>   - Added Fixes tag.
> 
>   drivers/net/ethernet/cadence/macb_main.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index ce95fad8cedd..36717e7e5811 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
>                  macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
> 
>                  macb_init_rx_ring(queue);
> -               queue_writel(queue, RBQP, queue->rx_ring_dma);
> +               queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma));
> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
> +               if (bp->hw_dma_cap & HW_DMA_CAP_64B)
> +                       macb_writel(bp, RBQPH, upper_32_bits(queue->rx_ring_dma));
> +#endif
> 
>                  macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
> 
> --
> 2.47.0
> 


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

* Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
  2025-08-22  9:34 ` [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller Stanimir Varbanov
@ 2025-08-22 12:13   ` Nicolas Ferre
  2025-08-22 15:17   ` Claudiu Beznea
  1 sibling, 0 replies; 18+ messages in thread
From: Nicolas Ferre @ 2025-08-22 12:13 UTC (permalink / raw)
  To: Stanimir Varbanov, netdev, linux-kernel, devicetree,
	linux-arm-kernel, linux-rpi-kernel,
	Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Claudiu Beznea, Phil Elwell,
	Jonathan Bell, Dave Stevenson, Andrew Lunn

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
> 


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

* Re: [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1
  2025-08-22  9:34 ` [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1 Stanimir Varbanov
@ 2025-08-22 12:15   ` Nicolas Ferre
  2025-08-22 15:17   ` Claudiu Beznea
  1 sibling, 0 replies; 18+ messages in thread
From: Nicolas Ferre @ 2025-08-22 12:15 UTC (permalink / raw)
  To: Stanimir Varbanov, netdev, linux-kernel, devicetree,
	linux-arm-kernel, linux-rpi-kernel,
	Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Claudiu Beznea, Phil Elwell,
	Jonathan Bell, Dave Stevenson, Andrew Lunn, Conor Dooley

On 22/08/2025 at 11:34, Stanimir Varbanov wrote:
> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> 
> The Raspberry Pi RP1 chip has the Cadence GEM ethernet
> controller, so add a compatible string for it.
> 
> 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: Nicolas Ferre <nicolas.ferre@microchip.com>

> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>   Documentation/devicetree/bindings/net/cdns,macb.yaml | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
> index 559d0f733e7e..0591da97d434 100644
> --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml
> +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
> @@ -54,6 +54,7 @@ properties:
>             - cdns,np4-macb             # NP4 SoC devices
>             - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
>             - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
> +          - raspberrypi,rp1-gem       # Raspberry Pi RP1 gigabit ethernet interface
>             - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC
>             - cdns,emac                 # Generic
>             - cdns,gem                  # Generic
> --
> 2.47.0
> 


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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
  2025-08-22  9:42   ` Nicolas Ferre
@ 2025-08-22 15:16   ` Claudiu Beznea
  2025-08-25 23:53   ` Jakub Kicinski
  2 siblings, 0 replies; 18+ messages in thread
From: Claudiu Beznea @ 2025-08-22 15:16 UTC (permalink / raw)
  To: Stanimir Varbanov, netdev, linux-kernel, devicetree,
	linux-arm-kernel, linux-rpi-kernel,
	Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre, Phil Elwell,
	Jonathan Bell, Dave Stevenson, stable, Andrew Lunn



On 22.08.2025 12:34, Stanimir Varbanov wrote:
> In case of rx queue reset and 64bit capable hardware, set the upper
> 32bits of DMA ring buffer address.
> 
> Cc: stable@vger.kernel.org # v4.6+
> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
> Credits-to: Phil Elwell <phil@raspberrypi.com>
> Credits-to: Jonathan Bell <jonathan@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>


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

* Re: [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1
  2025-08-22  9:34 ` [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1 Stanimir Varbanov
  2025-08-22 12:15   ` Nicolas Ferre
@ 2025-08-22 15:17   ` Claudiu Beznea
  1 sibling, 0 replies; 18+ messages in thread
From: Claudiu Beznea @ 2025-08-22 15:17 UTC (permalink / raw)
  To: Stanimir Varbanov, netdev, linux-kernel, devicetree,
	linux-arm-kernel, linux-rpi-kernel,
	Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre, Phil Elwell,
	Jonathan Bell, Dave Stevenson, Andrew Lunn, Conor Dooley



On 22.08.2025 12:34, Stanimir Varbanov wrote:
> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> 
> The Raspberry Pi RP1 chip has the Cadence GEM ethernet
> controller, so add a compatible string for it.
> 
> 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: Conor Dooley <conor.dooley@microchip.com>


Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>

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

* Re: [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
  2025-08-22  9:34 ` [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller Stanimir Varbanov
  2025-08-22 12:13   ` Nicolas Ferre
@ 2025-08-22 15:17   ` Claudiu Beznea
  1 sibling, 0 replies; 18+ messages in thread
From: Claudiu Beznea @ 2025-08-22 15:17 UTC (permalink / raw)
  To: Stanimir Varbanov, netdev, linux-kernel, devicetree,
	linux-arm-kernel, linux-rpi-kernel,
	Broadcom internal kernel review list
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Florian Fainelli, Andrea della Porta, Nicolas Ferre, Phil Elwell,
	Jonathan Bell, Dave Stevenson, Andrew Lunn



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>

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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
  2025-08-22  9:42   ` Nicolas Ferre
  2025-08-22 15:16   ` Claudiu Beznea
@ 2025-08-25 23:53   ` Jakub Kicinski
  2025-08-26  8:35     ` Stanimir Varbanov
  2025-08-26  9:14     ` Nicolas Ferre
  2 siblings, 2 replies; 18+ messages in thread
From: Jakub Kicinski @ 2025-08-25 23:53 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Andrea della Porta, Nicolas Ferre, Claudiu Beznea, Phil Elwell,
	Jonathan Bell, Dave Stevenson, stable, Andrew Lunn,
	Théo Lebrun

On Fri, 22 Aug 2025 12:34:36 +0300 Stanimir Varbanov wrote:
> In case of rx queue reset and 64bit capable hardware, set the upper
> 32bits of DMA ring buffer address.
> 
> Cc: stable@vger.kernel.org # v4.6+
> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
> Credits-to: Phil Elwell <phil@raspberrypi.com>
> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index ce95fad8cedd..36717e7e5811 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
>  		macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
>  
>  		macb_init_rx_ring(queue);
> -		queue_writel(queue, RBQP, queue->rx_ring_dma);
> +		queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma));
> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
> +		if (bp->hw_dma_cap & HW_DMA_CAP_64B)
> +			macb_writel(bp, RBQPH, upper_32_bits(queue->rx_ring_dma));
> +#endif
>  
>  		macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
>  

Looks like a subset of Théo Lebrun's work:
https://lore.kernel.org/all/20250820-macb-fixes-v4-0-23c399429164@bootlin.com/
let's wait for his patches to get merged instead?

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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-25 23:53   ` Jakub Kicinski
@ 2025-08-26  8:35     ` Stanimir Varbanov
  2025-08-26  9:13       ` Nicolas Ferre
  2025-08-26  9:14     ` Nicolas Ferre
  1 sibling, 1 reply; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-26  8:35 UTC (permalink / raw)
  To: Jakub Kicinski, Stanimir Varbanov
  Cc: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Andrea della Porta, Nicolas Ferre, Claudiu Beznea, Phil Elwell,
	Jonathan Bell, Dave Stevenson, stable, Andrew Lunn,
	Théo Lebrun

Hi Jakub,

On 8/26/25 2:53 AM, Jakub Kicinski wrote:
> On Fri, 22 Aug 2025 12:34:36 +0300 Stanimir Varbanov wrote:
>> In case of rx queue reset and 64bit capable hardware, set the upper
>> 32bits of DMA ring buffer address.
>>
>> Cc: stable@vger.kernel.org # v4.6+
>> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
>> Credits-to: Phil Elwell <phil@raspberrypi.com>
>> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
>> index ce95fad8cedd..36717e7e5811 100644
>> --- a/drivers/net/ethernet/cadence/macb_main.c
>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
>>  		macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
>>  
>>  		macb_init_rx_ring(queue);
>> -		queue_writel(queue, RBQP, queue->rx_ring_dma);
>> +		queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma));
>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>> +		if (bp->hw_dma_cap & HW_DMA_CAP_64B)
>> +			macb_writel(bp, RBQPH, upper_32_bits(queue->rx_ring_dma));
>> +#endif
>>  
>>  		macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
>>  
> 
> Looks like a subset of Théo Lebrun's work:
> https://lore.kernel.org/all/20250820-macb-fixes-v4-0-23c399429164@bootlin.com/
> let's wait for his patches to get merged instead?

No objections for this patch, it could be postponed. But the others from
the series could be applied.

regards,
~Stan



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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-26  8:35     ` Stanimir Varbanov
@ 2025-08-26  9:13       ` Nicolas Ferre
  2025-08-28  8:29         ` Stanimir Varbanov
  0 siblings, 1 reply; 18+ messages in thread
From: Nicolas Ferre @ 2025-08-26  9:13 UTC (permalink / raw)
  To: Stanimir Varbanov, Jakub Kicinski
  Cc: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Andrea della Porta, Claudiu Beznea, Phil Elwell, Jonathan Bell,
	Dave Stevenson, stable, Andrew Lunn, Théo Lebrun

On 26/08/2025 at 10:35, Stanimir Varbanov wrote:
> Hi Jakub,
> 
> On 8/26/25 2:53 AM, Jakub Kicinski wrote:
>> On Fri, 22 Aug 2025 12:34:36 +0300 Stanimir Varbanov wrote:
>>> In case of rx queue reset and 64bit capable hardware, set the upper
>>> 32bits of DMA ring buffer address.
>>>
>>> Cc: stable@vger.kernel.org # v4.6+
>>> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
>>> Credits-to: Phil Elwell <phil@raspberrypi.com>
>>> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
>>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>
>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
>>> index ce95fad8cedd..36717e7e5811 100644
>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
>>>               macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
>>>
>>>               macb_init_rx_ring(queue);
>>> -            queue_writel(queue, RBQP, queue->rx_ring_dma);
>>> +            queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma));
>>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>>> +            if (bp->hw_dma_cap & HW_DMA_CAP_64B)
>>> +                    macb_writel(bp, RBQPH, upper_32_bits(queue->rx_ring_dma));
>>> +#endif
>>>
>>>               macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
>>>
>>
>> Looks like a subset of Théo Lebrun's work:
>> https://lore.kernel.org/all/20250820-macb-fixes-v4-0-23c399429164@bootlin.com/
>> let's wait for his patches to get merged instead?
> 
> No objections for this patch, it could be postponed. But the others from
> the series could be applied.

Some cleanup by Théo, could interfere with sorting of compatibility 
strings...
We'll try make all this be queued in order, as Théo was first to send. 
Sorry for not having realized this earlier.

Best regards,
   Nicolas


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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-25 23:53   ` Jakub Kicinski
  2025-08-26  8:35     ` Stanimir Varbanov
@ 2025-08-26  9:14     ` Nicolas Ferre
  2025-08-28  8:29       ` Stanimir Varbanov
  1 sibling, 1 reply; 18+ messages in thread
From: Nicolas Ferre @ 2025-08-26  9:14 UTC (permalink / raw)
  To: Jakub Kicinski, Stanimir Varbanov
  Cc: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Andrea della Porta, Claudiu Beznea, Phil Elwell, Jonathan Bell,
	Dave Stevenson, stable, Andrew Lunn, Théo Lebrun

On 26/08/2025 at 01:53, Jakub Kicinski wrote:
> On Fri, 22 Aug 2025 12:34:36 +0300 Stanimir Varbanov wrote:
>> In case of rx queue reset and 64bit capable hardware, set the upper
>> 32bits of DMA ring buffer address.
>>
>> Cc: stable@vger.kernel.org # v4.6+
>> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
>> Credits-to: Phil Elwell <phil@raspberrypi.com>
>> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
>> index ce95fad8cedd..36717e7e5811 100644
>> --- a/drivers/net/ethernet/cadence/macb_main.c
>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
>>                macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
>>
>>                macb_init_rx_ring(queue);
>> -             queue_writel(queue, RBQP, queue->rx_ring_dma);
>> +             queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma));
>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>> +             if (bp->hw_dma_cap & HW_DMA_CAP_64B)
>> +                     macb_writel(bp, RBQPH, upper_32_bits(queue->rx_ring_dma));
>> +#endif
>>
>>                macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
>>
> 
> Looks like a subset of Théo Lebrun's work:
> https://lore.kernel.org/all/20250820-macb-fixes-v4-0-23c399429164@bootlin.com/
> let's wait for his patches to get merged instead?

Yes, we can certainly wait. As RBOPH changes by Théo are key, they will 
probably remove the need for this fix altogether: but I count on you 
Stanimir to monitor that (as I don't have a 64 bit capable platform at 
hand).

Best regards,
   Nicolas


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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-26  9:14     ` Nicolas Ferre
@ 2025-08-28  8:29       ` Stanimir Varbanov
  0 siblings, 0 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-28  8:29 UTC (permalink / raw)
  To: Nicolas Ferre, Jakub Kicinski, Stanimir Varbanov
  Cc: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Andrea della Porta, Claudiu Beznea, Phil Elwell, Jonathan Bell,
	Dave Stevenson, stable, Andrew Lunn, Théo Lebrun



On 8/26/25 12:14 PM, Nicolas Ferre wrote:
> On 26/08/2025 at 01:53, Jakub Kicinski wrote:
>> On Fri, 22 Aug 2025 12:34:36 +0300 Stanimir Varbanov wrote:
>>> In case of rx queue reset and 64bit capable hardware, set the upper
>>> 32bits of DMA ring buffer address.
>>>
>>> Cc: stable@vger.kernel.org # v4.6+
>>> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue
>>> to handle RX errors")
>>> Credits-to: Phil Elwell <phil@raspberrypi.com>
>>> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
>>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>
>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/
>>> ethernet/cadence/macb_main.c
>>> index ce95fad8cedd..36717e7e5811 100644
>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue,
>>> struct napi_struct *napi,
>>>                macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
>>>
>>>                macb_init_rx_ring(queue);
>>> -             queue_writel(queue, RBQP, queue->rx_ring_dma);
>>> +             queue_writel(queue, RBQP, lower_32_bits(queue-
>>> >rx_ring_dma));
>>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>>> +             if (bp->hw_dma_cap & HW_DMA_CAP_64B)
>>> +                     macb_writel(bp, RBQPH, upper_32_bits(queue-
>>> >rx_ring_dma));
>>> +#endif
>>>
>>>                macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
>>>
>>
>> Looks like a subset of Théo Lebrun's work:
>> https://lore.kernel.org/all/20250820-macb-fixes-
>> v4-0-23c399429164@bootlin.com/
>> let's wait for his patches to get merged instead?
> 
> Yes, we can certainly wait. As RBOPH changes by Théo are key, they will
> probably remove the need for this fix altogether: but I count on you
> Stanimir to monitor that (as I don't have a 64 bit capable platform at
> hand).

Sure I will monitor those series. Unfortunately I also don't have MACB
64bit platform, I only have GEM.

regards,
~Stan


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

* Re: [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer
  2025-08-26  9:13       ` Nicolas Ferre
@ 2025-08-28  8:29         ` Stanimir Varbanov
  0 siblings, 0 replies; 18+ messages in thread
From: Stanimir Varbanov @ 2025-08-28  8:29 UTC (permalink / raw)
  To: Nicolas Ferre, Stanimir Varbanov, Jakub Kicinski
  Cc: netdev, linux-kernel, devicetree, linux-arm-kernel,
	linux-rpi-kernel, Broadcom internal kernel review list,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Andrea della Porta, Claudiu Beznea, Phil Elwell, Jonathan Bell,
	Dave Stevenson, stable, Andrew Lunn, Théo Lebrun

Hi Nicolas,

On 8/26/25 12:13 PM, Nicolas Ferre wrote:
> On 26/08/2025 at 10:35, Stanimir Varbanov wrote:
>> Hi Jakub,
>>
>> On 8/26/25 2:53 AM, Jakub Kicinski wrote:
>>> On Fri, 22 Aug 2025 12:34:36 +0300 Stanimir Varbanov wrote:
>>>> In case of rx queue reset and 64bit capable hardware, set the upper
>>>> 32bits of DMA ring buffer address.
>>>>
>>>> Cc: stable@vger.kernel.org # v4.6+
>>>> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue
>>>> to handle RX errors")
>>>> Credits-to: Phil Elwell <phil@raspberrypi.com>
>>>> Credits-to: Jonathan Bell <jonathan@raspberrypi.com>
>>>> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
>>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>>
>>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/
>>>> ethernet/cadence/macb_main.c
>>>> index ce95fad8cedd..36717e7e5811 100644
>>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>>> @@ -1634,7 +1634,11 @@ static int macb_rx(struct macb_queue *queue,
>>>> struct napi_struct *napi,
>>>>               macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
>>>>
>>>>               macb_init_rx_ring(queue);
>>>> -            queue_writel(queue, RBQP, queue->rx_ring_dma);
>>>> +            queue_writel(queue, RBQP, lower_32_bits(queue-
>>>> >rx_ring_dma));
>>>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>>>> +            if (bp->hw_dma_cap & HW_DMA_CAP_64B)
>>>> +                    macb_writel(bp, RBQPH, upper_32_bits(queue-
>>>> >rx_ring_dma));
>>>> +#endif
>>>>
>>>>               macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
>>>>
>>>
>>> Looks like a subset of Théo Lebrun's work:
>>> https://lore.kernel.org/all/20250820-macb-fixes-
>>> v4-0-23c399429164@bootlin.com/
>>> let's wait for his patches to get merged instead?
>>
>> No objections for this patch, it could be postponed. But the others from
>> the series could be applied.
> 
> Some cleanup by Théo, could interfere with sorting of compatibility
> strings...

Théo's series touches clk properties so I do not expect conflicts.

regards,
~Stan

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

end of thread, other threads:[~2025-08-28  8:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22  9:34 [PATCH v2 0/5] dd ethernet support for RPi5 Stanimir Varbanov
2025-08-22  9:34 ` [PATCH v2 1/5] net: cadence: macb: Set upper 32bits of DMA ring buffer Stanimir Varbanov
2025-08-22  9:42   ` Nicolas Ferre
2025-08-22 15:16   ` Claudiu Beznea
2025-08-25 23:53   ` Jakub Kicinski
2025-08-26  8:35     ` Stanimir Varbanov
2025-08-26  9:13       ` Nicolas Ferre
2025-08-28  8:29         ` Stanimir Varbanov
2025-08-26  9:14     ` Nicolas Ferre
2025-08-28  8:29       ` Stanimir Varbanov
2025-08-22  9:34 ` [PATCH v2 2/5] dt-bindings: net: cdns,macb: Add compatible for Raspberry Pi RP1 Stanimir Varbanov
2025-08-22 12:15   ` Nicolas Ferre
2025-08-22 15:17   ` Claudiu Beznea
2025-08-22  9:34 ` [PATCH v2 3/5] net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller Stanimir Varbanov
2025-08-22 12:13   ` Nicolas Ferre
2025-08-22 15:17   ` Claudiu Beznea
2025-08-22  9:34 ` [PATCH v2 4/5] arm64: dts: rp1: Add ethernet DT node Stanimir Varbanov
2025-08-22  9:34 ` [PATCH v2 5/5] arm64: dts: broadcom: Enable RP1 ethernet for Raspberry Pi 5 Stanimir Varbanov

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).