From fb61f3353ee048d4f739564ee726aed3a9784562 Mon Sep 17 00:00:00 2001 From: JiaY-shi Date: Sat, 17 Jun 2023 17:03:04 +0800 Subject: [PATCH] QualcommAX: ipq60xx: add support for GL.iNet gl-ax1800 and gl-axt1800 --- .../uboot-envtools/files/qualcommax_ipq60xx | 2 + package/firmware/ipq-wifi/Makefile | 4 + .../arm64/boot/dts/qcom/ipq6000-gl-ax1800.dts | 70 ++++ .../boot/dts/qcom/ipq6000-gl-axt1800.dts | 130 +++++++ .../arm64/boot/dts/qcom/ipq6000-glinet.dtsi | 347 ++++++++++++++++++ target/linux/qualcommax/image/ipq60xx.mk | 29 +- .../ipq60xx/base-files/etc/board.d/02_network | 6 + .../etc/hotplug.d/firmware/11-ath11-caldata | 2 + .../base-files/lib/upgrade/platform.sh | 2 + 9 files changed, 591 insertions(+), 1 deletion(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-ax1800.dts create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-axt1800.dts create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-glinet.dtsi diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq60xx b/package/boot/uboot-envtools/files/qualcommax_ipq60xx index 853037b77609d7..ea9e30337828e5 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq60xx +++ b/package/boot/uboot-envtools/files/qualcommax_ipq60xx @@ -15,6 +15,8 @@ cambiumnetworks,xe3-4) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" ;; +glinet,gl-ax1800|\ +glinet,gl-axt1800|\ netgear,wax214) idx="$(find_mtd_index 0:appsblenv)" [ -n "$idx" ] && \ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 1c95983964f4a3..f45bee40bbb284 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -37,6 +37,8 @@ ALLWIFIBOARDS:= \ dynalink_dl-wrx36 \ edgecore_eap102 \ edimax_cax1800 \ + glinet_gl-ax1800 \ + glinet_gl-axt1800 \ linksys_mx4200 \ linksys_mx5300 \ linksys_mx8500 \ @@ -163,6 +165,8 @@ $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873)) $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36)) $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102)) $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) +$(eval $(call generate-ipq-wifi-package,glinet_gl-ax1800,GL.iNet GL-AX1800)) +$(eval $(call generate-ipq-wifi-package,glinet_gl-axt1800,GL.iNet GL-AXT1800)) $(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_mx8500,Linksys MX8500)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-ax1800.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-ax1800.dts new file mode 100644 index 00000000000000..7e31dd03744050 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-ax1800.dts @@ -0,0 +1,70 @@ +/dts-v1/; +/* + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ipq6000-glinet.dtsi" + +/ { + model = "GL Technologies, Inc. AX1800"; + compatible = "glinet,gl-ax1800", "qcom,ipq6018", "qcom,ipq6018-cp03"; + + aliases { + ethernet3 = &dp4; + ethernet4 = &dp5; + }; +}; + +ðernet_0 { + qca8075_3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + }; + + qca8075_4: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + }; +}; + +&switch { + switch_lan_bmp = <(ESS_PORT2|ESS_PORT3|ESS_PORT4|ESS_PORT5)>; /* lan port bitmap */ + + qcom,port_phyinfo { + port@3 { + port_id = <4>; + phy_address = <3>; + }; + port@4 { + port_id = <5>; + phy_address = <4>; + }; + }; +}; + +&dp4 { + phy-handle = <&qca8075_3>; + status = "okay"; +}; + +&dp5 { + phy-handle = <&qca8075_4>; + phy-mode = "psgmii"; + status = "okay"; +}; + +&wifi { + qcom,ath11k-calibration-variant = "GL-iNet-GL-AX1800"; +}; \ No newline at end of file diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-axt1800.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-axt1800.dts new file mode 100644 index 00000000000000..b319e5e74e2b18 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-gl-axt1800.dts @@ -0,0 +1,130 @@ +/dts-v1/; +/* + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ipq6000-glinet.dtsi" + +/ { + model = "GL Technologies, Inc. AXT1800"; + compatible = "glinet,gl-axt1800", "qcom,ipq6018", "qcom,ipq6018-cp03"; + + aliases { + sdhc0 = &sdhc_1; + }; + + V30:V30 { + compatible = "regulator-fixed"; + regulator-name = "vmmc-supply"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + }; + + V18:V18 { + compatible = "regulator-fixed"; + regulator-name = "vqmmc-supply"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; +}; + + +&tlmm { + + sd_pins: sd_pins { + sd { + pins = "gpio62"; + function = "sd_card"; + bias-pull-up; + }; + ldo { + pins = "gpio66"; + function = "gpio"; + bias-pull-up; + }; + }; + + pwm_pins: pwm_pinmux { + pwm { + pins = "gpio30"; + function = "pwm13"; + drive-strength = <8>; + }; + }; + + fan_pins: fan_pins { + pwr { + pins = "gpio29"; + function = "gpio"; + bias-pull-up; + output-high; + }; + speed { + pins = "gpio31"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; +}; + +&soc { + fan0: pwm-fan { + compatible = "pwm-fan"; + pinctrl-0 = <&fan_pins>; + pinctrl-names = "default"; + cooling-min-state = <0>; + cooling-max-state = <255>; + #cooling-cells = <2>; + pwms = <&pwm 1 40000 0>; + cooling-levels = <0 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 + 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 37 38 39 + 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 + 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 + 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 + 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 + 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 + 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 + 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 + 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255>; + }; + +}; + + +&pwm{ + pinctrl-0 = <&pwm_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&sdhc_1 { + pinctrl-0 = <&sd_pins>; + pinctrl-names = "default"; + cd-gpios = <&tlmm 62 1>; + sd-ldo-gpios = <&tlmm 66 1>; + vqmmc-supply = <&V18>; + vmmc-supply = <&V30>; + status = "okay"; +}; + +&wifi { + qcom,ath11k-calibration-variant = "GL-iNet-GL-AXT1800"; +}; \ No newline at end of file diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-glinet.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-glinet.dtsi new file mode 100644 index 00000000000000..e1a4dfdb3863fd --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-glinet.dtsi @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ipq6018.dtsi" +#include "ipq6018-ess.dtsi" +#include "ipq6018-512m.dtsi" + + +#include +#include +#include + +/ { + aliases { + ethernet0 = &dp1; + ethernet1 = &dp2; + ethernet2 = &dp3; + label-mac-device = &dp1; + serial0 = &blsp1_uart3; + led-boot = &led_system_white; + led-failsafe = &led_system_white; + led-running = &led_system_white; + led-upgrade = &led_system_white; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + switch { + label = "switch"; + gpios = <&tlmm 9 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system_white: system-white { + label = "white:system"; + gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led_system_blue: system-blue { + label = "blue:system"; + gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; + color = ; + }; + }; +}; + +&tlmm { + gpio-reserved-ranges = <20 1>; + + spi_1_pins: spi_1_pins { + mux { + pins = "gpio38", "gpio39", "gpio40", "gpio41"; + function = "blsp0_spi"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + button_pins: button_pins { + switch_button { + pins = "gpio9"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + reset_button { + pins = "gpio18"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + mdio_pins: mdio-pins { + mdc { + pins = "gpio64"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio65"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + + mux_2 { + pins = "gpio74"; + function = "gpio"; + bias-pull-up; + }; + }; + + usb_power_pins: usb_power_pins { + mux { + pins = "gpio0"; + function = "gpio"; + bias-pull-up; + output-high; + }; + }; + + leds_pins: leds_pins { + white { + pins = "gpio35"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + blue { + pins = "gpio37"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + i2c_1_pins: i2c_1_pins { + mux { + pins = "gpio42", "gpio43"; + function = "blsp2_i2c"; + drive-strength = <8>; + bias-pull-down; + }; + }; +}; + +&blsp1_uart3 { + pinctrl-0 = <&serial_3_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_1_pins>; + pinctrl-names = "default"; + cs-select = <0>; + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + compatible = "n25q128a11"; + linux,modalias = "m25p80", "n25q128a11"; + spi-max-frequency = <50000000>; + use-default-sizes; + }; +}; + +&blsp1_i2c3 { + pinctrl-0 = <&i2c_1_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&qusb_phy_1 { + status = "okay"; +}; + + +&ssphy_0 { + status = "okay"; +}; + +&usb3 { + pinctrl-0 = <&usb_power_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&usb2 { + status = "okay"; +}; + +&edma { + status = "okay"; +}; + +&rpm { + status = "disabled"; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 74 GPIO_ACTIVE_LOW>; + + ethernet_0: ethernet-phy-package@0 { + compatible = "qcom,qca8075-package"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + qcom,package-mode = "psgmii"; + + qca8075_0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + + qca8075_1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + + qca8075_2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = <(ESS_PORT2|ESS_PORT3)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode = ; + + qcom,port_phyinfo { + port@0 { + port_id = <1>; + phy_address = <0>; + }; + port@1 { + port_id = <2>; + phy_address = <1>; + }; + port@2 { + port_id = <3>; + phy_address = <2>; + }; + }; +}; + +&dp1{ + phy-handle = <&qca8075_0>; + status = "okay"; +}; + +&dp2{ + phy-handle = <&qca8075_1>; + status = "okay"; +}; + +&dp3{ + phy-handle = <&qca8075_2>; + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + + +&wifi { + status = "okay"; + + qcom,ath11k-fw-memory-mode = <1>; + }; + + +&CPU0 { + /delete-property/ cpu-supply; +}; + +&CPU1 { + /delete-property/ cpu-supply; +}; + +&CPU2 { + /delete-property/ cpu-supply; +}; + +&CPU3 { + /delete-property/ cpu-supply; +}; \ No newline at end of file diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index 41cfd164ee7d46..f8f9fdb61d5686 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -24,6 +24,34 @@ define Device/cambiumnetworks_xe3-4 endef TARGET_DEVICES += cambiumnetworks_xe3-4 +define Device/glinet_gl-ax1800 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL-iNet + DEVICE_MODEL := GL-AX1800 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@cp03-c1 + SOC := ipq6000 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-ax1800 e2fsprogs dosfstools kmod-fs-ext4 kmod-fs-ntfs kmod-fs-vfat \ + kmod-fs-exfat block-mount kmod-usb-storage kmod-usb2 fdisk +endef +TARGET_DEVICES += glinet_gl-ax1800 + +define Device/glinet_gl-axt1800 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL-iNet + DEVICE_MODEL := GL-AXT1800 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@cp03-c1 + SOC := ipq6000 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-axt1800 kmod-hwmon-core e2fsprogs dosfstools kmod-fs-ext4 kmod-fs-ntfs kmod-fs-vfat \ + kmod-fs-exfat kmod-hwmon-pwmfan block-mount kmod-usb-storage kmod-usb2 fdisk +endef +TARGET_DEVICES += glinet_gl-axt1800 + define Device/netgear_wax214 $(call Device/FitImage) $(call Device/UbiFit) @@ -51,4 +79,3 @@ define Device/yuncore_fap650 IMAGE/factory.ubin := append-ubi | qsdk-ipq-factory-nand endef TARGET_DEVICES += yuncore_fap650 - diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network index 86d55de7b8dd17..4e8dac2b5e64d4 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network @@ -17,6 +17,12 @@ ipq60xx_setup_interfaces() cambiumnetworks,xe3-4) ucidef_set_interface_lan "lan1 lan2" "dhcp" ;; + glinet,gl-ax1800) + ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4" "eth0" + ;; + glinet,gl-axt1800) + ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" + ;; netgear,wax214) ucidef_set_interfaces_lan_wan "lan" ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata index cc2de7514e8879..41329ba80c4385 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata @@ -15,6 +15,8 @@ case "$FIRMWARE" in cambiumnetworks,xe3-4) caldata_extract "0:ART" 0x1000 0x10000 ;; + glinet,gl-ax1800|\ + glinet,gl-axt1800|\ netgear,wax214) caldata_extract "0:art" 0x1000 0x10000 ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh index cbc6292978bf2d..fc0ebd69412bc3 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh @@ -37,6 +37,8 @@ platform_do_upgrade() { fw_setenv bootcount 0 nand_do_upgrade "$1" ;; + glinet,gl-axt1800|\ + glinet,gl-ax1800|\ netgear,wax214) nand_do_upgrade "$1" ;;