ipq807x: add support for ZTE MF269

Co-authored-by: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Hugo Yuan
2022-09-08 20:27:05 +08:00
committed by Tianling Shen
parent 39f2ecd08d
commit c8b8a6adca
9 changed files with 276 additions and 3 deletions

View File

@@ -27,7 +27,8 @@ redmi,ax6|\
redmi,ax6-stock|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000)
xiaomi,ax9000|\
zte,mf269)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000"

View File

@@ -49,6 +49,7 @@ ALLWIFIBOARDS:= \
xiaomi_ax3600 \
xiaomi_ax9000 \
zte_mf18a \
zte_mf269 \
zte_mf289f
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
@@ -147,6 +148,7 @@ $(eval $(call generate-ipq-wifi-package,teltonika_rutx,Teltonika RUTX))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
$(eval $(call generate-ipq-wifi-package,zte_mf18a,ZTE MF18A))
$(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269))
$(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
$(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))

Binary file not shown.

View File

@@ -14,7 +14,8 @@ ipq807x_setup_interfaces()
dynalink,dl-wrx36)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
edgecore,eap102)
edgecore,eap102|\
zte,mf269)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;
edimax,cax1800)
@@ -38,9 +39,30 @@ ipq807x_setup_interfaces()
esac
}
ipq807x_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
local label_mac=""
case "$board" in
zte,mf269)
wan_mac="$(get_mac_binary "$(find_mtd_chardev mac)" 0x20000)"
lan_mac="$(macaddr_add "$wan_mac" 1)"
label_mac="$wan_mac"
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
[ -n "$label_mac" ] && ucidef_set_label_macaddr "$label_mac"
}
board_config_update
board=$(board_name)
ipq807x_setup_interfaces $board
ipq807x_setup_macs $board
board_config_flush
exit 0

View File

@@ -17,7 +17,8 @@ case "$FIRMWARE" in
redmi,ax6-stock|\
xiaomi,ax3600|\
xiaomi,ax3600-stock|\
xiaomi,ax9000)
xiaomi,ax9000|\
zte,mf269)
caldata_extract "0:art" 0x1000 0x20000
;;
esac

View File

@@ -0,0 +1,18 @@
[ "$ACTION" == "add" ] || exit 0
PHYNBR=${DEVPATH##*/phy}
[ -n $PHYNBR ] || exit 0
. /lib/functions.sh
. /lib/functions/system.sh
board=$(board_name)
case "$board" in
zte,mf269)
mac_addr="$(get_mac_binary "$(find_mtd_chardev mac)" 0x20000)"
[ "$PHYNBR" = "0" ] && macaddr_add "$mac_addr" 2 > "/sys${DEVPATH}/macaddress"
[ "$PHYNBR" = "1" ] && macaddr_add "$mac_addr" 3 > "/sys${DEVPATH}/macaddress"
;;
esac

View File

@@ -110,6 +110,10 @@ platform_do_upgrade() {
# Reset success flag
fw_setenv flag_boot_success 0
nand_do_upgrade "$1"
;;
zte,mf269)
CI_UBIPART="rootfs"
nand_do_upgrade "$1"
;;
*)

View File

@@ -0,0 +1,212 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "ipq8074-512m.dtsi"
#include "ipq8074-ac-cpu.dtsi"
#include "ipq8074-ess.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
model = "ZTE MF269";
compatible = "zte,mf269", "qcom,ipq8074";
aliases {
serial0 = &blsp1_uart5;
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 46 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
leds {
compatible = "gpio-leds";
led_system_white: system-white {
label = "white:system";
gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>;
};
};
};
&tlmm {
mdio_pins: mdio-pins {
mdc {
pins = "gpio68";
function = "mdc";
drive-strength = <8>;
bias-pull-up;
};
mido {
pins = "gpio69";
function = "mdio";
drive-strength = <8>;
bias-pull-up;
};
};
usb_vbus_pins: usb-vbus-pins {
usb-pins {
pins = "gpio29";
function = "gpio";
drive-strength = <8>;
bias-disable;
output-high;
};
};
};
&blsp1_spi1 {
pinctrl-0 = <&spi_0_pins>;
pinctrl-names = "default";
cs-select = <0>;
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
spi-max-frequency = <50000000>;
};
};
&blsp1_uart5 {
status = "okay";
};
&prng {
status = "okay";
};
&cryptobam {
status = "okay";
};
&crypto {
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";
};
};
};
&qusb_phy_0 {
status = "okay";
};
&ssphy_0 {
status = "okay";
};
&usb_0 {
pinctrl-0 = <&usb_vbus_pins>;
pinctrl-names = "default";
status = "okay";
};
&mdio {
status = "okay";
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
qca8075_24: ethernet-phy@24 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <24>;
reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>;
};
qca8075_28: ethernet-phy@28 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <28>;
reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
};
};
&switch {
status = "okay";
switch_cpu_bmp = <0x1>; /* cpu port bitmap */
switch_lan_bmp = <0x3e>; /* lan port bitmap */
switch_wan_bmp = <0x40>; /* wan port bitmap */
switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/
switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/
bm_tick_mode = <0>; /* bm tick mode */
tm_tick_mode = <0>; /* tm tick mode */
qcom,port_phyinfo {
port@4 {
port_id = <5>;
phy_address = <24>;
port_mac_sel = "QGMAC_PORT";
};
port@5 {
port_id = <6>;
phy_address = <28>;
port_mac_sel = "QGMAC_PORT";
};
};
};
&edma {
status = "okay";
};
&dp5_syn {
status = "okay";
phy-handle = <&qca8075_24>;
label = "lan";
};
&dp6_syn {
status = "okay";
phy-handle = <&qca8075_28>;
label = "wan";
};
&wifi {
status = "okay";
qcom,ath11k-calibration-variant = "ZTE-MF269";
qcom,ath11k-fw-memory-mode = <1>;
};

View File

@@ -133,3 +133,16 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
endif
endef
TARGET_DEVICES += xiaomi_ax9000
define Device/zte_mf269
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := ZTE
DEVICE_MODEL := MF269
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@ac04
SOC := ipq8071
DEVICE_PACKAGES := ipq-wifi-zte_mf269
endef
TARGET_DEVICES += zte_mf269