Installing OpenWRT on Compute Module 5

Hello,

I've been using OpenWRT on a Nexx WT3020 for a while. But the OpenWRT image got bigger and bigger over time and I decided to move to something more flexible.
I decided to go the custom way with a Raspberry Pi basis.
I bought a DFRobot router mini carrier board : https://www.dfrobot.com/product-2242.html
This board was initially designed for Compute Module 4.
I also bought a CM5 with 16Gb eMMC, 2Gb of RAM and embedded WiFi.

I installed Raspberry Pi 5b image, adding the missing dtb files, changing the config.txt and cmdline.txt to get the console redirected to the UART. I also added the missing modules to get the RTL8111 chip working.

I get boot, prompt, and RTL8111 recognised by the system.

Now my issue : I can't reach LuCi interface from the computer. In fact it seems there is no network communication between OpenWRT and the computer. While OpenWRT IP is 192.168.1.1 for BR-LAN, the computer selects another IP after a while like 169.x.x.x. Even manually setting the computer's IP to 192.168.1.2 does not change anything.

I'm now trying with plain Raspberry Pi 5 image with no modification (so RT8111 is not recognized), just modifying the config.txt and cmdline.txt to get the console over UART and using the correct dtb file. Situation is the same. This same image works fine on a Raspberry Pi 5.
Chip is the same between CM5 and RPi5 so there should be no difference.
Once the cable is disconnected, OpenWRT reacts saying the port is in disabled state, and gets in forwarding state when the cable is plugged in again which makes me thinking that there is no HW issue.
The RJ45 cable works fine as well.
brctl show br-lan is associated to eth0 which is the port I'm connecting to.

I'm now quite stuck here in my debugging becaus I don't know where to search next.

Could someone more experienced provide assistance ?
Thanks !

In addition to previous tests, I tried the Raspberry OS lite image and was able to connect the network, apt update and upgrade, from both ethernet ports of the carrier board. I think this eliminates hardware incompatibility topics and let us concentrate on SW issues.

So I guess there is one configuration somewhere which should differ between RPi5 and CM5.

Did you ever have any luck getting things working? I’m trying to get the same combination of hardware up and running and have hit the same roadblock as you.

Hello Dave,

Yes, it runs since about one week or a bit more. I just have a few issues with WiFi I have to check:

  • I use Wifischedule and it does not work, I have to figure out why
  • Embedded WiFi does not work on automatic channel selection, I suppose this to be due to close source driver or something like that
  • In the same idea, I did not manage to activate both 2.4GHz and 5GHz networks at the same time
    I have to post a request on how to submit the changes to have them added in the mainstream repo. I'm new to development and all that stuff.
    I made an overlay as well to have an LED indicating the WiFi activation, and a button to turn WiFi ON and OFF. Both connected to GPIOs. They both work fine in Raspberry OS so they should work in OpenWRT. I'm just missing the wireless trigger to connect to the LED. But I'm quite close, it is just a matter of time.

Florent, did you do anything special to get the onboard Ethernet working on the Raspberry Pi 5 CM? Ethernet on the carrier board is working fine for me, but the CM’s Ethernet port will show the link is up with a cable connected but no traffic passes through it. No interrupts shown for the built in Ethernet port either in /proc/interrupts FWIW.

Hello Dave,

Yes, I made very few modifications.
I faced the same issue as you. I commented out the following lines in bcm2712-rpi-cm5.dtsi :

interrupt-parent = <&gpio>;
interrupts = <37 IRQ_TYPE_LEVEL_LOW>;

They are not present for Raspberry Pi 5B and it works as is. But they are present for Compute Module 5 in Raspberry OS and it works fine as well. So I don't know why we have those differences. I supposed there was a kernel change between the version used by OpenWRT (6.6.73) and Raspberry OS last revision. But I found nothing related to this.

I also added compute module 5 support in target/linux/bcm27xx/image/Makefile, in target/linux/bcm27xx/base-files/etc/board.d/02_network and target/linux/bcm27xx/base-files/lib/preinit/05_set_preinit_iface_brcm2708

I hope this helps

Just an update from my end — everything looks to be working well after I got the .dtb file corresponding to the 6.6.x kernel version.

I opened a PR to include the dtb files and the changes you mentioned to the two network files. Hopefully that’ll get accepted and we’ll have official support for the CM in the stock builds then.

Nice to have your feedback and see you got it working.
Thank you so much for opening the PR, I had no time to do it up to now.