Skip to content

Commit

Permalink
readme: update with applet-specific usage help
Browse files Browse the repository at this point in the history
  • Loading branch information
wkz committed Feb 2, 2016
1 parent fac2247 commit 10f1c6d
Showing 1 changed file with 75 additions and 23 deletions.
98 changes: 75 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,97 @@
phytool
=======

Linux MII register access

Linux MDIO register access

Usage
-----

phytool read iface/phy/reg
phytool write iface/phy/reg val
phytool print iface/phy[/reg]

The PHY argument is either in clause-22 direct adressing syntax, or in
clause-45 syntax `port:dev`. Where `port` is the MDIO port address and
`dev` is the device's PHY address (0x1-0xA), MAC register (0x10-0x1A),
the global register (0x1B), or the global2 register (0x1C)
phytool read IFACE/ADDR/REG
phytool write IFACE/ADDR/REG <0-0xffff>
phytool print IFACE/ADDR[/REG]

where

ADDR := C22 | C45
C22 := <0-0x1f>
C45 := <0-0x1f>:<0-0x1f>
REG := <0-0x1f>

Some devices have a SERDES specific page on `dev` address 0xF
Note: Not all MDIO drivers support the `port:device` Clause 45 address
format.

The `read` and `write` commands are simple register level
accessors. The `print` command will pretty-print a register. When
using the `print` command, the register is optional. If left out, the
most common registers will be shown.

Examples
--------

~ # phytool read eth4/0/4
0x0de1

~ # phytool print eth4/0
~ # phytool print eth0/0
ieee-phy: id:0x01410eb1

ieee-phy: reg:BMCR(0x00) val:0x0800
flags: reset loopback aneg-enable power-down isolate aneg-restart collision-test
speed: 10-half
○ ○ ○ ○ ◉ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
0 8 0 0


ieee-phy: reg:BMCR(0x00) val:0x1140
flags: -reset -loopback +aneg-enable -power-down -isolate -aneg-restart -collision-test
speed: 1000-full

ieee-phy: reg:BMSR(0x01) val:0x7949
link capabilities: 100-b4 100-f 100-h 10-f 10-h 100-t2-f 100-t2-h
flags: ext-status aneg-complete remote-fault aneg-capable link jabber ext-register
○ ◉ ◉ ◉ ◉ ○ ○ ◉ ○ ◉ ○ ○ ◉ ○ ○ ◉
7 9 4 9
capabilities: -100-b4 +100-f +100-h +10-f +10-h -100-t2-f -100-t2-h
flags: +ext-status -aneg-complete -remote-fault +aneg-capable -link -jabber +ext-register


mv6tool
=======

Marvell Link Street register access

Usage
-----

mv6tool read LOCATION/REG
mv6tool write LOCATION/REG <0-0xffff>
mv6tool print LOCATION[/REG]
mv6tool print IFACE

where

LOCATION := IFACE/<port|phy> | DEV/<ADDR|phyN|portN|globalG|serdes>

DEV := <0-0x1f>
ADDR := <0-0x1f>
N := <0-0xa>
G := <0-2>
REG := <0-0x1f>

The `read` and `write` commands are simple register level
accessors. The `print` command will pretty-print a register. When
using the `print` command, the register is optional. If left out, the
most common registers will be shown.

Examples
--------

~ # mv6tool 1/global1/0
mv6: model:mv88e6097 dev:1 global:1
mv6: reg:00 val:0xc800

~ # mv6tool print eth1-1
mv6: model:mv88e6352 dev:0 port:1
mv6: reg:PS(0x00) val:0x100f
flags: -pause-en -my-pause +phy-detect -link -eee -tx-paused -flow-ctrl
speed: 10-half
mode: 0xf

mv6: reg:PC(0x04) val:0x1414
flags: -router-header +igmp-snoop -vlan-tunnel -tag-if-both
egress-mode: 01, untagged
frame-mode: 00, normal
initial-pri: 01, tag prio
egress-floods: 01, allow UC
port-state: 00, disabled

Origin & References
-------------------
Expand Down

0 comments on commit 10f1c6d

Please sign in to comment.