net:phy:motorcomm: Fix the problem that phytool cannot be used by YT8531
authorSamin Guo <samin.guo@starfivetech.com>
Fri, 4 Nov 2022 01:42:40 +0000 (09:42 +0800)
committerSamin Guo <samin.guo@starfivetech.com>
Wed, 9 Nov 2022 10:06:56 +0000 (18:06 +0800)
commit84a102df7e9c8b8f5a430f343284dcfc9c516a25
tree4e48bf3de09cf3de57d8b4d973b8593538b1cc86
parent37c389bcb7db4ccc38244ec9199daa6438bb38a5
net:phy:motorcomm: Fix the problem that phytool cannot be used by YT8531

phy_read_status should not judge the auto negotiation speed, which
will cause 0x1e to be frequently modified.

JH7110B In different speed modes, the tx_inverted  needs to be
dynamically updated to match the timming.

known issue:
Function yt8521_read_status, it will be executed once per second.
Can read and write ext reg (0xa001/a002/a003). This may causes the ext value
read by the phytool always is 0.

$ phytool write eth0/0/0x1e 0xa001
$ phytool read eth0/0/0x1f
0000

To avoid this problem, you can read 0x1f as fast as possible after
writing 0x1e.
$ phytool write eth0/0/0x1e 0xa001; phytool read eth0/0/0x1f
0x8160

Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
drivers/net/phy/motorcomm.c