Skip to content

Commit d992d95

Browse files
georgemoussalemrobimarko
authored andcommitted
qualcommax: ipq50xx: add support for Linksys MX6200
Linksys MX6200 is a triband Wi-Fi 6E wireless router. Speficiations: * SoC: Qualcomm IPQ5018 (64-bit dual-core ARM Cortex-A53 @ 1.0Ghz) * Memory: Nanya NT5CC256M16ER-EK (512 MiB DDR3-933) * Serial Port: 3v3 TTL 115200n8 * Wi-Fi: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax) QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax) QCN6122 (2x2:2 6 Ghz 802.11an/ac/ax) * Ethernet: IPQ5018 integrated virtual switch connected to: - LAN Port: Internal IPQ5018 GE PHY - WAN Port: Maxlinear Ethernet GPY115C PHY * Flash: Macronix MX35UF2GE4AD (256 MiB) * LEDs: 1x multi-color PWM LED * Buttons: 1x WPS (GPIO 27 Active Low) 1x Reset (GPIO 28 Acive Low) * FCC ID: 2AYRA-08436 Flash instructions: ************************************************************************ NOTE: serial access is required! Although the web UI allows you to install the Openwrt image, secure boot is enabled which will prevent booting an unsigned image. The boot sequence must be adjusted in U-boot to allow booting unsigned images. ************************************************************************ 1. On OEM firmware, login to the web UI (typically @ http://192.168.1.1) and click 'CA' in the bottom right corner. Then click -> Connectivity -> Manual Upgrade. Alternatively, browse to http://<router IP>/fwupdate.html. Upload openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi. Continue with step 5. 2. Installation on alternate partition using serial connection from OEM firmware (default login: root, password: admin): flash_erase /dev/mtd19 0 0 nandwrite -p /dev/mtd19 openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi reboot Continue with step 5. 3. Installation using serial connection from initramfs setup tftp server listening on IP in 192.168.1.0/24 (other than the router IP 192.168.1.1). In U-boot, load the initramfs image to memory: tftp $loadaddr <your IP>:openwrt-qualcommax-ipq50xx-linksys_mx6200-initramfs-uImage.itb boot the image using command: bootm $loadaddr when fully booted, scp the sysupgrade image to your router IP (default: 192.168.1.1): scp -O <path>/openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-sysypgrade.bin [email protected]:/tmp/ use sysupgrade to flash the image to nand: sysupgrade -n -v /tmp/openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-sysupgrade.bin Continue with step 5. 4. Optionally install on alternate partition. From Openwrt: mtd -r -e rootfs_1 -n write openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi rootfs_1 Continue with step 5. 5. Setup U-boot for ability to dual boot signed (stock) and non-signed (Openwrt) images with auto-detection. From U-boot, run (be aware: copy line by line): setenv setnandbootargs 'setenv bootargs init=/sbin/init ubi.mtd=rootfs rootfstype=squashfs rootwait' setenv nandinitcmd 'setenv mtdids nand0=nand0; run setrootfscmd; ubi part rootfs 2048' setenv setrootfscmd 'if test $boot_part = 1; then setenv mtdparts mtdparts=nand0:0x${imgsize}@0x${prikern}(rootfs); else setenv mtdparts mtdparts=nand0:0x${imgsize}@0x${altkern}(rootfs); fi' setenv readhdr1cmd 'ubi read $loadaddr kernel 0x40; setexpr IMGOFF $loadaddr + 0x10; setexpr CODEOFF $loadaddr + 0x14; setexpr SIGOFF $loadaddr + 0x1c; setexpr CERTOFF $loadaddr + 0x24' setenv readhdr2cmd 'setexpr.l HDR *$loadaddr; setexpr.l IMGSZ *$IMGOFF; setexpr.l CODESZ *$CODEOFF; setexpr.l SIGSZ *$SIGOFF; setexpr.l CERTSZ *$CERTOFF; setexpr TSIZE $CODESZ + $SIGSZ; setexpr TSIZE $TSIZE + $CERTSZ' setenv testmbncmd 'if test $HDR -ne edfe0dd0 -a $IMGSZ -eq $TSIZE; then bootipq; else ubi read $loadaddr kernel $kernsize; run setnandbootargs; bootm $loadaddr; fi' setenv bootcmd2 'if test $auto_recovery = no; then bootipq; else run nandinitcmd; run readhdr1cmd; run readhdr2cmd; run testmbncmd; fi' setenv bootcmd 'run bootcmd2' saveenv 6. Back to the OEM firmware. Download firmware from OEM website: MX6200: https://support.linksys.com/kb/article/408-en/ From serial/SSH, in Openwrt, flash OEM firmware to alternate partition: mtd -r -e rootfs_1 -n write FW_MX6200_1.0.11.216041_prod.signed.img rootfs_1 Switching active partition: 1. From U-boot, executive the following to switch to partition 1: setenv boot_part 1 for partition 2: setenv boot_part 2 2. From Openwrt: fw_printenv boot_part In case it's 1: fw_setenv boot_part 2 . /lib/upgrade/platform.sh linksys_bootconfig_set_primaryboot "0:bootconfig" 1 linksys_bootconfig_set_primaryboot "0:bootconfig1" 1 In case it's 2: fw_setenv boot_part 1 . /lib/upgrade/platform.sh linksys_bootconfig_set_primaryboot "0:bootconfig" 0 linksys_bootconfig_set_primaryboot "0:bootconfig1" 0 and reboot Signed-off-by: George Moussalem <[email protected]> Link: openwrt/openwrt#21038 Signed-off-by: Robert Marko <[email protected]>
1 parent 7d68582 commit d992d95

File tree

9 files changed

+182
-0
lines changed

9 files changed

+182
-0
lines changed

package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ glinet,gl-b3000)
1919
linksys,mr5500|\
2020
linksys,mx2000|\
2121
linksys,mx5500|\
22+
linksys,mx6200|\
2223
linksys,spnmx56)
2324
ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x20000"
2425
;;

package/firmware/ipq-wifi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ ALLWIFIBOARDS:= \
5555
linksys_mx4200 \
5656
linksys_mx5300 \
5757
linksys_mx5500 \
58+
linksys_mx6200 \
5859
linksys_mx8500 \
5960
linksys_spnmx56 \
6061
linksys_whw03 \
@@ -235,6 +236,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx2000,Linksys MX2000))
235236
$(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
236237
$(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300))
237238
$(eval $(call generate-ipq-wifi-package,linksys_mx5500,Linksys MX5500))
239+
$(eval $(call generate-ipq-wifi-package,linksys_mx6200,Linksys MX6200))
238240
$(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500))
239241
$(eval $(call generate-ipq-wifi-package,linksys_spnmx56,Linksys SPNMX56))
240242
$(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03))
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/dts-v1/;
2+
3+
#include "ipq5018.dtsi"
4+
#include "ipq5018-mx-base.dtsi"
5+
#include "ipq5018-qcn6122.dtsi"
6+
7+
/ {
8+
model = "Linksys MX6200";
9+
compatible = "linksys,mx6200", "qcom,ipq5018";
10+
11+
chosen {
12+
bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M";
13+
stdout-path = "serial0:115200n8";
14+
};
15+
};
16+
17+
/*
18+
* =================================================================
19+
* _______________________ ____________
20+
* | IPQ5018 | | |
21+
* | +------+ +--------+ | | +--------+ |
22+
* | | MAC0 |---| GE Phy |-+--- MDI ---+ | RJ45 | +
23+
* | +------+ +--------+ | | +--------+ |
24+
* | | |____________|
25+
* | | _______________________
26+
* | | | MXL GPY115C Phy |
27+
* | +------+ +--------+ | | +--------+ +------+ |
28+
* | | MAC1 |---| Uniphy |-+-- SGMII---+ | Phy |---| RJ45 | |
29+
* | +------+ +--------+ | | +--------+ +------+ |
30+
* |_______________________| |_______________________|
31+
*
32+
* =================================================================
33+
*/
34+
35+
&switch {
36+
status = "okay";
37+
38+
switch_mac_mode = <MAC_MODE_SGMII_CHANNEL0>;
39+
40+
qcom,port_phyinfo {
41+
// MAC0 -> GE Phy -> MDI --> RJ45
42+
port@0 {
43+
port_id = <1>;
44+
mdiobus = <&mdio0>;
45+
phy_address = <7>;
46+
};
47+
48+
// MAC1 ---SGMII---> MaxLinear PHY -> RJ45
49+
port@1 {
50+
port_id = <2>;
51+
mdiobus = <&mdio1>;
52+
phy_address = <15>;
53+
port_mac_sel = "QGMAC_PORT";
54+
};
55+
};
56+
};
57+
58+
// MAC0 ---MDI---> IPQ5018 GE PHY
59+
&dp1 {
60+
status = "okay";
61+
62+
label = "lan";
63+
phy-handle = <&ge_phy>;
64+
nvmem-cells = <&hw_mac_addr 1>;
65+
nvmem-cell-names = "mac-address";
66+
};
67+
68+
// MAC1 ---SGMII---> MXL Phy
69+
&dp2 {
70+
status = "okay";
71+
72+
label = "wan";
73+
phy-handle = <&gpy115c>;
74+
nvmem-cells = <&hw_mac_addr 0>;
75+
nvmem-cell-names = "mac-address";
76+
};
77+
78+
&mdio0 {
79+
status = "okay";
80+
};
81+
82+
&mdio1 {
83+
status = "okay";
84+
85+
pinctrl-0 = <&mdio1_pins>;
86+
pinctrl-names = "default";
87+
reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
88+
89+
// Maxlinear Ethernet GPY115C
90+
gpy115c: ethernet-phy@f {
91+
compatible = "ethernet-phy-id67c9.df10";
92+
reg = <15>;
93+
};
94+
};
95+
96+
&q6_region {
97+
reg = <0x0 0x4b000000 0x0 0x4d00000>;
98+
};
99+
100+
&wifi {
101+
status = "okay";
102+
103+
qcom,rproc = <&q6_wcss_pd1>;
104+
qcom,ath11k-calibration-variant = "Linksys-MX6200";
105+
qcom,ath11k-fw-memory-mode = <1>;
106+
qcom,bdf-addr = <0x4c400000>;
107+
};
108+
109+
&wifi1 {
110+
status = "okay";
111+
112+
qcom,rproc = <&q6_wcss_pd2>;
113+
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
114+
qcom,ath11k-calibration-variant = "Linksys-MX6200-5G";
115+
qcom,ath11k-fw-memory-mode = <1>;
116+
qcom,m3-dump-addr = <0x4df00000>;
117+
};
118+
119+
&wifi2 {
120+
status = "okay";
121+
122+
qcom,rproc = <&q6_wcss_pd3>;
123+
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
124+
qcom,ath11k-calibration-variant = "Linksys-MX6200-6G";
125+
qcom,ath11k-fw-memory-mode = <1>;
126+
qcom,bdf-addr = <0x4e500000>;
127+
qcom,m3-dump-addr = <0x4f200000>;
128+
};

target/linux/qualcommax/image/ipq50xx.mk

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ define Device/linksys_mx5500
136136
endef
137137
TARGET_DEVICES += linksys_mx5500
138138

139+
define Device/linksys_mx6200
140+
$(call Device/FitImage)
141+
$(call Device/UbiFit)
142+
DEVICE_VENDOR := Linksys
143+
DEVICE_MODEL := MX6200
144+
BLOCKSIZE := 128k
145+
PAGESIZE := 2048
146+
DEVICE_DTS_CONFIG := [email protected]
147+
KERNEL_SIZE := 8192k
148+
IMAGE_SIZE := 51200k
149+
NAND_SIZE := 256m
150+
SOC := ipq5018
151+
IMAGE/factory.ubi := append-ubi | linksys-image type=$$$$(DEVICE_MODEL)
152+
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
153+
ipq-wifi-linksys_mx6200
154+
endef
155+
TARGET_DEVICES += linksys_mx6200
156+
139157
define Device/linksys_spnmx56
140158
$(call Device/linksys_ipq50xx_mx_base)
141159
DEVICE_MODEL := SPNMX56

target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ipq50xx_setup_interfaces()
2222
xiaomi,ax6000)
2323
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
2424
;;
25+
linksys,mx6200|\
2526
yuncore,ax830|\
2627
yuncore,ax850)
2728
ucidef_set_interfaces_lan_wan "lan" "wan"

target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ case "$FIRMWARE" in
3131
ath11k_remove_regdomain
3232
ath11k_set_macflag
3333
;;
34+
linksys,mx6200)
35+
caldata_extract "0:art" 0x1000 0x20000
36+
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
37+
ath11k_patch_mac $(macaddr_add $label_mac 2) 0
38+
ath11k_remove_regdomain
39+
ath11k_set_macflag
40+
;;
3441
xiaomi,ax6000)
3542
caldata_extract "0:art" 0x1000 0x20000
3643
;;
@@ -65,6 +72,13 @@ case "$FIRMWARE" in
6572
ath11k_remove_regdomain
6673
ath11k_set_macflag
6774
;;
75+
linksys,mx6200)
76+
caldata_extract "0:art" 0x26800 0x20000
77+
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
78+
ath11k_patch_mac $(macaddr_add $label_mac 3) 0
79+
ath11k_remove_regdomain
80+
ath11k_set_macflag
81+
;;
6882
yuncore,ax830)
6983
caldata_extract "0:ART" 0x4c000 0x20000
7084
label_mac=$(mtd_get_mac_binary 0:ART 0)
@@ -74,6 +88,17 @@ case "$FIRMWARE" in
7488
;;
7589
esac
7690
;;
91+
"ath11k/QCN6122/hw1.0/cal-ahb-b00b040.wifi.bin")
92+
case "$board" in
93+
linksys,mx6200)
94+
caldata_extract "0:art" 0x4c000 0x20000
95+
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
96+
ath11k_patch_mac $(macaddr_add $label_mac 4) 0
97+
ath11k_remove_regdomain
98+
ath11k_set_macflag
99+
;;
100+
esac
101+
;;
77102
"ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin")
78103
case "$board" in
79104
linksys,mr5500|\

target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ boot() {
77
linksys,mr5500|\
88
linksys,mx2000|\
99
linksys,mx5500|\
10+
linksys,mx6200|\
1011
linksys,spnmx56)
1112
mtd resetbc s_env || true
1213
;;

target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ platform_do_upgrade() {
206206
remove_oem_ubi_volume squashfs
207207
nand_do_upgrade "$1"
208208
;;
209+
linksys,mx6200)
210+
linksys_bootconfig_pre_upgrade "$1"
211+
remove_oem_ubi_volume ubi_rootfs
212+
nand_do_upgrade "$1"
213+
;;
209214
xiaomi,ax6000)
210215
# Make sure that UART is enabled
211216
fw_setenv boot_wait on

target/linux/qualcommax/ipq50xx/config-default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CONFIG_GRO_CELLS=y
44
CONFIG_IPQ_CMN_PLL=y
55
CONFIG_IPQ_GCC_5018=y
66
CONFIG_LEDS_PWM=y
7+
CONFIG_MAXLINEAR_GPHY=y
78
CONFIG_MTD_SPI_NAND=y
89
CONFIG_NET_DEVLINK=y
910
CONFIG_NET_DSA=y

0 commit comments

Comments
 (0)