[BPI-R3] lan1,2,3,4 not appearing

Hi,

I am trying to build a kernel with most things as modules except the pure minimum required to mount the ext4 partition from the sd card. I have the kernel booting and can log in as both the serial console and wifi interfaces are working. None of the lan0,1,2,3,4 interfaces are appearing. I guess the dsa switch is not working. Which .ko file is the driver for the switch bit, and thus lan0,1,2,3,4 ? Error messages in the dmesg log:

[    0.098713] mtk-socinfo mtk-socinfo.0.auto: error -ENOENT: Failed to get socinfo data
[    0.098777] mtk-socinfo mtk-socinfo.0.auto: probe with driver mtk-socinfo failed with error -2
...
[    1.458797] mtk-msdc 11230000.mmc: msdc_track_cmd_data: cmd=52 arg=00000C00; host->error=0x00000002
[    1.467964] mtk-msdc 11230000.mmc: msdc_track_cmd_data: cmd=52 arg=80000C08; host->error=0x00000002
...
[   15.554014] mt7530-mdio mdio-bus:1f: failed to read mt7530 register
[   16.567722] mtk_soc_eth 15100000.ethernet: mdio: MDIO timeout
[   16.573551] mt7530-mdio mdio-bus:1f: failed to read mt7530 register
[   16.579815] mt7530-mdio mdio-bus:1f: reset timeout
[   16.584611] mt7530-mdio mdio-bus:1f: probe with driver mt7530-mdio failed with error -110
...

which kernel (version)? have you tried my kernel? you can disable things you do not need, mt7530 driver is builtin…no module, also mtk ethernet driver needs to be builtin

have you used the right dtb? read error is a bit strange

If I make the mt7530 and mtk ethernet driver built in, it works as you describe. But, I was wishing to try them as modules and that does not work due to “MDIO timeout”. My guess is I am missing the module for the MDIO bit, but I don’t know which driver that might be. Maybe an i2c driver?

If it works with both builtin but not as module it is an issue with module…afair there was a such issue,not sure if anyone have found a way to use it as module…but why? If you compile for this board all basicly needed should be builtin else you are need rootfs to get basics working (e.g. not nice with tftp).

A bit late, but…

I found that most things which requires direct access to the PCIe bus needs to be built directly into the kernel, enabling them as modules just does not work. It’s as if the SOC is being changed into a different mode which blocks any enabling of peripherals.

Amongst the builtin configs, I had to have STP, BRIDGE, NET_DSA, LLC, HSR, PCS_MTK_LYNXI, NET_MEDIATEK_SOC & PHYLINK all set as Y rather than M as having PCS_MTK_LYNXI loaded as a module causes a kernel oops. I am sure there are other such as PCIE_MEDIATEK_GEN3.

I did complain to Mediatek about these & just got ignored hence why I now refuse to buy anything which they have designed.

@bib I found that some devices work fine as modules, but others do not. My theory currently is that when running as a module, the module forgets to turn the clk on that it needs, and therefore does not work. The kernel tends to switch off clk that it thinks are not being used. To fix this we need two things:

  1. A method for modules to turn clk on/off
  2. The modules looking up in the DT which clk to turn on and to then actually turn it on. Until then, I am running the problem devices an Y instead of M.

For example, the problem I see is:

[   16.567722] mtk_soc_eth 15100000.ethernet: mdio: MDIO timeout

So, here the problem is either the PHY is not powered on or it not receiving clocking.

Have you tried the clock change in my kernel repos issues

mt7530 doesn't work on bpi-r3 if mtk_eth is built as module · Issue #102 · frank-w/BPI-Router-Linux · GitHub ?

I hit this exact issue with Ubuntu 24.04 after recompiling kernel to add missing mtk_eth module. Ubuntu makes everything modules.

This is with the v6.8 kernel, hopefully these clock issues have been reported to kernel maintainers and a fix is coming.

In the meantime I will try suggestion from @jcdutton on GitHub to use “clk_ignore_unused” boot param.

I can confirm this works, I added it via GRUB to test. I will now make this a permanent setting until kernel module is fixed.

For reference if the module loads correctly this is what you see in dmesg:

[   14.969089] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[   14.972329] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx

It depends on your defconfig…you do not use distribution kernel for arm.

Not sure it is reported to kernel-ML it has to be sorted out if it is a regression at some point or till there since driver support and which soc are affected