net: phy: add driver for MediaTek SoC built-in GE PHYs
Subsystems (3)
PATCH v5 1/1 net: phy: add driver for MediaTek SoC built-in GE PHYs
Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet PHYs which require calibration data from the SoC's efuse. Despite the similar design the driver doesn't share any code with the existing mediatek-ge.c.
Add support for such PHYs by introducing a new driver with basic support for MediaTek SoCs MT7981 and MT7988 built-in 1GE PHYs.
---
Changes since v4:
* completely drop LED intialization for now, reduce to bare minimal working driver
Changes since v3:
* fix spelling and reverse xmas tree
* add dt-binding for mediatek,boottrap
Changes since v2:
* remove everything related to PHY LEDs for now, LED support will be cleaned up and submitted once PHY LED framework is more ready
Changes since v1:
* split-off SoC-specific driver from mediatek-ge.c as requested
* address comments made by Heiner Kallweit
* add pinctrl handling for PHY LED
* remove calibration details not needed in production hardware
MAINTAINERS | 9 + drivers/net/phy/Kconfig | 12 + drivers/net/phy/Makefile | 1 + drivers/net/phy/mediatek-ge-soc.c | 1116 +++++++++++++++++++++++++++++ drivers/net/phy/mediatek-ge.c | 3 +- 5 files changed, 1140 insertions(+), 1 deletion(-) create mode 100644 drivers/net/phy/mediatek-ge-soc.c
MAINTAINERS +9 -0
@@ -13151,6 +13151,15 @@ S: Maintained F: drivers/net/pcs/pcs-mtk-lynxi.c F: include/linux/pcs/pcs-mtk-lynxi.h +MEDIATEK ETHERNET PHY DRIVERS +M: Daniel Golle <[email protected]> +M: Qingfang Deng <[email protected]> +M: SkyLake Huang <[email protected]> +L: [email protected] +S: Maintained +F: drivers/net/phy/mediatek-ge-soc.c +F: drivers/net/phy/mediatek-ge.c + MEDIATEK I2C CONTROLLER DRIVER M: Qii Wang <[email protected]> L: [email protected]
drivers/net/phy/Kconfig +12 -0
@@ -236,6 +236,18 @@ config MEDIATEK_GE_PHY help Supports the MediaTek Gigabit Ethernet PHYs. +config MEDIATEK_GE_SOC_PHY + tristate "MediaTek SoC Ethernet PHYs" + depends on (ARM64 && ARCH_MEDIATEK) || COMPILE_TEST + select NVMEM_MTK_EFUSE + help + Supports MediaTek SoC built-in Gigabit Ethernet PHYs. + + Include support for built-in Ethernet PHYs which are present in + the MT7981 and MT7988 SoCs. These PHYs need calibration data + present in the SoCs efuse and will dynamically calibrate VCM + (common-mode voltage) during startup. + config MICREL_PHY tristate "Micrel PHYs" depends on PTP_1588_CLOCK_OPTIONAL
drivers/net/phy/Makefile +1 -0
@@ -69,6 +69,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o +obj-$(CONFIG_MEDIATEK_GE_SOC_PHY) += mediatek-ge-soc.o obj-$(CONFIG_MESON_GXL_PHY) += meson-gxl.o obj-$(CONFIG_MICREL_KS8995MA) += spi_ks8995.o obj-$(CONFIG_MICREL_PHY) += micrel.o
drivers/net/phy/mediatek-ge-soc.c new file +1116 -0
1,116 lines not on this page · raw message
drivers/net/phy/mediatek-ge.c +2 -1
@@ -102,7 +102,8 @@ static struct phy_driver mtk_gephy_driver[] = {module_phy_driver (mtk_gephy_driver);static struct mdio_device_id __maybe_unused mtk_gephy_tbl[] = { - {PHY_ID_MATCH_VENDOR (0x03a29400 ) }, + {PHY_ID_MATCH_EXACT (0x03a29441 ) }, + {PHY_ID_MATCH_EXACT (0x03a29412 ) }, { } };
Signature · 1 line
2.41.0
Quoted 8 lines · Daniel Golle
Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet PHYs which require calibration data from the SoC's efuse. Despite the similar design the driver doesn't share any code with the existing
mediatek-ge.c.
Add support for such PHYs by introducing a new driver with basic support for MediaTek SoCs MT7981 and MT7988 built-in 1GE PHYs.Signed-off-by Daniel Golle <[email protected]>
drivers/net/phy/mediatek-ge-soc.c line 824
Quoted 8 lines
drivers/net/phy/mediatek-ge-soc.c new file +8
-0+static void mt798x_phy_eee (struct phy_device *phydev) +{ +phy_modify_mmd (phydev,MDIO_MMD_VEND1 , +MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG120 , +MTK_PHY_LPI_SIG_EN_LO_THRESH1000_MASK | +MTK_PHY_LPI_SIG_EN_HI_THRESH1000_MASK , +FIELD_PREP (MTK_PHY_LPI_SIG_EN_LO_THRESH1000_MASK ,0x0 ) | +FIELD_PREP (MTK_PHY_LPI_SIG_EN_HI_THRESH1000_MASK ,0x14 ));
Does this PHY have SmartEEE? Where the PHY itself does EEE without the help of the MAC? At some point we would like to properly support that, but first we need to sort out the mess MAC/PHY EEE is in.
Andrew
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 8 lines · On Sun, 11 Jun 2023 00:48:10 +0100 you wrote:
Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet PHYs which require calibration data from the SoC's efuse. Despite the similar design the driver doesn't share any code with the existing
mediatek-ge.c.
Add support for such PHYs by introducing a new driver with basic support for MediaTek SoCs MT7981 and MT7988 built-in 1GE PHYs.[...]
Here is the summary with links:
- [net-next,v5] net: phy: add driver for MediaTek SoC built-in GE PHYs
https://git.kernel.org/netdev/net-next/c/98c485eaf509
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Russell King (Oracle)
reviewerQuoted 8 lines · Daniel Golle
Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet PHYs which require calibration data from the SoC's efuse. Despite the similar design the driver doesn't share any code with the existing
mediatek-ge.c.
Add support for such PHYs by introducing a new driver with basic support for MediaTek SoCs MT7981 and MT7988 built-in 1GE PHYs.Signed-off-by Daniel Golle <[email protected]>
Hi Daniel,
It looks like your series wasn't threaded to this message. I assume that was a mistake?
Thanks.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!