Skip to content

Commit ac4aa9d

Browse files
dangowrtvinodkoul
authored andcommitted
phy: add driver for MediaTek XFI T-PHY
Add driver for MediaTek's XFI T-PHY which can be found in the MT7988 SoC. The XFI T-PHY is a 10 Gigabit/s Ethernet SerDes PHY with muxes on the internal side to be used with either USXGMII PCS or LynxI PCS, depending on the selected PHY interface mode. The PHY can operates only in PHY_MODE_ETHERNET, the submode is one of PHY_INTERFACE_MODE_* corresponding to the supported modes: * USXGMII \ * 10GBase-R }- USXGMII PCS - XGDM \ * 5GBase-R / \ }- Ethernet MAC * 2500Base-X \ / * 1000Base-X }- LynxI PCS - GDM / * Cisco SGMII (MAC side) / I chose the name XFI T-PHY because names of functions dealing with the phy in the vendor driver are prefixed "xfi_pextp_". The register space used by the phy is called "pextp" in the vendor sources, which could be read as "_P_CI _ex_press _T_-_P_hy", and that is quite misleading as this phy isn't used for anything related to PCIe, so I wanted to find a better name. XFI is still somehow related (as in: you would find the relevant places using grep in the vendor driver when looking for that) and the term seemed to at least somehow be aligned with the function of that phy: Dealing with (up to) 10 Gbit/s Ethernet serialized differential signals. In order to work-around a performance issue present on the first of two XFI T-PHYs found in MT7988, special tuning is applied which can be selected by adding the 'mediatek,usxgmii-performance-errata' property to the device tree node, similar to how the vendor driver is doing that too. There is no documentation for most registers used for the analog/tuning part, however, most of the registers have been partially reverse-engineered from MediaTek's SDK implementation (see links, an opaque sequence of 32-bit register writes) and descriptions for all relevant digital registers and bits such as resets and muxes have been supplied by MediaTek. Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/b72d6cba92bf9e29fb035c03052fa1e86664a25b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_sgmii.c Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/dec96a1d9b82cdcda4a56453fd0b453d4cab4b85/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c Signed-off-by: Daniel Golle <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://lore.kernel.org/r/8719c82634df7e8e984f1a608be3ba2f2d494fb4.1712625857.git.daniel@makrotopia.org Signed-off-by: Vinod Koul <[email protected]>
1 parent f482f76 commit ac4aa9d

File tree

4 files changed

+464
-0
lines changed

4 files changed

+464
-0
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13781,6 +13781,7 @@ L: [email protected]
1378113781
S: Maintained
1378213782
F: drivers/net/phy/mediatek-ge-soc.c
1378313783
F: drivers/net/phy/mediatek-ge.c
13784+
F: drivers/phy/mediatek/phy-mtk-xfi-tphy.c
1378413785

1378513786
MEDIATEK I2C CONTROLLER DRIVER
1378613787
M: Qii Wang <[email protected]>

drivers/phy/mediatek/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ config PHY_MTK_PCIE
1313
callback for PCIe GEN3 port, it supports software efuse
1414
initialization.
1515

16+
config PHY_MTK_XFI_TPHY
17+
tristate "MediaTek 10GE SerDes XFI T-PHY driver"
18+
depends on ARCH_MEDIATEK || COMPILE_TEST
19+
depends on OF
20+
select GENERIC_PHY
21+
help
22+
Say 'Y' here to add support for MediaTek XFI T-PHY driver.
23+
The driver provides access to the Ethernet SerDes T-PHY supporting
24+
1GE and 2.5GE modes via the LynxI PCS, and 5GE and 10GE modes
25+
via the USXGMII PCS found in MediaTek SoCs with 10G Ethernet.
26+
1627
config PHY_MTK_TPHY
1728
tristate "MediaTek T-PHY Driver"
1829
depends on ARCH_MEDIATEK || COMPILE_TEST

drivers/phy/mediatek/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ obj-$(CONFIG_PHY_MTK_PCIE) += phy-mtk-pcie.o
88
obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o
99
obj-$(CONFIG_PHY_MTK_UFS) += phy-mtk-ufs.o
1010
obj-$(CONFIG_PHY_MTK_XSPHY) += phy-mtk-xsphy.o
11+
obj-$(CONFIG_PHY_MTK_XFI_TPHY) += phy-mtk-xfi-tphy.o
1112

1213
phy-mtk-hdmi-drv-y := phy-mtk-hdmi.o
1314
phy-mtk-hdmi-drv-y += phy-mtk-hdmi-mt2701.o

0 commit comments

Comments
 (0)