Re: [linux-next-v2 5/5] arm64: dts: rockchip: Add missing of ethernet-phy-id to reset the phy on Rock 3A SBC

Anand Moon
2022-12-07T04:29:55Z

Hi Michael

On Tue, 22 Nov 2022 at 22:16, Michael Riesch
<michael.riesch@wolfvision.net> wrote:
>
> Hi Anand,
>
> On 11/16/22 21:01, Anand Moon wrote:
> > Add MDIO description with ethernet-phy-id compatible string
> > which enable calling reset of the phy. The PHY will then be probed,
> > independent of if it can be found on the bus or not,
> > and that probing will enable the GPIO.
> >
> > ethernet-phy-id is read from ethenet register dump reg2 and reg3.
> >
> > Fix following warning.
> > [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
> > [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1
> > [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19)
>
> Without this patch, the phy on my ROCK3A is properly detected:
>
> [ 1.494963] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00]
> driver [RTL8211F Gigabit Ethernet)
>
> but with the patch applied, only a generic phy is recognized:
>
> [ 1.398674] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00]
> driver [Generic PHY] (irq=POLL)
>
> This does not seem right at all. NACK to this patch!
>

Yep you are correct I found way to read the ethernet id

# there is kernel module witch help read the ethernet-id using netlink socket.
$ git clone https://github.com/wkz/mdio-tools

$ sudo mdio
fixed-0
stmmac-0
$ sudo mdio stmmac-0
DEV PHY-ID LINK
0x00 0x001cc916 up
0x01 0x001cc916 up

with the above ethernet id I update the compatible string
compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";

I could get the ethernet registered correctly.

[ 9.865059] rk_gmac-dwmac fe010000.ethernet end0: Register
MEM_TYPE_PAGE_POOL RxQ-0
[ 10.061904] rk_gmac-dwmac fe010000.ethernet end0: PHY [stmmac-0:00]
driver [RTL8211F Gigabit Ethernet] (irq=POLL)

Thanks
-Anand