705-net-dsa-add-Qualcomm-IPQ4019-built-in-switch-support.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From b5f71652b85a85ea53162e9e2b760b84fd0d254f Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <[email protected]>
  3. Date: Mon, 1 Nov 2021 18:10:28 +0100
  4. Subject: [PATCH] net: dsa: add Qualcomm IPQ4019 built-in switch support
  5. Qualcomm IPQ40xx SoC-s have a variant of QCA8337N switch built-in.
  6. It shares most of the stuff with its external counterpart, however it is
  7. modified for the SoC.
  8. Namely, it doesn't have second CPU port (Port 6), so it has 6 ports
  9. instead of 7.
  10. It also has no built-in PHY-s but rather requires external PSGMII based
  11. companion PHY-s (QCA8072 and QCA8075) for which it first needs to carry
  12. out calibration before using them.
  13. PSGMII has a SoC built-in PHY that is used to connect to the PHY-s which
  14. unfortunately requires some magic values as the datasheet doesnt document
  15. the bits that are being set or the register at all.
  16. Since its built-in it is MMIO like other peripherals and doesn't have its
  17. own MDIO bus but depends on the SoC provided one.
  18. CPU connection is at Port 0 and it uses some kind of a internal connection
  19. and no traditional RGMII/SGMII.
  20. It also doesn't use in-band tagging like other qca8k switches so a shinfo
  21. based tagger is used.
  22. Signed-off-by: Robert Marko <[email protected]>
  23. ---
  24. drivers/net/dsa/qca/Kconfig | 9 +++++++++
  25. drivers/net/dsa/qca/Makefile | 1 +
  26. 2 files changed, 10 insertions(+)
  27. --- a/drivers/net/dsa/qca/Kconfig
  28. +++ b/drivers/net/dsa/qca/Kconfig
  29. @@ -23,3 +23,13 @@ config NET_DSA_QCA8K_LEDS_SUPPORT
  30. help
  31. This enabled support for LEDs present on the Qualcomm Atheros
  32. QCA8K Ethernet switch chips.
  33. +
  34. +config NET_DSA_QCA8K_IPQ4019
  35. + tristate "Qualcomm Atheros IPQ4019 built-in Ethernet switch support"
  36. + depends on HAS_IOMEM && NET_DSA
  37. + select NET_DSA_TAG_IPQ4019
  38. + select REGMAP
  39. + help
  40. + This enables support for the Qualcomm Atheros IPQ4019 SoC built-in
  41. + Ethernet switch.
  42. +
  43. --- a/drivers/net/dsa/qca/Makefile
  44. +++ b/drivers/net/dsa/qca/Makefile
  45. @@ -1,5 +1,6 @@
  46. # SPDX-License-Identifier: GPL-2.0-only
  47. obj-$(CONFIG_NET_DSA_AR9331) += ar9331.o
  48. +obj-$(CONFIG_NET_DSA_QCA8K_IPQ4019) += qca8k-ipq4019.o
  49. obj-$(CONFIG_NET_DSA_QCA8K) += qca8k.o
  50. qca8k-y += qca8k-common.o qca8k-8xxx.o
  51. ifdef CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT