mtk_xfi_tphy_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

mtk_xfi_tphy_setup β€” setup phy for specified interface mode. πŸ’…

This is the mtk_xfi_tphy_setup(9) page from the Kernel API Manual, and no cap, it's giving "small page, real hardware job." 🫢

πŸ“œ SYNOPSIS πŸ“œ

void mtk_xfi_tphy_setup (struct mtk_xfi_tphy *xfi_tphy , phy_interface_t
interface );

🧚 ARGUMENTS 🧚

  • xfi_tphy β€” the XFI phy instance. That's the main-character object you're setting up. πŸ‘‘
  • interface β€” the Ethernet interface mode. It tells the setup which vibe it's dressing for. 🌈

πŸ”₯ DESCRIPTION πŸ”₯

OK so this setup function is basically the condensed result of combining the 5 functions that set up the phy in MediaTek's GPL licensed public SDK sources. Those originals live in mtk_sgmii.c[1] as well as mtk_usxgmii.c[2]. πŸ’–

A bunch of the magic values got upgraded to register and bit definitions, but ngl, that couldn't happen in every single case. 😭 Some raw magic is still in the chat.

The vendor driver goes full sequence of 32-bit writes mode; this version lowkey tries to only modify the bits that are actually required. ✨

🫢 Vibe check: the page literally says "try," so we're not out here promising every write is minimal. It's the goal, bestie, not a blood oath.

The refs, fr fr:

Ref [1]:

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

Ref [2]:

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

🌸 SEE ALSO 🌸

The friend group is right here πŸ‘―:

Periodt. πŸ’…


That's the whole page, bestie. Bye! πŸ’…πŸŽ€ This one came from ./drivers/phy/mediatek, dated October 2026, and it's the mtk_xfi_tphy_setup(9) page. πŸ¦‹

πŸ“¦ where this page comes from