119-net-macb-add-support-for-sama7g5-gem-interface.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 0085cd8576ceeaddeedf973b939b41ba96e3f77c Mon Sep 17 00:00:00 2001
  2. From: Claudiu Beznea <[email protected]>
  3. Date: Wed, 9 Dec 2020 15:03:38 +0200
  4. Subject: [PATCH 119/247] net: macb: add support for sama7g5 gem interface
  5. Add support for SAMA7G5 gigabit ethernet interface.
  6. Signed-off-by: Claudiu Beznea <[email protected]>
  7. Reviewed-by: Andrew Lunn <[email protected]>
  8. Signed-off-by: David S. Miller <[email protected]>
  9. ---
  10. drivers/net/ethernet/cadence/macb_main.c | 17 +++++++++++++++++
  11. 1 file changed, 17 insertions(+)
  12. --- a/drivers/net/ethernet/cadence/macb_main.c
  13. +++ b/drivers/net/ethernet/cadence/macb_main.c
  14. @@ -4387,6 +4387,14 @@ static const struct macb_usrio_config ma
  15. .refclk = MACB_BIT(CLKEN),
  16. };
  17. +static const struct macb_usrio_config sama7g5_usrio = {
  18. + .mii = 0,
  19. + .rmii = 1,
  20. + .rgmii = 2,
  21. + .refclk = BIT(2),
  22. + .hdfctlen = BIT(6),
  23. +};
  24. +
  25. static const struct macb_config fu540_c000_config = {
  26. .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
  27. MACB_CAPS_GEM_HAS_PTP,
  28. @@ -4480,6 +4488,14 @@ static const struct macb_config zynq_con
  29. .usrio = &macb_default_usrio,
  30. };
  31. +static const struct macb_config sama7g5_gem_config = {
  32. + .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG,
  33. + .dma_burst_length = 16,
  34. + .clk_init = macb_clk_init,
  35. + .init = macb_init,
  36. + .usrio = &sama7g5_usrio,
  37. +};
  38. +
  39. static const struct of_device_id macb_dt_ids[] = {
  40. { .compatible = "cdns,at32ap7000-macb" },
  41. { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
  42. @@ -4497,6 +4513,7 @@ static const struct of_device_id macb_dt
  43. { .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
  44. { .compatible = "cdns,zynq-gem", .data = &zynq_config },
  45. { .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
  46. + { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
  47. { /* sentinel */ }
  48. };
  49. MODULE_DEVICE_TABLE(of, macb_dt_ids);