Skip to content

Commit 5029164

Browse files
ccchen1984blogic
authored andcommitted
ramips: add support for ASUS 4G-AX56
Specifications: - Device: ASUS 4g-AX56 - SoC: MT7621AT - Flash: 128MB - RAM: 512MB - Switch: 1 WAN, 4 LAN (10/100/1000 Mbps) - WiFi: MT7905 2x2 2.4G + MT7975 2x2 5G - LTE : Fibocom FG621-EA - LEDs: 1x POWER (white, configurable) 1x 2.4G (white, not configurable) 1x 5G (white, not configurable) 1x WAN (white, not configurable) 1x 3G/4G (white, not configurable) 3x signal (white, not configurable) Flash by U-Boot TFTP method: - Configure your PC with IP 192.168.0.2 - Set up TFTP server and put the factory.bin image on your PC - Connect serial port(rate:115200) and turn on AP, then interrupt "U-Boot Boot Menu" by hitting any key Select "2. Upgrade firmware" Press enter when show "Run firmware after upgrading? (Y/n):" Select 0 for TFTP method Input U-Boot's IP address: 192.168.0.1 Input TFTP server's IP address: 192.168.0.2 Input IP netmask: 255.255.255.0 Input file name: openwrt-ramips-mt7621-asus_4g-ax56-squashfs-factory.bin - Restart AP aftre see the log "Firmware upgrade completed!" Notice: - LTE module is disable after flash openwrt image so you must active LTE by following two AT command echo -e "AT+GTAUTOCONNECT=1\r\n" > /dev/ttyUSB0 echo -e "AT+GTRNDIS=1,1\r\n" > /dev/ttyUSB0 - After finish AT command once, you don't need to input command later even if reboot/restore default Signed-off-by: Chuncheng Chen <[email protected]> Link: openwrt/openwrt#16752 Signed-off-by: John Crispin <[email protected]>
1 parent 9e78db0 commit 5029164

File tree

4 files changed

+227
-0
lines changed

4 files changed

+227
-0
lines changed

package/boot/uboot-envtools/files/ramips

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ zte,mf283plus)
6969
;;
7070
asus,rt-ax53u|\
7171
asus,rt-ax54|\
72+
asus,4g-ax56|\
7273
belkin,rt1800|\
7374
elecom,wrc-x1800gs|\
7475
h3c,tx1800-plus|\
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
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 = "asus,4g-ax56", "mediatek,mt7621-soc";
11+
model = "ASUS 4G-AX56";
12+
13+
aliases {
14+
led-boot = &led_power;
15+
led-failsafe = &led_power;
16+
led-running = &led_power;
17+
led-upgrade = &led_power;
18+
label-mac-device = &gmac0;
19+
};
20+
21+
chosen {
22+
bootargs = "console=ttyS0,115200";
23+
bootargs-override = "console=ttyS0,115200";
24+
};
25+
26+
leds {
27+
compatible = "gpio-leds";
28+
29+
led_power: power {
30+
color = <LED_COLOR_ID_WHITE>;
31+
function = LED_FUNCTION_POWER;
32+
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
33+
};
34+
};
35+
36+
keys {
37+
compatible = "gpio-keys";
38+
39+
key-restart {
40+
label = "reset";
41+
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
42+
linux,code = <KEY_RESTART>;
43+
};
44+
45+
key-wps {
46+
label = "wps";
47+
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
48+
linux,code = <KEY_WPS_BUTTON>;
49+
};
50+
};
51+
};
52+
53+
&nand {
54+
status = "okay";
55+
56+
mediatek,nmbm;
57+
mediatek,bmt-remap-range =
58+
<0x000000 0x7e0000>,
59+
<0x35e0000 0x7800000>;
60+
61+
partitions {
62+
compatible = "fixed-partitions";
63+
#address-cells = <1>;
64+
#size-cells = <1>;
65+
66+
partition@0 {
67+
label = "u-boot";
68+
reg = <0x0 0x80000>;
69+
read-only;
70+
};
71+
72+
/*
73+
* u-boot gets split here while keeping u-boot read-only,
74+
* which allows safe usage of fw_setenv
75+
*/
76+
partition@80000 {
77+
label = "u-boot-env";
78+
reg = <0x80000 0x60000>;
79+
};
80+
81+
partition@e0000 {
82+
label = "nvram";
83+
reg = <0xe0000 0x100000>;
84+
read-only;
85+
};
86+
87+
partition@1e0000 {
88+
label = "factory";
89+
reg = <0x1e0000 0x100000>;
90+
read-only;
91+
92+
nvmem-layout {
93+
compatible = "fixed-layout";
94+
#address-cells = <1>;
95+
#size-cells = <1>;
96+
97+
eeprom_factory_0: eeprom@0 {
98+
reg = <0x0 0xe00>;
99+
};
100+
101+
macaddr_factory_4: macaddr@4 {
102+
reg = <0x4 0x6>;
103+
};
104+
105+
precal_factory_e10: precal@e10 {
106+
reg = <0xe10 0x19c10>;
107+
};
108+
};
109+
};
110+
111+
partition@2e0000 {
112+
label = "factory2";
113+
reg = <0x2e0000 0x100000>;
114+
read-only;
115+
};
116+
117+
partition@3e0000 {
118+
label = "firmware";
119+
reg = <0x3e0000 0x3200000>;
120+
121+
compatible = "fixed-partitions";
122+
#address-cells = <1>;
123+
#size-cells = <1>;
124+
125+
partition@0 {
126+
label = "kernel";
127+
reg = <0x0 0x400000>;
128+
};
129+
130+
partition@400000 {
131+
label = "ubi";
132+
reg = <0x400000 0x2e00000>;
133+
};
134+
};
135+
136+
partition@35e0000 {
137+
label = "firmware2";
138+
reg = <0x35e0000 0x3200000>;
139+
};
140+
141+
partition@67e0000 {
142+
label = "jffs2";
143+
reg = <0x67e0000 0x1020000>;
144+
};
145+
146+
/* Last 8M are reserved for NMBM management (bad blocks) */
147+
};
148+
};
149+
150+
&pcie {
151+
status = "okay";
152+
};
153+
154+
&pcie1 {
155+
wifi@0,0 {
156+
compatible = "mediatek,mt76";
157+
reg = <0x0000 0 0 0 0>;
158+
nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
159+
nvmem-cell-names = "eeprom", "precal";
160+
mediatek,disable-radar-background;
161+
};
162+
};
163+
164+
&gmac0 {
165+
nvmem-cells = <&macaddr_factory_4>;
166+
nvmem-cell-names = "mac-address";
167+
};
168+
169+
&gmac1 {
170+
status = "okay";
171+
label = "wan";
172+
phy-handle = <&ethphy0>;
173+
174+
nvmem-cells = <&macaddr_factory_4>;
175+
nvmem-cell-names = "mac-address";
176+
};
177+
178+
&ethphy0 {
179+
/delete-property/ interrupts;
180+
};
181+
182+
&switch0 {
183+
ports {
184+
port@1 {
185+
status = "okay";
186+
label = "lan1";
187+
};
188+
189+
port@2 {
190+
status = "okay";
191+
label = "lan2";
192+
};
193+
194+
port@3 {
195+
status = "okay";
196+
label = "lan3";
197+
};
198+
199+
port@4 {
200+
status = "okay";
201+
label = "lan4";
202+
};
203+
};
204+
};
205+
206+
&state_default {
207+
gpio {
208+
groups = "i2c", "uart2", "uart3", "jtag", "wdt";
209+
function = "gpio";
210+
};
211+
};

target/linux/ramips/image/mt7621.mk

100644100755
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,20 @@ define Device/asus_rt-ax54
471471
endef
472472
TARGET_DEVICES += asus_rt-ax54
473473

474+
define Device/asus_4g-ax56
475+
$(Device/nand)
476+
$(Device/uimage-lzma-loader)
477+
DEVICE_VENDOR := ASUS
478+
DEVICE_MODEL := 4G-AX56
479+
IMAGE_SIZE := 51200k
480+
IMAGES += factory.bin
481+
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
482+
check-size
483+
DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 kmod-usb-serial-option \
484+
kmod-usb-net-cdc-ncm
485+
endef
486+
TARGET_DEVICES += asus_4g-ax56
487+
474488
define Device/beeline_smartbox-flash
475489
$(Device/nand)
476490
$(Device/uimage-lzma-loader)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ platform_do_upgrade() {
7474
asus,rt-ac85p|\
7575
asus,rt-ax53u|\
7676
asus,rt-ax54|\
77+
asus,4g-ax56|\
7778
beeline,smartbox-flash|\
7879
beeline,smartbox-giga|\
7980
beeline,smartbox-pro|\

0 commit comments

Comments
 (0)