From 8364f0816417bfe404f7bded4eaa4f4a60c6d006 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 19 May 2021 21:04:43 +0200 Subject: [PATCH] ipq807x: add Xiaomi AX3600 Xiaomi AX3600 is a budget 802.11ax dual-band router/AP. Specifications: * CPU: Qualcomm IPQ8071A Quad core Cortex-A53 1.4GHz * RAM: 512MB of DDR3 * Storage: 256MB of parallel NAND * Ethernet: 4x1G RJ45 ports (QCA8075) with 1x status LED per port * WLAN: * PCI based Qualcomm QCA9889 1x1 802.11ac Wawe 2 for IoT * 2.4GHz: Qualcomm QCN5024 2x2 802.11b/g/n/ax 574 Mbps PHY rate * 5GHz: Qualcomm QCN5054 4x4@80MHz or 2x2@160MHz 802.11a/b/g/n/ac/ax 2402 PHY rate * LED-s: * System (Blue and Yellow) * IoT (Blue) * Network (Blue and Yellow) * Buttons: 1x Soft reset * Power: 12V DC Jack Installation instructions: Obtaining SSH access is mandatory https://openwrt.org/inbox/toh/xiaomi/xiaomi_ax3600#obtain_ssh_access Installation is done by the ubiformat method, through SSH: 1. Open an SSH shell to the router 2. Copy the file openwrt-ipq807x-generic-xiaomi_ax3600-initramfs-factory.ubi to the /tmp directory 3. Check which rootfs partition is your router booted in (0 = rootfs | 1 = rootfs_1): nvram get flag_boot_rootfs 4. Find the rootfs and rootfs_1 mtd indexes respectively: cat /proc/mtd Please confirm if mtd12 and mtd13 are the correct indexes from above! 5. Use the command ubiformat to flash the opposite mtd with UBI image: If nvram get flag_boot_rootfs returned 0: ubiformat /dev/mtd13 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-initramfs-factory.ubi -s 2048 -O 2048 && nvram set flag_boot_rootfs=1 && nvram set flag_last_success=1 && nvram commit otherwise: ubiformat /dev/mtd12 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-initramfs-factory.ubi -s 2048 -O 2048 && nvram set flag_boot_rootfs=0 && nvram set flag_last_success=0 && nvram commit 6. Reboot the device by: reboot Previous commands flashed an ubinized OpenWrt initramfs that will serve as the intermediate step since OpenWrt uses unified rootfs in order to fully utilize NAND and provide enough space for packages. Continue in order to pernamently flash OpenWrt: 7. SSH into OpenWrt from one of the LAN ports 8. Copy the file openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin to the /tmp directory 9. Sysupgrade the device: sysupgrade -n /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin Device will reboot with OpenWrt, and then sysupgrade can be used to upgrade the device when desired. Signed-off-by: Christian Marangi Signed-off-by: Robert Marko --- package/boot/uboot-envtools/files/ipq807x | 24 ++ package/firmware/ipq-wifi/Makefile | 17 +- .../ipq-wifi/board-xiaomi_ax3600.ipq8074 | Bin 0 -> 131176 bytes .../ipq-wifi/board-xiaomi_ax3600.qca9889 | Bin 0 -> 2260 bytes .../ipq807x/base-files/etc/board.d/01_leds | 16 + .../ipq807x/base-files/etc/board.d/02_network | 28 ++ .../etc/hotplug.d/firmware/11-ath11k-caldata | 20 ++ .../base-files/lib/upgrade/platform.sh | 65 ++++ .../arm64/boot/dts/qcom/ipq8071-ax3600.dts | 73 ++++ .../arm64/boot/dts/qcom/ipq8071-ax3600.dtsi | 311 ++++++++++++++++++ target/linux/ipq807x/image/generic.mk | 18 + 11 files changed, 569 insertions(+), 3 deletions(-) create mode 100644 package/boot/uboot-envtools/files/ipq807x create mode 100644 package/firmware/ipq-wifi/board-xiaomi_ax3600.ipq8074 create mode 100644 package/firmware/ipq-wifi/board-xiaomi_ax3600.qca9889 create mode 100644 target/linux/ipq807x/base-files/etc/board.d/01_leds create mode 100644 target/linux/ipq807x/base-files/etc/board.d/02_network create mode 100644 target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata create mode 100644 target/linux/ipq807x/base-files/lib/upgrade/platform.sh create mode 100644 target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts create mode 100644 target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x new file mode 100644 index 000000000000..bf116d1fca0c --- /dev/null +++ b/package/boot/uboot-envtools/files/ipq807x @@ -0,0 +1,24 @@ +[ -e /etc/config/ubootenv ] && exit 0 + +touch /etc/config/ubootenv + +. /lib/uboot-envtools.sh +. /lib/functions.sh + +board=$(board_name) + +case "$board" in +xiaomi,ax3600) + idx="$(find_mtd_index 0:appsblenv)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000" + idx2="$(find_mtd_index bdata)" + [ -n "$idx2" ] && \ + ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x10000" "0x20000" + ;; +esac + +config_load ubootenv +config_foreach ubootenv_add_app_config + +exit 0 diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 56c799302e64..9b490e6f74e1 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -41,6 +41,7 @@ ALLWIFIBOARDS:= \ qxwlan_e2600ac-c2 \ sony_ncp-hg100-cellular \ teltonika_rutx \ + xiaomi_ax3600 \ zte_mf18a \ zte_mf289f @@ -50,7 +51,7 @@ define Package/ipq-wifi-default SUBMENU:=ath10k Board-Specific Overrides SECTION:=firmware CATEGORY:=Firmware - DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x) + DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x) TITLE:=Custom Board endef @@ -59,17 +60,26 @@ define ipq-wifi-install-one-to $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin endef +define ipq-wifi-install-ath11-one-to + $(INSTALL_DIR) $(2)/lib/firmware/ath11k/$(3)/ + $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath11k/$(3)/board-2.bin +endef + define ipq-wifi-install-one $(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\ $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\ $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\ $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\ + $(if $(filter $(suffix $(1)),.QCA9889 .qca9889),\ + $(call ipq-wifi-install-one-to,$(1),$(2),QCA9887/hw1.0),\ $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\ $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\ $(if $(filter $(suffix $(1)),.QCA99X0 .qca99x0),\ $(call ipq-wifi-install-one-to,$(1),$(2),QCA99X0/hw2.0),\ + $(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074),\ + $(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\ $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\ - )))) + )))))) endef # Blank line required at end of above define due to foreach context @@ -102,7 +112,7 @@ Do not install it for any other device! endef # Add board name to ALLWIFIBOARDS -# Place files in this directory as board-. +# Place files in this directory as board-. # Add $(eval $(call generate-ipq-wifi-package,,)) $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365)) @@ -121,6 +131,7 @@ $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c1,Qxwlan E2600AC C1)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c2,Qxwlan E2600AC C2)) $(eval $(call generate-ipq-wifi-package,sony_ncp-hg100-cellular,Sony NCP-HG100/Cellular)) $(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,zte_mf18a,ZTE MF18A)) $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F)) diff --git a/package/firmware/ipq-wifi/board-xiaomi_ax3600.ipq8074 b/package/firmware/ipq-wifi/board-xiaomi_ax3600.ipq8074 new file mode 100644 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)9;Lb# z8^|H=kcELl{CgAaHHlenW{`JE%-m3hS)jfrB?5zhapb$_9Cy) z5Kssx1QY@a0fm4hapb$_9Cy)5Ksu*0)hVz5{;+j literal 0 HcmV?d00001 diff --git a/package/firmware/ipq-wifi/board-xiaomi_ax3600.qca9889 b/package/firmware/ipq-wifi/board-xiaomi_ax3600.qca9889 new file mode 100644 index 0000000000000000000000000000000000000000..af4405cd53cb9ca94b9fd2b75856bf84ac0d22cf GIT binary patch literal 2260 zcmWG^cGPtY@h~*-)^+lC402(}&CO*1f*l+nl7S%+h?7c-Z3~h!b;?rnQu2#z4b3c) zby8BxGLutn4Gc^Tbc#!piYtptQgd~oDhz-CNffRYC|Z_Sl$n@UVjGc}n4g=e>lk5d zW?%rclM!f-3(!s%4wgC=#-6_)BzG-hV3239_he#l(E&L|9*6~j7z8R97y=+H3=)?( zhC)&V_!$(K6c_{r85sf?L6CvLNO9}dt^ABX|FZLvVh|10axuc(sK5Y%AUB>ncaDZO z5;9tfkr5QFU?2ixfauiJWMnQW?6V9E4h5Zy7`Oy78QM@a{wQbQ zWNL0@!@y8bI(HEaSJh9R0b)bwH9HDQm#+cgs(O$b1dUDHrpCsG8kpG7Q<0YuQIV4s zQIeAvQ6&N}F!)4dOjxn^=vh|I2vDv^0{?zjFtBhWFf=2HF)%&SX9U%9> */ + +/dts-v1/; + +#include "ipq8071-ax3600.dtsi" + +/ { + model = "Xiaomi AX3600"; + compatible = "xiaomi,ax3600", "qcom,ipq8074"; + + leds { + compatible = "gpio-leds"; + + led_system_blue: system-blue { + label = "blue:system"; + gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>; + }; + + led_system_yellow: system-yellow { + label = "yellow:system"; + gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>; + }; + + network-yellow { + label = "yellow:network"; + gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>; + }; + + network-blue { + label = "blue:network"; + gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + }; + + aiot { + label = "blue:aiot"; + gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&pcie_qmp0 { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + perst-gpio = <&tlmm 52 GPIO_ACTIVE_HIGH>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@1,0 { + status = "okay"; + + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + + qcom,ath10k-calibration-variant = "Xiaomi-AX3600"; + nvmem-cell-names = "calibration"; + nvmem-cells = <&caldata_qca9889>; + }; + }; +}; + +&wifi { + qcom,ath11k-calibration-variant = "Xiaomi-AX3600"; +}; diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi new file mode 100644 index 000000000000..c18cef52f39d --- /dev/null +++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi @@ -0,0 +1,311 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2021, Robert Marko */ + +#include "ipq8074-512m.dtsi" +#include "ipq8074-ac-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include + +/ { + aliases { + serial0 = &blsp1_uart5; + led-boot = &led_system_yellow; + led-failsafe = &led_system_yellow; + led-running = &led_system_blue; + led-upgrade = &led_system_yellow; + label-mac-device = &dp2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_0"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 34 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&tlmm { + 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_uart5 { + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + /* + * Bootloader will find the NAND DT node by the compatible and + * then "fixup" it by adding the partitions from the SMEM table + * using the legacy bindings thus making it impossible for us + * to change the partition table or utilize NVMEM for calibration. + * So add a dummy partitions node that bootloader will populate + * and set it as disabled so the kernel ignores it instead of + * printing warnings due to the broken way bootloader adds the + * partitions. + */ + 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 = "0:sbl1"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "0:mibib"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "0:qsee"; + reg = <0x200000 0x300000>; + read-only; + }; + + partition@500000 { + label = "0:devcfg"; + reg = <0x500000 0x80000>; + read-only; + }; + + partition@580000 { + label = "0:rpm"; + reg = <0x580000 0x80000>; + read-only; + }; + + partition@600000 { + label = "0:cdt"; + reg = <0x600000 0x80000>; + read-only; + }; + + partition@680000 { + label = "0:appsblenv"; + reg = <0x680000 0x80000>; + }; + + partition@700000 { + label = "0:appsbl"; + reg = <0x700000 0x100000>; + read-only; + }; + + partition@800000 { + label = "0:art"; + reg = <0x800000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dp2: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_dp3: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_dp4: macaddr@12 { + reg = <0x12 0x6>; + }; + + macaddr_dp5: macaddr@18 { + reg = <0x18 0x6>; + }; + + caldata_qca9889: caldata@4d000 { + reg = <0x33000 0x844>; + }; + }; + + partition@880000 { + label = "bdata"; + reg = <0x880000 0x80000>; + }; + + partition@900000 { + /* This is crash + crash_syslog parts combined */ + label = "pstore"; + reg = <0x900000 0x100000>; + }; + + /* Make the first rootfs a dedicated ubi partition for kernel */ + partition@a00000 { + label = "ubi_kernel"; + reg = <0xa00000 0x23c0000>; + }; + + /* Place the real rootfs in the original second rootfs and + * expand it to the end of the nand + */ + rootfs: partition@2dc0000 { + label = "rootfs"; + reg = <0x2dc0000 0xd240000>; + }; + }; + }; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; + + 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>; + }; + + 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>; /* cpu port bitmap */ + switch_lan_bmp = <0x1e>; /* lan port bitmap */ + switch_wan_bmp = <0x20>; /* wan port bitmap */ + switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ + bm_tick_mode = <0>; /* bm tick mode */ + tm_tick_mode = <0>; /* tm tick 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>; + }; + port@3 { + port_id = <4>; + phy_address = <3>; + }; + port@4 { + port_id = <5>; + phy_address = <4>; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_1>; + label = "wan"; + nvmem-cells = <&macaddr_dp2>; + nvmem-cell-names = "mac-address"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan1"; + nvmem-cells = <&macaddr_dp3>; + nvmem-cell-names = "mac-address"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "lan2"; + nvmem-cells = <&macaddr_dp4>; + nvmem-cell-names = "mac-address"; +}; + +&dp5 { + status = "okay"; + phy-handle = <&qca8075_4>; + label = "lan3"; + nvmem-cells = <&macaddr_dp5>; + nvmem-cell-names = "mac-address"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-fw-memory-mode = <1>; +}; diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk index 91a3daeedf79..11cca5450618 100644 --- a/target/linux/ipq807x/image/generic.mk +++ b/target/linux/ipq807x/image/generic.mk @@ -16,3 +16,21 @@ define Device/UbiFit IMAGE/factory.ubi := append-ubi IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef + +define Device/xiaomi_ax3600 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := AX3600 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@ac04 + SOC := ipq8071 + KERNEL_SIZE := 36608k + DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := initramfs-factory.ubi + ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel +endif +endef +TARGET_DEVICES += xiaomi_ax3600 -- 2.30.2