BUG report: sun4i-emac and mdio-sun4i
qianfan
qianfanguijin at 163.com
Wed May 10 02:40:25 PDT 2023
Hi:
Now the linux driver for allwinner sun4i emac has split two seprate drivers,
emac and mdio. But there has minor problem.
Most of resources such as clk are prepared when emac driver loaded, and the mdio
driver can't work if the clk is not enabled.
So if we reigster mdio driver before emac driver, the top level will read phy's
id right now when mdio driver registed. But the emac resoure have not prepared
that will cause sun4i_mdio_read always return zero.
Listen mdio_access trace event, and then 'insmod mdio-sun4i.ko' you can find
the read result: (all of the register are read as zero)
insmod-3744 ..: mdio_access: 1c0b080.mdio-mii read phy:0x00 reg:0x02 val:0x0000
insmod-3744 ..: mdio_access: 1c0b080.mdio-mii read phy:0x00 reg:0x03 val:0x0000
That will cause phy_id always zero, the phy's special driver can not loaded:
$ cat /sys/bus/mdio_bus/devices/1c0b080.mdio-mii\:00/phy_id
0x00000000
I had tried capture the mdc/mdio bus signal, noting is sent.
If both mdio-sun4i.c and sun4i-emac.c drivers are built with Y, the kernel
will always load mdio-sun4i.c first.
So can we find a easy was to make sure mdio driver are loaded later, at least
after emac driver? Or merge those two drivers?
Thanks
More information about the linux-arm-kernel
mailing list