[BPI-R4-PRO] Mainline OpenWRT

I had issues with sandisk cards (original,not fake) on R4Pro when running in real highspeed (52MHz) so i upstreamed the sd-overlay with 48MHZ where it looks stable so far (except some warnings on linux bootup which seem to be compensated - had no more in later runtime). Make sure you write not to fast and wait till cache is written completely to card.

yup. as mentioned, a cheaper card actually worked better for me. have no idea how to “upstream the sd-overlay with 48MHZ” but will google it if sd card issues persist.

for anyone else who runs into it, the OpenWRT snapshot build seems to enable the SFP wan port, so I had no link on the RJ45 wan port (furthest right, by the dc in port) until I ran the following at the u-boot prompt:

setenv bootconf_extra mt7988a-bananapi-bpi-r4-pro-8x-wan-phy

saveenv

reset

Also, it seems quite slow to bring up the web ui (luci?), so slow in fact that i have to “apply unchecked” when changing interface IP’s, as the UI isn’t available before the reconnect timeout reverts the change. Need to increase that timeout to avoid confusion/frustration…

The board support was with only sfp because phy driver needed for RJ45 of combo was not working and downstream driver was rejected. So first versions were with only SFP.

To not break existing setups after we (thx to pietro) got upstream phy driver working we made sfp default with the possibility to change via the overlay config.

We are waiting for the mux part where basic patches are currently upstreamed (phy port series from maxime) to drop overlays at some time as it allows automatic switch (via moddef0 gpio of sfp).

greek to me, but sounds good. really appreciate all the work. Bought this hoping to get a Rooter (GoldenOrb) build for it, (or OpenMPTCPRouter) and that may actually happen at some point now…

Finally and with help of claude I could install and run the snapshot yesterday. The move to emmc did work, too. Uboot is current. I use the router as repeater which works well. Should I upgrade the switch firmware to 1.0.85? I did read there were some problems, but someone found solutions and did patch some files.
Are the patches already in the snapshot?

Without actual firmware you will experience issues with the lan-combo port. Files are not shipped with openwrt,but linked here in forum and my wiki

Meanwhile I did do the Firmware-Update and even a snapshot update. Both did work very well. Thank you. I am waiting for a mesh implementation in luci (I didn’t see anything yet) then I buy a second R4 Pro.

Can anyone help with a weird issue that is only just now popping up? It seems my device is bricking itself every roughly 24 hours. I am on the latest snapshot and I have confirmed I’m on the latest mxl firmware. Every day I wake up to find the radios are detected as “Generic Device” and do nothing. A reboot then takes down the wired connection also and I have no internet at all. Reflashing the latest snapshot fixes this, but then the same problem presents itself the next day. Anyone else have this? Only just started a few days ago for me.

Can you access the device via ethernet (wired)? Please look into logs (dmesg) before reboot. Sounds like a wifi only issue…reboot of course cut off wired connection but it should be restored when system is up again…maybe your flashing was incomplete? Which bootdevice are you using (sdmmc,spinand,emmc)?

Booting from sd card. When the radios went down I was able to ssh into it over ethernet, but after rebooting to see if that would fix the issue, I am no longer even able to ssh in wired.

Since it wont come up again after the reboot maybe the image on the sd card is somehow being corrupted because the sd card is dying? I’m really not sure though because whatever is occurring is only happening during early morning hours and it seems weird to me that a damaged sd card would only malfunction during a specific time frame, and that reflashing that same card would then WORK after. Very confused atm, gonna run out and get a different sd card because the only other one I have is fast and large and I’ve heard theres issues with those.

Can you do an lspci when the radios are not available?
If they don’t show up there, look at mediatek: filogic: keep MT7988 PCIe PEXTP clocks enabled by Folkerist · Pull Request #25751 · openwrt/openwrt · GitHub

I did that earlier and they did not show up, neither did my nvme drive as well. I’ll take a look at that right now, thank you!

How do I go about testing these patches? Do I need to download something and then use the firmware builder?

Leaving instructions here (Claude helped me) for anyone who also runs into this issue and wants to try this solution.

Your router has four PCIe ports, each with its own reference clock. While booting, the kernel switches off clocks it thinks nothing is using. On the 8X that sometimes happens while the PCIe links are still starting up, so a random mix of the Wi-Fi card and NVMe drives goes missing on each boot. You can confirm it’s your problem by running this on the router:

dmesg | grep -i “link down”

If you see lines like mtk-pcie-gen3 ... PCIe link down, this is your bug.

  1. Check your current boot options:

fw_printenv -n bootargs

It should print something like console=ttyS0,115200n1 pci=pcie_bus_perf root=/dev/fit0 rootwait (NAND installs also have ubi.block=0,fit).

  1. Save a copy so you can undo it later:

fw_printenv -n bootargs > /root/bootargs.orig

  1. Add the option:

fw_setenv bootargs “$(fw_printenv -n bootargs) clk_ignore_unused”

  1. Reboot, then check that the option is active:

cat /proc/cmdline

The output should include clk_ignore_unused. Reboot a few times and check that the Wi-Fi and NVMe show up every time.

I’ve been using that patch for a while. Actually there’s also another clock to fix for USB discovery as well.

Using the patch for a few days it seems the crashes are back with a vengeance. Now multiple times daily seemingly randomly throughout the day. Its not the wifi radios going down this time, all internet access is lost even over ethernet. Rebooting fixes it. Any suggestions from anyone for what to do now that the previous patch hasnt solved it?

Imho it is the wrong thread discussing random issues.

Have you changed power supply? Sounds like such issue.

This only began after updating to the mainline snapshot a few weeks ago. Previously I was on the Wozi build but I noticed SQM didn’t work there so I tried switching to the mainline build. For the first week or so it seemed to work fine and then I had the crashing issues I previously posted about. I figured that since I’m running into these issues, others may too so I figured I’d ask here so it could be fixed. If it is not relevant enough, I can create a new thread if you want. I have not changed the power supply or anything else. The only thing I’ve done is the clock fix as well as bootconf_extra mt7988a-bananapi-bpi-r4-pro-8x-wan-phy.

activating the phy can increase power-usage, but let us discuss this in separate thread