diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index d79d1a9ab43893..1d21e058e1a94f 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -34,6 +34,7 @@ ALLWIFIBOARDS:= \ buffalo_wxr-5950ax12 \ cmcc_rax3000q \ compex_wpq873 \ + dptech_ap3000-2c \ dynalink_dl-wrx36 \ edgecore_eap102 \ edimax_cax1800 \ @@ -170,6 +171,7 @@ $(eval $(call generate-ipq-wifi-package,arcadyan_aw1000,Arcadyan AW1000)) $(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12)) $(eval $(call generate-ipq-wifi-package,cmcc_rax3000q,CMCC RAX3000Q)) $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873)) +$(eval $(call generate-ipq-wifi-package,dptech_ap3000-2c,DPtech AP3000-2C)) $(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)) diff --git a/package/firmware/ipq-wifi/src/board-dptech_ap3000-2c.ipq6018 b/package/firmware/ipq-wifi/src/board-dptech_ap3000-2c.ipq6018 new file mode 100644 index 00000000000000..9857d4599a824f Binary files /dev/null and b/package/firmware/ipq-wifi/src/board-dptech_ap3000-2c.ipq6018 differ diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-ap3000-2c.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-ap3000-2c.dts new file mode 100644 index 00000000000000..ff232e581231c2 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-ap3000-2c.dts @@ -0,0 +1,375 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq6018-512m.dtsi" +#include "ipq6018-ess.dtsi" +#include "ipq6018-mp5496.dtsi" +#include "ipq6018-nss.dtsi" + +#include +#include +#include + +/ { + model = "DPtech AP3000-2C"; + compatible = "dptech,ap3000-2c", "qcom,ipq6018"; + + aliases { + serial0 = &blsp1_uart3; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &dp4; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + led_power: power { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1radio"; + }; + + wlan5g { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0radio"; + }; + }; +}; + +&tlmm { + button_pins: button_pinmux { + pins = "gpio9"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + + led_pins: led_pinmux { + pins = "gpio23", "gpio37", "gpio55"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio_pins: mdio_pinmux { + mdc { + pins = "gpio64"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio65"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + spi_pins: spi_pinmux { + pins = "gpio38", "gpio39", "gpio40", "gpio41"; + function = "blsp0_spi"; + drive-strength = <8>; + bias-pull-down; + }; +}; + +&blsp1_uart3 { + status = "okay"; + + pinctrl-0 = <&serial_3_pins>; + pinctrl-names = "default"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:sbl1"; + reg = <0x0 0xc0000>; + read-only; + }; + + partition@c0000 { + label = "0:mibib"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:bootconfig"; + reg = <0xd0000 0x20000>; + }; + + partition@f0000 { + label = "0:bootconfig1"; + reg = <0xf0000 0x20000>; + }; + + partition@110000 { + label = "0:qsee"; + reg = <0x110000 0x1a0000>; + read-only; + }; + + partition@2b0000 { + label = "0:qsee_1"; + reg = <0x2b0000 0x1a0000>; + read-only; + }; + + partition@450000 { + label = "0:devcfg"; + reg = <0x450000 0x10000>; + read-only; + }; + + partition@460000 { + label = "0:devcfg_1"; + reg = <0x460000 0x10000>; + read-only; + }; + + partition@470000 { + label = "0:rpm"; + reg = <0x470000 0x40000>; + read-only; + }; + + partition@4b0000 { + label = "0:rpm_1"; + reg = <0x4b0000 0x40000>; + read-only; + }; + + partition@4f0000 { + label = "0:cdt"; + reg = <0x4f0000 0x10000>; + read-only; + }; + + partition@500000 { + label = "0:cdt_1"; + reg = <0x500000 0x10000>; + read-only; + }; + + partition@510000 { + compatible = "u-boot,env"; + label = "0:appsblenv"; + reg = <0x510000 0x10000>; + }; + + partition@520000 { + label = "0:appsbl"; + reg = <0x520000 0xa0000>; + read-only; + }; + + partition@5c0000 { + label = "0:appsbl_1"; + reg = <0x5c0000 0xa0000>; + read-only; + }; + + partition@660000 { + label = "0:art"; + reg = <0x660000 0x40000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + partitions { + status = "disabled"; + }; + + nand@0 { + reg = <0>; + + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&usb3 { + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + + qca8075_2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; + + 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 { + status = "okay"; + + switch_cpu_bmp = <0x1>; + switch_lan_bmp = <0x1e>; + switch_wan_bmp = <0x20>; + switch_inner_bmp = <0xc0>; + switch_mac_mode = <0x0>; + switch_mac_mode1 = <0xff>; + switch_mac_mode2 = <0xff>; + bm_tick_mode = <0x00>; + tm_tick_mode = <0x00>; + + qcom,port_phyinfo { + port@2 { + port_id = <3>; + phy_address = <2>; + }; + port@3 { + port_id = <4>; + phy_address = <3>; + }; + port@4 { + port_id = <5>; + phy_address = <4>; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp3 { + status = "okay"; + + label = "wan"; + phy-handle = <&qca8075_2>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&dp4 { + status = "okay"; + + label = "lan1"; + phy-handle = <&qca8075_3>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&dp5 { + status = "okay"; + + label = "lan2"; + phy-handle = <&qca8075_4>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "DPtech-AP3000-2C"; + qcom,ath11k-fw-memory-mode = <1>; +}; diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index f6364081443bc0..940260191f6743 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -17,6 +17,19 @@ define Device/cmiot_ax18 endef TARGET_DEVICES += cmiot_ax18 +define Device/dptech_ap3000-2c + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := DPtech + DEVICE_MODEL := AP3000-2C + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := ipq6000 + DEVICE_DTS_CONFIG := config@cp03-c1-DP019 + DEVICE_PACKAGES := ipq-wifi-dptech_ap3000-2c +endef +TARGET_DEVICES += dptech_ap3000-2c + define Device/glinet_gl-common $(call Device/FitImage) $(call Device/UbiFit) 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 348437b8456423..6fe000b138bc10 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 @@ -19,14 +19,15 @@ ipq60xx_setup_interfaces() xiaomi,rm1800) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; + dptech,ap3000-2c|\ + glinet,gl-axt1800) + ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" + ;; glinet,gl-ax1800|\ jdcloud,re-cs-02|\ linksys,mr7350) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; - glinet,gl-axt1800) - ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" - ;; *) echo "Unsupported hardware. Network interfaces not initialized" ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index b82946cdc55338..17eef37ebb8c2c 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -9,6 +9,7 @@ board=$(board_name) case "$FIRMWARE" in "ath11k/IPQ6018/hw1.0/cal-ahb-c000000.wifi.bin") case "$board" in + dptech,ap3000-2c|\ glinet,gl-ax1800|\ glinet,gl-axt1800|\ linksys,mr7350|\ diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index b2180e9f6c0993..6fdee5183b81d3 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -10,6 +10,10 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case "$board" in + dptech,ap3000-2c) + [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 1 > /sys${DEVPATH}/macaddress + ;; glinet,gl-ax1800|\ glinet,gl-axt1800) [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress