Add support for TP-Link Archer AC750 C2 V5

Hello, I'd like to get OpenWrt workin on an old TP_MODEL_C2V5. It's useless with the stock firmware so has been replaced, but I'd like to still use it as an access point. I've tried a number of attempts at getting a dts configuration that works, but without luck. Anyone willing to help? I solder on headers to the uart so I can try configs.

Here's what I know:

SoC: MT7620A (580 MHZ)
RAM: 64 MB
Flash: 8MB (GD25Q64CSIG)
Wifi: SoC internal + MT7610EN
Ethernet: 5x 10/100/1000 Mbps QCA8337

Bootlog from the serial port:

U-Boot 1.1.3 (May 31 2017 - 15:22:27)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb8000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
spi_wait_nsec: 29 
spi device id: c8 40 17 c8 40 (4017c840)
Warning: un-recognized chip ID, please update bootloader!
============================================ 
Ralink UBoot Version: 4.3.0.0
-------------------------------------------- 
ASIC 7620_MP (Port5<->GigaSW)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May 31 2017  Time:15:22:27
============================================ 
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 =64 Mbytes

 GPIO pin 10 reset to switch
#Reset_MT7530

continue to starting system.
0 
disable switch phyport...
   
3: System Boot system code via Flash.(0xbc020000)
do_bootm:argc=2, addr=0xbc020000
## Booting image at bc020000 ...
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c150) ...
## Giving linux memsize in MB, 64

Starting kernel ...

Linux version 2.6.36 (tomcat@buildserver) (gcc version 4.6.3 (Buildroot 2012.11.1) ) #1 Wed May 31 15:26:39 CST 2017

 The CPU feqenuce set to 580 MHz

 MIPS CPU sleep mode enabled.
 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)
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: console=ttyS1,115200 root=/dev/mtdblock2 rootfstype=squashfs init=/sbin/init
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=0004000f
Readback ErrCtl register=0004000f
Memory: 61348k/65536k available (2716k kernel code, 4188k reserved, 569k 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 = 1a301f
RALINK_GPIOMODE = 18301f
PPLL_CFG1=0xe7c000
MT7620 PPLL lock
PPLL_DRV =0x80080504
start PCIe register access
RALINK_RSTCTRL = 2400000
RALINK_CLKCFG1 = 75afffc0

*************** MT7620 PCIe RC mode *************
PCIE0 enabled
Port 0 N_FTS = 1b105000
init_rt2880pci done
bio: create slab <bio-0> at 0
pci 0000:00:00.0: BAR 0: can't assign mem (size 0x80000000)
pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
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]
pci 0000:01:00.0: BAR 0: set to [mem 0x20000000-0x200fffff] (PCI address [0x20000000-0x200fffff]
pci 0000:01:00.1: BAR 0: assigned [mem 0x20100000-0x201fffff]
pci 0000:01:00.1: BAR 0: set to [mem 0x20100000-0x201fffff] (PCI address [0x20100000-0x201fffff]
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-0x201fffff]
pci 0000:00:00.0:   bridge window [mem pref disabled]
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
bus=0x1, slot = 0x0
res[0]->start = 20100000
res[0]->end = 201fffff
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 Ralink Systick timer
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
squashfs: version 4.0 (2009/01/31) Phillip Lougher
fuse init (API version 7.15)
msgmni has been set to 119
io scheduler noop registered
io scheduler deadline registered (default)
Ralink gpio driver initialized
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250: ttyS0 at MMIO 0x10000500 (irq = 37) is a 16550A
serial8250: ttyS1 at MMIO 0x10000c00 (irq = 12) is a 16550A
brd: module loaded
loop: 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 7 MTD partitions on "raspi":
0x000000000000-0x000000020000 : "boot"
0x000000020000-0x000000160000 : "kernel"
0x000000160000-0x0000007c0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
0x0000007c0000-0x0000007d0000 : "config"
0x0000007d0000-0x0000007e0000 : "romfile"
0x0000007e0000-0x0000007f0000 : "rom"
0x0000007f0000-0x000000800000 : "radio"
Register flash device:flash0
PPP generic driver version 2.4.2
NET: Registered protocol family 24
Mirror/redirect action on
u32 classifier
    Actions configured
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (958 buckets, 3832 max)
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Restricted Cone
TCP cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Ebtables v2.0 registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
SQUASHFS error: Xattrs in filesystem, these will be ignored
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 168k freed
starting pid 204, tty '': '/etc/init.d/rcS'
rdm_major = 253
spiflash_ioctl_read, Read from 0x007df100 length 0x6, ret 0, retlen 0x6
Read MAC from flash(  7df100) ffffffb0-4e-26-00-75-ffffffcd
SMACCR1 -- : 0x0000b04e
SMACCR0 -- : 0x260075cd
Ralink APSoC Ethernet Driver Initilization. v3.1  256 rx/tx descriptors allocated, mtu = 1500!
NAPI enable, Tx Ring = 256, Rx Ring = 256
spiflash_ioctl_read, Read from 0x007df100 length 0x6, ret 0, retlen 0x6
Read MAC from flash(  7df100) ffffffb0-4e-26-00-75-ffffffcd
SMACCR1 -- : 0x0000b04e
SMACCR0 -- : 0x260075cd
PROC INIT OK!
add domain:tplinkwifi.net
add domain:tplinklogin.net
tp_domain init ok
L2TP core driver, V2.0
PPPoL2TP kernel driver, V2.0
starting pid 239, tty '/dev/ttyS1': '/bin/sh'
~ # [ util_execSystem ] 139:  ipt_init cmd is "/var/tmp/dconf/rc.router"

[ dm_readFile ] 2061:  can not open xml file /var/tmp/pc/reduced_data_model.xml!, about to open file /etc/reduced_data_model.xml
spiflash_ioctl_read, Read from 0x007c0000 length 0x10000, ret 0, retlen 0x10000
spiflash_ioctl_read, Read from 0x007c0000 length 0x7c65, ret 0, retlen 0x7c65
spiflash_ioctl_read, Read from 0x007df100 length 0x6, ret 0, retlen 0x6
spiflash_ioctl_read, Read from 0x007df200 length 0x4, ret 0, retlen 0x4
spiflash_ioctl_read, Read from 0x007df300 length 0x4, ret 0, retlen 0x4
spiflash_ioctl_read, Read from 0x007df400 length 0x10, ret 0, retlen 0x10
spiflash_ioctl_read, Read from 0x007df500 length 0x29, ret 0, retlen 0x29
spiflash_ioctl_read, Read from 0x007df600 length 0x21, ret 0, retlen 0x21
spiflash_ioctl_read, Read from 0x007df700 length 0x10, ret 0, retlen 0x10
spiflash_ioctl_read, Read from 0x00020000 length 0x1d0, ret 0, retlen 0x1d0
spiflash_ioctl_read, Read from 0x007df100 length 0x6, ret 0, retlen 0x6
sendto: No such file or directory
pid 238 send 2001 error
[ util_execSystem ] 139:  oal_startDynDns cmd is "dyndns /var/tmp/dconf/dyndns.conf"

[ oal_sys_getOldTZInfo ] 457:  Open TZ file error!
[ util_execSystem ] 139:  oal_sys_unsetTZ cmd is "echo "" > /etc/TZ"

[ util_execSystem ] 139:  oal_sys_unsetTZ cmd is "echo "" > /etc/TZ"

[ util_execSystem ] 139:  oal_startNoipDns cmd is "noipdns /var/tmp/dconf/noipdns.conf"

[ util_execSystem ] 139:  oal_startCmxDns cmd is "cmxdns /var/tmp/dconf/cmxdns.conf"

ioctl: No such device
[ util_execSystem ] 139:  oal_br_addBridge cmd is "brctl addbr br0;brctl setfd br0 0;brctl stp br0 off"

[ util_execSystem ] 139:  oal_ipt_addLanRules cmd is "iptables -t filter -A INPUT -i br+ -j ACCEPT
"

[ util_execSystem ] 139:  oal_intf_setIntf cmd is "ifconfig br0 192.168.0.1 netmask 255.255.255.0 up"

[ util_execSystem ] 139:  oal_util_setProcLanAddr cmd is "echo "br0 16820416,"Raeth v3.1 ( > /proc/net/conNAPI
ntract_LocalAddr)
"

[ util_exec
phy_tx_ring = 0x03014000, tx_ring = 0xa3014000
System ] 139:  o
phy_rx_ring0 = 0x03015000, rx_ring0 = 0xa3015000
al_intf_enableInSMACCR1 -- : 0x0000b04e
tf cmd is "ifconSMACCR0 -- : 0x260075cd
fig eth0 up"

ESW: Link Status Changed - Port5 Link UP
ESW: Link Status Changed - Port4 Link UP
CDMA_CSG_CFG = 81000000
GDMA1_FWD_CFG = 20710000
[ rsl_getUnusedVlan ] 1015:  GET UNUSED VLAN TAG 1 : [3]
[ rsl_getUnusedVlan ] 1015:  GET UNUSED VLAN TAG 2 : [4]
[ rsl_getUnusedVlan ] 1015:  GET UNUSED VLAN TAG 3 : [5]
[ rsl_getUnusedVlan ] 1015:  GET UNUSED VLAN TAG 4 : [6]
[ util_execSystem ] 139:  oal_addVlanTagIntf cmd is "vconfig add eth0 3"

[ util_execSystem ] 139:  oal_intf_enableIntf cmd is "ifconfig eth0.3 up"

set if eth0.3 to *not wan dev
[ util_execSystem ] 139:  oal_addVlanTagIntf cmd is "vconfig add eth0 4"

[ util_execSystem ] 139:  oal_intf_enableIntf cmd is "ifconfig eth0.4 up"

set if eth0.4 to *not wan dev
[ util_execSystem ] 139:  oal_addVlanTagIntf cmd is "vconfig add eth0 5"

[ util_execSystem ] 139:  oal_intf_enableIntf cmd is "ifconfig eth0.5 up"

set if eth0.5 to *not wan dev
[ util_execSystem ] 139:  oal_addVlanTagIntf cmd is "vconfig add eth0 6"

[ util_execSystem ] 139:  oal_intf_enableIntf cmd isdevice eth0.3 entered promiscuous mode
 "ifconfig eth0.device eth0 entered promiscuous mode
6 up"

set if br0: port 1(eth0.3) entering forwarding state
eth0.6 to *not wbr0: port 1(eth0.3) entering forwarding state
an dev
[ util_execSystem ] 139:  oal_addVlanTagIntf cmd is "vconfig add eth0 2"device eth0.4 entered promiscuous mode


[ util_execSbr0: port 2(eth0.4) entering forwarding state
ystem ] 139:  oabr0: port 2(eth0.4) entering forwarding state
l_intf_enableIntf cmd is "ifconfig eth0.2 up"

set if eth0.2 to wan dev
[ vladevice eth0.5 entered promiscuous mode
n_addLanPortsIntbr0: port 3(eth0.5) entering forwarding state
oBridge ] 551:  br0: port 3(eth0.5) entering forwarding state
add lan Port 255 from br0
[ util_execSystem ] 139:  oal_br_addIntfIntoBridge cmdevice eth0.6 entered promiscuous mode
d is "brctl addibr0: port 4(eth0.6) entering forwarding state
f br0 eth0.3"
br0: port 4(eth0.6) entering forwarding state

[ util_execSystem ] 139:  oal_br_addIntfIntoBridge cmd is "brctl addif br0 eth0.4"

[ util_execSystem ] 139:  oal_br_addIntfIntoBridge cmd is "brctl addif br0 eth0.5"

[ util_execSystem ] 139:  oal_br_addIntfIntoBridge cmd is "brctl addif br0 eth0.6"

[ util_execSystem ] 139:  rsl_initIPv6CfgObj cmd is "echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6"

[ util_execSystem ] 139:  oal_eth_setIGMPSnoopParam cmd is "for i in /sys/devices/virtual/net/*/bridge/multicast_snooping;do echo 0 > $i ; done"

[ util_execSystem ] 139:  oal_wlan_ra_setCountryRegion cmd is "cp /etc/SingleSKU_FCC.dat /var/Wireless/RT2860AP/SingleSKU.dat"

[ util_execSystem ] 139:  oal_wlan_ra_setCountryRegion cmd is "iwpriv ra0 set CountryRegion=0"

ra0       no private ioctls.

[ util_execSystem ] 166:  execute ok, exit status = 255

[ util_execSystem ] 139:  oal_wlan_ra_loadDriver cmd is "insmod /lib/modules/kmdir/kernel/drivers/net/wireless/mt_wifi_ap/mt_wifi.ko"

ADDRCONF(NETDEV_CHANGE): eth0.4: link becomes ready
ADDRCONF(NETDEV_CHANGE): eth0.5: link becomes ready
ADDRCONF(NETDEV_CHANGE): eth0.6: link becomes ready
ADDRCONF(NETDEV_CHANGE): eth0.2: link becomes ready
rt2860v2_ap: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint


=== pAd = c088f000, size = 914456 ===

<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
AP Driver version-2.7.2.0
[ util_execSystem ] 139:  oal_wlan_ra_initWlan cmd is "ifconfig ra0 up"

RX DESC a2973000  size = 4096
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)
Key1Str is Invalid key length(0) or Type(0)
Key2Str 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)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
1. Phy Mode = 9
2. Phy Mode = 9
spiflash_ioctl_read, Read from 0x007f0000 length 0x200, ret 0, retlen 0x200
E2PROM: D0 target power=0x11e 
 pAd->TemperatureRef25C = 0x1
E2PROM: 40 MW Power Delta= 1 
3. Phy Mode = 9
e[mAntCfgInit: primary/secondary ant 0/1
e[mInitialize RF Central Registers for E2 !!!
Initialize RF Central Registers for E3 !!!
Initialize RF Channel Registers for E2 !!!
Initialize RF Channel Registers for E3 !!!
Initialize RF DCCal Registers for E2 !!!
Initialize RF DCCal Registers for E3 !!!
D1 = -3, D2 = 12, CalCode = 35 !!!
Current Temperature from BBP_R49=0xfffffff3
RT6352_TssiTableAdjust: upper_bound = 0x7F decimal: 127
RT6352_TssiTableAdjust: lower_bound = 0xFFFFFF80 decimal: -128
*** RT6352_TssiTableAdjust: G Tssi[-7 .. +7] = -128 -128 -128 -128 -128 -25 -12
 - 0 - 12 28 127 127 127 127 127, offset=1, tuning=1
RT6352_TssiTableAdjust: G Tssi[-7 .. +7] = -127 -127 -127 -127 -127 -24 -11 - 1 - 13 29 127 127 127 127 127, offset=1, tuning=1
mp_temperature=0x01, step = +0
E2PROM: G Tssi[-7 .. +7] = -127 -127 -127 -127 -127 -24 -11 - 1 - 13 29 127 127 127 127 127, offset=1, tuning=1
 TX BW Filter Calibration !!!
 RX BW Filter Calibration !!!
LOFT Calibration Done!
IQCalibration Start!
IQCalibration Done! CH = 0, (gain= 1, phase= 2)
IQCalibration Start!
IQCalibration Done! CH = 1, (gain= f, phase=3a)
TX IQ Calibration Done!
bAutoTxAgcG = 1
MCS Set = ff ff 00 00 01
SYNC - BBP R4 to 20MHz.l
The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
Main bssid = b0:4e:26:00:75:cd
<==== rt28xx_init, Status=0
0x1300 = 00064300
[ util_execSystem ] 139:  oal_wlan_ra_initWlan cmd is "echo 1 > /proc/tplink/led_wlan_24G"

[ util_execSystem ] 139:  oal_wlan_ra_setStaNum cmd is "iwpriv ra0 set MaxStaNum=32"

[ util_execSystem ] 139:  device ra0 entered promiscuous mode
oal_br_addIntfInbr0: port 5(ra0) entering forwarding state
toBridge cmd is br0: port 5(ra0) entering forwarding state
"brctl addif br0 ra0"

[ util_execSystem ] 139:  oal_br_addIntfIntoBridge cmd device apcli0 entered promiscuous mode
is "brctl addif br0 apcli0"

[ util_execSystem ] 139:  oal_br_addIntfIntoBridgdevice ra1 entered promiscuous mode
e cmd is "brctl addif br0 ra1"

[ util_execSystem ] 139:  oal_wlan_ra_initEnd cmspiflash_ioctl_read, Read from 0x007f0000 length 0x2, ret 0, retlen 0x2
d is "wlNetlinkTool &"

[ util_execSystem ] 139:  oal_wlan_ra_initEnd cmd is "killall -q wscd"

[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_wlan_ra_initEnd cmd is "wscd -i ra0 -m 1 -w /var/tmp/wsc_upnp/ &"

WLAN-Start wlNetlinkTool
Waiting for Wireless Events from interfaces...
swWlanChkAhbErr: netlink to do
[ util_execSystem ] 139:  oal_wlan_ra_setCountryRegion cmd is "cp /etc/SingleSKU_5G_FCC.dat /var/Wireless/RT2860AP/SingleSKU_5G.dat"

[ util_execSystem ] 139:  oal_wlan_ra_setCountryRegion cmd is "iwpriv rai0 set CountryRegionABand=0"

rai0      no private ioctls.

[ util_execSystem ] 166:  execute ok, exit status = 255

[ util_execSystem ] 139:  oal_wlan_ra_loadDriver cmd is "insmod /lib/modules/kmdir/kernel/drivers/net/wireless/MT7610_ap/MT7610_ap.ko"

wscd: SSDP UDP PORT = 1900


=== pAd = c0e82000, size = 1304600 ===

<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
device_id =0x7650
Read eeprom data from flash into memory!
spiflash_ioctl_read, Read from 0x007f8000 length 0x200, ret 0, retlen 0x200
==>MT76x0_WLAN_ChipOnOff(): OnOff:1, pAd->WlanFunCtrl:0x0, Reg-WlanFunCtrl=0xff000002
MACVersion = 0x76502000
[ util_execSystem ] 139:  oal_wlan_ra_initWlan cmd is "ifconfig rai0 up"

load fw spent 16ms
RX DESC a2a41000 size = 4096
RX1 DESC a2a42000 size = 4096
cfg_mode=14
cfg_mode=14
wmode_band_equal(): Band Not Equal!
1. Phy Mode = 49
2. Phy Mode = 49
ERROR!!! E2PROM: WRONG VERSION 0x2, should be 1
ext_pa_current_setting = 1
MT76x0_TssiTableAdjust: upper_bound = 0x7F decimal: 127
MT76x0_TssiTableAdjust: lower_bound = 0xFFFFFF80 decimal: -128
*** MT76x0_TssiTableAdjust: A Tssi[-7 .. +7] = -128 -128 -128 -128 -15 -5 -3 * 0 * 0 14 16 127 127 127 127, offset=-4, tuning=1
MT76x0_TssiTableAdjust: A Tssi[-7 .. +7] = -128 -128 -128 -128 -19 -9 -7 * -4 * -4 10 12 123 123 123 123, offset=-4, tuning=1
mp_temperature=0xfffffffc, step = +0
MT76x0_TssiTableAdjust: upper_bound = 0x7F decimal: 127
MT76x0_TssiTableAdjust: lower_bound = 0xFFFFFF80 decimal: -128
*** MT76x0_TssiTableAdjust: A Tssi[-7 .. +7] = -128 -128 -128 -128 -18 -5 -3 * -4 * 1 15 20 127 127 127 127, offset=-4, tuning=1
MT76x0_TssiTableAdjust: A Tssi[-7 .. +7] = -128 -128 -128 -128 -22 -9 -7 * -4 * -3 11 16 123 123 123 123, offset=-4, tuning=1
mp_temperature=0xfffffffc, step = +0
3. Phy Mode = 49
AntCfgInit: primary/secondary ant 0/1
ChipStructAssign(): RALINK6590 hook !
bAutoTxAgcG = 1
MCS Set = ff 00 00 00 01
MT76x0_ChipBBPAdjust():rf_bw=2, ext_ch=1, PrimCh=36, HT-CentCh=38, VHT-CentCh=42
APStartUp(): AP Set CentralFreq at 42(Prim=36, HT-CentCh=38, VHT-CentCh=42, BBP_BW=2)
Main bssid = b0:4e:26:00:75:cc
<==== rt28xx_init, Status=0
MT76x0_ChipBBPAdjust():rf_bw=2, ext_ch=3, PrimCh=153, HT-CentCh=151, VHT-CentCh=155
APStartUp(): AP Set CentralFreq at 155(Prim=153, HT-CentCh=151, VHT-CentCh=155, BBP_BW=2)
0x1300 = 00064300
RTMPDrvOpen(1):Check if PDMA is idle!
RTMPDrvOpen(2):Check if PDMA is idle!
[ util_execSystem ] 139:  oal_wlan_ra_initWlan cmd is "echo 1 > /proc/tplink/led_wlan_5G"

[ util_execSystem ] 139:  oal_wlan_ra_setStaNum cmd is "iwpriv rai0 set MaxStaNum=32"

[ util_execSystem ] 139:  device rai0 entered promiscuous mode
oal_br_addIntfInbr0: port 8(rai0) entering forwarding state
toBridge cmd is br0: port 8(rai0) entering forwarding state
"brctl addif br0 rai0"

[ util_execSystem ] 139:  oal_br_addIntfIntoBridge cmddevice apclii0 entered promiscuous mode
 is "brctl addif br0 apclii0"

[ util_execSystem ] 139:  oal_br_addIntfIntoBridevice rai1 entered promiscuous mode
dge cmd is "brctl addif br0 rai1"

wlNetlinkTool isspiflash_ioctl_read, Read from 0x007f8000 length 0x2, ret 0, retlen 0x2
 already there. 
[ util_execSystem ] 139:  oal_wlan_ra_initEnd cmd is "killall -q wscd_5G"

[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_wlan_ra_initEnd cmd is "wscd_5G -i rai0 -m 1 -w /var/tmp/wsc_upnp_5G/ &"

wscd: SSDP UDP PORT = 1900
sendto: No such file or directory
pid 238 send 2030 error
sendto: No such file or directory
pid 238 send 2004 error
[ util_execSystem ] 139:  oal_startDhcps cmd is "dhcpd /var/tmp/dconf/udhcpd.conf"

[ util_execSystem ] 139:  oal_lan6_startDhcp6s cmd is "dhcp6s -c /var/tmp/dconf/dhcp6s_br0.conf -P /var/run/dhcp6s_br0.pid br0 &"

[ util_execSystem ] 139:  oal_lan6_startRadvd cmd is "radvd -C /var/tmp/dconf/radvd_br0.conf -p /var/run/radvd_br0.pid &"

[ util_execSystem ] 139:  oal_br_delIntfFromBridge cmd is "brctl delif br0 eth0.2"

mldProxy# file: src/mld_ifinfo.c;line: 102; error = No such file or directory
mldProxy# Err: get LLA failed
iptables: Bad rule (does a matching rule exist in that chain?).
brctl: bridge br0: Invalid argument
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_intf_setIfMac cmd is "ifconfig eth0.2 down"

[ util_execSystem ] 139:  oal_intf_setIfMac cmd is "ifconfig eth0.2 hw ether B0:4E:26:00:75:CE up"

[ util_execSystem ] 139:  oal_intf_enableIntf cmd is "ifconfig eth0.2 up"

radvd starting
[Jan 01 00:00:12] radvd: no linklocal address configured for br0
[Jan 01 00:00:12] radvd: error parsing or activating the config file: /var/tmp/dconf/radvd_br0.conf
[ util_execSystem ] 139:  oal_rip_updateConfig cmd is "rm -f /var/tmp/dconf/zebra.conf"

[ util_execSystem ] 139:  oal_rip_updateConfig cmd is "rm -f /var/tmp/dconf/ripd.conf"

[ util_execSystem ] 139:  removeAllRIPIpTableRule cmd is "iptables -L INPUT -v --line-numbers > /var/iptable"

[ getPidFromPidFile ] 112:  Cann't open file: /var/run/zebra.pid.
[ util_execSystem ] 139:  controlRipProcess cmd is "zebra -d -f /var/tmp/dconf/zebra.conf"

[ getPidFromPidFile ] 112:  Cann't open file: /var/run/ripd.pid.
[ util_execSystem ] 139:  oal_ipt_fwDdos cmd is "iptables -D FORWARD -j FIREWALL_DDOS
"

iptables: No chain/target/match by that name.
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_ipt_forbidLanPing cmd is "iptables -t filter -D INPUT -i br+ -p icmp --icmp-type echo-request -j DROP
iptables -t filter -D FORWARD -i br+ -p icmp --icmp-type echo-request -j DROP
"

iptables: Bad rule (does a matching rule exist in that chain?).
iptables: Bad rule (does a matching rule exist in that chain?).
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_ddos_delPingRule cmd is "iptables -t filter -D INPUT ! -i br+ -p icmp --icmp-type echo-request -j ACCEPT
"

iptables: Bad rule (does a matching rule exist in that chain?).
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_ipt_setDDoSRules cmd is "iptables -F FIREWALL_DDOS"

[ util_execSystem ] 139:  ddos_clearAll cmd is "rm -f /var/tmp/dosHost"

[ util_execSystem ] 139:  oal_initFirewallObj cmd is "ebtables -N FIREWALL"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -F"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -X"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -P INPUT ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -P FORWARD DROP"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -P OUTPUT ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -N FIREWALL"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -N FWRULE"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -N SETMSS"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A INPUT -i lo -p ALL -j ACCEPT -m comment 					--comment "loop back""

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A INPUT  -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A INPUT -i br+ -p tcp --dport 23 -j ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A INPUT -p tcp --dport 23 -j DROP"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A INPUT -i br+ -p icmpv6 --icmpv6-type echo-request -j ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j DROP"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A FORWARD -i br+ -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A FORWARD -o br+ -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -A FORWARD -j FIREWALL"

[ util_execSystem ] 139:  oal_initIp6FirewallObj cmd is "ip6tables -I FORWARD 1 -j SETMSS"

[ util_execSystem ] 139:  oal_fw6_setFwEnabeld cmd is "ip6tables -D FIREWALL -j ACCEPT"

ip6tables: Bad rule (does a matching rule exist in that chain?).
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_fw6_setFwEnabeld cmd is "ip6tables -F FIREWALL"

[ util_execSystem ] 139:  oal_fw6_setFwEnabeld cmd is "ip6tables -A FIREWALL -j ACCEPT"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_ftp.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_ftp.ko"

[ util_execSystem ] 139:  oal_openAlg cmd is "iptables -D FORWARD_VPN_PASSTHROUGH  -p udp --dport 500 -j DROP"

iptables: Bad rule (does a matching rule exist in that chain?).
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_proto_gre.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_pptp.ko"

[ util_execSystem ] 139:  oal_openAlg cmd is "iptables -D FORWARD_VPN_PASSTHROUGH  -p tcp --dport 1723 -j DROP"

iptables: Bad rule (does a matching rule exist in that chain?).
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  oal_openAlg cmd is "iptables -D FORWARD_VPN_PASSTHROUGH  -p udp --dport 1701 -j DROP"

iptables: Bad rule (does a matching rule exist in that chain?).
[ util_execSystem ] 166:  execute ok, exit status = 1

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_tftp.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_tftp.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_h323.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_h323.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_sip.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_sip.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_rtsp.ko"

[ util_execSystem ] 139:  setupModules cmd is "insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/nf_nat_rtsp.ko"

nf_nat_rtsp v0.6.21 loading
[ util_execSystem ] 139:  oal_wan_HWNat_enable cmd is "insmod /lib/modules/kmdir/kernel/net/nat/hw_nat/hw_nat.ko wanIfName=eth0.2"

Ralink HW NAT Module Enabled
enable switch phyport...
[cmd_dutInit():697] init shm
[tddp_taskEntry():151] tddp task start
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[4].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
Set: phy[4].reg[0] = 3300
resetMiiPortV over.
[ util_execSystem ] 139:  prepareDropbear cmd is "dropbearkey -t rsa -f /var/tmp/dropbear/dropbear_rsa_host_key"

Will output 1024 bit rsa secret key to '/var/tmp/dropbear/dropbear_rsa_host_key'
Generating key, this may take a while...
[ util_execSystem ] 139:  prepareDropbear cmd is "dropbearkey -t dss -f /var/tmp/dropbear/dropbear_dss_host_key"

Will output 1024 bit dss secret key to '/var/tmp/dropbear/dropbear_dss_host_key'
Generating key, this may take a while...
[ util_execSystem ] 139:  prepareDropbear cmd is "dropbear -p 22 -r /var/tmp/dropbear/dropbear_rsa_host_key -d /var/tmp/dropbear/dropbear_dss_host_key -A /var/tmp/dropbear/dropbearpwd"

[ util_execSystem ] 139:  oal_sys_unsetTZ cmd is "echo "" > /etc/TZ"

[ util_execSystem ] 139:  oal_sys_unsetTZ cmd is "echo "" > /etc/TZ"

I'm by no means any hero with DTS myself, it looks like there are a few MT7620 devices supported already that have an Atheros switch as well: Engenius ESR600 and Lava LR-25G001. I'm not sure how much the AR8327 and QCA8337 differ (but Qualcomm has renamed a lot of models for marketing purposes with minimal changes often, from what I understand).

If you can use the same driver and DTS binding (and the ar8327 code in the OpenWrt tree has some 8337 matches, as well as the ar8216 code), the trick would be to find out the initialisation values for the switch. Looking at the Lava and Engenius DTSes, those really seem to be device-dependent.

AR8337 and QCA8337 are the same chip, just rebranded - AR8327 is its immediate predecessor (e.g. used on ath79/ tl-wdr4300); there are N-variants (e.g. QCA8337N) for either of these, offering some hardware acceleration (if supported by the driver, so not yet).

1 Like

(the n variant offer the hnat feature that we don't use since it's only supported with the qsdk

2 Likes

Thanks. I've been trying the existing ones but pretty much guessing on what values for things like qca,ar8327-initvals and others needed. No luck so far but I might reflash with stock to see if I can dump the switch registers with that.

1 Like

Hello, I'd like to get OpenWrt on an C2V5 too. Did you succeed?

No, sorry, I didn't. I didn't know enough about how the QCA8337 works to get the correct values to get it working and didn't manage to pique anyone's interest on IRC. Plus I thought maybe I should wait until this PR was merged.

I went with a different device, but I'm still interested in putting the C2V5 to use if you have more luck than I did.

4 posts were split to a new topic: Lava LR-25G001

Apparently we can dump the qca8337 and 7620 registers from the stock firmware using ./bin/qca8337_switch read reg. List of all applets of that executable below:

file qca8337_switch in ASCII, data at offset 0x003418:
...
socketUsage: 
 %s reset   - reset qca8337 switch
 %s init                - init qca8337 switch
 %s read reg            - read qca8337 switch register
 %s write reg value     - write qca8337 switch register
 %s rphy phy reg        - read qca8337 phy register
 %s wphy phy reg value  - write qca8337 phy register
 %s rreg reg            - read 7620 cpu register
 %s wreg reg value      - write 7620 cpu register
 %s rmii phy reg            - read 7620 phy register
 %s wmii phy reg value      - write 7620 phy register
 %s vlan dump           - dump qca8337 vlan entries
 %s vlan add vid ports  - add qca8337 vlan entry with vid and ports included
 %s vlan del vid        - delete qca8337 vlan entry with vid
 %s vlan flush          - flush qca8337 vlan entries

Of course, we need to become SuperUser before using this command in ssh.

1 Like

Hello, did anything work out with this device? I really want to install openwrt on it, I don’t understand at all how it works, is there any success?

Hello, did anything work out with this device? I really want to install openwrt on it, I don’t understand at all how it works, is there any success?

Sorry @RZC-ALEX, I didn't have any success. I'm also not familiar with the intricacies of OpenWRT and my original post didn't get much traction so the device is sitting on a shelf. Instead I picked up a Xiaomi Redmi AC2100 and it's been running fine.

If you have more luck than I did please let me know, as I could still use the device elsewhere.