diff --git a/package/firmware/ipq-wifi/._board-zte_mf263.qca4019.bin b/package/firmware/ipq-wifi/._board-zte_mf263.qca4019.bin new file mode 100755 index 000000000..12c97a5d1 Binary files /dev/null and b/package/firmware/ipq-wifi/._board-zte_mf263.qca4019.bin differ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 0baada32e..e21d4def6 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -59,7 +59,8 @@ ALLWIFIBOARDS:= \ redmi_ax6 \ xiaomi_ax3600 \ xiaomi_ax9000 \ - zte_mf269 + zte_mf269 \ + zte_mf263 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) @@ -164,5 +165,6 @@ $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) $(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_mf269,ZTE MF269)) +$(eval $(call generate-ipq-wifi-package,zte_mf263,ZTE MF263)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-zte_mf263.qca4019 b/package/firmware/ipq-wifi/board-zte_mf263.qca4019 new file mode 100755 index 000000000..8903e90b4 Binary files /dev/null and b/package/firmware/ipq-wifi/board-zte_mf263.qca4019 differ diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 2014ca3e5..41dfd6ba7 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -84,6 +84,10 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0t@eth0" "5:wan" "3:lan" ;; + zte,mf263) + ucidef_add_switch "switch0" \ + "0t@eth0" "2:lan" "3:lan" "4:lan" "5:wan" + ;; mobipromo,cm520-79f) ucidef_add_switch "switch0" \ "0t@eth0" "3:lan:2" "4:lan:1" "5:wan" @@ -168,6 +172,10 @@ ipq40xx_setup_macs() wan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_add "$wan_mac" 1) ;; + zte,mf263) + wan_mac=$(mtd_get_mac_binary mac 0x0) + lan_mac=$(macaddr_add "$wan_mac" 1) + ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 4d2d564f7..bd42c51f7 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -147,6 +147,10 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0) ;; + zte,mf263) + caldata_extract "0:ART" 0x1000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x0) +2) + ;; zyxel,nbg6617 |\ zyxel,wre6606) caldata_extract "ART" 0x1000 0x2f20 @@ -250,6 +254,10 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc) ;; + zte,mf263) + caldata_extract "0:ART" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x0) +3) + ;; zyxel,nbg6617 |\ zyxel,wre6606) caldata_extract "ART" 0x5000 0x2f20 diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 49fb4e3de..c6a1246b9 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -212,6 +212,10 @@ platform_do_upgrade() { asus_nand_upgrade_tar 20951040 "$1" fi ;; + zte,mf263) + PART_NAME=rootfs + nand_do_upgrade "$1" + ;; cellc,rtl30vw) CI_UBIPART="ubifs" askey_do_upgrade "$1" diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts new file mode 100755 index 000000000..ed78d8497 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts @@ -0,0 +1,390 @@ +/* + * Copyright (c) 2021 Hugo Yuan + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "ZTE MF263"; + compatible = "zte,mf263", "qcom,ipq4019"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256MB */ + }; + + aliases { + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + chosen { + bootargs-override = "ubi.mtd=rootfs root=/dev/ubiblock0_1 rootfstype=squashfs rootwait clk_ignore_unused"; + }; + + soc { + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + serial@78af000 { + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + status = "okay"; + }; + + serial@78b0000 { + pinctrl-0 = <&serial_1_pins>; + pinctrl-names = "default"; + status = "okay"; + }; + + i2c@78b7000 { /* BLSP1 QUP2 */ + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + + status = "okay"; + }; + + usb3: usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + + leds { + compatible = "gpio-leds"; + + power: status { + label = "status"; + gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; + }; + + other: other { + label = "other"; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>, + <&tlmm 54 GPIO_ACTIVE_HIGH>; + num-cs = <2>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = < 0x00 0x40000 >; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = < 0x40000 0x20000 >; + }; + + partition@60000 { + label = "0:QSEE"; + reg = < 0x60000 0x60000 >; + }; + + partition@c0000 { + label = "0:CDT"; + reg = < 0xc0000 0x10000 >; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = < 0xd0000 0x10000 >; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = < 0xe0000 0x10000 >; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = < 0xf0000 0xc0000 >; + }; + + partition@1b0000 { + label = "0:reserved1"; + reg = < 0x1b0000 0x50000 >; + }; + }; + }; + + spi-nand@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = < 0x00 0xa0000 >; + }; + + partition@a0000 { + label = "0:ART"; + reg = < 0xa0000 0x80000 >; + }; + + partition@120000 { + label = "mac"; + reg = < 0x120000 0x80000 >; + }; + + partition@1a0000 { + label = "reserved2"; + reg = < 0x1a0000 0xc0000 >; + }; + + partition@260000 { + label = "cfg-param"; + reg = < 0x260000 0x400000 >; + }; + + partition@660000 { + label = "log"; + reg = < 0x660000 0x400000 >; + }; + + partition@a60000 { + label = "oops"; + reg = < 0xa60000 0xa0000 >; + }; + + partition@b00000 { + label = "reserved3"; + reg = < 0xb00000 0x500000 >; + }; + + partition@1000000 { + label = "web"; + reg = < 0x1000000 0x800000 >; + }; + + partition@1800000 { + label = "rootfs"; + reg = < 0x1800000 0x1d00000 >; + }; + + partition@3500000 { + label = "data"; + reg = < 0x3500000 0x1900000 >; + }; + + partition@4e00000 { + label = "fota"; + reg = < 0x4e00000 0x3200000 >; + }; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + i2c_0_pins: i2c-0-pinmux { + mux { + pins = "gpio20", "gpio21"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_0_pins: serial0-pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + serial_1_pins: serial1_pinmux { + mux { + pins = "gpio8", "gpio9"; + function = "blsp_uart1"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "zte_mf263"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "zte_mf263"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index a22018fe2..c9445deb0 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -704,6 +704,20 @@ define Device/p2w_r619ac-128m endef TARGET_DEVICES += p2w_r619ac-128m +define Device/zte_mf263 + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := ZTE + DEVICE_MODEL := MF263 + DEVICE_DTS := qcom-ipq4019-zte-mf263 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := -kmod-ath10k-ct -ath10k-firmware-qca4019-ct kmod-ath10k ath10k-firmware-qca4019 ipq-wifi-zte_mf263 +endef +TARGET_DEVICES += zte_mf263 + define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP-DK01.1 diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 6b6af5865..832d51aa9 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,58 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,59 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -43,6 +43,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ + qcom-ipq4019-hugo-ac1200.dtb \ ++ qcom-ipq4019-zte-mf263.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \