ramips: add support for Wavlink WL-WN531G3
This device is similiar to the Wavlink WL-WN531A3. Hardware
SoC: Mediatek MT7620A RAM: 64MB FLASH: 8MB NOR (GigaDevice GD25Q64CS) ETH:
- 2x 10/100/1000 Mbps Ethernet (RTL8211F)
- 3x 10/100 Mbps Ethernet (integrated in SOC) WIFI:
- 2.4GHz: 1x (integrated in SOC) (2x2:2)
- 5GHz: 1x MT7612E (2x2:2)
- 4 external antennas BTN:
- 1x Reset button
- 1x Touchlink button
- 1x Turbo button
- 1x Wps button
- 1x ON/OFF switch LEDS:
- 1x Red led (system status)
- 1x Blue led (system status)
- 5x Blue leds (ethernet ports)
- 1x Power led
- 1x Wifi led UART:
- 57600-8-N-1
Everything works correctly.
Installation
Flash the initramfs image in the OEM firmware interface When Openwrt boots, flash the sysupgrade image otherwise you won't be able to keep configuration between reboots. In my case the whole device was locked and there was no way to flash the image, except for flashing directly to the flash via an spi-flasher. You need to put the sysupgrade image file at the beginning of 0x60000.
Notes
-
Router mac addresses: LAN XX:XX:XX:XX:XX:F0 (factory @ 0x28) WAN XX:XX:XX:XX:XX:F1 (factory @ 0x2e) WIFI 2G XX:XX:XX:XX:XX:F2 (factory @ 0x04) WIFI 5G XX:XX:XX:XX:XX:F3 (factory @ 0x8004)
LABEL XX:XX:XX:XX:XX:F2
all done
I needed to add the line #include <dt-bindings/leds/common.h> in the dts file
all done
Done
Take a look at https://github.com/openwrt/openwrt/commit/31a6605de04218e1c04bd5c2436c24d7d1c07506 Does this board have eLNA?
@namiltd I rechecked the board but didnt find LNA or PA related components.
Or maybe you have a log of loading the stock firmware? There's a lot to read from it.
LINUX started...
THIS IS ASIC
Linux version 2.6.36 (root@zz) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r16449) ) #65 Wed Apr 18 17:46:30 CST 2018
The CPU feqenuce set to 580 MHz
PCIE: bypass PCIe DLL.
PCIE: Elastic buffer control: Addr:0x68 -> 0xB4
disable all power about PCIe
CPU revision is: 00019650 (MIPS 24Kc)
Software DMA cache coherency
Determined physical RAM map:
memory: 04000000 @ 00000000 (usable)
User-defined physical RAM map:
memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: mem=64M console=ttyS1,57600n8 root=/dev/mtdblock6 rootfstype=squashfs console=ttyS0 init_debug=99
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Primary instruction cache 64kB, VIPT, , 4-waylinesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
Writing ErrCtl register=0002803e
Readback ErrCtl register=0002803e
Memory: 59720k/65536k available (3727k kernel code, 5816k reserved, 1014k data, 168k init, 0k highmem)
NR_IRQS:128
console [ttyS1] enabled
Calibrating delay loop... 386.04 BogoMIPS (lpj=772096)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
RALINK_GPIOMODE = 1a301d
RALINK_GPIOMODE = 18301d
PPLL_CFG1=0xe74000
MT7620 PPLL lock
PPLL_DRV =0x80080504
start PCIe register access
RALINK_RSTCTRL = 2400000
RALINK_CLKCFG1 = 75afffc0
*************** MT7620 PCIe RC mode *************
PCIE0 enabled
init_rt2880pci done
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pci 0000:00:00.0: BAR 0: can't assign mem (size 0x80000000)
pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
pci 0000:00:00.0: BAR 1: set to [mem 0x20200000-0x2020ffff] (PCI address [0x20200000-0x2020ffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
pci 0000:01:00.0: BAR 0: set to [mem 0x20000000-0x200fffff 64bit] (PCI address [0x20000000-0x200fffff]
pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
pci 0000:00:00.0: PCI bridge to [bus 01-01]
pci 0000:00:00.0: bridge window [io disabled]
pci 0000:00:00.0: bridge window [mem 0x20000000-0x200fffff]
pci 0000:00:00.0: bridge window [mem 0x20100000-0x201fffff pref]
BAR0 at slot 0 = 0
bus=0x0, slot = 0x0
res[0]->start = 0
res[0]->end = 0
res[1]->start = 20200000
res[1]->end = 2020ffff
res[2]->start = 0
res[2]->end = 0
res[3]->start = 0
res[3]->end = 0
res[4]->start = 0
res[4]->end = 0
res[5]->start = 0
res[5]->end = 0
bus=0x1, slot = 0x0
res[0]->start = 20000000
res[0]->end = 200fffff
res[1]->start = 0
res[1]->end = 0
res[2]->start = 0
res[2]->end = 0
res[3]->start = 0
res[3]->end = 0
res[4]->start = 0
res[4]->end = 0
res[5]->start = 0
res[5]->end = 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
RT3xxx EHCI/OHCI init.
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2 (NAND) (SUMMARY) (ZLIB) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
msgmni has been set to 116
io scheduler noop registered (default)
Ralink gpio driver initialized
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x10000500 (irq = 37) is a 16550A
serial8250: ttyS1 at MMIO 0x10000c00 (irq = 12) is a 16550A
brd: module loaded
deice id : c8 40 17 c8 40 (4017c840)
Warning: un-recognized chip ID, please update SPI driver!
GD25Q64B(c8 40170000) (8192 Kbytes)
mtd .name = raspi, .size = 0x00800000 (0M) .erasesize = 0x00000008 (0K) .numeraseregions = 65536
Creating 6 MTD partitions on "raspi":
0x000000000000-0x000000800000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000060000 : "params"
0x000000060000-0x000000800000 : "firmware"
mtd: try split firmware partition
mtd: split_firmware
mtd: firmware_partition->size 0x7a0000
mtd: firmware_partition->offset 0x60000
mtd: uimage_len 1579678
mtd: rootfs_partition->size 0x61e562
mtd: rootfs_partition->offset 0x1e1a9e
mtd: partition "rootfs" created automatically, ofs=1E1A9E, len=61E562
0x0000001e1a9e-0x000000800000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
mtd: rootfs_len 5104994
mtd: unused_partition->size 0x140000
mtd: unused_partition->offset 0x6c0000
mtd: partition "rootfs_data" created automatically, ofs=6C0000, len=140000
0x0000006c0000-0x000000800000 : "rootfs_data"
rdm_major = 253
SMACCR1 -- : 0x0000803f
SMACCR0 -- : 0x5da6e3f0
Ralink APSoC Ethernet Driver Initilization. v3.1 256 rx/tx descriptors allocated, mtu = 1500!
NAPI enable, Tx Ring = 256, Rx Ring = 256
SMACCR1 -- : 0x0000803f
SMACCR0 -- : 0x5da6e3f0
PROC INIT OK!
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
usbcore: registered new interface driver asix
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
rt3xxx-ehci rt3xxx-ehci: Ralink EHCI Host Controller
rt3xxx-ehci rt3xxx-ehci: new USB bus registered, assigned bus number 1
rt3xxx-ehci rt3xxx-ehci: irq 18, io mem 0x101c0000
rt3xxx-ehci rt3xxx-ehci: USB 0.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
rt3xxx-ohci rt3xxx-ohci: RT3xxx OHCI Controller
rt3xxx-ohci rt3xxx-ohci: new USB bus registered, assigned bus number 2
rt3xxx-ohci rt3xxx-ohci: irq 18, io mem 0x101c1000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
MTK MSDC device init.
mtk-sd: MediaTek MT6575 MSDC Driver
u32 classifier
nf_conntrack version 0.5.0 (933 buckets, 3732 max)
nf_conntrack_rtsp v0.6.21 loading
nf_nat_rtsp v0.6.21 loading
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Linux
----------------------------
--------igd inited----------
----------------------------
TCP cubic registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <[email protected]>
All bugs added by David S. Miller <[email protected]>
msdc0 -> ops_get_cd return<0> <- msdc_ops_get_cd() : L<2318> PID<kworker/u:1><0x1d>
VFS: Mounted root (squashfs filesystem) readonly on device 31:6.
Freeing unused kernel memory: 168k freed
Console is alive
procd: Console is alive
- skip procd watchdog -
procd: - skip procd watchdog -
kmod: ran 1 iterations
- preinit -
procd: - preinit -
procd: procd_preinit(67): Launched preinit instance, pid=39
Press the [f] key and hit [enter] to enter failsafe mode
kmod: ran 1 iterations
JFFS2 notice: (73) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 6 of xref (0 dead, 0 orphan) found.
mount_root: jffs2 is ready
JFFS2 notice: (70) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 6 of xref (0 dead, 0 orphan) found.
procd: spawn_procd(40): Exec to real procd now
- early -
procd: - early -
- skip procd watchdog -
procd: - skip procd watchdog -
- skip procd watchdog -
procd: - skip procd watchdog -
- init -
procd: - init -
Please press Enter to activate this console.
tntfs: module license 'Commercial. For support email [email protected].' taints kernel.
Disabling lock debugging due to kernel taint
Tuxera NTFS driver 3015.1.29 [Flags: R/W MODULE].
Tuxera FAT 12/16/32 driver version 3015.1.29 [Flags: R/W MODULE].
Built against headers 2.6.36 #4 Wed Mar 23 11:01:18 CST 2016 mips
Running on kernel 2.6.36 #65 Wed Apr 18 17:46:30 CST 2018 mips
WARNING: Running kernel does not match configured kernel headers the driver was built with! The driver needs to be rebuilt with the correct kernel headers!
Tuxera exFAT driver version 3015.8.24 [Flags: R/W MODULE].
Built against headers 2.6.36 #4 Wed Mar 23 11:01:18 CST 2016 mips
Running on kernel 2.6.36 #65 Wed Apr 18 17:46:30 CST 2018 mips
regiester url hooks finish
l7 inited
PPTP driver version 0.8.5
[IPC:00369]:ipc server success, path:/tmp/ipc_path_disk, sock:3
Raeth v3.1 (NAPI
)
phy_tx_ring = 0x02e63000, tx_ring = 0xa2e63000
phy_rx_ring0 = 0x02e64000, rx_ring0 = 0xa2e64000
0x19: 863 --> 862
0: 1040 --> 9040
0x19: 863 --> 862
0: 1040 --> 9040
SMACCR1 -- : 0x0000803f
SMACCR0 -- : 0x5da6e3f0
ESW: Link Status Changed - Port4 Link UP
CDMA_CSG_CFG = 81000000
GDMA1_FWD_CFG = 20710000
device eth0.1 entered promiscuous mode
device eth0 entered promiscuous mode
-------->fdb_create, 402!!!
br-lan: port 1(eth0.1) entering learning state
br-lan: port 1(eth0.1) entering learning state
touch_enable=1
procd: - init complete -
0x1300 = 00064320
ESW: Link Status Changed - Port4 Link UP
device ra0 entered promiscuous mode
-------->fdb_create, 402!!!
br-lan: port 2(ra0) entering learning state
br-lan: port 2(ra0) entering learning state
[IPC:00198]:connect OK,socket=4
-------->fdb_create, 402!!!
device ra1 entered promiscuous mode
-------->fdb_create, 402!!!
device rai0 entered promiscuous mode
-------->fdb_create, 402!!!
br-lan: port 4(rai0) entering learning state
br-lan: port 4(rai0) entering learning state
device rai1 entered promiscuous mode
-------->fdb_create, 402!!!
ESW: Link Status Changed - Port4 Link Down
-------->fdb_create, 402!!!
main[107]:reset start
wps_init[17]:wps init
resetd_init[31]:flag:1
main[136]:reset_time: 60
ESW: Link Status Changed - Port4 Link UP
br-lan: port 1(eth0.1) entering forwarding state
device ra2 entered promiscuous mode
-------->fdb_create, 402!!!
br-lan: port 6(ra2) entering learning state
br-lan: port 6(ra2) entering learning state
wpsinit
br-lan: port 2(ra0) entering forwarding state
br-lan: port 4(rai0) entering forwarding state
-------->fdb_create, 402!!!
-------->fdb_create, 402!!!
-------->fdb_create, 402!!!
da match,0x803f5da6e3f3
br-lan: port 6(ra2) entering forwarding state
Unfortunately, the log shows nothing about the LNA.
You can also simply turn this option on and compare the transmitting power, the difference should be noticeable at a further distance from the router.
&wmac {
pinctrl-names = "default", "pa_gpio";
pinctrl-0 = <&pa_pins>;
pinctrl-1 = <&pa_gpio_pins>;
Are the MAC addresses for OpenWRT consistent with those in the stock firmware (also for WiFi 2.4G and 5GHz)?
I will try it out now. And yes the MAC addresses are consistent.
I tested the changes, but I cant see an improvement with this settings
Ok, thank you, I have no other comments.