ipq40xx: Add support for Linksys MR6350
authorRoland Reinl <[email protected]>
Thu, 30 Nov 2023 16:16:41 +0000 (17:16 +0100)
committerRobert Marko <[email protected]>
Sat, 15 Nov 2025 10:28:22 +0000 (11:28 +0100)
This pull request is based on
- the discussions in https://forum.openwrt.org/t/adding-openwrt-support-for-linksys-mr6350
- https://github.com/openwrt/openwrt/pull/11405 which added support for similar devices.

Device Specs:
- IPQ4019
- Quad Core CPU
- 256 MB RAM
- 256 MB FLASH
- 4 LAN ports, 1 WAN port
- 2.4GHz (802.11n) and 5GHz (802.11c) wifi
- 3 LEDs (Red, blue, green) which are routed to one indicator at the top of the case
- 2 buttons (Reset, WPS)

Disassembling the device:
- There are 4 screws at the bottom of the device which must be removed
- Two are under the fron rubber feets
- Two are under the labels in the back (corner next to the rear rubber feets)

Serial interface:
- The serial interface is already populated on the device with a 6-pin header
- Pin 1 is next to the heatsink
- Pinout: 1: 3.3V, 2: TX, 3: RX, 4: unknown, 5: GND, 6: GND
- Settings: 115200, 8N1

Migrating to OpenWrt requires multiple steps:
- Load and boot the initramfs image
- Adapt U-Boot settings to support bigger kernels
- Flash the sysupgrade image

Load and boot initramfs:
- Connect serial interface
- Set up a TFTP server on IP 192.168.1.254
- Copy openwrt-ipq40xx-generic-linksys_mr6350-initramfs-zImage.itb to TFTP server
- Rename file to C0A80101.img
- Boot up the device and stop in U-Boot
- Run the following U-Boot commands after a link has been established:
  tftp
  bootm
- Initramfs image is started now.

Adapt U-Boot settings to support bigger kernels:
- Run "fw_printenv" in the initramfs image  after booting
- There should be an entry kernsize=300000 which indicates the maximum size for the kernel is 3MB
- Execute "fw_setenv kernsize 500000" to increase the max kernel size to 5MB
- Check that the change are applied with "fw_printenv"

Flash the sysupgrade image:
- Default sysupgrade routine either with a initramfs image containing LuCI or via command line.

Revert back to OEM firmware:
- Only tested with FW_MR6350_1.1.3.210129_prod.img
- Flash the OEM firmware via sysupgrade
- Forced update is required

Signed-off-by: Roland Reinl <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/17977
Signed-off-by: Robert Marko <[email protected]>
package/boot/uboot-tools/uboot-envtools/files/ipq40xx
package/firmware/ipq-wifi/Makefile
target/linux/ipq40xx/base-files/etc/board.d/02_network
target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq40xx/base-files/etc/init.d/bootcount
target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh
target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-mr6350.dts [new file with mode: 0644]
target/linux/ipq40xx/image/generic.mk

index e2d67d7f195b0ad39c992e7660aca879f13c4b56..f49e94d295e21fa7724a8e710a9969a8f0ceb058 100644 (file)
@@ -63,6 +63,7 @@ linksys,ea6350v3)
        ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x20000"
        ;;
 linksys,ea8300|\
+linksys,mr6350|\
 linksys,mr8300)
        ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x40000" "0x20000"
        ;;
index 6ba5cc60374fcf22782e58b1ee0e3991fb06844f..8268970c4f25368ef92a6ffdbe4781ddbe6b2721 100644 (file)
@@ -48,6 +48,7 @@ ALLWIFIBOARDS:= \
        iodata_wn-dax3000gr \
        linksys_homewrk \
        linksys_mr5500 \
+       linksys_mr6350 \
        linksys_mr7350 \
        linksys_mr7500 \
        linksys_mx2000 \
@@ -225,6 +226,7 @@ $(eval $(call generate-ipq-wifi-package,ignitenet_ss-w2-ac2600,Ignitenet SS-W2-A
 $(eval $(call generate-ipq-wifi-package,iodata_wn-dax3000gr,I-O DATA WN-DAX3000GR))
 $(eval $(call generate-ipq-wifi-package,linksys_homewrk,Linksys HomeWRK))
 $(eval $(call generate-ipq-wifi-package,linksys_mr5500,Linksys MR5500))
+$(eval $(call generate-ipq-wifi-package,linksys_mr6350,Linksys MR6350))
 $(eval $(call generate-ipq-wifi-package,linksys_mr7350,Linksys MR7350))
 $(eval $(call generate-ipq-wifi-package,linksys_mr7500,Linksys MR7500))
 $(eval $(call generate-ipq-wifi-package,linksys_mx2000,Linksys MX2000))
index 13b1cdc43ad1160dedccb0545f01e4f11081e5f9..773cb5a2ff8b2441630067c292ee60779f9dd443 100644 (file)
@@ -17,6 +17,7 @@ ipq40xx_setup_interfaces()
        asus,rt-ac58u|\
        linksys,ea6350v3|\
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300|\
        mikrotik,hap-ac2|\
        mikrotik,hap-ac3|\
@@ -221,6 +222,7 @@ ipq40xx_setup_macs()
                ;;
        linksys,ea6350v3|\
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300)
                wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                lan_mac=$(macaddr_add "$wan_mac" 1)
index 469c0626ee0927032cc4b7614f372bbcbe36c758..7b959c54a0d2f1d7abf05fe32247f14f893f6e70 100644 (file)
@@ -21,6 +21,7 @@ case "$FIRMWARE" in
                /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
                ;;
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300)
                caldata_extract "ART" 0x9000 0x2f20
                # OEM assigns 4 sequential MACs
@@ -88,6 +89,7 @@ case "$FIRMWARE" in
                ath10k_patch_mac $(mtd_get_mac_ascii CFG1 RADIOADDR0)
                ;;
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300)
                caldata_extract "ART" 0x1000 0x2f20
                ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
@@ -179,6 +181,7 @@ case "$FIRMWARE" in
                ath10k_patch_mac $(mtd_get_mac_ascii CFG1 RADIOADDR1)
                ;;
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300)
                caldata_extract "ART" 0x5000 0x2f20
                ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3)
index 0120f78cfe840919f93926d88725c000dcef6474..079edce24c36707ce3feb378559da23f9c79a791 100755 (executable)
@@ -39,6 +39,7 @@ boot() {
                ;;
        linksys,ea6350v3|\
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300|\
        linksys,whw01|\
        linksys,whw03v2)
index 9ee8adbf7f54e49aa344e1225464072a0367d37c..e0547c36500ec68ade77de6910974fbb7d664a83 100644 (file)
@@ -4,6 +4,7 @@ case "$(board_name)" in
 ezviz,cs-w3-wd1200g-eup|\
 linksys,ea6350v3|\
 linksys,ea8300|\
+linksys,mr6350|\
 linksys,mr8300)
        uci set system.@system[0].compat_version="2.0"
        uci commit system
index 12d9b4eeecaaca319bb8312dc82e2ff66d067fc9..3165c767bba005e051f9021a9671dce85a80381c 100644 (file)
@@ -20,6 +20,7 @@ preinit_set_mac_address() {
                ip link set dev eth0 address $(mtd_get_mac_ascii CFG1 ethaddr)
                ;;
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300)
                base_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                ip link set dev lan1 address $(macaddr_add "$base_mac" 1)
index 860c3fd2de997a271d62df92318bdc677c98ec82..256b3cfb91c1bedbb1e268503e81dbcc200c2919 100644 (file)
@@ -16,7 +16,7 @@ linksys_get_target_firmware() {
                        "${cur_boot_part}" "${mtd_ubi0}"
        fi
 
-       # OEM U-Boot for EA6350v3, EA8300 and MR8300; bootcmd=
+       # OEM U-Boot for EA6350v3, EA8300, MR6350 and MR8300; bootcmd=
        #  if test $auto_recovery = no;
        #      then bootipq;
        #  elif test $boot_part = 1;
index 21ec2f4d294102edf99ec0664a97fd31906226aa..7db23a1c77d9686f111f8a4a4d5297ff27b898d1 100644 (file)
@@ -169,6 +169,7 @@ platform_do_upgrade() {
                ;;
        linksys,ea6350v3|\
        linksys,ea8300|\
+       linksys,mr6350|\
        linksys,mr8300|\
        linksys,whw01|\
        linksys,whw03v2)
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-mr6350.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-mr6350.dts
new file mode 100644 (file)
index 0000000..e9732a3
--- /dev/null
@@ -0,0 +1,114 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT\r
+\r
+#include "qcom-ipq4019-xx8300.dtsi"\r
+#include <dt-bindings/leds/common.h>\r
+\r
+/ {\r
+       model = "Linksys MR6350";\r
+       compatible = "linksys,mr6350", "qcom,ipq4019";\r
+\r
+       aliases {\r
+               led-boot = &led_blue;\r
+               led-failsafe = &led_red;\r
+               led-running = &led_green;\r
+               led-upgrade = &led_blue;\r
+               serial0 = &blsp1_uart1;\r
+       };\r
+\r
+       // Top panel LEDs, above Linksys logo\r
+       leds {\r
+               compatible = "gpio-leds";\r
+               \r
+               led_blue: led-blue {\r
+                       color = <LED_COLOR_ID_BLUE>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;\r
+               };\r
+\r
+               led_red: led-red {\r
+                       color = <LED_COLOR_ID_RED>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;\r
+                       panic-indicator;\r
+               };\r
+\r
+               led_green: led-green {\r
+                       color = <LED_COLOR_ID_GREEN>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;\r
+               };\r
+       };\r
+\r
+       keys {\r
+               compatible = "gpio-keys";\r
+\r
+               button-reset {\r
+                       label = "reset";\r
+                       linux,code = <KEY_RESTART>;\r
+                       gpios = <&tlmm 50 GPIO_ACTIVE_LOW>;\r
+               };\r
+\r
+               button-wps {\r
+                       label = "wps";\r
+                       linux,code = <KEY_WPS_BUTTON>;\r
+                       gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;\r
+               };\r
+       };\r
+};\r
+\r
+&mdio {\r
+       status = "okay";\r
+       pinctrl-0 = <&mdio_pins>;\r
+       pinctrl-names = "default";\r
+       reset-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;\r
+       reset-delay-us = <2000>;\r
+       reset-post-delay-us = <5000>;\r
+};\r
+       \r
+&tlmm {\r
+       status = "okay";\r
+\r
+       mdio_pins: mdio_pinmux {\r
+               mdio {\r
+                       pins = "gpio6";\r
+                       function = "mdio";\r
+                       bias-pull-up;\r
+               };\r
+\r
+               mdc {\r
+                       pins = "gpio7";\r
+                       function = "mdc";\r
+                       bias-pull-up;\r
+               };\r
+       };\r
+};\r
+\r
+&wifi0 {\r
+       status = "okay";\r
+       qcom,ath10k-calibration-variant = "linksys-mr6350";\r
+};\r
+\r
+&wifi1 {\r
+       status = "okay";\r
+       qcom,ath10k-calibration-variant = "linksys-mr6350";\r
+};\r
+\r
+&swport1 {\r
+       label = "wan";\r
+};\r
+\r
+&swport2 {\r
+       label = "lan1";\r
+};\r
+\r
+&swport3 {\r
+       label = "lan2";\r
+};\r
+\r
+&swport4 {\r
+       label = "lan3";\r
+};\r
+\r
+&swport5 {\r
+       label = "lan4";\r
+};\r
index 544fe0424d49c59d6485031080fb13721eb97ed4..36f7e4047fbeeab57fe400817d2b49dde20abd5b 100644 (file)
@@ -714,6 +714,23 @@ define Device/linksys_ea8300
 endef
 TARGET_DEVICES += linksys_ea8300
 
+define Device/linksys_mr6350
+       $(call Device/FitzImage)
+       $(call Device/kernel-size-6350-8300)
+       DEVICE_VENDOR := Linksys
+       DEVICE_MODEL := MR6350
+       SOC := qcom-ipq4019
+       KERNEL_SIZE := 5120k
+       IMAGE_SIZE := 84992k
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
+       IMAGES += factory.bin
+       IMAGE/factory.bin  := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | linksys-image type=MR6350
+       DEVICE_PACKAGES := ipq-wifi-linksys_mr6350 kmod-usb-ledtrig-usbport
+endef
+TARGET_DEVICES += linksys_mr6350
+
 define Device/linksys_mr8300
        $(call Device/FitzImage)
        $(call Device/kernel-size-6350-8300)