[openwrt/openwrt] ipq807x: add support for Zbtlink ZBT-Z800AX
LEDE Commits
lede-commits at lists.infradead.org
Wed Apr 17 03:09:03 PDT 2024
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9cef2bc224b9bda19a8a79df6d1de9560c081ce2
commit 9cef2bc224b9bda19a8a79df6d1de9560c081ce2
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Tue Mar 26 23:16:05 2024 +0800
ipq807x: add support for Zbtlink ZBT-Z800AX
Hardware specifications:
SoC: Qualcomm IPQ8072A
RAM: 1GB of DDR4 600MHz
Flash1: Winbond W25Q64DW 8MB
Flash2: MX30UF2G28AD 256MB
WiFi1: QCN5024 2.4GHz AX 4x4
WiFi2: QCN5054 5GHz AX 4x4
Ethernet: 5x 1G RJ45 port
USB: 2x USB 3.0 (1x M.2)
Button: Reset, WPS
Flash instructions:
Upload factory.bin in stock firmware's
upgrade page, do not preserve settings.
Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
---
package/firmware/ipq-wifi/Makefile | 2 +
.../arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts | 454 +++++++++++++++++++++
target/linux/qualcommax/image/ipq807x.mk | 15 +
.../ipq807x/base-files/etc/board.d/01_leds | 3 +
.../ipq807x/base-files/etc/board.d/02_network | 3 +-
.../etc/hotplug.d/firmware/11-ath11k-caldata | 1 +
.../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 4 +
.../ipq807x/base-files/lib/upgrade/platform.sh | 3 +-
8 files changed, 483 insertions(+), 2 deletions(-)
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 5d4d4aafb0..41c772c967 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -52,6 +52,7 @@ ALLWIFIBOARDS:= \
yyets_le1 \
yuncore_ax880 \
yuncore_fap650 \
+ zbtlink_zbt-z800ax \
zte_mf269 \
zte_mf287 \
zte_mf287plus \
@@ -170,6 +171,7 @@ $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
$(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1))
$(eval $(call generate-ipq-wifi-package,yuncore_ax880,Yuncore AX880))
$(eval $(call generate-ipq-wifi-package,yuncore_fap650,Yuncore FAP650))
+$(eval $(call generate-ipq-wifi-package,zbtlink_zbt-z800ax,Zbtlink ZBT-Z800AX))
$(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269))
$(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287))
$(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus))
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts
new file mode 100644
index 0000000000..c352b72567
--- /dev/null
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-zbt-z800ax.dts
@@ -0,0 +1,454 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "Zbtlink ZBT-Z800AX";
+ compatible = "zbtlink,zbt-z800ax", "qcom,ipq8074";
+
+ aliases {
+ led-boot = &led_net;
+ led-failsafe = &led_net;
+ led-upgrade = &led_net;
+ serial0 = &blsp1_uart5;
+ /*
+ * Aliases as required by u-boot
+ * to patch MAC addresses
+ */
+ ethernet0 = &dp1;
+ ethernet1 = &dp2;
+ ethernet2 = &dp3;
+ ethernet3 = &dp4;
+ ethernet4 = &dp5;
+ label-mac-device = &dp1;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ bootargs-append = " root=/dev/ubiblock0_1";
+ };
+
+ gpio-export {
+ compatible = "gpio-export";
+
+ lte-power {
+ gpio-export,name = "lte_power";
+ gpio-export,output = <1>;
+ gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&button_pins>;
+ pinctrl-names = "default";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
+ };
+
+ wps {
+ label = "wps";
+ linux,code = <KEY_WPS_BUTTON>;
+ gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_net: net {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_WAN_ONLINE;
+ gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
+ };
+
+ module {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_MOBILE;
+ gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
+ };
+
+ wlan2g {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_WLAN_2GHZ;
+ gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "phy1radio";
+ };
+
+ wlan5g {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_WLAN_5GHZ;
+ gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "phy0radio";
+ };
+ };
+};
+
+&tlmm {
+ button_pins: button-pins {
+ mux {
+ pins = "gpio34", "gpio46";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-pull-up;
+ };
+ };
+
+ mdio_pins: mdio-pins {
+ mdc {
+ pins = "gpio68";
+ function = "mdc";
+ drive-strength = <8>;
+ bias-pull-up;
+ };
+
+ mdio {
+ pins = "gpio69";
+ function = "mdio";
+ drive-strength = <8>;
+ bias-pull-up;
+ };
+ };
+};
+
+&blsp1_spi1 {
+ pinctrl-0 = <&spi_0_pins>;
+ pinctrl-names = "default";
+ cs-select = <0>;
+ status = "okay";
+
+ flash at 0 {
+ compatible = "jedec,spi-nor";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0>;
+ spi-max-frequency = <50000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition at 0 {
+ label = "0:sbl1";
+ reg = <0x0 0x50000>;
+ read-only;
+ };
+
+ partition at 50000 {
+ label = "0:mibib";
+ reg = <0x50000 0x10000>;
+ read-only;
+ };
+
+ partition at 60000 {
+ label = "0:bootconfig";
+ reg = <0x60000 0x20000>;
+ read-only;
+ };
+
+ partition at 80000 {
+ label = "0:bootconfig1";
+ reg = <0x80000 0x20000>;
+ read-only;
+ };
+
+ partition at a0000 {
+ label = "0:qsee";
+ reg = <0xa0000 0x180000>;
+ read-only;
+ };
+
+ partition at 220000 {
+ label = "0:qsee_1";
+ reg = <0x220000 0x180000>;
+ read-only;
+ };
+
+ partition at 3a0000 {
+ label = "0:devcfg";
+ reg = <0x3a0000 0x10000>;
+ read-only;
+ };
+
+ partition at 3b0000 {
+ label = "0:devcfg_1";
+ reg = <0x3b0000 0x10000>;
+ read-only;
+ };
+
+ partition at 3c0000 {
+ label = "0:apdp";
+ reg = <0x3c0000 0x10000>;
+ read-only;
+ };
+
+ partition at 3d0000 {
+ label = "0:apdp_1";
+ reg = <0x3d0000 0x10000>;
+ read-only;
+ };
+
+ partition at 3e0000 {
+ label = "0:rpm";
+ reg = <0x3e0000 0x40000>;
+ read-only;
+ };
+
+ partition at 420000 {
+ label = "0:rpm_1";
+ reg = <0x420000 0x40000>;
+ read-only;
+ };
+
+ partition at 460000 {
+ label = "0:cdt";
+ reg = <0x460000 0x10000>;
+ read-only;
+ };
+
+ partition at 470000 {
+ label = "0:cdt_1";
+ reg = <0x470000 0x10000>;
+ read-only;
+ };
+
+ partition at 480000 {
+ label = "0:appsblenv";
+ reg = <0x480000 0x10000>;
+ };
+
+ partition at 490000 {
+ label = "0:appsbl";
+ reg = <0x490000 0xa0000>;
+ read-only;
+ };
+
+ partition at 530000 {
+ label = "0:appsbl_1";
+ reg = <0x530000 0xa0000>;
+ read-only;
+ };
+
+ partition at 5d0000 {
+ label = "0:art";
+ reg = <0x5d0000 0x40000>;
+ read-only;
+ };
+
+ partition at 610000 {
+ label = "0:ethphyfw";
+ reg = <0x610000 0x80000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&blsp1_uart5 {
+ status = "okay";
+};
+
+&cryptobam {
+ status = "okay";
+};
+
+&crypto {
+ status = "okay";
+};
+
+&prng {
+ status = "okay";
+};
+
+&qpic_bam {
+ status = "okay";
+};
+
+&qpic_nand {
+ status = "okay";
+
+ partitions {
+ status = "disabled";
+ };
+
+ nand at 0 {
+ reg = <0>;
+ nand-ecc-strength = <8>;
+ nand-ecc-step-size = <512>;
+ nand-bus-width = <8>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition at 0 {
+ label = "rootfs";
+ reg = <0x0000000 0x3400000>;
+ };
+
+ partition at 3400000 {
+ label = "0:wififw";
+ reg = <0x3400000 0x0800000>;
+ read-only;
+ };
+
+ partition at 3c00000 {
+ label = "rootfs_1";
+ reg = <0x3c00000 0x3400000>;
+ };
+
+ partition at 7000000 {
+ label = "0:wififw_1";
+ reg = <0x7000000 0x0800000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&qusb_phy_0 {
+ status = "okay";
+};
+
+&qusb_phy_1 {
+ status = "okay";
+};
+
+&ssphy_0 {
+ status = "okay";
+};
+
+&ssphy_1 {
+ status = "okay";
+};
+
+&usb_0 {
+ status = "okay";
+};
+
+&usb_1 {
+ status = "okay";
+};
+
+&mdio {
+ status = "okay";
+
+ pinctrl-0 = <&mdio_pins>;
+ pinctrl-names = "default";
+ reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+ ethernet-phy-package at 0 {
+ compatible = "qcom,qca8075-package";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ qca8075_0: ethernet-phy at 0 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0>;
+ };
+
+ qca8075_1: ethernet-phy at 1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <1>;
+ };
+
+ qca8075_2: ethernet-phy at 2 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <2>;
+ };
+
+ qca8075_3: ethernet-phy at 3 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <3>;
+ };
+
+ qca8075_4: ethernet-phy at 4 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <4>;
+ };
+ };
+};
+
+&switch {
+ status = "okay";
+
+ switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>;
+ switch_wan_bmp = <ESS_PORT5>;
+ switch_mac_mode = <MAC_MODE_PSGMII>;
+
+ qcom,port_phyinfo {
+ port at 1 {
+ port_id = <1>;
+ phy_address = <0>;
+ };
+ port at 2 {
+ port_id = <2>;
+ phy_address = <1>;
+ };
+ port at 3 {
+ port_id = <3>;
+ phy_address = <2>;
+ };
+ port at 4 {
+ port_id = <4>;
+ phy_address = <3>;
+ };
+ port at 5 {
+ port_id = <5>;
+ phy_address = <4>;
+ };
+ };
+};
+
+&edma {
+ status = "okay";
+};
+
+&dp1 {
+ status = "okay";
+ phy-handle = <&qca8075_0>;
+ label = "lan1";
+};
+
+&dp2 {
+ status = "okay";
+ phy-handle = <&qca8075_1>;
+ label = "lan2";
+};
+
+&dp3 {
+ status = "okay";
+ phy-handle = <&qca8075_2>;
+ label = "lan3";
+};
+
+&dp4 {
+ status = "okay";
+ phy-handle = <&qca8075_3>;
+ label = "lan4";
+};
+
+&dp5 {
+ status = "okay";
+ phy-handle = <&qca8075_4>;
+ label = "wan";
+};
+
+&wifi {
+ status = "okay";
+
+ qcom,ath11k-calibration-variant = "ZBT-Z800AX";
+};
diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk
index 74fe15a997..027278b63c 100644
--- a/target/linux/qualcommax/image/ipq807x.mk
+++ b/target/linux/qualcommax/image/ipq807x.mk
@@ -299,6 +299,21 @@ define Device/yuncore_ax880
endef
TARGET_DEVICES += yuncore_ax880
+define Device/zbtlink_zbt-z800ax
+ $(call Device/FitImage)
+ $(call Device/UbiFit)
+ DEVICE_VENDOR := Zbtlink
+ DEVICE_MODEL := ZBT-Z800AX
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ DEVICE_DTS_CONFIG := config at hk09
+ SOC := ipq8072
+ DEVICE_PACKAGES := ipq-wifi-zbtlink_zbt-z800ax
+ IMAGES += factory.bin
+ IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand
+endef
+TARGET_DEVICES += zbtlink_zbt-z800ax
+
define Device/zte_mf269
$(call Device/FitImage)
$(call Device/UbiFit)
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds
index 737c64fcec..23d87f1b2d 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds
@@ -62,6 +62,9 @@ yuncore,ax880)
ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "90000.mdio-1:18:green:wan" "wan" "tx rx link_10 link_100 link_1000 link_2500"
ucidef_set_led_netdev "lan-port-link" "LAN-PORT-LINK" "90000.mdio-1:1c:green:lan" "lan" "tx rx link_10 link_100 link_1000 link_2500"
;;
+zbtlink,zbt-z800ax)
+ ucidef_set_led_netdev "internet" "Internet" "green:wan-online" "wan"
+ ;;
esac
board_config_flush
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
index fb3fec6fc9..77c84d40fa 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
@@ -15,7 +15,8 @@ ipq807x_setup_interfaces()
buffalo,wxr-5950ax12|\
dynalink,dl-wrx36|\
linksys,mx5300|\
- xiaomi,ax9000)
+ xiaomi,ax9000|\
+ zbtlink,zbt-z800ax)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
cmcc,rm2-6)
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index 88ba972407..f533bac48e 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -28,6 +28,7 @@ case "$FIRMWARE" in
xiaomi,ax3600|\
xiaomi,ax9000|\
yuncore,ax880|\
+ zbtlink,zbt-z800ax|\
zte,mf269|\
zyxel,nbg7815)
caldata_extract "0:art" 0x1000 0x20000
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index 500f01c31f..dd85dcfe98 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -30,4 +30,8 @@ case "$board" in
[ "$PHYNBR" = "1" ] && macaddr_add $label_mac 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "2" ] && macaddr_add $label_mac 3 > /sys${DEVPATH}/macaddress
;;
+ zbtlink,zbt-z800ax)
+ [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) -1 > /sys${DEVPATH}/macaddress
+ [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) -2 > /sys${DEVPATH}/macaddress
+ ;;
esac
diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
index bffca41e02..768bf649ce 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
@@ -51,7 +51,8 @@ platform_do_upgrade() {
netgear,rax120v2|\
netgear,wax218|\
netgear,wax620|\
- netgear,wax630)
+ netgear,wax630|\
+ zbtlink,zbt-z800ax)
nand_do_upgrade "$1"
;;
buffalo,wxr-5950ax12)
More information about the lede-commits
mailing list