Skip to content

Commit de0b9b6

Browse files
NULL0xFFhauke
authored andcommitted
ramips: add support for ipTIME AX2002MESH
ipTIME AX2002MESH is an 802.11ax (Wi-Fi 6) router based on MediaTek MT7621 SoC. Specifications: - SoC: MediaTek MT7621, MIPS 1004Kc, 880 MHz - RAM: 128 MiB - Flash: NAND 128 MiB (ESMT PSU1GA30DT) - WLAN: MediaTek MT7915E - 2.4 GHz: ax/b/g/n - 5 GHz: ac/ax/n - Ethernet: - LAN: MediaTek MT7530, 2x 1GbE - WAN: MediaTek SoC built-in, 1x 1GbE - UART: J4 header, 115200 8N1 - Pinout: [3V3] [TX] [RX] [GND] - Button: Reset - LEDs: 6 LEDs - 1x CPU (Amber) - 1x WLAN 5GHz (Amber) - 1x WLAN 2.4GHz (Amber) - 2x LAN (Amber) - 1x WAN (Amber) - Power: DC 12V/1A MAC addresses: | Interface | MAC | Algorithm | |:----------|:-----------------:|:--------------------------| | WLAN 2.4G | 58:86:94:XX:XX:34 | label | | WAN | 58:86:94:XX:XX:35 | label + 1 | | LAN | 58:86:94:XX:XX:37 | label + 3 | | WLAN 5G | 5A:86:94:XX:XX:37 | label + 3 with LA bit set | - The WLAN 2.4G MAC address (label) is stored in factory partition, 0x4 Installation: - Stock web interface: 1. Flash the **initramfs-factory** image through the web page. 2. Boot into OpenWrt and perform sysupgrade with **sysupgrade** image. - Recovery mode: 1. Turn on the device and press the Reset button more than 10 seconds to enter recovery mode. 2. Access the recovery web interface at 192.168.0.1/24 and flash the **initramfs-factory** image. 3. Boot into OpenWrt and perform sysupgrade with **sysupgrade** image. Signed-off-by: Myoung Ha, Ji <[email protected]> Link: openwrt/openwrt#20584 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 2462b36 commit de0b9b6

File tree

7 files changed

+209
-0
lines changed

7 files changed

+209
-0
lines changed

package/boot/uboot-tools/uboot-envtools/files/ramips

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ elecom,wrc-x1800gs|\
7878
h3c,tx1800-plus|\
7979
h3c,tx1801-plus|\
8080
h3c,tx1806|\
81+
iptime,ax2002m|\
8182
iptime,ax2004m|\
8283
jcg,q20|\
8384
linksys,e7350|\
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7621.dtsi"
4+
5+
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/input/input.h>
7+
#include <dt-bindings/leds/common.h>
8+
9+
/ {
10+
compatible = "iptime,ax2002m", "mediatek,mt7621-soc";
11+
model = "ipTIME AX2002MESH";
12+
13+
aliases {
14+
led-boot = &led_cpu;
15+
led-failsafe = &led_cpu;
16+
led-running = &led_cpu;
17+
led-upgrade = &led_cpu;
18+
};
19+
20+
chosen {
21+
bootargs = "console=ttyS0,115200";
22+
};
23+
24+
leds {
25+
compatible = "gpio-leds";
26+
27+
led_cpu: led-0 {
28+
color = <LED_COLOR_ID_AMBER>;
29+
function = LED_FUNCTION_CPU;
30+
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31+
};
32+
33+
led-1 {
34+
color = <LED_COLOR_ID_AMBER>;
35+
function = LED_FUNCTION_WLAN_2GHZ;
36+
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
37+
linux,default-trigger = "phy0radio";
38+
};
39+
40+
led-2 {
41+
color = <LED_COLOR_ID_AMBER>;
42+
function = LED_FUNCTION_WLAN_5GHZ;
43+
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
44+
linux,default-trigger = "phy1radio";
45+
};
46+
};
47+
48+
keys {
49+
compatible = "gpio-keys";
50+
51+
reset {
52+
label = "reset";
53+
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
54+
linux,code = <KEY_RESTART>;
55+
};
56+
};
57+
};
58+
59+
&nand {
60+
status = "okay";
61+
62+
mediatek,nmbm;
63+
mediatek,bmt-max-ratio = <1>;
64+
mediatek,bmt-max-reserved-blocks = <64>;
65+
mediatek,bmt-remap-range = <0x000000 0x580000>;
66+
67+
partitions {
68+
compatible = "fixed-partitions";
69+
#address-cells = <1>;
70+
#size-cells = <1>;
71+
72+
partition@0 {
73+
label = "u-boot";
74+
reg = <0x0 0x80000>;
75+
read-only;
76+
};
77+
78+
partition@80000 {
79+
label = "u-boot-env";
80+
reg = <0x80000 0x80000>;
81+
};
82+
83+
partition@100000 {
84+
label = "factory";
85+
reg = <0x100000 0x80000>;
86+
read-only;
87+
88+
nvmem-layout {
89+
compatible = "fixed-layout";
90+
#address-cells = <1>;
91+
#size-cells = <1>;
92+
93+
eeprom_factory_0: eeprom@0 {
94+
reg = <0x0 0xe00>;
95+
};
96+
97+
macaddr_factory_4: macaddr@4 {
98+
compatible = "mac-base";
99+
reg = <0x4 0x6>;
100+
#nvmem-cell-cells = <1>;
101+
};
102+
103+
precal_factory_e10: precal@e10 {
104+
reg = <0xe10 0x19c10>;
105+
};
106+
};
107+
};
108+
109+
partition@180000 {
110+
label = "firmware";
111+
reg = <0x180000 0x7680000>;
112+
113+
compatible = "fixed-partitions";
114+
#address-cells = <1>;
115+
#size-cells = <1>;
116+
117+
partition@0 {
118+
label = "kernel";
119+
reg = <0x0 0x400000>;
120+
};
121+
122+
partition@400000 {
123+
label = "ubi";
124+
reg = <0x400000 0x7280000>;
125+
};
126+
};
127+
128+
/* last 8 MiB is reserved for NMBM bad block table */
129+
};
130+
};
131+
132+
&state_default {
133+
gpio {
134+
groups = "i2c", "jtag", "wdt";
135+
function = "gpio";
136+
};
137+
};
138+
139+
&gmac0 {
140+
nvmem-cells = <&macaddr_factory_4 3>;
141+
nvmem-cell-names = "mac-address";
142+
};
143+
144+
&gmac1 {
145+
status = "okay";
146+
label = "wan";
147+
phy-handle = <&ethphy0>;
148+
149+
nvmem-cells = <&macaddr_factory_4 1>;
150+
nvmem-cell-names = "mac-address";
151+
};
152+
153+
&ethphy0 {
154+
/delete-property/ interrupts;
155+
};
156+
157+
&switch0 {
158+
ports {
159+
port@1 {
160+
status = "okay";
161+
label = "lan2";
162+
};
163+
164+
port@2 {
165+
status = "okay";
166+
label = "lan1";
167+
};
168+
};
169+
};
170+
171+
&pcie {
172+
status = "okay";
173+
};
174+
175+
&pcie1 {
176+
wifi@0,0 {
177+
compatible = "mediatek,mt76";
178+
reg = <0x0000 0 0 0 0>;
179+
nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
180+
nvmem-cell-names = "eeprom", "precal";
181+
};
182+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,27 @@ define Device/iptime_a8004t
18641864
endef
18651865
TARGET_DEVICES += iptime_a8004t
18661866

1867+
define Device/iptime_ax2002m
1868+
$(Device/nand)
1869+
IMAGE_SIZE := 121344k
1870+
KERNEL_LOADADDR := 0x82000000
1871+
KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \
1872+
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
1873+
ifeq ($(IB),)
1874+
ARTIFACTS := initramfs-factory.bin
1875+
ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \
1876+
check-size | iptime-crc32 ax2002m
1877+
endif
1878+
DEVICE_VENDOR := ipTIME
1879+
DEVICE_MODEL := AX2002MESH
1880+
DEVICE_PACKAGES := kmod-mt7915-firmware
1881+
DEVICE_COMPAT_VERSION := 2.0
1882+
DEVICE_COMPAT_MESSAGE := NMBM has been newly enabled, and its flash block \
1883+
mapping might be incompatible with existing installation. \
1884+
New installation with factory image via recovery mode is recommended.
1885+
endef
1886+
TARGET_DEVICES += iptime_ax2002m
1887+
18671888
define Device/iptime_ax2004m
18681889
$(Device/nand)
18691890
IMAGE_SIZE := 121344k

target/linux/ramips/mt7621/base-files/etc/board.d/02_network

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ ramips_setup_interfaces()
101101
glinet,gl-mt1300|\
102102
iodata,wn-deax1800gr|\
103103
iptime,a3002mesh|\
104+
iptime,ax2002m|\
104105
jcg,q20|\
105106
jdcloud,re-sp-01b|\
106107
lenovo,newifi-d1|\

target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ board_config_update
1010
case "$(board_name)" in
1111
ubnt,edgerouter-x|\
1212
ubnt,edgerouter-x-sfp|\
13+
iptime,ax2002m|\
1314
iptime,ax2004m)
1415
ucidef_set_compat_version "2.0"
1516
;;

target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ case "$board" in
9797
macaddr_setbit_la "$(macaddr_add $hw_mac_addr 3)" > /sys${DEVPATH}/macaddress
9898
[ "$PHYNBR" = "1" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress
9999
;;
100+
iptime,ax2002m|\
100101
iptime,ax2004m)
101102
if [ "$PHYNBR" = "1" ]; then
102103
hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"

target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ platform_do_upgrade() {
4545
fw_setenv --lock / bootImage 0 || exit 1
4646
fi
4747
;;
48+
iptime,ax2002m|\
4849
iptime,ax2004m)
4950
if [ "$(fw_printenv -n boot_from 2>/dev/null)" != "firmware1" ]; then
5051
fw_setenv boot_from firmware1 || exit 1
@@ -105,6 +106,7 @@ platform_do_upgrade() {
105106
gemtek,wvrtm-127acn|\
106107
gemtek,wvrtm-130acn|\
107108
iptime,a3004t|\
109+
iptime,ax2002m|\
108110
iptime,ax2004m|\
109111
iptime,t5004|\
110112
jcg,q20|\

0 commit comments

Comments
 (0)