PHYTOOL(8)

πŸ“¦ version 2, in epel 9, fedora 43, fedora 44, nixos 26.05

πŸ’– PHYTOOL(8) β€” Linux MDIO register access πŸ’–

okay bestie, gather round, because phytool is one of those tiny little commands that's lowkey carrying the whole networking department on its back. it lives in the System Management Commands section of the manual (section 8, iykyk), and it's literally just here to let you poke at MDIO registers on Linux. that's it. that's the whole vibe. and yet. ✨


🌸 NAME 🌸

phytool β€” Linux MDIO register access


πŸŽ€ SYNOPSIS πŸŽ€

phytool read IFACE/ADDR/REG

phytool write IFACE/ADDR/REG <0-0xffff>

phytool print IFACE/ADDR[/REG]

and where, you ask, do all those lil pieces come from? girl, here's the breakdown:

ADDR   := C22 | C45

C22    := <0-0x1f>

C45    := <0-0x1f>:<0-0x1f>

REG    := <0-0x1f>

so ADDR is either a C22 address or a C45 address, C22 is a single number from <0-0x1f>, C45 is a pair like <0-0x1f>:<0-0x1f> (yes, with the colon, it's giving coordinates honestly), and REG is also <0-0x1f>. simple as. 🫢


✨ DESCRIPTION ✨

so the read and write commands? they're the most straightforward little register-level accessors you've ever met. no drama, no mystery β€” you point them at a register, and they read it or write it. periodt.

then there's print, which is the glow-up command: it pretty-prints a register for you so you're not squinting at raw hex like it's a cryptic text from your ex. 🌈

and here's the cute part β€” when you're using print, the register is optional. leave it out and phytool will show you the most common registers instead. honestly? considerate. main character behavior. πŸ‘‘


πŸ’€ NOTES πŸ’€

not all MDIO drivers support the port:device Clause 45 address format. so if you throw a C45-style address at a driver that's not about that life, it's just not gonna work. no cap. πŸ™ˆ

πŸ”₯ EXAMPLES πŸ”₯

here's the three commands you'll actually be typing at 2am:

phytool read eth0/0:3/1

phytool write eth0/0xa/0 0x1140

phytool print eth0/0x1c

look at that 0:3 Clause 45 flex in the first one. iconic. πŸ’…


😭 REPORTING BUGS 😭

found a bug? there's a bug report address for that. go tell them, bestie β€” they want to know.


πŸ¦‹ SEE ALSO πŸ¦‹

mv6tool(8) β€” yes, its sibling. go say hi.


and that's the whole page, fr fr. this little writeup came from the System Management Commands corner of the manual, and it was dated January 2024 with the tag PHYTOOL(8) at the bottom. πŸŽ€ so there you have it β€” go forth, read those registers, slay. βœ¨πŸ’–

πŸ“¦ where this page comes from