Skip to content

Commit 317f893

Browse files
fildunskyhauke
authored andcommitted
mediatek: filogic: add support for Bazis AX3000WM
- SoC: MediaTek MT7981B - CPU: 2x 1.3 GHz Cortex-A53 - Flash: 128 MiB SPI NAND (Winbond W25N01GV) - RAM: 256 MiB (Nanya NT5CC128M16JR-EK) - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax) - Ethernet: 1x 10/100/1000/2500 Mbps MaxLinear GPY211C WAN, 1x10/100/1000 Mbps MT7981 LAN - USB 3.0 port - 2x buttons: Reset, Mesh - 3x LEDs on top panel (red, green, blue) - 3x PHY port LEDs (1 amber, 2 green) - Board version: WD830M V2.0 - Power: 5 VDC, 3 A UART: internal test points, 3V3 115200 8N1 (RX, TX, GND) Interface MAC Algorithm LAN (label) 1c:bf:ce:xx:xx:x1 0x4 WAN 1c:bf:ce:xx:xx:x2 0xa WLAN 2.4G 1c:bf:ce:xx:xx:x3 0x2a WLAN 5G 1c:bf:ce:xx:xx:x4 0x24 At the moment installation is possible via UART only since SSH root is password protected. Set a static ip on the ethernet interface of your PC: (ip address: 192.168.1.2, subnet mask:255.255.255.0). Boot into initramfs via TFTP: ``` setenv serverip 192.168.1.2 tftpboot 0x46000000 openwrt-mediatek-filogic-bazis_ax3000wm-initramfs-recovery.itb bootm 0x46000000 ``` Install kmod-mtd-rw and activate it: ``` apk update && apk add kmod-mtd-rw insmod mtd-rw i_want_a_brick=1 ``` Upload to the router and write OpenWrt BL2 and FIP bootloader: ``` mtd write openwrt-mediatek-filogic-bazis_ax3000wm-preloader.bin BL2 mtd write openwrt-mediatek-filogic-bazis_ax3000wm-bl31-uboot.fip FIP ``` Prepare ubi partition: ``` ubidetach -p /dev/mtd4 ubiformat /dev/mtd4 -y ubiattach -p /dev/mtd4 ``` Upgrade via luci web interface with sysupgrade file or by issuing a command: ``` sysupgrade -n openwrt-mediatek-filogic-bazis_ax3000wm-squashfs-sysupgrade.itb ``` Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com> Link: openwrt/openwrt#21813 (cherry picked from commit 658e4ad) Link: openwrt/openwrt#21924 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 7f9363a commit 317f893

File tree

8 files changed

+674
-0
lines changed

8 files changed

+674
-0
lines changed

package/boot/uboot-mediatek/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,18 @@ define U-Boot/mt7981_abt_asr3000
231231
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
232232
endef
233233

234+
define U-Boot/mt7981_bazis-ax3000wm
235+
NAME:=BAZIS AX3000WM
236+
BUILD_SUBTARGET:=filogic
237+
BUILD_DEVICES:=bazis_ax3000wm
238+
UBOOT_CONFIG:=mt7981_bazis_ax3000wm
239+
UBOOT_IMAGE:=u-boot.fip
240+
BL2_BOOTDEV:=spim-nand
241+
BL2_SOC:=mt7981
242+
BL2_DDRTYPE:=ddr3
243+
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
244+
endef
245+
234246
define U-Boot/mt7981_cmcc_a10
235247
NAME:=CMCC A10
236248
BUILD_SUBTARGET:=filogic
@@ -1106,6 +1118,7 @@ UBOOT_TARGETS := \
11061118
mt7628_ravpower_rp-wd009 \
11071119
mt7629_rfb \
11081120
mt7981_abt_asr3000 \
1121+
mt7981_bazis-ax3000wm \
11091122
mt7981_cmcc_a10 \
11101123
mt7981_cmcc_rax3000m-emmc-ddr3 \
11111124
mt7981_cmcc_rax3000m-emmc-ddr4 \
Lines changed: 329 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
--- /dev/null
2+
+++ b/configs/mt7981_bazis_ax3000wm_defconfig
3+
@@ -0,0 +1,107 @@
4+
+CONFIG_ARM=y
5+
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
6+
+CONFIG_POSITION_INDEPENDENT=y
7+
+CONFIG_ARCH_MEDIATEK=y
8+
+CONFIG_TEXT_BASE=0x41e00000
9+
+CONFIG_SYS_MALLOC_F_LEN=0x4000
10+
+CONFIG_NR_DRAM_BANKS=1
11+
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-bazis-ax3000wm"
12+
+CONFIG_OF_LIBFDT_OVERLAY=y
13+
+CONFIG_TARGET_MT7981=y
14+
+CONFIG_SYS_LOAD_ADDR=0x46000000
15+
+CONFIG_PRE_CON_BUF_ADDR=0x4007ef00
16+
+CONFIG_DEBUG_UART_BASE=0x11002000
17+
+CONFIG_DEBUG_UART_CLOCK=40000000
18+
+CONFIG_DEBUG_UART=y
19+
+CONFIG_FIT=y
20+
+CONFIG_BOOTDELAY=30
21+
+CONFIG_AUTOBOOT_KEYED=y
22+
+CONFIG_AUTOBOOT_MENU_SHOW=y
23+
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-bazis-ax3000wm.dtb"
24+
+CONFIG_LOGLEVEL=7
25+
+CONFIG_PRE_CONSOLE_BUFFER=y
26+
+CONFIG_LOG=y
27+
+# CONFIG_BOARD_INIT is not set
28+
+CONFIG_BOARD_LATE_INIT=y
29+
+CONFIG_HUSH_PARSER=y
30+
+CONFIG_SYS_PROMPT="MT7981> "
31+
+CONFIG_CMD_CPU=y
32+
+CONFIG_CMD_LICENSE=y
33+
+CONFIG_CMD_BOOTMENU=y
34+
+CONFIG_CMD_ASKENV=y
35+
+CONFIG_CMD_ERASEENV=y
36+
+CONFIG_CMD_ENV_FLAGS=y
37+
+CONFIG_CMD_STRINGS=y
38+
+CONFIG_CMD_DM=y
39+
+CONFIG_CMD_GPIO=y
40+
+CONFIG_CMD_GPT=y
41+
+CONFIG_CMD_MTD=y
42+
+CONFIG_CMD_PART=y
43+
+CONFIG_CMD_TFTPSRV=y
44+
+CONFIG_CMD_RARP=y
45+
+CONFIG_CMD_CDP=y
46+
+CONFIG_CMD_SNTP=y
47+
+CONFIG_CMD_LINK_LOCAL=y
48+
+CONFIG_CMD_DHCP=y
49+
+CONFIG_CMD_DNS=y
50+
+CONFIG_CMD_PING=y
51+
+CONFIG_CMD_PXE=y
52+
+CONFIG_CMD_CACHE=y
53+
+CONFIG_CMD_PSTORE=y
54+
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
55+
+CONFIG_CMD_UUID=y
56+
+CONFIG_CMD_HASH=y
57+
+CONFIG_CMD_SMC=y
58+
+CONFIG_CMD_UBI=y
59+
+CONFIG_CMD_UBI_RENAME=y
60+
+CONFIG_OF_EMBED=y
61+
+CONFIG_ENV_OVERWRITE=y
62+
+CONFIG_ENV_IS_IN_UBI=y
63+
+CONFIG_ENV_REDUNDANT=y
64+
+CONFIG_ENV_UBI_PART="ubi"
65+
+CONFIG_ENV_UBI_VOLUME="ubootenv"
66+
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
67+
+CONFIG_ENV_RELOC_GD_ENV_ADDR=y
68+
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
69+
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/bazis_ax3000wm_env"
70+
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
71+
+CONFIG_VERSION_VARIABLE=y
72+
+CONFIG_NETCONSOLE=y
73+
+CONFIG_USE_IPADDR=y
74+
+CONFIG_IPADDR="192.168.1.1"
75+
+CONFIG_USE_SERVERIP=y
76+
+CONFIG_SERVERIP="192.168.1.254"
77+
+CONFIG_NET_RANDOM_ETHADDR=y
78+
+CONFIG_BUTTON=y
79+
+CONFIG_BUTTON_GPIO=y
80+
+CONFIG_CLK=y
81+
+CONFIG_GPIO_HOG=y
82+
+CONFIG_LED=y
83+
+CONFIG_LED_BLINK=y
84+
+CONFIG_LED_GPIO=y
85+
+# CONFIG_MMC is not set
86+
+CONFIG_MTD=y
87+
+CONFIG_DM_MTD=y
88+
+CONFIG_MTD_SPI_NAND=y
89+
+CONFIG_MTD_UBI_FASTMAP=y
90+
+CONFIG_PHY_FIXED=y
91+
+CONFIG_MEDIATEK_ETH=y
92+
+CONFIG_PHY=y
93+
+CONFIG_PHY_MTK_TPHY=y
94+
+CONFIG_PINCTRL=y
95+
+CONFIG_PINCONF=y
96+
+CONFIG_PINCTRL_MT7981=y
97+
+CONFIG_POWER_DOMAIN=y
98+
+CONFIG_MTK_POWER_DOMAIN=y
99+
+CONFIG_DM_REGULATOR=y
100+
+CONFIG_DM_REGULATOR_FIXED=y
101+
+CONFIG_DM_REGULATOR_GPIO=y
102+
+CONFIG_RAM=y
103+
+CONFIG_DM_SERIAL=y
104+
+CONFIG_SERIAL_RX_BUFFER=y
105+
+CONFIG_MTK_SERIAL=y
106+
+CONFIG_SPI=y
107+
+CONFIG_DM_SPI=y
108+
+CONFIG_MTK_SPIM=y
109+
+CONFIG_ZSTD=y
110+
+CONFIG_HEXDUMP=y
111+
--- /dev/null
112+
+++ b/arch/arm/dts/mt7981-bazis-ax3000wm.dts
113+
@@ -0,0 +1,159 @@
114+
+// SPDX-License-Identifier: GPL-2.0
115+
+/*
116+
+ * Copyright (c) 2026
117+
+ * Author: Fil Dunsky <filipp.dunsky@gmail.com>
118+
+ */
119+
+
120+
+/dts-v1/;
121+
+#include "mt7981.dtsi"
122+
+#include <dt-bindings/gpio/gpio.h>
123+
+#include <dt-bindings/input/linux-event-codes.h>
124+
+
125+
+/ {
126+
+ #address-cells = <1>;
127+
+ #size-cells = <1>;
128+
+ model = "Bazis AX3000WM";
129+
+ compatible = "bazis,ax3000wm", "mediatek,mt7981";
130+
+
131+
+ chosen {
132+
+ stdout-path = &uart0;
133+
+ tick-timer = &timer0;
134+
+ };
135+
+
136+
+ memory@40000000 {
137+
+ device_type = "memory";
138+
+ reg = <0x40000000 0x10000000>;
139+
+ };
140+
+
141+
+ gpio-keys {
142+
+ compatible = "gpio-keys";
143+
+
144+
+ reset {
145+
+ label = "reset";
146+
+ linux,code = <KEY_RESTART>;
147+
+ gpios = <&pio 1 GPIO_ACTIVE_LOW>;
148+
+ };
149+
+
150+
+ mesh {
151+
+ label = "mesh";
152+
+ linux,code = <KEY_RFKILL>;
153+
+ gpios = <&pio 0 GPIO_ACTIVE_LOW>;
154+
+ };
155+
+ };
156+
+
157+
+ leds {
158+
+ compatible = "gpio-leds";
159+
+
160+
+ led_status: led_power {
161+
+ label = "blue:power";
162+
+ gpios = <&pio 13 GPIO_ACTIVE_LOW>;
163+
+ };
164+
+
165+
+ led_warning: led_fault {
166+
+ label = "red:fault";
167+
+ gpios = <&pio 34 GPIO_ACTIVE_LOW>;
168+
+ };
169+
+
170+
+ led_status_green: led-2 {
171+
+ label = "green:status";
172+
+ gpios = <&pio 35 GPIO_ACTIVE_LOW>;
173+
+ };
174+
+ };
175+
+};
176+
+
177+
+&uart0 {
178+
+ mediatek,force-highspeed;
179+
+ status = "okay";
180+
+};
181+
+
182+
+&eth {
183+
+ status = "okay";
184+
+ mediatek,gmac-id = <1>;
185+
+ phy-mode = "gmii";
186+
+ phy-handle = <&phy0>;
187+
+
188+
+ mdio {
189+
+ phy0: ethernet-phy@0 {
190+
+ compatible = "ethernet-phy-id03a2.9461";
191+
+ reg = <0x0>;
192+
+ phy-mode = "gmii";
193+
+ };
194+
+ };
195+
+};
196+
+
197+
+&pio {
198+
+ spi_flash_pins: spi0-pins-func-1 {
199+
+ mux {
200+
+ function = "flash";
201+
+ groups = "spi0", "spi0_wp_hold";
202+
+ };
203+
+
204+
+ conf-pu {
205+
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
206+
+ drive-strength = <MTK_DRIVE_4mA>;
207+
+ bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
208+
+ };
209+
+
210+
+ conf-pd {
211+
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
212+
+ drive-strength = <MTK_DRIVE_4mA>;
213+
+ bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
214+
+ };
215+
+ };
216+
+};
217+
+
218+
+&spi0 {
219+
+ #address-cells = <1>;
220+
+ #size-cells = <0>;
221+
+ pinctrl-names = "default";
222+
+ pinctrl-0 = <&spi_flash_pins>;
223+
+ status = "okay";
224+
+ must_tx;
225+
+ enhance_timing;
226+
+ dma_ext;
227+
+ ipm_design;
228+
+ support_quad;
229+
+ tick_dly = <2>;
230+
+ sample_sel = <0>;
231+
+
232+
+ spi_nand@0 {
233+
+ compatible = "spi-nand";
234+
+ reg = <0>;
235+
+ spi-max-frequency = <52000000>;
236+
+
237+
+ partitions {
238+
+ compatible = "fixed-partitions";
239+
+ #address-cells = <1>;
240+
+ #size-cells = <1>;
241+
+
242+
+ partition@0 {
243+
+ label = "BL2";
244+
+ reg = <0x0 0x100000>;
245+
+ };
246+
+
247+
+ partition@100000 {
248+
+ label = "u-boot-env";
249+
+ reg = <0x100000 0x80000>;
250+
+ };
251+
+
252+
+ partition@180000 {
253+
+ label = "Factory";
254+
+ reg = <0x180000 0x200000>;
255+
+ };
256+
+
257+
+ partition@380000 {
258+
+ label = "FIP";
259+
+ reg = <0x380000 0x200000>;
260+
+ };
261+
+
262+
+ partition@580000 {
263+
+ label = "ubi";
264+
+ reg = <0x580000 0x7a40000>;
265+
+ };
266+
+ };
267+
+ };
268+
+};
269+
+
270+
+&watchdog {
271+
+ status = "disabled";
272+
+};
273+
--- /dev/null
274+
+++ b/defenvs/bazis_ax3000wm_env
275+
@@ -0,0 +1,54 @@
276+
+ipaddr=192.168.1.1
277+
+serverip=192.168.1.254
278+
+loadaddr=0x46000000
279+
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
280+
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
281+
+bootconf=config-1
282+
+bootdelay=0
283+
+bootfile=openwrt-mediatek-filogic-bazis_ax3000wm-initramfs-recovery.itb
284+
+bootfile_bl2=openwrt-mediatek-filogic-bazis_ax3000wm-preloader.bin
285+
+bootfile_fip=openwrt-mediatek-filogic-bazis_ax3000wm-bl31-uboot.fip
286+
+bootfile_upg=openwrt-mediatek-filogic-bazis_ax3000wm-squashfs-sysupgrade.itb
287+
+bootled_pwr=blue:power
288+
+bootled_rec=red:fault
289+
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
290+
+bootmenu_default=0
291+
+bootmenu_delay=0
292+
+bootmenu_title= ( ( ( OpenWrt ) ) )
293+
+bootmenu_0=Initialize environment.=run _firstboot
294+
+bootmenu_0d=Run default boot command.=run boot_default
295+
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
296+
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
297+
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
298+
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
299+
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
300+
+bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return
301+
+bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
302+
+bootmenu_8=Reboot.=reset
303+
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
304+
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
305+
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
306+
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
307+
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
308+
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
309+
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
310+
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
311+
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
312+
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
313+
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
314+
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
315+
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
316+
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
317+
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
318+
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format
319+
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
320+
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
321+
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
322+
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
323+
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
324+
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
325+
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
326+
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
327+
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
328+
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
329+
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"

target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set_preinit_iface() {
22
case $(board_name) in
3+
bazis,ax3000wm|\
34
cudy,m3000-v1|\
45
cudy,tr3000-256mb-v1|\
56
cudy,tr3000-v1|\

0 commit comments

Comments
 (0)