Skip to content

Commit 1748ce8

Browse files
ses1erhauke
authored andcommitted
mediatek: add support for WAVLINK WL-WN536AX6 Rev a
Product name: Wavlink WL-WN536AX6 Rev a "Mighty LX2" Product link: https://www.wavlink.com/en_us/product/WL-WN536AX6.html Specifications: SOC: MT7986AV RAM: 512MB DDR4 Flash: 128MB SPI NAND Ports: 4 LAN (1G) & 1 WAN (2.5G) WIFI: MT7976PN + MT7975N LEDs: 8 (STATUS, WIFI, WAN, LAN1, LAN2, LAN3, LAN4, PWR) USB: 1 (3.0) MAC table, same as stock firmware: LAN: 80:3F:5D:xx:xx:x1 partition "hw" at 0x44e (ASCII) WAN: 80:3F:5D:xx:xx:x2 partition "hw" at 0x460 (ASCII) 2G: 80:3F:5D:xx:xx:x3 5G: 80:3F:5D:xx:xx:x4 * Installation with OEM WebUI: Note: Make sure PC is connected on LAN1 port. The OEM firmware has an unknown root password and settings are kept after upgrading firmware. Therefore, a customized Openwrt firmware is needed to remove the root password on login, by adding `passwd -d root` to /etc/init.d/bootcount. The WebUI does a filename check so the customized firmware is named accordingly. 1. Download modified firmware file `WAVLINK_WN536AX6-A_M36AX6_V250320-WO-437baca-modified.bin` from https://github.com/ses1er/firmware-misc/tree/main/wavlink/wl-wn536ax6a 2. Log into WebUI on default IP: http://192.168.20.1 3. Browse to More (top menu) -> System -> Firmware Upgrade. 4. Under `Local Upgrade` section, check the device to be upgraded and upload downloaded modified firmware. Click `UPLOAD FILE`, then `APPLY` 5. Wait about 2 minutes (ignore progress bar), and browse to http://192.168.20.1. You should see LUCI login page. Username is root and no password. 6. Browse to `System -> Backup/Flash Firmware`, click on `Flash Image`, click `Browse` and locate `openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin` file. 7. Uncheck `Keep settings and retain the current configuration` and click `Continue`. 8. Router will now be set to IP 192.168.1.1 which is the Openwrt default. * Installation with UART: Note: Having UART connected while cold booting the device will result in a kernel panic when initializing wifi. I've found this workaround: 1. Power off the device and ensure UART is not connected to PC. 2. Power up the device, when lights come on, plug in UART. 3. Warm boots and soft restarts will not cause kernel panic for the duration of device being powered on. Repeat steps for subsequent cold boots. 1. Configure TFTP server with IP 192.168.1.66. Copy `openwrt-mediatek-filogic-wavlink_wl-wn536ax6a-initramfs.itb` to TFTP root. 2. Interrupt boot by pressing 0. 3. Run the following in Uboot console: `setenv serverip 192.168.1.66; setenv ipaddr 192.168.1.1; tftpboot 0x46000000 openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-initramfs.itb; bootm` 4. Transfer `openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin` to device: (`scp -O openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin [email protected]:/tmp/`) 5. Run the following on device: `sysupgrade -n /tmp/openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin` Signed-off-by: Qing W. <[email protected]> Tested-by: Martin Blumenstingl <[email protected]> Link: openwrt/openwrt#20760 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 9bdf723 commit 1748ce8

File tree

4 files changed

+408
-0
lines changed

4 files changed

+408
-0
lines changed
Lines changed: 385 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,385 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
3+
/dts-v1/;
4+
#include <dt-bindings/gpio/gpio.h>
5+
#include <dt-bindings/input/input.h>
6+
#include <dt-bindings/leds/common.h>
7+
#include <dt-bindings/pinctrl/mt65xx.h>
8+
9+
#include "mt7986a.dtsi"
10+
11+
/ {
12+
compatible = "wavlink,wl-wn536ax6-a", "mediatek,mt7986a";
13+
model = "WAVLINK WL-WN536AX6 Rev a";
14+
15+
aliases {
16+
serial0 = &uart0;
17+
label-mac-device = &wifi;
18+
led-boot = &led_status_blue;
19+
led-failsafe = &led_status_blue;
20+
led-running = &led_status_blue;
21+
led-upgrade = &led_status_blue;
22+
};
23+
24+
chosen {
25+
stdout-path = "serial0:115200n8";
26+
};
27+
28+
gpio-keys {
29+
compatible = "gpio-keys";
30+
31+
reset {
32+
label = "reset";
33+
linux,code = <KEY_RESTART>;
34+
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
35+
};
36+
37+
pair {
38+
label = "pair";
39+
linux,code = <KEY_WPS_BUTTON>;
40+
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
41+
};
42+
43+
turbo {
44+
label = "turbo";
45+
linux,code = <BTN_MISC>;
46+
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
47+
};
48+
};
49+
50+
leds {
51+
compatible = "gpio-leds";
52+
53+
led-0 {
54+
color = <LED_COLOR_ID_BLUE>;
55+
function = LED_FUNCTION_WAN;
56+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
57+
};
58+
59+
led-1 {
60+
color = <LED_COLOR_ID_BLUE>;
61+
function = LED_FUNCTION_POWER;
62+
gpios = <&pio 14 GPIO_ACTIVE_HIGH>;
63+
};
64+
65+
led_status_blue: led-2 {
66+
color = <LED_COLOR_ID_BLUE>;
67+
function = LED_FUNCTION_STATUS;
68+
gpios = <&pio 31 GPIO_ACTIVE_LOW>;
69+
};
70+
71+
led-3 {
72+
color = <LED_COLOR_ID_BLUE>;
73+
function = LED_FUNCTION_WLAN;
74+
gpios = <&pio 32 GPIO_ACTIVE_LOW>;
75+
linux,default-trigger = "phy1tpt";
76+
};
77+
};
78+
79+
memory@40000000 {
80+
reg = <0 0x40000000 0 0x20000000>;
81+
device_type = "memory";
82+
};
83+
84+
reg_1p8v: regulator-1p8v {
85+
compatible = "regulator-fixed";
86+
regulator-name = "fixed-1.8V";
87+
regulator-min-microvolt = <1800000>;
88+
regulator-max-microvolt = <1800000>;
89+
regulator-boot-on;
90+
regulator-always-on;
91+
};
92+
93+
reg_3p3v: regulator-3p3v {
94+
compatible = "regulator-fixed";
95+
regulator-name = "fixed-3.3V";
96+
regulator-min-microvolt = <3300000>;
97+
regulator-max-microvolt = <3300000>;
98+
regulator-boot-on;
99+
regulator-always-on;
100+
};
101+
102+
reg_5v: regulator-5v {
103+
compatible = "regulator-fixed";
104+
regulator-name = "fixed-5V";
105+
regulator-min-microvolt = <5000000>;
106+
regulator-max-microvolt = <5000000>;
107+
regulator-boot-on;
108+
regulator-always-on;
109+
};
110+
};
111+
112+
&crypto {
113+
status = "okay";
114+
};
115+
116+
&eth {
117+
status = "okay";
118+
119+
/* LAN */
120+
gmac0: mac@0 {
121+
compatible = "mediatek,eth-mac";
122+
reg = <0>;
123+
phy-mode = "2500base-x";
124+
125+
nvmem-cell-names = "mac-address";
126+
nvmem-cells = <&macaddr_hw_44e 0>;
127+
128+
fixed-link {
129+
full-duplex;
130+
pause;
131+
speed = <2500>;
132+
};
133+
};
134+
135+
/* WAN */
136+
gmac1: mac@1 {
137+
compatible = "mediatek,eth-mac";
138+
reg = <1>;
139+
phy-mode = "2500base-x";
140+
phy-handle = <&phy6>;
141+
142+
nvmem-cell-names = "mac-address";
143+
nvmem-cells = <&macaddr_hw_44e 1>;
144+
};
145+
146+
mdio-bus {
147+
#address-cells = <1>;
148+
#size-cells = <0>;
149+
150+
/* MaxLinear GPY211C 2.5G PHY */
151+
phy6: phy@6 {
152+
/*
153+
* Force the ID here as the PHY only reports it's
154+
* (C45) ID correctly after a reset (before resetting
155+
* it reports 0xfffffff, which causes only the genphy
156+
* driver to match).
157+
*/
158+
compatible = "ethernet-phy-id67c9.de10";
159+
reg = <6>;
160+
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
161+
reset-assert-us = <600>;
162+
reset-deassert-us = <20000>;
163+
phy-mode = "2500base-x";
164+
};
165+
166+
switch@1f {
167+
compatible = "mediatek,mt7531";
168+
reg = <31>;
169+
reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
170+
171+
ports {
172+
#address-cells = <1>;
173+
#size-cells = <0>;
174+
175+
port@0 {
176+
reg = <0>;
177+
label = "lan4";
178+
};
179+
180+
port@1 {
181+
reg = <1>;
182+
label = "lan3";
183+
};
184+
185+
port@2 {
186+
reg = <2>;
187+
label = "lan2";
188+
};
189+
190+
port@3 {
191+
reg = <3>;
192+
label = "lan1";
193+
};
194+
195+
port@6 {
196+
reg = <6>;
197+
label = "cpu";
198+
ethernet = <&gmac0>;
199+
phy-mode = "2500base-x";
200+
201+
fixed-link {
202+
speed = <2500>;
203+
full-duplex;
204+
pause;
205+
};
206+
};
207+
};
208+
};
209+
};
210+
};
211+
212+
&pio {
213+
spi_flash_pins: spi-flash-pins-33-to-38 {
214+
mux {
215+
function = "spi";
216+
groups = "spi0", "spi0_wp_hold";
217+
};
218+
219+
conf-pd {
220+
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
221+
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
222+
drive-strength = <MTK_DRIVE_8mA>;
223+
};
224+
225+
conf-pu {
226+
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
227+
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
228+
drive-strength = <MTK_DRIVE_8mA>;
229+
};
230+
};
231+
232+
wf_2g_5g_pins: wf_2g_5g-pins {
233+
mux {
234+
function = "wifi";
235+
groups = "wf_2g", "wf_5g";
236+
};
237+
238+
conf {
239+
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
240+
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
241+
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
242+
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
243+
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
244+
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
245+
"WF1_TOP_CLK", "WF1_TOP_DATA";
246+
drive-strength = <MTK_DRIVE_4mA>;
247+
};
248+
};
249+
250+
wf_dbdc_pins: wf_dbdc-pins {
251+
mux {
252+
function = "wifi";
253+
groups = "wf_dbdc";
254+
};
255+
256+
conf {
257+
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
258+
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
259+
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
260+
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
261+
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
262+
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
263+
"WF1_TOP_CLK", "WF1_TOP_DATA";
264+
drive-strength = <MTK_DRIVE_4mA>;
265+
};
266+
};
267+
};
268+
269+
&spi0 {
270+
pinctrl-names = "default";
271+
pinctrl-0 = <&spi_flash_pins>;
272+
status = "okay";
273+
274+
/* Macronix SPI NAND (128M) */
275+
flash@0 {
276+
compatible = "spi-nand";
277+
#address-cells = <1>;
278+
#size-cells = <1>;
279+
reg = <0>;
280+
281+
spi-max-frequency = <52000000>;
282+
spi-tx-bus-width = <4>;
283+
spi-rx-bus-width = <4>;
284+
285+
spi-cal-enable;
286+
spi-cal-mode = "read-data";
287+
spi-cal-datalen = <7>;
288+
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>;
289+
spi-cal-addrlen = <5>;
290+
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
291+
292+
partitions {
293+
compatible = "fixed-partitions";
294+
#address-cells = <1>;
295+
#size-cells = <1>;
296+
297+
partition@0 {
298+
label = "BL2";
299+
reg = <0x0 0x100000>;
300+
read-only;
301+
};
302+
303+
partition@100000 {
304+
label = "u-boot-env";
305+
reg = <0x100000 0x80000>;
306+
};
307+
308+
partition@180000 {
309+
label = "Factory";
310+
reg = <0x180000 0x200000>;
311+
read-only;
312+
313+
nvmem-layout {
314+
compatible = "fixed-layout";
315+
#address-cells = <1>;
316+
#size-cells = <1>;
317+
318+
eeprom_factory_0: eeprom@0 {
319+
reg = <0x0 0x1000>;
320+
};
321+
};
322+
};
323+
324+
partition@380000 {
325+
label = "FIP";
326+
reg = <0x380000 0x200000>;
327+
read-only;
328+
};
329+
330+
partition@580000 {
331+
label = "ubi";
332+
reg = <0x580000 0x4000000>;
333+
};
334+
335+
partition@7580000 {
336+
label = "HW";
337+
reg = <0x4580000 0x80000>;
338+
read-only;
339+
340+
nvmem-layout {
341+
compatible = "fixed-layout";
342+
#address-cells = <1>;
343+
#size-cells = <1>;
344+
345+
macaddr_hw_44e: macaddr@44e {
346+
compatible = "mac-base";
347+
reg = <0x44e 0x11>;
348+
#nvmem-cell-cells = <1>;
349+
};
350+
};
351+
};
352+
};
353+
};
354+
};
355+
356+
&ssusb {
357+
status = "okay";
358+
vusb33-supply = <&reg_3p3v>;
359+
vbus-supply = <&reg_5v>;
360+
};
361+
362+
&uart0 {
363+
status = "okay";
364+
};
365+
366+
&usb_phy {
367+
status = "okay";
368+
};
369+
370+
&trng {
371+
status = "okay";
372+
};
373+
374+
&watchdog {
375+
status = "okay";
376+
};
377+
378+
&wifi {
379+
nvmem-cells = <&eeprom_factory_0>;
380+
nvmem-cell-names = "eeprom";
381+
pinctrl-names = "default", "dbdc";
382+
pinctrl-0 = <&wf_2g_5g_pins>;
383+
pinctrl-1 = <&wf_dbdc_pins>;
384+
status = "okay";
385+
};

target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ tplink,re6000xd)
233233
ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx"
234234
ucidef_set_led_netdev "eth1" "lan-3" "blue:lan-2" "eth1" "link tx rx"
235235
;;
236+
wavlink,wl-wn536ax6-a)
237+
ucidef_set_led_netdev "wifi" "wifi" "blue:wlan" "phy1-ap0" "link"
238+
ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth1" "link tx rx"
239+
;;
236240
wavlink,wl-wn551x3)
237241
ucidef_set_led_netdev "lan-1" "lan-1" "green:lan-1" "lan1" "link tx rx"
238242
ucidef_set_led_netdev "lan-2" "lan-2" "green:lan-2" "lan2" "link tx rx"

0 commit comments

Comments
 (0)