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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
  13. index c8d66f966a8b..ebcc46d8aa9d 100644
  14. --- a/drivers/net/ethernet/cadence/macb_main.c
  15. +++ b/drivers/net/ethernet/cadence/macb_main.c
  16. @@ -4359,6 +4359,14 @@ static const struct macb_usrio_config macb_default_usrio = {
  17. .refclk = MACB_BIT(CLKEN),
  18. };
  19. +static const struct macb_usrio_config sama7g5_usrio = {
  20. + .mii = 0,
  21. + .rmii = 1,
  22. + .rgmii = 2,
  23. + .refclk = BIT(2),
  24. + .hdfctlen = BIT(6),
  25. +};
  26. +
  27. static const struct macb_config fu540_c000_config = {
  28. .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
  29. MACB_CAPS_GEM_HAS_PTP,
  30. @@ -4452,6 +4460,14 @@ static const struct macb_config zynq_config = {
  31. .usrio = &macb_default_usrio,
  32. };
  33. +static const struct macb_config sama7g5_gem_config = {
  34. + .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG,
  35. + .dma_burst_length = 16,
  36. + .clk_init = macb_clk_init,
  37. + .init = macb_init,
  38. + .usrio = &sama7g5_usrio,
  39. +};
  40. +
  41. static const struct of_device_id macb_dt_ids[] = {
  42. { .compatible = "cdns,at32ap7000-macb" },
  43. { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
  44. @@ -4469,6 +4485,7 @@ static const struct of_device_id macb_dt_ids[] = {
  45. { .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
  46. { .compatible = "cdns,zynq-gem", .data = &zynq_config },
  47. { .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
  48. + { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
  49. { /* sentinel */ }
  50. };
  51. MODULE_DEVICE_TABLE(of, macb_dt_ids);
  52. --
  53. 2.32.0