diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx index d4169fa663..d8542a9aac 100644 --- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx +++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx @@ -19,6 +19,7 @@ glinet,gl-b3000) linksys,mr5500|\ linksys,mx2000|\ linksys,mx5500|\ +linksys,mx6200|\ linksys,spnmx56) ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x20000" ;; diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 1106de7fc4..a1a3e6a798 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -55,6 +55,7 @@ ALLWIFIBOARDS:= \ linksys_mx4200 \ linksys_mx5300 \ linksys_mx5500 \ + linksys_mx6200 \ linksys_mx8500 \ linksys_spnmx56 \ linksys_whw03 \ @@ -235,6 +236,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx2000,Linksys MX2000)) $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) $(eval $(call generate-ipq-wifi-package,linksys_mx5500,Linksys MX5500)) +$(eval $(call generate-ipq-wifi-package,linksys_mx6200,Linksys MX6200)) $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500)) $(eval $(call generate-ipq-wifi-package,linksys_spnmx56,Linksys SPNMX56)) $(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts new file mode 100644 index 0000000000..250fe39075 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts @@ -0,0 +1,128 @@ +/dts-v1/; + +#include "ipq5018.dtsi" +#include "ipq5018-mx-base.dtsi" +#include "ipq5018-qcn6122.dtsi" + +/ { + model = "Linksys MX6200"; + compatible = "linksys,mx6200", "qcom,ipq5018"; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M"; + stdout-path = "serial0:115200n8"; + }; +}; + +/* +* ================================================================= +* _______________________ ____________ +* | IPQ5018 | | | +* | +------+ +--------+ | | +--------+ | +* | | MAC0 |---| GE Phy |-+--- MDI ---+ | RJ45 | + +* | +------+ +--------+ | | +--------+ | +* | | |____________| +* | | _______________________ +* | | | MXL GPY115C Phy | +* | +------+ +--------+ | | +--------+ +------+ | +* | | MAC1 |---| Uniphy |-+-- SGMII---+ | Phy |---| RJ45 | | +* | +------+ +--------+ | | +--------+ +------+ | +* |_______________________| |_______________________| +* +* ================================================================= + */ + +&switch { + status = "okay"; + + switch_mac_mode = ; + + qcom,port_phyinfo { + // MAC0 -> GE Phy -> MDI --> RJ45 + port@0 { + port_id = <1>; + mdiobus = <&mdio0>; + phy_address = <7>; + }; + + // MAC1 ---SGMII---> MaxLinear PHY -> RJ45 + port@1 { + port_id = <2>; + mdiobus = <&mdio1>; + phy_address = <15>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +// MAC0 ---MDI---> IPQ5018 GE PHY +&dp1 { + status = "okay"; + + label = "lan"; + phy-handle = <&ge_phy>; + nvmem-cells = <&hw_mac_addr 1>; + nvmem-cell-names = "mac-address"; +}; + +// MAC1 ---SGMII---> MXL Phy +&dp2 { + status = "okay"; + + label = "wan"; + phy-handle = <&gpy115c>; + nvmem-cells = <&hw_mac_addr 0>; + nvmem-cell-names = "mac-address"; +}; + +&mdio0 { + status = "okay"; +}; + +&mdio1 { + status = "okay"; + + pinctrl-0 = <&mdio1_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>; + + // Maxlinear Ethernet GPY115C + gpy115c: ethernet-phy@f { + compatible = "ethernet-phy-id67c9.df10"; + reg = <15>; + }; +}; + +&q6_region { + reg = <0x0 0x4b000000 0x0 0x4d00000>; +}; + +&wifi { + status = "okay"; + + qcom,rproc = <&q6_wcss_pd1>; + qcom,ath11k-calibration-variant = "Linksys-MX6200"; + qcom,ath11k-fw-memory-mode = <1>; + qcom,bdf-addr = <0x4c400000>; +}; + +&wifi1 { + status = "okay"; + + qcom,rproc = <&q6_wcss_pd2>; + qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; + qcom,ath11k-calibration-variant = "Linksys-MX6200-5G"; + qcom,ath11k-fw-memory-mode = <1>; + qcom,m3-dump-addr = <0x4df00000>; +}; + +&wifi2 { + status = "okay"; + + qcom,rproc = <&q6_wcss_pd3>; + qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; + qcom,ath11k-calibration-variant = "Linksys-MX6200-6G"; + qcom,ath11k-fw-memory-mode = <1>; + qcom,bdf-addr = <0x4e500000>; + qcom,m3-dump-addr = <0x4f200000>; +}; diff --git a/target/linux/qualcommax/image/ipq50xx.mk b/target/linux/qualcommax/image/ipq50xx.mk index 6a6a50d6f7..be247c7df9 100644 --- a/target/linux/qualcommax/image/ipq50xx.mk +++ b/target/linux/qualcommax/image/ipq50xx.mk @@ -136,6 +136,24 @@ define Device/linksys_mx5500 endef TARGET_DEVICES += linksys_mx5500 +define Device/linksys_mx6200 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := MX6200 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@mp03.5-c1 + KERNEL_SIZE := 8192k + IMAGE_SIZE := 51200k + NAND_SIZE := 256m + SOC := ipq5018 + IMAGE/factory.ubi := append-ubi | linksys-image type=$$$$(DEVICE_MODEL) + DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \ + ipq-wifi-linksys_mx6200 +endef +TARGET_DEVICES += linksys_mx6200 + define Device/linksys_spnmx56 $(call Device/linksys_ipq50xx_mx_base) DEVICE_MODEL := SPNMX56 diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network index 05bed90e27..4bcd7dd5df 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network @@ -22,6 +22,7 @@ ipq50xx_setup_interfaces() xiaomi,ax6000) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; + linksys,mx6200|\ yuncore,ax830|\ yuncore,ax850) ucidef_set_interfaces_lan_wan "lan" "wan" diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 6cd00bf53c..cf48022aea 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -31,6 +31,13 @@ case "$FIRMWARE" in ath11k_remove_regdomain ath11k_set_macflag ;; + linksys,mx6200) + caldata_extract "0:art" 0x1000 0x20000 + label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) + ath11k_patch_mac $(macaddr_add $label_mac 2) 0 + ath11k_remove_regdomain + ath11k_set_macflag + ;; xiaomi,ax6000) caldata_extract "0:art" 0x1000 0x20000 ;; @@ -65,6 +72,13 @@ case "$FIRMWARE" in ath11k_remove_regdomain ath11k_set_macflag ;; + linksys,mx6200) + caldata_extract "0:art" 0x26800 0x20000 + label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) + ath11k_patch_mac $(macaddr_add $label_mac 3) 0 + ath11k_remove_regdomain + ath11k_set_macflag + ;; yuncore,ax830) caldata_extract "0:ART" 0x4c000 0x20000 label_mac=$(mtd_get_mac_binary 0:ART 0) @@ -74,6 +88,17 @@ case "$FIRMWARE" in ;; esac ;; +"ath11k/QCN6122/hw1.0/cal-ahb-b00b040.wifi.bin") + case "$board" in + linksys,mx6200) + caldata_extract "0:art" 0x4c000 0x20000 + label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) + ath11k_patch_mac $(macaddr_add $label_mac 4) 0 + ath11k_remove_regdomain + ath11k_set_macflag + ;; + esac + ;; "ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin") case "$board" in linksys,mr5500|\ diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount index 0e573a1407..efde13d43a 100755 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount @@ -7,6 +7,7 @@ boot() { linksys,mr5500|\ linksys,mx2000|\ linksys,mx5500|\ + linksys,mx6200|\ linksys,spnmx56) mtd resetbc s_env || true ;; diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh index bbc6d8eb7f..24bacdb6b8 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh @@ -206,6 +206,11 @@ platform_do_upgrade() { remove_oem_ubi_volume squashfs nand_do_upgrade "$1" ;; + linksys,mx6200) + linksys_bootconfig_pre_upgrade "$1" + remove_oem_ubi_volume ubi_rootfs + nand_do_upgrade "$1" + ;; xiaomi,ax6000) # Make sure that UART is enabled fw_setenv boot_wait on diff --git a/target/linux/qualcommax/ipq50xx/config-default b/target/linux/qualcommax/ipq50xx/config-default index 97a342776a..33e5611af4 100644 --- a/target/linux/qualcommax/ipq50xx/config-default +++ b/target/linux/qualcommax/ipq50xx/config-default @@ -4,6 +4,7 @@ CONFIG_GRO_CELLS=y CONFIG_IPQ_CMN_PLL=y CONFIG_IPQ_GCC_5018=y CONFIG_LEDS_PWM=y +CONFIG_MAXLINEAR_GPHY=y CONFIG_MTD_SPI_NAND=y CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y