730-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 60ed9eb9605656c19ca402b7bd3f47552e901601 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Mon, 13 Feb 2023 02:33:14 +0000
  4. Subject: [PATCH] net: phy: add driver for MediaTek SoC built-in GE PHYs
  5. Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet
  6. PHYs which require calibration data from the SoC's efuse.
  7. Despite the similar design the driver doesn't share any code with the
  8. existing mediatek-ge.c, so add support for these PHYs by introducing a
  9. new driver for only MediaTek's ARM64 SoCs.
  10. Signed-off-by: Daniel Golle <[email protected]>
  11. ---
  12. MAINTAINERS | 9 +
  13. drivers/net/phy/Kconfig | 12 +
  14. drivers/net/phy/Makefile | 1 +
  15. drivers/net/phy/mediatek-ge-soc.c | 1263 +++++++++++++++++++++++++++++
  16. drivers/net/phy/mediatek-ge.c | 3 +-
  17. 5 files changed, 1287 insertions(+), 1 deletion(-)
  18. create mode 100644 drivers/net/phy/mediatek-ge-soc.c
  19. --- a/MAINTAINERS
  20. +++ b/MAINTAINERS
  21. @@ -11797,6 +11797,15 @@ S: Maintained
  22. F: drivers/net/pcs/pcs-mtk-lynxi.c
  23. F: include/linux/pcs/pcs-mtk-lynxi.h
  24. +MEDIATEK ETHERNET PHY DRIVERS
  25. +M: Daniel Golle <[email protected]>
  26. +M: Qingfang Deng <[email protected]>
  27. +M: SkyLake Huang <[email protected]>
  28. +L: [email protected]
  29. +S: Maintained
  30. +F: drivers/net/phy/mediatek-ge-soc.c
  31. +F: drivers/net/phy/mediatek-ge.c
  32. +
  33. MEDIATEK I2C CONTROLLER DRIVER
  34. M: Qii Wang <[email protected]>
  35. L: [email protected]
  36. --- a/drivers/net/phy/Kconfig
  37. +++ b/drivers/net/phy/Kconfig
  38. @@ -293,6 +293,18 @@ config MEDIATEK_GE_PHY
  39. help
  40. Supports the MediaTek Gigabit Ethernet PHYs.
  41. +config MEDIATEK_GE_SOC_PHY
  42. + tristate "MediaTek SoC Ethernet PHYs"
  43. + depends on (ARM64 && ARCH_MEDIATEK) || COMPILE_TEST
  44. + select NVMEM_MTK_EFUSE
  45. + help
  46. + Supports MediaTek SoC built-in Gigabit Ethernet PHYs.
  47. +
  48. + Include support for built-in Ethernet PHYs which are present in
  49. + the MT7981 and MT7988 SoCs. These PHYs need calibration data
  50. + present in the SoCs efuse and will dynamically calibrate VCM
  51. + (common-mode voltage) during startup.
  52. +
  53. config MICREL_PHY
  54. tristate "Micrel PHYs"
  55. help
  56. --- a/drivers/net/phy/Makefile
  57. +++ b/drivers/net/phy/Makefile
  58. @@ -81,6 +81,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o
  59. obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o
  60. obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o
  61. obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o
  62. +obj-$(CONFIG_MEDIATEK_GE_SOC_PHY) += mediatek-ge-soc.o
  63. obj-$(CONFIG_MESON_GXL_PHY) += meson-gxl.o
  64. obj-$(CONFIG_MICREL_KS8995MA) += spi_ks8995.o
  65. obj-$(CONFIG_MICREL_PHY) += micrel.o
  66. --- a/drivers/net/phy/mediatek-ge.c
  67. +++ b/drivers/net/phy/mediatek-ge.c
  68. @@ -136,7 +136,8 @@ static struct phy_driver mtk_gephy_drive
  69. module_phy_driver(mtk_gephy_driver);
  70. static struct mdio_device_id __maybe_unused mtk_gephy_tbl[] = {
  71. - { PHY_ID_MATCH_VENDOR(0x03a29400) },
  72. + { PHY_ID_MATCH_EXACT(0x03a29441) },
  73. + { PHY_ID_MATCH_EXACT(0x03a29412) },
  74. { }
  75. };