Sitecom WLR-4100 (MT7620A + QCA 8337) support

Hi,
I am new in OpenWRT.
I have SItecom WLR-4100 v1 002 equipped with:
CPU:MT7620A @580MHz WiSoC
Flash: 8MB, RAM: 64MB, USB: 1x USB 2.0
Switch: QCA8337
802.11b/g/n, GbE 4x LAN + 1x WAN

I identified some router having MT7620A and others having QCA8337, so I suppose it is not so difficult to build OpenWRT for this device:
I noticed WLR-4100 v1 002 has the same PCB of WLR-5100, but the5GHz module is missing.

Do you have usb-ttl adapter and serial console boot logs? Root access or any other way for flashing openwrt firmware image?

1 Like

Yes, Here it is the bootlog:

U-boot Ver:1.0.0.1 2013/05/23 14:40:54

Board: Ralink APSoC DRAM:  64 MB

spi_wait_nsec: 28 

spi device id: c2 20 17 c2 20 (2017c220)

find flash: MX25L6405D

Flash size 8MB, sector count = 128

============================================ 

ASIC 7620_MP (Port5<->GigaSW)

Product Name: WLR-4100v1002


Please choose the operation: 

   2: Load system code then write to Flash via TFTP. 

   3: Boot system code via Flash (default).

   9: Load Boot Loader code then write to Flash via TFTP. 

 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:    1826190 Bytes =  1.7 MB

   Load Address: 80000000

   Entry Point:  8000c110

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK


Starting kernel ...



LINUX started...

 THIS IS ASIC

init started: BusyBox v1.13.3 (2014-02-21 19:07:17 CST)

starting pid 746, tty '/dev/console': '/sbin/config_init'
mknod: /dev/ttyS0: File exists
mknod: /dev/ttyS1: File exists
Config Init version: 1.4.1.24 date: 2014/02/21
Wed Jan  1 00:00:00 UTC 2014
ln: /lib/./modules: File exists

starting pid 795, tty '/dev/ttyS1': '/sbin/config_term'
************************************************************************
*                            WLR-4100v1002                             *
************************************************************************
KernelApp/Ramdisk Ver:1.4.1.24			 Date:2014/02/21
password:

SITECOM provides the source code:


Where I found the flash map:
name: "Bootloader",
size: 0x30000,
offset: 0,

name: "Config ",
size: 0x10000,
offset: 0x30000,

name: "Factory", /* mtdblock3, RFData */
size: 0x10000, /* 64KB */
offset: 0x40000,

name: "Kernel",
size: 0x790000,
offset: 0x50000,

name: "app",
size: 0x660000, /* 2MB+64KB */
offset: 0x1FA000,

name: "backup", /* backup configuration */
size: 0x10000, /* 64KB */
offset: 0x7e0000,

name: "storage",
size: 0x10000, /* 64 KB */
offset: 0x7f0000,

I identified the following U-Boot unlisted option 1:

*1: System Load Linux to SDRAM via TFTP. 
 * Please Input new ones /or Ctrl-C to discard
 *	Input device IP (192.168.99.9) ==:192.168.99.9

So I may try to upload some code from other similar router in RAM without touching the Flash.
@123serge123 What do you think?

Can you try image from this archive


and show logs.

I did it on RAM (hopefully), I renamed the bin file inside the *.zip to uImageWLR-5100v1002.bin:

1: System Load Linux to SDRAM via TFTP. 
 Please Input new ones /or Ctrl-C to discard
	Input device IP (192.168.99.9) ==:192.168.99.9
	Input server IP (192.168.99.8) ==:192.168.99.8
	Input Linux Kernel filename (uImageWLR-5100v1002) ==:uImageWLR-5100v1002.bin
 Waitting for RX_DMA_BUSY status Start... done
 AR8327 giga Mac support 
SUPPORT_QCA8337 
TFTP from server 192.168.99.8; our IP address is 192.168.99.9
Filename 'uImageWLR-5100v1002.bin'.
 TIMEOUT_COUNT=10,Load address: 0x80a00000
Loading: *Got ARP REPLY, set server/gtwy eth addr (xx:xx:xx:xx:xx:xx)
Got it

#################################################################
	 #################################################################
	 #################################################################
	 ###################################################Got ARP REQUEST, return our IP
##############
	 ##########################Got ARP REQUEST, return our IP
#######################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##############################
done
Bytes transferred = 3814118 (3a32e6 hex)
NetBootFileXferSize= 003a32e6
Erasing SPI Flash...
.
Writing to SPI Flash...
.
done

I hope the Erasing SPI Flash does not mean "the Flash is contaminated".
Here it the log:

Automatic boot of image at addr 0x80A00000 ...
## Booting image at 80a00000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.180
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3814054 Bytes =  3.6 MB
   Load Address: 80000000
   Entry Point:  80000000
  Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 4.14.180 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11063-85e04e9f46)) #0 Sat May 16 18:32:20 2020
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Sitecom WLR-4100
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from 0x80481740 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=0006f7fa
[    0.000000] Readback ErrCtl register=0006f7fa
[    0.000000] Memory: 56632K/65536K available (3916K kernel code, 187K rwdata, 500K rodata, 3388K init, 215K bss, 8904K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 600MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000010] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.007593] Calibrating delay loop... 398.13 BogoMIPS (lpj=1990656)
[    0.073594] pid_max: default: 32768 minimum: 301
[    0.078333] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084698] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097696] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107255] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113219] pinctrl core: initialized pinctrl subsystem
[    0.119508] NET: Registered protocol family 16
[    0.145293] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.150746] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.157063] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.162488] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.168764] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.174185] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.180476] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.185809] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.196823] clocksource: Switched to clocksource systick
[    0.203059] NET: Registered protocol family 2
[    0.208257] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.214981] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.221210] TCP: Hash tables configured (established 1024 bind 1024)
[    0.227482] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.233107] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.239502] NET: Registered protocol family 1
[    2.576830] random: fast init done
[    4.127829] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    4.134391] Crashlog allocated RAM at address 0x3f00000
[    4.141205] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    4.153055] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    4.158707] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    4.244597] io scheduler noop registered
[    4.248408] io scheduler deadline registered (default)
[    4.254179] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    4.263147] console [ttyS0] disabled
[    4.266599] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
žfø†˜xx~˜æ˜~˜àæžøžæžàžf˜ž~`f昘~˜††ž†àžfx怘€žfø†˜xx~˜æ˜~˜àæžøžæžàžf˜ž~`f昘~˜††ž†àžfx怘€žfø†˜ø˜ø˜æfàæžþž`æàæžøžæžàžf˜žfx†øž†˜~x†žf†àžfx怘€žfø†˜ø˜ø˜æfàæžþž`æàæžøžæžàžf˜žfx†øž†˜~x†žf†àžfx怘€žfø†˜à˜xx˜~˜øfž.˜øfž.†.~.xþžæàfx.˜øfž.˜žæž`fx˜˜€žfø†x˜~˜ž†xf˜øfž.†.~.˜ž†xfžx.˜æx.†€˜à˜øx.˜††àf~fæøf†æ€˜€žfø†˜x~˜à˜~.x†ž€fx`f†.f†ø~†ž`fžþžøžf†ø~†ž`fžþžøžxþžf†ž`˜žøž.˜f`xf†~†žfx.˜øfž.†.˜˜€žfø†`˜x`˜à˜~˜€†øfx~†žøž~.˜f`f†ø~†ž`fžþžøž˜žøž.`fž.†.`˜˜˜

Then when linux set 57600 baud on UART I was unable to read. Then I adapted the setting from 115200 baud of the factory UBoot and I got this (after pressing return):

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.3, r11063-85e04e9f46
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# 
root@OpenWrt:/# 

and the internal Flash is apparently untouched. Since I get the same messages fter re-boot:

init started: BusyBox v1.13.3 (2014-02-21 19:07:17 CST)

starting pid 746, tty '/dev/console': '/sbin/config_init'
mknod: /dev/ttyS0: File exists
mknod: /dev/ttyS1: File exists
Config Init version: 1.4.1.24 date: 2014/02/21
Wed Jan  1 00:00:00 UTC 2014
ln: /lib/./modules: File exists
starting pid 795, tty '/dev/ttyS1': '/sbin/config_term'
************************************************************************
*                            WLR-4100v1002                             *
************************************************************************
KernelApp/Ramdisk Ver:1.4.1.24			 Date:2014/02/21
password: 

Woow.
Did you create the package on the fly?

I issued the command for double checking the flash:

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00001000 "uboot"
mtd1: 00010000 00001000 "config"
mtd2: 00010000 00001000 "factory"
mtd3: 00790000 00001000 "firmware"
mtd4: 001be000 00001000 "kernel"
mtd5: 005d2000 00001000 "rootfs"
mtd6: 00290000 00001000 "rootfs_data"
mtd7: 00010000 00001000 "backup"
mtd8: 00010000 00001000 "storage"

Then for the boot:

root@OpenWrt:/dev# dmesg
[    0.000000] Linux version 4.14.180 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11063-85e04e9f46)) #0 Sat May 16 18:32:20 2020
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Sitecom WLR-4100
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 8047e5d0, node_mem_map 81000040
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x80481740 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=0006f5ff
[    0.000000] Readback ErrCtl register=0006f5ff
[    0.000000] Memory: 56632K/65536K available (3916K kernel code, 187K rwdata, 500K rodata, 3388K init, 215K bss, 8904K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 600MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000010] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.007593] Calibrating delay loop... 398.13 BogoMIPS (lpj=1990656)
[    0.073598] pid_max: default: 32768 minimum: 301
[    0.078337] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084702] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097700] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107258] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113223] pinctrl core: initialized pinctrl subsystem
[    0.119512] NET: Registered protocol family 16
[    0.145297] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.150749] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.157066] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.162492] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.168767] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.174188] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.180477] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.185810] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.196825] clocksource: Switched to clocksource systick
[    0.203060] NET: Registered protocol family 2
[    0.208258] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.214982] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.221210] TCP: Hash tables configured (established 1024 bind 1024)
[    0.227484] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.233110] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.239504] NET: Registered protocol family 1
[    0.243698] PCI: CLS 0 bytes, default 32
[    2.576832] random: fast init done
[    4.126906] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    4.133475] Crashlog allocated RAM at address 0x3f00000
[    4.140280] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    4.152137] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    4.157785] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    4.243630] io scheduler noop registered
[    4.247441] io scheduler deadline registered (default)
[    4.253210] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    4.262181] console [ttyS0] disabled
[    4.265633] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    4.275309] console [ttyS0] enabled
[    4.289021] bootconsole [early0] disabled
[    4.312407] spi spi0.0: force spi mode3
[    4.320877] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    4.330707] 6 fixed-partitions partitions found on MTD device spi0.0
[    4.343377] Creating 6 MTD partitions on "spi0.0":
[    4.352940] 0x000000000000-0x000000030000 : "uboot"
[    4.363558] 0x000000030000-0x000000040000 : "config"
[    4.374340] 0x000000040000-0x000000050000 : "factory"
[    4.385309] 0x000000050000-0x0000007e0000 : "firmware"
[    4.399413] 2 uimage-fw partitions found on MTD device firmware
[    4.411270] Creating 2 MTD partitions on "firmware":
[    4.421177] 0x000000000000-0x0000001be000 : "kernel"
[    4.431941] 0x0000001be000-0x000000790000 : "rootfs"
[    4.442648] mtd: device 5 (rootfs) set to be root filesystem
[    4.455496] 1 squashfs-split partitions found on MTD device rootfs
[    4.467882] 0x000000500000-0x000000790000 : "rootfs_data"
[    4.479537] 0x0000007e0000-0x0000007f0000 : "backup"
[    4.490309] 0x0000007f0000-0x000000800000 : "storage"
[    4.501999] libphy: Fixed MDIO Bus: probed
[    4.519449] gsw: setting port4 to ephy mode
[    4.528129] libphy: mdio: probed
[    4.558736] switch0: Atheros AR8337 rev. 2 switch registered on mdio-bus
[    4.863466] ar8327: qca,phy-rgmii-en is not specified
[    4.896670] ar8327: qca,phy-rgmii-en is not specified
[    4.906911] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    4.921319] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    4.933785] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    4.950774] rt2880_wdt 10000120.watchdog: Initialized
[    4.962183] NET: Registered protocol family 10
[    4.975388] Segment Routing with IPv6
[    4.982862] NET: Registered protocol family 17
[    4.991790] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    5.017627] 8021q: 802.1Q VLAN Support v1.8
[    5.046164] Freeing unused kernel memory: 3388K
[    5.055222] This architecture does not have kernel memory protection.
[    5.083932] init: Console is alive
[    5.091126] init: - watchdog -
[    5.120004] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.138721] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.157256] init: - preinit -
[    5.385600] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    5.401851] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    5.413500] 8021q: adding VLAN 0 to HW filter on device eth0
[    5.425051] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.452193] random: procd: uninitialized urandom read (4 bytes read)
[    6.592236] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[    6.615183] procd: - early -
[    6.621202] procd: - watchdog -
[    6.890796] procd: - watchdog -
[    6.897468] procd: - ubus -
[    6.910078] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.933986] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.947247] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.961071] procd: - init -
[    7.413166] kmodloader: loading kernel modules from /etc/modules.d/*
[    7.453518] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    7.492742] Loading modules backported from Linux version v4.19.120-0-gfdc072324f3c
[    7.508086] Backport generated by backports.git v4.19.120-1-0-g60c3a249
[    7.559026] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.585309] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    7.720846] xt_time: kernel timezone is -0000
[    7.832778] PPP generic driver version 2.4.2
[    7.858418] NET: Registered protocol family 24
[    7.920910] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[    7.935389] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[    7.950858] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[    7.965250] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    7.992117] urngd: jent-rng init failed, err: 2
[    8.037836] kmodloader: done loading kernel modules from /etc/modules.d/*
[   36.385064] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   36.401064] 8021q: adding VLAN 0 to HW filter on device eth0
[   36.514578] br-lan: port 1(eth0.1) entered blocking state
[   36.525412] br-lan: port 1(eth0.1) entered disabled state
[   36.536567] device eth0.1 entered promiscuous mode
[   36.546174] device eth0 entered promiscuous mode
[   36.609175] br-lan: port 1(eth0.1) entered blocking state
[   36.620000] br-lan: port 1(eth0.1) entered forwarding state
[   36.631316] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   37.418410] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   66.977018] random: crng init done
[   66.983804] random: 6 urandom warning(s) missed due to ratelimiting

Then the WLAN LED blinks when I connect the Ethernet, like the LAN 3 and 4 (all 100Mbps not 1Gbps). No LED on LAN 1 and LAN 2 connecting at 10Mbps.

Let's fix current state (and correct if i'm wrong):

  1. ramfs image is loaded and run correctly.
  2. linux serial console speed don't match uboot speed and must be set to 115200.
  3. qca8337 switch work partially (2 ports not working) but device is accessible by network(?)
  4. wifi work(?)
  5. LEDs and buttons don't work correctly.
  6. MAC addresses match to vendors firmware (?).
    I'd like to see output of coomands:
ifconfig -a
swconfig dev switch0 show

Now you can backup content of flash partitions.
And start to test normal (not ram started!) image.

Confirmed

Yes, router boots at 115200, then it switches to 57600baud. it is better to set 115200

Yes WLAN, Port 3 and 4 negotiate at full speed. Actually 1Gbps (yesterey I tested them with 100Mbps laptop). Ports 1 and 2 just 10Mbps (LED off). After boot (before TFTP upload) all the 5 ports negotiate 1Gbps. Device is not accessible from Ethernet.
I read at other topic dealing with similar issue. I discover UBoot menu option 4:

4: System Enter Boot Command Line Interface.
U-Boot 1.1.3 (May 23 2013 - 14:40:54)
MT7620 # 

Allowing the execution of the following commands:

? - alias for 'help'
bootm - boot application image from memory
cp - memory copy
erase - erase SPI FLASH memory
go - start application at address 'addr'
help - print online help
loadb - load binary file over serial line (kermit mode)
md - memory display
mdio - Ralink PHY register R/W command !!
mm - memory modify (auto-incrementing)
nm - memory modify (constant address)
printenv- print environment variables
reset - Perform RESET of the CPU
rf - read/write rf register
saveenv - save environment variables to persistent storage
setenv - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor version

I may able to read mdio register of a working switch!!!

No WiFi

No neither the power LED. This source code excerpt may help:

/*
 * LED
 */
#define SENAO_GPIO_LED_POWER		9
#define SENAO_GPIO_LED_WPS		39 //2.4G
#define SENAO_GPIO_LED_24G		72			

/*
 * BUTTON
 */
#define SENAO_GPIO_BUTTON_WPS	2

/*
 * POWER
 */
#define SENAO_GPIO_POWER_USB		38


/*
 * OTHERS
 */
#define SENAO_GPIO_HW_RESET		17
#define SENAO_GPIO_SWITCH_RESET	45

Here it is:

root@OpenWrt:/# ifconfig -a
br-lan    Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::66d1:a3ff:fe0f:b984/64 Scope:Link
          inet6 addr: fd40:a744:834f::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:2400 (2.3 KiB)

eth0      Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          inet6 addr: fe80::66d1:a3ff:fe0f:b984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:494 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:159601 (155.8 KiB)
          Interrupt:5 

eth0.1    Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:2400 (2.3 KiB)

eth0.2    Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:85  
          inet6 addr: fe80::66d1:a3ff:fe0f:b985/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:464 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:152896 (149.3 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:288 errors:0 dropped:0 overruns:0 frame:0
          TX packets:288 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19584 (19.1 KiB)  TX bytes:19584 (19.1 KiB)

wlan0     Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

and:

root@OpenWrt:/# swconfig dev switch0 show
Global attributes:
	enable_vlan: 1
	ar8xxx_mib_poll_interval: 0
	ar8xxx_mib_type: 0
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	mirror_monitor_port: 0
	mirror_source_port: 0
	arl_age_time: 300
	arl_table: address resolution table

	igmp_snooping: 0
	igmp_v3: 0
Port 0:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:1 link:down
Port 2:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:2 link:down
Port 3:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:3 link:down
Port 4:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:4 link:down
Port 5:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 2
	link: port:5 link:up speed:100baseT full-duplex auto
Port 6:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:6 link:up speed:10baseT half-duplex 
VLAN 1:
	vid: 1
	ports: 0t 1 2 3 4 
VLAN 2:
	vid: 2
	ports: 0t 5 

I tried the same command on stock firmware:

# ifconfig -a
br0       Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::66d1:a3ff:fe0f:b984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1600  Metric:1
          RX packets:2016 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2369 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:270233 (263.8 KiB)  TX bytes:1786009 (1.7 MiB)

br2       Link encap:Ethernet  HWaddr 22:E0:68:0D:xx:5C  
          inet6 addr: fe80::20e0:68ff:fe0d:a55c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:548 (548.0 B)

eth2      Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          inet6 addr: fe80::66d1:a3ff:fe0f:b984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1600  Metric:1
          RX packets:2021 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2393 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:308913 (301.6 KiB)  TX bytes:1797605 (1.7 MiB)
          Interrupt:3 

eth2.1    Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          inet6 addr: fe80::66d1:a3ff:fe0f:b984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1600  Metric:1
          RX packets:2019 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2374 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:279515 (272.9 KiB)  TX bytes:1795963 (1.7 MiB)

eth2.2    Link encap:Ethernet  HWaddr DC:4A:3E:01:xx:81  
          inet6 addr: fe80::de4a:3eff:fe01:f081/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:1024 (1.0 KiB)

imq0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:16000  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:11000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

imq1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:16000  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:11000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ip6tnl0   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:1460  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:94 errors:0 dropped:0 overruns:0 frame:0
          TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8586 (8.3 KiB)  TX bytes:8586 (8.3 KiB)

ra0       Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          inet6 addr: fe80::66d1:a3ff:fe0f:b984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4 

ra1       Link encap:Ethernet  HWaddr 66:D1:A3:0E:xx:84  
          BROADCAST MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wds0      Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          BROADCAST MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wds1      Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          BROADCAST MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wds2      Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          BROADCAST MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wds3      Link encap:Ethernet  HWaddr 64:D1:A3:0F:xx:84  
          BROADCAST MULTICAST  MTU:1600  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

swconfig does not work on stock firmware

The uboot menu option 4 allows the execution of commands including mdio:

MT7620 # 
mdio mdio.r [phy_addr(dec)] [reg_addr(dec)] 
mdio.w [phy_addr(dec)] [reg_addr(dec)] [data(HEX)] 
mdio.anoff GMAC1 Force link status enable !!  
mdio.anon GMAC1 Force link status disable !!  
mdio.wb [phy register(dec)] [bit offset(Dec)] [Value(0/1)]  
mdio.d - dump all Phy registers 
mdio.d [phy register(dec)] - dump Phy registers 

MT7620 # mdio.d

SPEC defined Register
===============
00: 3100 01: 7949 02: 004D 03: D036 04: 1DE1 05: 0000 06: 0004 07: 2801 
08: 0000 09: 0200 10: 0000 11: 0000 12: 0000 13: 0000 14: 0000 15: 2000 
16: 0862 

Global Register Page 0
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Global Register Page 1
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Global Register Page 2
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Global Register Page 3
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 0 Page 0
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 0 Page 1
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 0 Page 2
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 0 Page 3
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 1 Page 0
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 1 Page 1
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 1 Page 2
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 1 Page 3
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 2 Page 0
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 2 Page 1
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 2 Page 2
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 2 Page 3
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 3 Page 0
===============
16: 0862 17: 7C1C 18: 0000 19: F400 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 3 Page 1
===============
16: 0862 17: 7C1C 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 3 Page 2
===============
16: 0862 17: 7C1C 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 3 Page 3
===============
16: 0862 17: 7C1C 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 4 Page 0
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 4 Page 1
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 4 Page 2
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Local Register Port 4 Page 3
===============
16: 0862 17: 0010 18: 0000 19: 0000 20: 082C 21: 0000 22: 2400 23: 0000 
24: 3200 25: 1000 26: 0000 27: 0000 28: 0000 29: 0000 30: 02EE 31: 0000 

Not sure this could help in identifiyng the initialization of QCA8337:

		phy0: ethernet-phy@0 {
			reg = <0>;
			phy-mode = "rgmii";
			qca,ar8327-initvals = <
				0x04 0x87300000 /* PORT0 PAD MODE CTRL */
				0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
				0x7c 0x0000007e /* PORT0_STATUS */
				0x94 0x00000000 /* PORT6_STATUS */
			>;
		};

I am still in stuck with this *.dts

/dts-v1/;

#include "mt7620a.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "sitecom,wlr-4100", "ralink,mt7620a-soc";
	model = "Sitecom WLR-4100 v1 002 sw07";

	aliases {
		led-boot = &led_status;
		led-failsafe = &led_status;
		led-running = &led_status;
		led-upgrade = &led_status;
	};

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	keys {
		compatible = "gpio-keys-polled";
		poll-interval = <20>;
							//SENAO_GPIO_BUTTON_WPS	2
		wps {
			label = "wps";
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
							//SENAO_GPIO_HW_RESET		17
	/*	reset {
			label = "reset";
			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	*/
	};

	leds {	
		compatible = "gpio-leds";
							//SENAO_GPIO_LED_POWER		9
		led_status: status {				
			label = "wlr-4100:green:status";
			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		};
							//SENAO_GPIO_LED_24G		72
		wifi2g {
			label = "wlr-4100:green:wifi2g";
			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
		};
							//SENAO_GPIO_LED_WPS		39
	/*	led_wps: wps {
			label = "wlr-4100:blue:wps";
			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
		};
	*/	
		
	};
	
								//SENAO_GPIO_POWER_USB		38
								//SENAO_GPIO_SWITCH_RESET	45
	/*
	gpio_export {
		compatible = "gpio-export";
		#size-cells = <0>;

		usb-power {
			gpio-export,name = "usb-power";
			gpio-export,output = <1>;
			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		};
	};
	*/

};

&gpio0 {
	status = "okay";
};

/*
&gpio1 {
	status = "okay";
};

&gpio2 {
	status = "okay";
};
*/

&gpio3 {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "uboot";
				reg = <0x0 0x30000>;
				read-only;
			};

			config: partition@30000 {
				label = "config";
				reg = <0x30000 0x10000>;
				read-only;
			};

			factory: partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x790000>;
			};

			partition@7e0000 {
				label = "backup";
				reg = <0x7e0000 0x10000>;
				read-only;
			};

			partition@7f0000 {
				label = "storage";
				reg = <0x7f0000 0x10000>;
				read-only;
			};
		};
	};
};

&ethernet {
	status = "okay";
	mtd-mac-address = <&factory 0x4>;
	//	mediatek,portmap = "wllll";
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;

	port@5 {
		status = "okay";
		phy-mode = "rgmii";
		mediatek,fixed-link = <1000 1 1 1>;
		phy-handle = <&phy0>;

	};

	mdio-bus {
		status = "okay";
		mediatek,mdio-mode = <1>;

		phy0: ethernet-phy@0 {
			reg = <0>;
			phy-mode = "rgmii";
			qca,ar8327-initvals = <
				0x04 0x07600000 /* PORT0 PAD MODE CTRL */
				0x08 0x07600000 /* PORT5 PAD MODE CTRL */
				//0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
				//0x10 0x40000000 /* Power-on Strapping: 176-pin interface configuration */
				0x50 0xc437c437 /* LED Control Register 0 */
				0x54 0xc337c337 /* LED Control Register 1 */
				0x58 0x00000000 /* LED Control Register 2 */
				0x5c 0x03ffff00 /* LED Control Register 3 */
				0x7c 0x0000007e /* PORT0_STATUS */
				0x90 0x0000007e /* PORT5 STATUS */
				//0x94 0x0000007e /* PORT6 STATUS */
			>;
		};

		phy1: ethernet-phy@1 {
			reg = <1>;
			phy-mode = "rgmii";
		};

		phy2: ethernet-phy@2 {
			reg = <2>;
			phy-mode = "rgmii";
		};

		phy3: ethernet-phy@3 {
			reg = <3>;
			phy-mode = "rgmii";
		};

		phy4: ethernet-phy@4 {
			reg = <4>;
			phy-mode = "rgmii";
		};
	};
};

/*
&gsw {
     mediatek,port4="gmac";
};
*/

&ehci {
	status = "okay";
};

&ohci {
	status = "okay";
};

&wmac {
	status = "okay";
	ralink,mtd-eeprom = <&factory 0>;
};

/*
&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
		mediatek,2ghz = <0>;
	};
};
*/

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			//ralink,group = "mdio", "rgmii1", "uartf", "i2c", "wled";
			ralink,group = "uartf", "i2c", "wled";
			ralink,function = "gpio";
		};
	};
};

Generating this log:

[    0.000000] Linux version 4.14.180 (andrea@tubo-wd) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11063-85e04e9f46)) #0 Sat May 16 18:32:20 2020
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Sitecom WLR-4100 v1 002 sw06
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x478 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=0006f5fa
[    0.000000] Readback ErrCtl register=0006f5fa
[    0.000000] Memory: 56764K/65536K available (3704K kernel code, 179K rwdata, 864K rodata, 3116K init, 208K bss, 8772K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 600MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000011] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.007588] Calibrating delay loop... 398.13 BogoMIPS (lpj=1990656)
[    0.073581] pid_max: default: 32768 minimum: 301
[    0.078309] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084671] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097608] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107169] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113129] pinctrl core: initialized pinctrl subsystem
[    0.118708] NET: Registered protocol family 16
[    0.147846] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.153303] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.159607] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.164946] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.174870] clocksource: Switched to clocksource systick
[    0.181169] NET: Registered protocol family 2
[    0.186213] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.192936] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.199162] TCP: Hash tables configured (established 1024 bind 1024)
[    0.205458] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.211085] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.217464] NET: Registered protocol family 1
[    2.574864] random: fast init done
[    3.614530] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    3.621198] Crashlog allocated RAM at address 0x3f00000
[    3.627981] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    3.639837] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.645490] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    3.735889] io scheduler noop registered
[    3.739636] io scheduler deadline registered (default)
[    3.745501] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    3.752666] console [ttyS0] disabled
[    3.756183] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    3.765807] console [ttyS0] enabled
[    3.765807] console [ttyS0] enabled
[    3.772837] bootconsole [early0] disabled
[    3.772837] bootconsole [early0] disabled
[    3.785969] spi spi0.0: force spi mode3
[    3.790652] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.795748] 6 fixed-partitions partitions found on MTD device spi0.0
[    3.802228] Creating 6 MTD partitions on "spi0.0":
[    3.807150] 0x000000000000-0x000000030000 : "uboot"
[    3.813023] 0x000000030000-0x000000040000 : "config"
[    3.818990] 0x000000040000-0x000000050000 : "factory"
[    3.825024] 0x000000050000-0x0000007e0000 : "firmware"
[    3.833908] 2 uimage-fw partitions found on MTD device firmware
[    3.840024] Creating 2 MTD partitions on "firmware":
[    3.845121] 0x000000000000-0x0000001be000 : "kernel"
[    3.851054] 0x0000001be000-0x000000790000 : "rootfs"
[    3.856949] mtd: device 5 (rootfs) set to be root filesystem
[    3.864215] 1 squashfs-split partitions found on MTD device rootfs
[    3.870607] 0x000000500000-0x000000790000 : "rootfs_data"
[    3.877043] 0x0000007e0000-0x0000007f0000 : "backup"
[    3.882892] 0x0000007f0000-0x000000800000 : "storage"
[    3.889722] libphy: Fixed MDIO Bus: probed
[    3.903091] gsw: setting port4 to ephy mode
[    3.907731] libphy: mdio: probed
[    3.936930] switch0: Atheros AR8337 rev. 2 switch registered on mdio-bus
[    4.242271] ar8327: qca,phy-rgmii-en is not specified
[    4.272383] ar8327: qca,phy-rgmii-en is not specified
[    4.277689] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    4.285748] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    4.292457] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    4.301384] rt2880_wdt 10000120.watchdog: Initialized
[    4.307838] NET: Registered protocol family 10
[    4.316628] Segment Routing with IPv6
[    4.320482] NET: Registered protocol family 17
[    4.325149] 8021q: 802.1Q VLAN Support v1.8
[    4.348087] Freeing unused kernel memory: 3116K
[    4.352753] This architecture does not have kernel memory protection.
[    4.374227] init: Console is alive
[    4.377932] init: - watchdog -
[    4.405478] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.422971] usbcore: registered new interface driver usbfs
[    4.428650] usbcore: registered new interface driver hub
[    4.434236] usbcore: registered new device driver usb
[    4.445275] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.453763] ehci-platform: EHCI generic platform driver
[    4.469430] phy phy-usbphy.0: remote usb device wakeup disabled
[    4.475509] phy phy-usbphy.0: UTMI 16bit 30MHz
[    4.480059] ehci-platform 101c0000.ehci: EHCI Host Controller
[    4.485985] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    4.494205] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    4.508127] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    4.515440] hub 1-0:1.0: USB hub found
[    4.519796] hub 1-0:1.0: 1 port detected
[    4.526853] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    4.534919] ohci-platform: OHCI generic platform driver
[    4.540633] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[    4.547627] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    4.555835] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    4.589649] hub 2-0:1.0: USB hub found
[    4.593938] hub 2-0:1.0: 1 port detected
[    4.601881] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.613423] init: - preinit -
[    4.837993] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    4.846606] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    4.852607] 8021q: adding VLAN 0 to HW filter on device eth0
[    4.858670] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    4.879601] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    6.012540] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[    6.029597] procd: - early -
[    6.032659] procd: - watchdog -
[    6.318135] procd: - watchdog -
[    6.321693] procd: - ubus -
[    6.331624] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.351298] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.358399] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.366017] procd: - init -
Please press Enter to activate this console.
[    6.827841] kmodloader: loading kernel modules from /etc/modules.d/*
[    6.856892] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    6.882346] Loading modules backported from Linux version v4.19.120-0-gfdc072324f3c
[    6.890235] Backport generated by backports.git v4.19.120-1-0-g60c3a249
[    6.916722] ip_tables: (C) 2000-2006 Netfilter Core Team
[    6.942756] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    7.067661] xt_time: kernel timezone is -0000
[    7.187033] PPP generic driver version 2.4.2
[    7.205139] NET: Registered protocol family 24
[    7.260504] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[    7.267963] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[    7.275914] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[    7.336617] kmodloader: done loading kernel modules from /etc/modules.d/*
[    7.382391] urngd: jent-rng init failed, err: 2
[   33.578915] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   33.587299] 8021q: adding VLAN 0 to HW filter on device eth0
[   33.617093] br-lan: port 1(eth0.1) entered blocking state
[   33.622618] br-lan: port 1(eth0.1) entered disabled state
[   33.628584] device eth0.1 entered promiscuous mode
[   33.633479] device eth0 entered promiscuous mode
[   33.690722] br-lan: port 1(eth0.1) entered blocking state
[   33.696312] br-lan: port 1(eth0.1) entered forwarding state
[   33.702209] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   34.596463] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

And this:

root@OpenWrt:/# ifconfig -a
br-lan    Link encap:Ethernet  HWaddr 64:D1:A3:xx:xx:84  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::66d1:a3ff:fexx:xx84/64 Scope:Link
          inet6 addr: fd79:ffeb:bde7::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:1964 (1.9 KiB)

eth0      Link encap:Ethernet  HWaddr 64:D1:A3:xx:xx:84  
          inet6 addr: fe80::66d1:a3ff:fexx:xx84/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:13951 (13.6 KiB)
          Interrupt:5 

eth0.1    Link encap:Ethernet  HWaddr 64:D1:A3:xx:xx:84  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:1964 (1.9 KiB)

eth0.2    Link encap:Ethernet  HWaddr 64:D1:A3:xx:xx:85  
          inet6 addr: fe80::66d1:a3ff:fexx:xx85/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:9394 (9.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:80 errors:0 dropped:0 overruns:0 frame:0
          TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5440 (5.3 KiB)  TX bytes:5440 (5.3 KiB)

wlan0     Link encap:Ethernet  HWaddr 64:D1:A3:xx:xx:84  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/# 
root@OpenWrt:/# [   64.662206] random: crng init done
[   64.665698] random: 6 urandom warning(s) missed due to ratelimiting
swconfig list
Found: switch0 - mdio-bus
Found: switch1 - mt7620
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 show

Global attributes:
	enable_vlan: 0
	ar8xxx_mib_poll_interval: 0
	ar8xxx_mib_type: 0
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	mirror_monitor_port: 0
	mirror_source_port: 0
	arl_age_time: 300
	arl_table: address resolution table
Port 0: MAC 64:d1:a3:xx:xx:85
Port 0: MAC 64:d1:a3:xx:xx:84

	igmp_snooping: 0
	igmp_v3: 0
Port 0:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:1 link:down
Port 2:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:2 link:down
Port 3:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:3 link:down
Port 4:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:4 link:down
Port 5:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:5 link:up speed:100baseT full-duplex auto
Port 6:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:6 link:up speed:10baseT half-duplex 
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch1 show

Global attributes:
	enable_vlan: 0
	mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0

Port 0:
	mib: Port 0 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:0 link:down
Port 1:
	mib: Port 1 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:1 link:down
Port 2:
	mib: Port 2 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:2 link:down
Port 3:
	mib: Port 3 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:3 link:down
Port 4:
	mib: Port 4 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:4 link:down
Port 5:
	mib: Port 5 MIB counters
TxGPC      : 112
TxBOC      : 0
TxGOC      : 29959
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:5 link:up speed:1000baseT full-duplex 
Port 6:
	mib: Port 6 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 112
RxBOC      : 0
RxGOC      : 29959
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:6 link:up speed:1000baseT full-duplex 
Port 7:
	mib: Port 7 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:7 link:down
root@OpenWrt:/# 
root@OpenWrt:/# cat /etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd2b:4026:3b1d::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device 'lan_eth0_1_dev'
	option name 'eth0.1'
	option macaddr '64:d1:a3:xx:xx:84'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr '64:d1:a3:xx:xx:85'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

root@OpenWrt:/# 

I suspect MT7620 has 2 RGMII interfaces on port 4 and 5:


Which are both connected to QCA8337:

  • one to Port 0 for managing LAN 1..4
  • the other to Port 5 for WLAN

But I do not know how to reflect this in *.dts

Did you try LAVA LR-25G001 (mt7620a+qca8337) config?

	mdio-bus {
		status = "okay";
		mediatek,mdio-mode = <1>;

		phy0: ethernet-phy@0 {
			reg = <0>;
			phy-mode = "rgmii";
			qca,ar8327-initvals = <
				0x04 0x87300000 /* PORT0 PAD MODE CTRL */
				0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
				0x7c 0x0000007e /* PORT0_STATUS */
				0x94 0x00000000 /* PORT6_STATUS */
			>;
		};

I think that your hardware config is the same. But in your case synchronization of rgmii interface between P5 of internal switch and P0 of qca8337 switch is lost. It may be helpful to see qca8337 port0 mib statistics.

Here it is the statistics:

root@OpenWrt:/# swconfig dev switch0 port 0 show
Port 0:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
root@OpenWrt:/# 
root@OpenWrt:/# swconfig list
Found: switch0 - mdio-bus
Found: switch1 - mt7620
root@OpenWrt:/# swconfig dev switch1 port 5 show
Port 5:
	mib: Port 5 MIB counters
TxGPC      : 528
TxBOC      : 0
TxGOC      : 174005
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:5 link:up speed:1000baseT full-duplex 
root@OpenWrt:/# 

Sure you may be right, the fact MT7620 and QCA8337 have 2 RGMII ports does not mean they are both conntected. And even if they are, we can use just one connection.

Sorry, I forgot that ar8337 statistics is disabled by default and you didn't configure ar8337 switch. So let's do it:

swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports '0t 1 2 3 4'
swconfig dev switch0 vlan 2 set ports '0t 5'
swconfig dev switch0 set ar8xxx_mib_poll_interval 100
swconfig dev switch0 set ar8xxx_mib_type 1
swconfig dev switch0 set apply 1

After that you will see traffic from port 5 of internal switch to port 0 of ar8337 and vice versus.
BTW you say nothing of config LAVA LR25G001.

You were very correct. Here it is the traffic on AR8337 port 0:

root@OpenWrt:/# swconfig dev switch0 port 0 show
Port 0:
	mib: MIB counters
RxBroad     : 0
RxPause     : 0
RxMulti     : 0
RxFcsErr    : 0
RxAlignErr  : 0
RxRunt      : 0
RxFragment  : 0
Rx64Byte    : 0
Rx128Byte   : 0
Rx256Byte   : 0
Rx512Byte   : 0
Rx1024Byte  : 0
Rx1518Byte  : 0
RxMaxByte   : 0
RxTooLong   : 0
RxGoodByte  : 0
RxBadByte   : 0
RxOverFlow  : 0
Filtered    : 0
TxBroad     : 141
TxPause     : 0
TxMulti     : 533
TxUnderRun  : 0
Tx64Byte    : 62
Tx128Byte   : 510
Tx256Byte   : 69
Tx512Byte   : 0
Tx1024Byte  : 25
Tx1518Byte  : 8
TxMaxByte   : 0
TxOverSize  : 0
TxByte      : 88794 (86.7 KiB)
TxCollision : 0
TxAbortCol  : 0
TxMultiCol  : 0
TxSingleCol : 0
TxExcDefer  : 0
TxDefer     : 0
TxLateCol   : 0

	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
root@OpenWrt:/# 

Can we embed the configuration you explained in the firmware?

BTW you say nothing of config LAVA LR25G001.

I just restored what you reccommended at the beginning.

Ok. No traffic from switch0 and switch1 in both direction. It's possible that external switch ar8337 is connected through port 4 of switch1.
To simplify discussion see this scheme:

        mt7620
        switch1       ar8337
         +--+         switch0
eth0<--->|P6| rgmii   +--+
         |P5|<-?->|<->|M0|
         |P4|<-?->|   |M1|
         +--+         |M2|
                      |M3|
                      |M4|
                      |M5|
                      |M6|
                      +--+

Next step for tests:

  1. P5, P4 and M0 must be configured in rgmii mode (show your current dts-file).
  2. Generate traffic in both direction. E.g. ping 192.168.1.1 from any computer and ping 192.168.1.2 (computer address) from router.
  3. See statistics of P5,P4,M0
swconfig dev switch1 port 4 show
swconfig dev switch1 port 5 show
swconfig dev switch0 port 0 show

Here it is:

/dts-v1/;

#include "mt7620a.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "sitecom,wlr-4100", "ralink,mt7620a-soc";
	model = "Sitecom WLR-4100 v1 002 sw07";

	aliases {
		led-boot = &led_status;
		led-failsafe = &led_status;
		led-running = &led_status;
		led-upgrade = &led_status;
	};

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	keys {
		compatible = "gpio-keys-polled";
		poll-interval = <20>;
							//SENAO_GPIO_BUTTON_WPS	2
		wps {
			label = "wps";
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
							//SENAO_GPIO_HW_RESET		17
	/*	reset {
			label = "reset";
			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	*/
	};

	leds {	
		compatible = "gpio-leds";
							//SENAO_GPIO_LED_POWER		9
		led_status: status {				
			label = "wlr-4100:green:status";
			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		};
							//SENAO_GPIO_LED_24G		72
		wifi2g {
			label = "wlr-4100:green:wifi2g";
			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
		};
							//SENAO_GPIO_LED_WPS		39
	/*	led_wps: wps {
			label = "wlr-4100:blue:wps";
			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
		};
	*/	
		
	};
	
								//SENAO_GPIO_POWER_USB		38
								//SENAO_GPIO_SWITCH_RESET	45
	/*
	gpio_export {
		compatible = "gpio-export";
		#size-cells = <0>;

		usb-power {
			gpio-export,name = "usb-power";
			gpio-export,output = <1>;
			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		};
	};
	*/

};

&gpio0 {
	status = "okay";
};

/*
&gpio1 {
	status = "okay";
};

&gpio2 {
	status = "okay";
};
*/

&gpio3 {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "uboot";
				reg = <0x0 0x30000>;
				read-only;
			};

			config: partition@30000 {
				label = "config";
				reg = <0x30000 0x10000>;
				read-only;
			};

			factory: partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x790000>;
			};

			partition@7e0000 {
				label = "backup";
				reg = <0x7e0000 0x10000>;
				read-only;
			};

			partition@7f0000 {
				label = "storage";
				reg = <0x7f0000 0x10000>;
				read-only;
			};
		};
	};
};

&ethernet {
	status = "okay";
	mtd-mac-address = <&factory 0x4>;
	//	mediatek,portmap = "wllll";
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;

	port@5 {
		status = "okay";
		phy-mode = "rgmii";
		mediatek,fixed-link = <1000 1 1 1>;
		phy-handle = <&phy0>;

	};

	mdio-bus {
		status = "okay";
		mediatek,mdio-mode = <1>;

		phy0: ethernet-phy@0 {
			reg = <0>;
			phy-mode = "rgmii";
			qca,ar8327-initvals = <
				0x04 0x87300000 /* PORT0 PAD MODE CTRL */
				0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
				0x7c 0x0000007e /* PORT0_STATUS */
				0x94 0x00000000 /* PORT6_STATUS */
			>;
		};

		phy1: ethernet-phy@1 {
			reg = <1>;
			phy-mode = "rgmii";
		};

		phy2: ethernet-phy@2 {
			reg = <2>;
			phy-mode = "rgmii";
		};

		phy3: ethernet-phy@3 {
			reg = <3>;
			phy-mode = "rgmii";
		};

		phy4: ethernet-phy@4 {
			reg = <4>;
			phy-mode = "rgmii";
		};
	};
};

/*
&gsw {
     mediatek,port4="gmac";
};
*/

&ehci {
	status = "okay";
};

&ohci {
	status = "okay";
};

&wmac {
	status = "okay";
	ralink,mtd-eeprom = <&factory 0>;
};

/*
&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
		mediatek,2ghz = <0>;
	};
};
*/

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			//ralink,group = "mdio", "rgmii1", "uartf", "i2c", "wled";
			ralink,group = "uartf", "i2c", "wled";
			ralink,function = "gpio";
		};
	};
};

Statistics of P5,P4,M0 after generation of traffic?

The DHCP does not work, so I manually assigned 192.168.1.2 to laptop (gateway 192.168.1.1).
I issued the commands you reccommended me before:

root@OpenWrt:/# swconfig dev switch0 set reset 1
root@OpenWrt:/# swconfig dev switch0 set enable_vlan 1
root@OpenWrt:/# swconfig dev switch0 vlan 1 set ports '0t 1 2 3 4'
root@OpenWrt:/# swconfig dev switch0 vlan 2 set ports '0t 5'
root@OpenWrt:/# swconfig dev switch0 set ar8xxx_mib_poll_interval 100
root@OpenWrt:/# swconfig dev switch0 set ar8xxx_mib_type 1
root@OpenWrt:/# swconfig dev switch0 set apply 1

Then the ping from laptop:

C:\Users\Andre>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

the ping from router:

root@OpenWrt:/# ping 192.168.1.2 -c 4 -w 10
PING 192.168.1.2 (192.168.1.2): 56 data bytes

--- 192.168.1.2 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

and the statistics:

root@OpenWrt:/# swconfig dev switch1 port 4 show
Port 4:
	mib: Port 4 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:4 link:down
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch1 port 5 show
Port 5:
	mib: Port 5 MIB counters
TxGPC      : 245
TxBOC      : 0
TxGOC      : 75623
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:5 link:up speed:1000baseT full-duplex 
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 port 0 show

Port 0:
	mib: MIB counters
RxBroad     : 0
RxPause     : 0
RxMulti     : 0
RxFcsErr    : 0
RxAlignErr  : 0
RxRunt      : 0
RxFragment  : 0
Rx64Byte    : 0
Rx128Byte   : 0
Rx256Byte   : 0
Rx512Byte   : 0
Rx1024Byte  : 0
Rx1518Byte  : 0
RxMaxByte   : 0
RxTooLong   : 0
RxGoodByte  : 0
RxBadByte   : 0
RxOverFlow  : 0
Filtered    : 0
TxBroad     : 597
TxPause     : 0
TxMulti     : 2565
TxUnderRun  : 0
Tx64Byte    : 69
Tx128Byte   : 2703
Tx256Byte   : 260
Tx512Byte   : 0
Tx1024Byte  : 98
Tx1518Byte  : 32
TxMaxByte   : 0
TxOverSize  : 0
TxByte      : 402052 (392.6 KiB)
TxCollision : 0
TxAbortCol  : 0
TxMultiCol  : 0
TxSingleCol : 0
TxExcDefer  : 0
TxDefer     : 0
TxLateCol   : 0

	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
root@OpenWrt:/# 

I looked further in the OEM logs and I noticed:

============================================ 
ASIC 7620_MP (Port5<->GigaSW)
Product Name: WLR-4100v1002