linux/drivers/phy/mediatek
Daniel Golle ac4aa9dbc7 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: b72d6cba92/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_sgmii.c
Link: dec96a1d9b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/8719c82634df7e8e984f1a608be3ba2f2d494fb4.1712625857.git.daniel@makrotopia.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2024-04-12 16:52:56 +05:30
..
Kconfig phy: add driver for MediaTek XFI T-PHY 2024-04-12 16:52:56 +05:30
Makefile phy: add driver for MediaTek XFI T-PHY 2024-04-12 16:52:56 +05:30
phy-mtk-dp.c phy: phy-mtk-dp: Fix an error code in probe() 2023-07-12 22:27:02 +05:30
phy-mtk-hdmi-mt2701.c phy: mediatek: hdmi: mt2701: use common helper to access registers 2022-09-24 11:57:50 +05:30
phy-mtk-hdmi-mt8173.c phy: mediatek: hdmi: mt8173: use common helper to access registers 2022-09-24 11:57:50 +05:30
phy-mtk-hdmi-mt8195.c phy: mediatek: hdmi: mt8195: fix prediv bad upper limit test 2023-07-12 22:27:02 +05:30
phy-mtk-hdmi-mt8195.h phy: mediatek: add support for phy-mtk-hdmi-mt8195 2023-04-12 21:56:41 +05:30
phy-mtk-hdmi.c phy: mediatek: add support for phy-mtk-hdmi-mt8195 2023-04-12 21:56:41 +05:30
phy-mtk-hdmi.h phy: Explicitly include correct DT includes 2023-07-17 11:52:56 +05:30
phy-mtk-io.h phy: mediatek: remove temporary variable @mask_ 2023-02-02 18:35:13 +05:30
phy-mtk-mipi-csi-0-5-rx-reg.h phy: mtk-mipi-csi: add driver for CSI phy 2024-02-07 15:02:13 +01:00
phy-mtk-mipi-csi-0-5.c phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30
phy-mtk-mipi-dsi-mt8173.c phy: mediatek: mipi: mt8173: use common helper to access registers 2022-09-24 11:57:50 +05:30
phy-mtk-mipi-dsi-mt8183.c phy: mediatek: mipi: mt8183: fix minimal supported frequency 2023-11-27 18:23:26 +05:30
phy-mtk-mipi-dsi.c phy: mediatek: mipi-dsi: Compress of_device_id match entries 2023-07-12 22:27:42 +05:30
phy-mtk-mipi-dsi.h phy: Explicitly include correct DT includes 2023-07-17 11:52:56 +05:30
phy-mtk-pcie.c phy: Explicitly include correct DT includes 2023-07-17 11:52:56 +05:30
phy-mtk-tphy.c phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30
phy-mtk-ufs.c phy: Explicitly include correct DT includes 2023-07-17 11:52:56 +05:30
phy-mtk-xfi-tphy.c phy: add driver for MediaTek XFI T-PHY 2024-04-12 16:52:56 +05:30
phy-mtk-xsphy.c phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30