Support for Wavlink WN529N2

At long last my CP2104 has arrived so I can start. I connected CP2104 pins Gnd, RXD, TXD to the Wavlink Gnd, T, R respectively. Using GTKTerm, port /dev/ttyUSB and baude rate 57600 on power up I got lots of output to look over. Mediatek MT7628 was comfirmed, but only 32Meg byte or RAM and 4Meg byte of flash.

A couple of minor observations removing power from either end both units get some power leakage via the protection diodes on the input ports. This is standard on all semiconductors.

A long printout of what I got may be of interest as I am curious as to where Wavlink got their code and what I should do next. Ian

========================================
# 38 click gpio index = 38
38 click gpio index = 38

[04060C09][04060C0A][88870000][22224342][00222243]
DU Setting Cal Done


U-Boot 1.1.3 (Feb  2 2018 - 10:46:23)

Board: Ralink APSoC DRAM:  32 MB
relocate_code Pointer at: 81fa0000
flash manufacture id: c8, device id 40 16
find flash: GD25Q32B
*** Warning - bad CRC, using default environment

============================================ 
Ralink UBoot Version: 5.0.0.0
-------------------------------------------- 
ASIC 7628_MP (Port5<->None)
DRAM component: 256 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 32 MBytes
Flash component: SPI Flash
Date:Feb  2 2018  Time:10:46:23
============================================ 
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768 

 ##### The CPU freq = 580 MHZ #### 
 estimate memory size =32 Mbytes
RESET MT7628 PHY!!!!!!
Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Enter boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 
default: 3
 0 
   
3: System Boot system code via Flash.
## Booting image at bc050000 ...
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3582088 Bytes =  3.4 MB
   Load Address: 80000000
   Entry Point:  8000c150
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c150) ...
## Giving linux memsize in MB, 32

Starting kernel ...


LINUX started...

 THIS IS ASIC
Linux version 2.6.36 (root@ubuntu) (gcc version 4.6.3 (Buildroot 2012.11.1) ) #1192 Tue Dec 19 13:31:13 CST 2017

 The CPU feqenuce set to 575 MHz

 MIPS CPU sleep mode enabled.
CPU revision is: 00019655 (MIPS 24Kc)
Software DMA cache coherency
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: console=ttyS1,57600n8 root=/dev/ram0 console=ttyS0
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 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=0002c804
Readback ErrCtl register=0002c804
Memory: 25192k/32768k available (4032k kernel code, 7576k reserved, 1057k data, 1896k init, 0k highmem)
NR_IRQS:128
console [ttyS1] enabled
Calibrating delay loop... 386.04 BogoMIPS (lpj=772096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
RALINK_GPIOMODE = 54054404 
RALINK_GPIOMODE = 54044404 
***** Xtal 40MHz *****
start PCIe register access
RALINK_RSTCTRL = 2400000
RALINK_CLKCFG1 = fdbfffc0

*************** MT7628 PCIe RC mode *************
PCIE0 no card, disable it(RST&CLK)
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
Switching to clocksource Ralink Systick timer
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
fuse init (API version 7.15)
msgmni has been set to 49
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered (default)
gpiomode one  0000  = 0x55144410 
Ralink gpio driver initialized = 73
Ralink gpio driver initialized
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x10000d00 (irq = 21) is a 16550A
serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
brd: module loaded
flash manufacture id: c8, device id 40 16
Wavlink Encryption System...
Wavlink Encryption System is installing
GD25Q32B(c8 40160000) (4096 Kbytes)
mtd .name = raspi, .size = 0x00400000 (4M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 5 MTD partitions on "raspi":
0x000000000000-0x000000400000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000001000000 : "Kernel"
mtd: partition "Kernel" extends beyond the end of device "raspi" -- size truncated to 0x3b0000
rdm_major = 253
GMAC1_MAC_ADRH -- : 0x0000803f
GMAC1_MAC_ADRL -- : 0x5d5b43e9
Ralink APSoC Ethernet Driver Initilization. v3.1  512 rx/tx descriptors allocated, mtu = 1500!
GMAC1_MAC_ADRH -- : 0x0000803f
GMAC1_MAC_ADRL -- : 0x5d5b43e9
PROC INIT OK!
my_net_link_3: create netlink socket ok.
PPP generic driver version 2.4.2
PPP MPPE Compression module registered
NET: Registered protocol family 24
PPTP driver version 0.8.5
IMQ driver loaded successfully.
	Hooking IMQ after NAT on PREROUTING.
	Hooking IMQ before NAT on POSTROUTING.


=== pAd = c0147000, size = 1360120 ===

<-- RTMPAllocTxRxRingMemory, Status=0, ErrorValue=0x
<-- RTMPAllocAdapterBlock, Status=0
RtmpChipOpsHook(492): Not support for HIF_MT yet!
mt7628_init()-->
mt7628_init(FW(8a00), HW(8a01), CHIPID(7628))
e2.bin mt7628_init(1133)::(2), pChipCap->fw_len(63888)
mt_bcn_buf_init(218): Not support for HIF_MT yet!
<--mt7628_init()
GACT probability on
Mirror/redirect action on
Simple TC action Loaded
netem: version 1.2
u32 classifier
    Performance counters on
    input device check on
    Actions configured
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (393 buckets, 1572 max)
ctnetlink v0.93: registering with nfnetlink.
nf_conntrack_rtsp v0.6.21 loading
matchsize=264
xt_time: kernel timezone is -0000
IPVS: Registered protocols ()
IPVS: Connection hash table configured (size=4096, memory=32Kbytes)
IPVS: ipvs loaded.
GRE over IPv4 demultiplexor driver
gre: can't add protocol
nf_nat_rtsp v0.6.21 loading
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Restricted Cone
ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
arp_tables: (C) 2002 David S. Miller
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
L2TP core driver, V2.0
PPPoL2TP kernel driver, V2.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Registering the dns_resolver key type
Warning: unable to open an initial console.
Freeing unused kernel memory: 1896k freed
Algorithmics/MIPS FPU Emulator v1.5
Welcome to
     __   ___  _____  _____   _  _______ ______  _____  _   ___
    |  \ /   ||  ___||  __ \ | ||  __  ||__  __||  ___|| | /  /
    |   ^    || |__  | |  \ \| || |  | |  | |   | |__  | |/  /
    |  | |   ||  ___|| |  | || || |__| |  | |   |  ___||    \
    |  | |   || |___ | |__/ /| ||  __  |  | |   | |___ | |\  \
    |__| |___||_____||_____/ |_||_|  |_|  |_|   |_____||_| \__\

		        = Everyday Genius =
		            
The timer is still in use...
Wavlink Encryption System is unlocked.
led=37, on=4000, off=1, blinks,=1, reset=1, time=4000
initGpio 38


Password for 'admin' changed

##### disable 1st wireless interface #####
RootMacAddress:80:3F:5D:5B:43:EB


TX_BCN DESC a0fac000 size = 320
RX[0] DESC a0fb0000 size = 2048
RX[1] DESC a0fb1000 size = 1024
E2pAccessMode=0
cfg_mode=9
cfg_mode=9
wmode_band_equal(): Band Equal!
AndesSendCmdMsg: Could not send in band command due to diable fRTMP_ADAPTER_MCU_SEND_IN_BAND_CMD
APSDCapable[0]=0
APSDCapable[1]=0
APSDCapable[2]=0
APSDCapable[3]=0
APSDCapable[4]=0
APSDCapable[5]=0
APSDCapable[6]=0
APSDCapable[7]=0
APSDCapable[8]=0
APSDCapable[9]=0
APSDCapable[10]=0
APSDCapable[11]=0
APSDCapable[12]=0
APSDCapable[13]=0
APSDCapable[14]=0
APSDCapable[15]=0
default ApCliAPSDCapable[0]=0
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
RTMPSetDefaultChannel() : default channel to 1 
load fw image from fw_header_image
AndesMTLoadFwMethod1(2174)::pChipCap->fw_len(63888)
FW Version:20151201
FW Build Date:20151201183641
CmdAddressLenReq:(ret = 0)
CmdFwStartReq: override = 1, address = 1048576
CmdStartDLRsp: WiFI FW Download Success
MtAsicDMASchedulerInit(): DMA Scheduler Mode=0(LMAC)
efuse_probe: efuse = 10000012
RtmpChipOpsEepromHook::e2p_type=0, inf_Type=4
RtmpEepromGetDefault::e2p_dafault=2
RtmpChipOpsEepromHook: E2P type(2), E2pAccessMode = 2, E2P default = 2
NVM is FLASH mode
1. Phy Mode = 14
Country Region from e2p = ffff
tssi_1_target_pwr_g_band = 34
2. Phy Mode = 14
3. Phy Mode = 14
NICInitPwrPinCfg(11): Not support for HIF_MT yet!
NICInitializeAsic(651): Not support rtmp_mac_sys_reset () for HIF_MT yet!
mt_mac_init()-->
MtAsicInitMac()-->
mt7628_init_mac_cr()-->
MtAsicSetMacMaxLen(1241): Set the Max RxPktLen=1024!
<--mt_mac_init()
	WTBL Segment 1 info:
		MemBaseAddr/FID:0x28000/0
		EntrySize/Cnt:32/128
	WTBL Segment 2 info:
		MemBaseAddr/FID:0x40000/0
		EntrySize/Cnt:64/128
	WTBL Segment 3 info:
		MemBaseAddr/FID:0x42000/64
		EntrySize/Cnt:64/128
	WTBL Segment 4 info:
		MemBaseAddr/FID:0x44000/128
		EntrySize/Cnt:32/128
AntCfgInit(2900): Not support for HIF_MT yet!
MCS Set = ff ff 00 00 01
MtAsicSetChBusyStat(826): Not support for HIF_MT yet!
[PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[PMF]RTMPMakeRsnIeCap: RSNIE Capability MFPC=0, MFPR=0
MtAsicSetRalinkBurstMode(2929): Not support for HIF_MT yet!
MtAsicSetPiggyBack(763): Not support for HIF_MT yet!
reload DPD from flash , 0x9F = [c600] doReload bit7[0]
CmdLoadDPDDataFromFlash: Channel = 10, DoReload = 0
MtAsicSetTxPreamble(2908): Not support for HIF_MT yet!
MtAsicAddSharedKeyEntry(1308): Not support for HIF_MT yet!
The 2-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 2
MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
Main bssid = 80:3f:5d:5b:43:eb
<==== rt28xx_init, Status=0
The 7628 UUID MacAddress = 80:3f:5d:5b:43:eb

The 7628 UUID MacAddress = 80:3f:5d:5b:43:eb

mt7628_set_ed_cca: TURN OFF EDCCA  mac 0x10618 = 0xd7083f0f, EDCCA_Status=0
WiFi Startup Cost (ra0): 3.164s
ifconfig: ioctl 0x8913 failed: No such device
brctl: bridge br0: No such device or address
/sbin/internet.sh: line 660: mdev: not found
##### configVIF #####
Raeth v3.1 (Tasklet)

phy_tx_ring = 0x019c4000, tx_ring = 0xa19c4000

phy_rx_ring0 = 0x019c6000, rx_ring0 = 0xa19c6000
GMAC1_MAC_ADRH -- : 0x0000803f
GMAC1_MAC_ADRL -- : 0x5d5b43e9
RT305x_ESW: Link Status Changed  ======>>>>>
RT305x_ESW: Link Status Changed  ======>>>>>
p0 = 0 
p1 = 0 
p2 = 0 
p3 = 0 
p4 = 0 
hotplug 0


vconfig: ioctl error for rem: No such device
vconfig: ioctl error for rem: No such device
/sbin/internet.sh: line 1175: rmmod: not found
device eth2 entered promiscuous mode
##### config Ralink ESW vlan partition (LLLLW) #####
##### config-vlan.sh 2 WLLLL bbbbbbb config Ralink ESW vlan partition (WLLLL) #####
switch reg write offset=14, value=405555
switch reg write offset=50, value=2001
switch reg write offset=98, value=7f3f
switch reg write offset=e4, value=3f
switch reg write offset=40, value=1001
switch reg write offset=44, value=1001
switch reg write offset=48, value=1002
switch reg write offset=70, value=ffff506f
done.
device ra0 entered promiscuous mode
device eth2.1 entered promiscuous mode
-----------wan_if = eth2.2-------------
udhcpc (v1.12.1) started
defconfig===================>
br0: port 2(eth2.1) entering learning state
br0: port 2(eth2.1) entering learning state
br0: port 1(ra0) entering learning state
br0: port 1(ra0) entering learning state
ifconfig: ioctl 0x8914 failed: Cannot assign requested address
ifconfig: ioctl 0x8914 failed: Cannot assign requested address
br0: port 2(eth2.1) entering forwarding state
br0: port 1(ra0) entering forwarding state
killall: udhcpd: no process killed
Set: phy[0].reg[0] = 3900
Set: phy[1].reg[0] = 3900
Set: phy[2].reg[0] = 3900
Set: phy[3].reg[0] = 3900
Set: phy[0].reg[0] = 3300
Set: phy[1].reg[0] = 3300
Set: phy[2].reg[0] = 3300
Set: phy[3].reg[0] = 3300
The 2-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 2
MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
MtAsicSetPiggyBack(763): Not support for HIF_MT yet!
tx_kickout_fail_count = 0
tx_timeout_fail_count = 0
rx_receive_fail_count = 0
alloc_cmd_msg = 86
free_cmd_msg = 86
br0: port 1(ra0) entering forwarding state

##### disable 1sswitch register base addr to 0xb0180000
t wireless interwrite offset 0x400, value 0x1080
face #####
write offset 0x1204, value 0x8
write offset 0x1004, value 0x3
/sbin/internet.sh: line 1255: radvd.sh: not found
/sbin/internet.sh: line 1272: long_loop: not found
Interface doesn't accept private ioctl...
set (8BE2): Network is down
route: ioctl 0x890c failed: No such process
Interface doesn't accept private ioctl...
set (8BE2): Network is down
sh: miniupnpd.sh: not found
killall: rt2860apd: no process killed
iptables v1.4.10: Couldn't load target `macipport_filter':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables v1.4.10: Couldn't load target `web_filter':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables v1.4.10: Couldn't load target `malicious_filter':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables v1.4.10: Couldn't load target `malicious_input_filter':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables v1.4.10: Couldn't load target `port_trigger':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables v1.4.10: Couldn't load target `trigger_prerouting':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
sh: /bin/super_dmz: not found
iptables v1.4.10: Couldn't load target `port_forward':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables v1.4.10: Couldn't load target `DMZ':File not found

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
180
0
180
0
is_ip_valid:  is not a valid IP address.
sh: ddns.sh: not found
syslogd: invalid option -- C
BusyBox v1.12.1 (2017-12-19 10:31:42 CST) multi-call binary

Usage: syslogd [OPTION]...

sh: klogd: not found
Autoeth.c run
led=37, on=1, off=4000, blinks,=1, reset=1, time=4000
sh: ip: not found
0
webs: Listening for HTTP requests at address 192.168.10.1

QoSInit
warning, can't get bandwidth string from UI.
warning, can't get bandwidth string from UI.
1970-01-01 00:00:22: (log.c.97) server started 
init: can't log to /dev/tty5
starting pid 3422, tty '/dev/ttyS1': '/bin/sh'


BusyBox v1.12.1 (2017-12-19 10:31:42 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

#

Please place all this code and output into a code box using the </> icon!

Sorry, now that I know what it is for I will use it. Thanks Ian.

Well, at least some of what was delivered to you was under GPL and you should have gotten clear information on how to obtain the sources and build chain. A search with Google led me to http://www.win-star.com/eshop/article.php?id=46