From 93588fa54ecf0264f0d69a4f717e62dd692fa227 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 17 Jan 2025 11:36:17 +0100 Subject: [PATCH] mediatek: filogic: add Asus ZenWiFi BT8 Hardware -------- MediaTek MT7988D SoC (3x Cortex-A53 @1.8 GHz max) 1GB DDR4 RAM 256MB SPI-NAND (Winbond) MediaTek MT7996 BE14000 Tri-Band Wi-Fi 7 3x LAN (2x 1GE MT7988 built-in, 1x 2.5GE MaxLinear GPY211C) 1x WAN (2.5GE MT7988 built-in) LED: RGB PWM (supported as 3x PWM LED) USB: 1x USB 3 Buttons: RESET, WPS UART: 115200 8N1 3.3V Installation ------------ 1. Hold down RESET button and power on the device until LED pulses red. 2. Assign IP 192.168.1.70/24 to your computer's Ethernet port 3. Connect Ethernet to one of the 1GE LAN ports 4. Open browser and visit http://192.168.1.1 5. Upload openwrt-mediatek-filogic-asus_zenwifi-bt8-factory.bin 6. Once OpenWrt initramfs system comes up, do sysupgrade using openwrt-mediatek-filogic-asus_zenwifi-bt8-squashfs-sysupgrade.bin Signed-off-by: John Crispin Signed-off-by: Daniel Golle --- .../mediatek/dts/mt7988d-asus-zenwifi-bt8.dts | 398 ++++++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 1 + .../base-files/lib/upgrade/platform.sh | 6 +- target/linux/mediatek/image/filogic.mk | 20 + 4 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts diff --git a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts new file mode 100644 index 0000000000..ecc01b4b99 --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts @@ -0,0 +1,398 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7988a.dtsi" +#include +#include +#include +#include +#include + +/ { + model = "ASUS ZenWiFi BT8"; + compatible = "asus,zenwifi-bt8", "mediatek,mt7988a"; + + aliases { + serial0 = &uart0; + label-mac-device = &gmac0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + chosen { + bootargs-override = "earlycon=uart8250,mmio32,0x11000000 console=ttyS0,115200n8"; + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0x0 0x40000000 0x0 0x40000000>; + }; + + cpus { + /delete-node/ cpu@3; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&button_pins>; + + factory { + label = "reset"; + linux,code = ; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "sync"; + linux,code = ; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + }; + }; + + pwm-leds { + compatible = "pwm-leds"; + + led_status_red: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + pwms = <&pwm 0 10000>; + }; + + led_status_green: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + pwms = <&pwm 1 10000>; + }; + + led_status_blue: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + pwms = <&pwm 3 10000>; + }; + }; +}; + +&cpu0 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu1 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu2 { + proc-supply = <&rt5190_buck3>; +}; + +&cci { + proc-supply = <&rt5190_buck3>; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio0_pins>; + status = "okay"; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4 0>; + nvmem-cell-names = "mac-address"; + + status = "okay"; +}; + +&gmac1 { + phy-mode = "internal"; + phy-connection-type = "internal"; + phy = <&int_2p5g_phy>; + + nvmem-cells = <&macaddr_factory_4 1>; + nvmem-cell-names = "mac-address"; + + openwrt,netdev-name = "wan"; + + status = "okay"; +}; + +&int_2p5g_phy { + pinctrl-names = "i2p5gbe-led"; + pinctrl-0 = <&i2p5gbe_led0_pins>; +}; + +&gmac2 { + phy-mode = "2500base-x"; + phy = <&phy5>; + + nvmem-cells = <&macaddr_factory_4 0>; + nvmem-cell-names = "mac-address"; + + openwrt,netdev-name = "lan3"; + + status = "okay"; +}; + +&gsw_phy0 { + status = "disabled"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + rt5190a_64: rt5190a@64 { + compatible = "richtek,rt5190a"; + reg = <0x64>; + /*interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;*/ + vin2-supply = <&rt5190_buck1>; + vin3-supply = <&rt5190_buck1>; + vin4-supply = <&rt5190_buck1>; + + regulators { + rt5190_buck1: buck1 { + regulator-name = "rt5190a-buck1"; + regulator-min-microvolt = <5090000>; + regulator-max-microvolt = <5090000>; + regulator-allowed-modes = + ; + regulator-boot-on; + regulator-always-on; + }; + + buck2 { + regulator-name = "vcore"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + regulator-always-on; + }; + + rt5190_buck3: buck3 { + regulator-name = "vproc"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + }; + + buck4 { + regulator-name = "rt5190a-buck4"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-allowed-modes = + ; + regulator-boot-on; + regulator-always-on; + }; + + ldo { + regulator-name = "rt5190a-ldo"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; +}; + +&mdio_bus { + phy5: ethernet-phy@5 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <5>; + + reset-gpios = <&pio 0 GPIO_ACTIVE_LOW>; + reset-assert-us = <200000>; + reset-deassert-us = <2000000>; + }; +}; + +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_1_pins>; + reset-gpios = <&pio 7 GPIO_ACTIVE_LOW>; + status = "okay"; + + pcie@0,0 { + reg = <0x0000 0 0 0 0>; + + mt7996@0,0 { + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + + band@0 { + /* 2.4 GHz */ + reg = <0>; + nvmem-cells = <&macaddr_factory_4 0>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + /* 5 GHz */ + reg = <1>; + nvmem-cells = <&macaddr_factory_4 1>; + nvmem-cell-names = "mac-address"; + }; + + band@2 { + /* 6 GHz */ + reg = <2>; + nvmem-cells = <&macaddr_factory_4 2>; + nvmem-cell-names = "mac-address"; + }; + }; + }; +}; + +&pcie3 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie3_pins>; + status = "okay"; +}; + +&pio { + button_pins: button-pins { + pins = "GPIO_RESET", "GPIO_WPS"; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + + pcie0_1_pins: pcie0-pins-g1 { + mux { + function = "pcie"; + groups = "pcie_2l_0_pereset", "pcie_clk_req_n0_0"; + }; + }; + + pwm_pins: pwm-pins { + mux { + function = "pwm"; + groups = "pwm0", "pwm1", "pwm3_0"; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: spi_nand@0 { + compatible = "u-boot-dont-touch-spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x400000>; + label = "Bootloader"; + read-only; + }; + + partition@400000 { + reg = <0x400000 0x7b00000>; + compatible = "linux,ubi"; + label = "UBI_DEV"; + + volumes { + ubi_factory: ubi-volume-factory { + volname = "Factory"; + }; + }; + }; + }; + }; +}; + +&ubi_factory { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1e00>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + }; +}; + +&ssusb1 { + status = "okay"; +}; + +&switch { + status = "okay"; + + ports { + port@0 { + status = "disabled"; + }; + + port@1 { + label = "lan2"; + }; + + port@2 { + label = "lan1"; + }; + + port@3 { + status = "disabled"; + }; + }; +}; + +&tphy { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&xphy { + status = "okay"; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index e9f63938b2..f228a3c3f8 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan0 eth1" eth2 ;; asus,rt-ax59u|\ + asus,zenwifi-bt8|\ cetron,ct3003|\ confiabits,mt7981|\ cudy,wr3000-v1|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 38019e89e5..5e15cf24d6 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -115,7 +115,8 @@ platform_do_upgrade() { ;; asus,rt-ax59u|\ asus,tuf-ax4200|\ - asus,tuf-ax6000) + asus,tuf-ax6000|\ + asus,zenwifi-bt8) CI_UBIPART="UBI_DEV" CI_KERNPART="linux" nand_do_upgrade "$1" @@ -260,7 +261,8 @@ platform_pre_upgrade() { case "$board" in asus,rt-ax59u|\ asus,tuf-ax4200|\ - asus,tuf-ax6000) + asus,tuf-ax6000|\ + asus,zenwifi-bt8) asus_initial_setup ;; xiaomi,mi-router-ax3000t|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index b188add1bd..f418a4ec9b 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -324,6 +324,26 @@ define Device/asus_tuf-ax6000 endef TARGET_DEVICES += asus_tuf-ax6000 +define Device/asus_zenwifi-bt8 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := ZenWiFi BT8 + DEVICE_DTS := mt7988d-asus-zenwifi-bt8 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-usb3 mt7988-2p5g-phy-firmware kmod-mt7996-firmware mt7988-wo-firmware + KERNEL := kernel-bin | gzip | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + KERNEL_LOADADDR := 0x48080000 + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := factory.bin + ARTIFACT/factory.bin := append-image initramfs-kernel.bin | uImage lzma +endif +endef +TARGET_DEVICES += asus_zenwifi-bt8 + define Device/bananapi_bpi-r3 DEVICE_VENDOR := Bananapi DEVICE_MODEL := BPi-R3 -- 2.30.2