OpenWrt support for Linksys MX4200

Thanks, that's very useful for what I intend to do.

@SpectreDev with the PR for MX5300 progressing, any chance the info there will help with getting MX4200 to work?

Not too sure

Well I'm really busy right now, I think someone else has to take over, I've got too many projects on hand, my stuff will remain public for someone else to pick up from

1 Like

If you want, I can prepare an image for the MX4200 for testing. I don't have this device.

That would be helpful! Are you testuser7 on GitHub?
From what I can tell, the MX4200 PR differs in that:
package/system/mtd/src/Makefile and target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount are missing.
There are changes to and is different.
I wonder if that's what's needed to get the WiFi working? Seems the layout of partitions is the same for both devices, so if MX5300 WiFi works after flashing and reboot, might be what's missing?

That's mine PR.
What is the problem with WiFi?

Tue Sep 19 08:14:02 2023 kern.warn kernel: [    9.912432] ath11k c000000.wifi: qmi ignore invalid mem req type 3
Tue Sep 19 08:14:02 2023 kernel: [    9.919922] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
Tue Sep 19 08:14:02 2023 kernel: [    9.919976] ath11k c000000.wifi: fw_version 0x290104a5 fw_build_timestamp 2023-08-02 20:32 fw_build_id WLAN.HK.
Tue Sep 19 08:14:02 2023 kern.err kernel: [   10.068950] ath11k c000000.wifi: failed to fetch board data for bus=ahb,qmi-chip-id=0,qmi-board-id=255,variant=Linksys-MX4200 from ath11k/IPQ8074/hw2.0/board-2.bin
Tue Sep 19 08:14:02 2023 kern.err kernel: [   10.069018] ath11k c000000.wifi: failed to fetch board data for bus=ahb,qmi-chip-id=0,qmi-board-id=255 from ath11k/IPQ8074/hw2.0/board-2.bin
Tue Sep 19 08:14:02 2023 kern.err kernel: [   10.082471] ath11k c000000.wifi: failed to fetch board.bin from IPQ8074/hw2.0
Tue Sep 19 08:14:02 2023 kern.warn kernel: [   10.095261] ath11k c000000.wifi: qmi failed to fetch board file: -12
Tue Sep 19 08:14:02 2023 kern.warn kernel: [   10.102281] ath11k c000000.wifi: failed to load board data file: -12

Which I think we concluded was OpenWrt wasn't flashed to all the partitions so the WiFi firmware wasn't loading at boot. Related, sysupgrade also wouldn't actually flash any upgrades I think?

Are you using the v1 or v2 profile for your build? I have an ISP locked device so wasn't sure on the version, I had the same problem with the wifi firmware on v1, but v2 works perfectly fine

hmm wifi was working on one of the earlier builds (in V2 at least) as SpectreDev was exploring adding usb support (so I could backup mtd partitions) at one point the tweak removed wifi.

Yeah I think the issue is that the WiFi calibration and board file needs to be separated for V1 and V2

If you grab the latest src and compile it, press and hold the reset button on the bottom with the device on until it reboots back to original firmware, and then you can flash the linksys v2 build and wifi should work (you should see the 3x radios ready to configure)

I compiled OpenWrt-SNAPSHOT-r24600-2a82d827ba (yesterday's) with SpectreDev's PR changes and installed it on a MX4200v2.

@lytr I can select channels 36 to 64 on radio0.

My issue is that the WAN interface doesn't pick up an IPv4 or IPv6 address from the Adtran SDX 621i ONT provided by my ISP. My backup router, a Draytek Vigor2860n, does get both and if I put it in between the ONT and the MX4200v2, the Mx4200v2 gets both IPs and I can connect to the internet through it. I guess that's an issue specific to my equipment and I'll have to investigate it myself, but any tips on how to troubleshoot the problem are welcome. My starting point will be of course DHCP errors.

The following error shows up in the logs every second:

Sat Dec  9 11:37:00 2023 kern.warn kernel: [ 2099.617708] hsl_phy_phydev_get[805]:ERROR:phy_addr 0 phydev is NULL
Sat Dec  9 11:37:00 2023 kern.warn kernel: [ 2099.620819] hsl_phy_phydev_get[805]:ERROR:phy_addr 5 phydev is NULL

Is that something that needs fixing?

I've got a question about partitions. Sometimes when I reboot it goes into the stock Linksys firmware, so only one partition was flashed with OpenWrt. Should I flash OpenWrt onto the partition currently occupied by Linksys's stock firmware or it's not gonna make any difference and it's best to leave it as it is?

For those landing on this post after a search, as per Linksys's own instructions, this is how you switch between firmware partitions:

Step 1:
Power OFF the router with the Power Switch.

Step 2:
Power ON the router and the Power light will start blinking. As soon as it turns OFF (for about 2 seconds), power OFF the router.

Step 3:
Repeat Step 2 twice.

Step 4:
Turn the power back ON and wait for the Power light to turn solid. It should now be booted using its alternate firmware partition.

If you want me to test something or provide any logs please ask. I'd like to contribute whichever way I can to get MX4200's support over the line.

Some BDF files are the same in both versions:

  1. v1
d6a9f11d0904a170d174fbe0482f75471b0d5ea92e59ff692caa101618967d99 *AH/bdwlan.bin
4690b158e106174661cee571fc5270e1fbd3bf0c0f966fc8df1b893f6eed3bde *AU/bdwlan.bin
7fbdadf7e0043e6650942fe6e61f48d65331b6b6e82e363342c4cbe2b898b4e2 *CN/bdwlan.bin
9be39da729314d17c9b2727d015fa9535bed7c83bb92b5c783fb0d697afb063c *EU/bdwlan.bin
431696f335681d99d105088431d5337b0ecf3b9ed9819ce4d3f5d270c2b9406d *FCC/bdwlan.bin
37c88ab3b4e8132384515e036d67f0f14d904597bb775790fbca8089db653966 *HK/bdwlan.bin
37c88ab3b4e8132384515e036d67f0f14d904597bb775790fbca8089db653966 *IC/bdwlan.bin
a122095f51a996ee1ef33f5475eb794115aa4740b90ed9ef05ef216b86e6f319 *IN/bdwlan.bin
c4706649b4d3b6bf63dbdb752ca5d9fb6b1a2209684de76a0488e6ff8bd543b9 *JP/bdwlan.bin
b3825d5d0459c5cddaffd7840205808877fc2c113dc1b8f795cd0e331365fd2a *KR/bdwlan.bin
f734c7f541f062e3a5541d5ee89dee7da47716854fd019d0542795cf32e30cad *ME/bdwlan.bin
4b2adb19ca37a99df094f5c7fc988c8861e4892e9a4e365d074bd266eb83289a *PH/bdwlan.bin
1aa73705f33fa9597d8fd07a05af4056cffa669ad43bc1af4c60ff85ff091ecd *SG/bdwlan.bin
6a185cd4cd55b4724c5b0ed6a915671b74eeb098bfc734a3b206df695f34c0b8 *TH/bdwlan.bin
87024e5adb90145b4b9f4feb1d268ed876116908d6460b90c3991da3deb5d1cd *TW/bdwlan.bin
e98f942a3daa2310c800800b81a3c722914b9533bd25689520daae6fe713de8c *VN/bdwlan.bin
  1. v2
962cce92271d0d235bf4e7bbed93fbd98312f5c5234ce9603809278f06d5293c *AH/bdwlan.bin
67cbce8ac70807868d7f96f12c2df294399f8e0f8c1f6c04104eb9537e59c71c *AU/bdwlan.bin
7fed03831dd7aff0c06ab70bf40049808dfb4c58b222ddec1a63209ea868cef4 *CN/bdwlan.bin
00af7b8bc914f7c5a032e4b246c58854cfcb801e507ac5bea60257890cf9d016 *EU/bdwlan.bin
7fed03831dd7aff0c06ab70bf40049808dfb4c58b222ddec1a63209ea868cef4 *FCC/bdwlan.bin
37c88ab3b4e8132384515e036d67f0f14d904597bb775790fbca8089db653966 *HK/bdwlan.bin
abef5c25bdbbbd85809bd8f115ac54f5f5291c7c4d56ac2e23a8f86af41c9b14 *IC/bdwlan.bin
a122095f51a996ee1ef33f5475eb794115aa4740b90ed9ef05ef216b86e6f319 *IN/bdwlan.bin
7fed03831dd7aff0c06ab70bf40049808dfb4c58b222ddec1a63209ea868cef4 *JP/bdwlan.bin
7fed03831dd7aff0c06ab70bf40049808dfb4c58b222ddec1a63209ea868cef4 *KR/bdwlan.bin
00af7b8bc914f7c5a032e4b246c58854cfcb801e507ac5bea60257890cf9d016 *ME/bdwlan.bin
4b2adb19ca37a99df094f5c7fc988c8861e4892e9a4e365d074bd266eb83289a *PH/bdwlan.bin
1aa73705f33fa9597d8fd07a05af4056cffa669ad43bc1af4c60ff85ff091ecd *SG/bdwlan.bin
962cce92271d0d235bf4e7bbed93fbd98312f5c5234ce9603809278f06d5293c *TH/bdwlan.bin
87024e5adb90145b4b9f4feb1d268ed876116908d6460b90c3991da3deb5d1cd *TW/bdwlan.bin
e98f942a3daa2310c800800b81a3c722914b9533bd25689520daae6fe713de8c *VN/bdwlan.bin

Can you try to build image from these sources?

I chose MX4200v2. It doesn't compile.

aarch64-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp  -I/home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/arch/arm64/boot/dts -I/home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/arch/arm64/boot/dts/include -I/home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/include/ -undef -D__DTS__  -o /home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/image-ipq8072-mx5300.dtb.tmp /home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/arch/arm64/boot/dts/qcom/ipq8072-mx5300.dts
/home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/scripts/dtc/dtc -O dtb -i/home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/arch/arm64/boot/dts/qcom/ -Wno-unit_address_vs_reg -Wno-simple_bus_reg -Wno-unit_address_format -Wno-pci_bridge -Wno-pci_device_bus_num -Wno-pci_device_reg -Wno-avoid_unnecessary_addr_size -Wno-alias_paths -Wno-graph_child_address -Wno-graph_port -Wno-unique_unit_address    -o /home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/image-ipq8072-mx5300.dtb /home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/image-ipq8072-mx5300.dtb.tmp
Error: /home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.1.65/arch/arm64/boot/dts/qcom/ipq8072-mx5300.dts:377.1-12 Label or path blsp1_spi4 not found
FATAL ERROR: Syntax error parsing input tree
make[5]: *** [Makefile:18: /home/user/openwrt-testuser7/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/image-ipq8072-mx5300.dtb] Error 1
make[5]: Leaving directory '/home/user/openwrt-testuser7/target/linux/qualcommax/image'
make[4]: *** [Makefile:21: install] Error 2
make[4]: Leaving directory '/home/user/openwrt-testuser7/target/linux/qualcommax'
make[3]: *** [Makefile:11: install] Error 2
make[3]: Leaving directory '/home/user/openwrt-testuser7/target/linux'
time: target/linux/install#18.81#8.63#27.22
    ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:30: target/linux/install] Error 1
make[2]: Leaving directory '/home/user/openwrt-testuser7'
make[1]: *** [target/Makefile:24: /home/user/openwrt-testuser7/staging_dir/target-aarch64_cortex-a53_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/user/openwrt-testuser7'
make: *** [/home/user/openwrt-testuser7/include/ world] Error 2

Try now. I removed mx5300 target.

If you want to try sysupgrade, you need to manually install OpenWrt firmware on both partitions first:

I’ve got a V1 - so will try in a bit and report back.

Regarding my issue with the WAN interface not picking up an IPv4 or IPv6 address, I solved it changing the MAC address of the wan interface to that of the Linksys router. Obviously my ISP doesn't bind the service to a particular MAC address, else the Draytek Vigor2680n would not have worked, but they possibly have some sort of approved vendor filtering on their DHCP server.

The question I have which somebody might be able to answer is why the wan interface is created with the LAN's MAC address instead of that of the router.

In the case of MX5300, the same MAC address is on all interfaces. It's probably the same here: