]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: cadence: macb: Add support for Raspberry Pi RP1 ethernet controller
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Tue, 16 Sep 2025 08:10:59 +0000 (11:10 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Sep 2025 22:09:00 +0000 (15:09 -0700)
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>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://patch.msgid.link/20250916081059.3992108-1-svarbanov@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c

index a6fbab388c196224f266f7657d9927c4a3d18dfc..e7ee8ade7aebc9e4e85495277fa2bf40a00b56e4 100644 (file)
@@ -5373,6 +5373,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" },
@@ -5393,6 +5404,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},