3941d69edf035d79e7d5c284a96979fabfe1e943
[openwrt/openwrt.git] /
1 From f9f0024bd9bf04a58b64bae356be4c04022d23bc Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 11 Nov 2024 16:40:07 +0000
4 Subject: [PATCH 1423/1482] net: macb: Add support for Raspberry Pi RP1
5 ethernet controller
6
7 The RP1 chip has the Cadence GEM block, but wants the tx_clock
8 to always run at 125MHz, in the same way as sama7g5.
9 Add the relevant configuration.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++++
14 1 file changed, 12 insertions(+)
15
16 --- a/drivers/net/ethernet/cadence/macb_main.c
17 +++ b/drivers/net/ethernet/cadence/macb_main.c
18 @@ -5023,6 +5023,17 @@ static const struct macb_config versal_c
19 .usrio = &macb_default_usrio,
20 };
21
22 +static const struct macb_config raspberrypi_rp1_config = {
23 + .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
24 + MACB_CAPS_JUMBO |
25 + MACB_CAPS_GEM_HAS_PTP,
26 + .dma_burst_length = 16,
27 + .clk_init = macb_clk_init,
28 + .init = macb_init,
29 + .usrio = &macb_default_usrio,
30 + .jumbo_max_len = 10240,
31 +};
32 +
33 static const struct of_device_id macb_dt_ids[] = {
34 { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
35 { .compatible = "cdns,macb" },
36 @@ -5043,6 +5054,7 @@ static const struct of_device_id macb_dt
37 { .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
38 { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
39 { .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },
40 + { .compatible = "raspberrypi,rp1-gem", .data = &raspberrypi_rp1_config },
41 { .compatible = "xlnx,zynqmp-gem", .data = &zynqmp_config},
42 { .compatible = "xlnx,zynq-gem", .data = &zynq_config },
43 { .compatible = "xlnx,versal-gem", .data = &versal_config},