OpenWrt support for Sitecom WLR-4100 v1 001

I have a Sitecom WLR-4100 v1 001 and it has Ralink 3352F and RTL8367RB. It might be the case that the chassis is the same with WLR-5100Vv 001, WLM 4600/WLM-5600(P72A), WLR-7100 and WLR-4004.

Is it possible to put OpenWRT on it?

Are you sure?

WLR4100 v1 hardware specs

Yes. Except that it's 3352F and not 3552F.

ok, might be that the one on wikidevi is v1 002 then.

Yes. It seems is v2.1. The pcb is looks exactly the same.

I am trying to add support for the WLR-4100 v1 001. I can compile OpenWRT and load it into RAM and boot it fine, but am having trouble getting the RTL8367RB switch to work. I have attached dmesg output and the .dts file I created based on similar devices. The four lines starting at 11.606186 show the error in initialising the switch.

At the end of the dmesg, it shows OpenWRT has initialised the network, though it does not actually work. With some earlier version of my .dts file the device was able to do some network communication, though I think this was through the built-in switch (?) of the RT3352 SoC, which meant the actual RTL8367RB switch did not work.

DMESG

[    0.000000] Linux version 4.14.195 (..@..) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11208-ce6496d796)) #0 Sun Sep 6 16:19:39 2020
[    0.000000] SoC Type: Ralink RT3352 id:1 rev:6
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is Sitecom WLR-4100 v1 001
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat 8039f2c0, node_mem_map 81000040
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8192 pages, LIFO batch:0
[    0.000000] random: get_random_bytes called from 0x803a26ec 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: 8128
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Writing ErrCtl register=00010d67
[    0.000000] Readback ErrCtl register=00010d67
[    0.000000] Memory: 25480K/32768K available (3137K kernel code, 163K rwdata, 412K rodata, 3000K init, 191K bss, 7288K 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: 400MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000016] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.015613] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.107855] pid_max: default: 32768 minimum: 301
[    0.117342] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.130370] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.153162] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.172579] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.184741] pinctrl core: initialized pinctrl subsystem
[    0.196145] NET: Registered protocol family 16
[    0.259443] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.270519] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.292407] clocksource: Switched to clocksource MIPS
[    0.304774] NET: Registered protocol family 2
[    0.314980] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.328786] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.341292] TCP: Hash tables configured (established 1024 bind 1024)
[    0.354196] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.365768] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.378655] NET: Registered protocol family 1
[    2.622443] random: fast init done
[    5.229054] rt-timer 10000100.timer: maximum frequency is 4069Hz
[    5.242978] Crashlog allocated RAM at address 0x1f00000
[    5.258138] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    5.282369] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    5.293927] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    5.470806] io scheduler noop registered
[    5.478537] io scheduler deadline registered (default)
[    5.490218] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    5.505000] console [ttyS0] disabled
[    5.512013] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    5.531685] console [ttyS0] enabled
[    5.545366] bootconsole [early0] disabled
[    5.575269] spi spi0.0: force spi mode3
[    5.584519] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    5.594417] 7 fixed-partitions partitions found on MTD device spi0.0
[    5.607069] Creating 7 MTD partitions on "spi0.0":
[    5.616632] 0x000000000000-0x000000030000 : "u-boot"
[    5.628522] 0x000000030000-0x000000040000 : "u-boot-env"
[    5.641173] 0x000000040000-0x000000050000 : "rf-data"
[    5.653434] 0x000000050000-0x0000007e0000 : "kernel"
[    5.741100] 0x000000660000-0x0000007e0000 : "app"
[    5.752615] 0x0000007e0000-0x0000007f0000 : "backup"
[    5.764498] 0x0000007f0000-0x000000800000 : "storage"
[    5.777550] libphy: Fixed MDIO Bus: probed
[    5.798749] rt3050-esw 10110000.esw: link changed 0x00
[    5.812378] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    5.830063] rt2880_wdt 10000120.watchdog: Initialized
[    5.842922] NET: Registered protocol family 10
[    5.862163] Segment Routing with IPv6
[    5.869780] NET: Registered protocol family 17
[    5.878830] 8021q: 802.1Q VLAN Support v1.8
[    5.919741] Freeing unused kernel memory: 3000K
[    5.928807] This architecture does not have kernel memory protection.
[    5.975511] init: Console is alive
[    5.983115] init: - watchdog -
[    6.034142] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.060889] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.086399] init: - preinit -
[    6.515693] 8021q: adding VLAN 0 to HW filter on device eth0
[    6.556382] random: procd: uninitialized urandom read (4 bytes read)
[    9.841231] procd: - early -
[    9.847450] procd: - watchdog -
[   10.495993] procd: - watchdog -
[   10.503460] procd: - ubus -
[   10.523845] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.560461] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.574406] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.590797] procd: - init -
[   11.497723] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.545592] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.606186] rtl8367b rtl8367rb: cannot find mdio node phandle
[   11.617800] rtl8367b rtl8367rb: using GPIO pins 1 (SDA) and 2 (SCK)
[   11.631619] rtl8367b rtl8367rb: unknown chip num:0000 ver:0000, mode:0000
[   11.645186] rtl8367b rtl8367rb: chip detection failed, err=-19
[   11.718336] Loading modules backported from Linux version v4.19.137-0-gc076c79e03c6
[   11.733637] Backport generated by backports.git v4.19.137-1-0-g60c3a249
[   11.787198] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.826560] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   12.064632] xt_time: kernel timezone is -0000
[   12.257666] PPP generic driver version 2.4.2
[   12.274290] urngd: v1.0.2 started.
[   12.294158] NET: Registered protocol family 24
[   12.398056] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "rf-data"
[   12.412521] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3352, rev 0200 detected
[   12.427977] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 000c detected
[   12.443189] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   12.572933] kmodloader: done loading kernel modules from /etc/modules.d/*
[   13.021186] random: crng init done
[   13.028104] random: 6 urandom warning(s) missed due to ratelimiting
[   51.159487] 8021q: adding VLAN 0 to HW filter on device eth0
[   51.204010] br-lan: port 1(eth0.1) entered blocking state
[   51.214861] br-lan: port 1(eth0.1) entered disabled state
[   51.226389] device eth0.1 entered promiscuous mode
[   51.236031] device eth0 entered promiscuous mode
[   51.357148] br-lan: port 1(eth0.1) entered blocking state
[   51.367982] br-lan: port 1(eth0.1) entered forwarding state
[   51.379608] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   52.143451] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

WLR-4100-1001.dts

/dts-v1/;

#include "rt3352.dtsi"

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

/ {
        compatible = "sitecom,wlr-4100-1001", "ralink,rt3352-soc";
        model = "Sitecom WLR-4100 v1 001";

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

        leds {
                compatible = "gpio-leds";

                led_power: power {
                        label = "wl-4100:amber:power";
                        gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
                };

                led_wps: wps {
                        label = "wl-4100:white:wps";
                        gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
                };
                /*
                unpopulated {
                        label = "wl-4100:amber:unpopulated";
                        gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
                };

                unpopulated2 {
                        label = "wl-4001:blue:unpopulated";
                        gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
                };
                */
        };

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

        };

        rtl8367rb {
                compatible = "realtek,rtl8367b";
                gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
                gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
                realtek,extif0 = <1 0 1 1 1 1 1 1 2>;
        };
};

&spi0 {
        status = "okay";

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

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

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

                        partition@30000 {
                                label = "u-boot-env";
                                reg = <0x30000 0x10000>;
                        };

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

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

                        partition@660000 {
                                label = "app";
                                reg = <0x660000 0x180000>;
                        };

                        partition@7E0000 {
                                label = "backup";
                                reg = <0x7E0000 0x10000>;
                        };

                        partition@7F0000 {
                                label = "storage";
                                reg = <0x7F0000 0x10000>;
                        };

                };
        };
};

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

&ethernet {
        mtd-mac-address = <&factory 0x4>;
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii_pins>;

        port@5 {
                phy-mode = "rgmii";
        };
};

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

Just for test I suggest some fixes:

  1. It's very possible that your board is connected to external rtl8367rb switch with mdio bus. Unfortunately rt305x subtarget don't implemete support for mdio but you can use mdio-gpio module (see kernel docs Documentation/devicetree/bindings/net/mdio-gpio.txt).
  2. rtl8367rb don't use extif0 to connect to SoC. Only extif1 (gmii or rgmii) or extif2 (rgmii only).
    So changes:
       aliases {
                led-boot = &led_power;
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
                mdio-gpio0 = &mdio0;
                };

                mdio0: mdio {
                	compatible = "virtual,mdio-gpio";
                	#address-cells = <1>;
	                #size-cells = <0>;
	                gpios = <&gpio0 MDIO_MDC
		            &gpio0 MDIO_MDATA>;
                };

        rtl8367rb {
                compatible = "realtek,rtl8367b";
                mii-bus = <&mdio0>;
                realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
        };

where for rt3352 MDIO_MDC = 23 and MDIO_MDATA = 22 if I recall correctly.
3. mtd parser don't recognize and split firmware patition. So change:

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

Other changes need to patch kernel sources :frowning:
BTW Can you show bootloader logs (original firmware)?

Many thanks for the suggestions. I suspected the switch was connected through mdio, but seeing it was not supported by the subtarget as you mentioned, I wasn't sure how to proceed.

I applied your changes to the .dts file, and the rtl8367 is now enabled:

[   10.606609] procd: - init -
[   11.499576] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.557888] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.606344] rtl8367b rtl8367rb: cannot find mdio bus from bus handle (yet)
[   11.649129] Loading modules backported from Linux version v4.19.137-0-gc076c79e03c6
[   11.664460] Backport generated by backports.git v4.19.137-1-0-g60c3a249
[   11.718010] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.753286] libphy: GPIO Bitbanged MDIO: probed
[   11.765903] rtl8367b rtl8367rb: using MDIO bus 'GPIO Bitbanged MDIO'
[   11.781622] rtl8367b rtl8367rb: RTL8367RB chip found
[   11.821957] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   12.067268] xt_time: kernel timezone is -0000
[   12.253474] PPP generic driver version 2.4.2
[   12.284967] NET: Registered protocol family 24
[   12.364587] urngd: v1.0.2 started.
[   12.403313] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "rf-data"
[   12.417757] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3352, rev 0200 detected
[   12.433197] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 000c detected
[   12.448234] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   12.553637] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.284214] random: crng init done
[   15.290976] random: 6 urandom warning(s) missed due to ratelimiting
[   19.630510] libphy: rtl8367rb: probed

swconfig also detects the switch:

root@OpenWrt:/# swconfig list
Found: switch0 - rt305x
Found: switch1 - rtl8367rb

And shows port information:

root@OpenWrt:/# swconfig dev switch1 port 0 show
Port 0:
        mib: Port 0 MIB counters
ifInOctets                          : 14408
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 80
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 14
ifInBroadcastPkts                   : 26
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 14408
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 87
etherStatsPkts65to127Octets         : 6
etherStatsPkts128to255Octets        : 8
etherStatsPkts256to511Octets        : 19
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 120
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow auto

I also modified the default network config to use the rtl8367 switch:

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 'fd9c:5695:6c95::/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 'xx'

config switch
        option name 'rtl8367rb'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'rtl8367rb'
        option vlan '1'
        option ports '0 1 2 3 4 5 6t'

I can fully control the switch, but the device is unable to connect to the internet through it. I tried both extif1 and extif2 in the .dts file, both to no avail. ifconfig also shows 0 received bytes:

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr xx
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fdc7:b109:1503::1/60 Scope:Global
          inet6 addr: fe80::66d1:xx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2300 (2.2 KiB)

eth0      Link encap:Ethernet  HWaddr xx
          inet6 addr: fe80::66d1:xx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:8025 (7.8 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr xx
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2300 (2.2 KiB)

As requested, the OEM Boot logs:

Summary
U-boot Ver:1.0.0.1 2012/05/18 14:24:58


Board: Ralink APSoC DRAM:  32 MB
============================================
ASIC 3352_MP (Port5<->GigaSW)
Product Name: esr9850v2
SDRAM CFG0 (f1a25272)
SDRAM CFG1 (f0120300)

Please choose the operation:
   1: Load system code to SDRAM via TFTP.

   Image Name:   Linux Kernel Image
   Created:      2015-12-15   4:33:13 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1215962 Bytes =  1.2 MB
   Load Address: 80000000
   Entry Point:  80256000
OK

LINUX started...

 THIS IS ASIC
init started: BusyBox v1.7.5 (2015-12-15 12:29:44 CST)
starting pid 155, tty '/dev/console': '/sbin/config_init'
mknod: /dev/ttyS0: File exists
mknod: /dev/ttyS1: File exists
Config Init version: 3.1.0.1 date: 2015/12/15
Thu Jan  1 00:00:00 UTC 2015
mount: can't find /sys in /etc/fstab or /etc/mtab
ln: /lib/./modules: File exists
switch reg write offset=94, value=7f00
switch reg write offset=14, value=5555
switch reg write offset=40, value=1001
switch reg write offset=44, value=1001
switch reg write offset=48, value=1001
switch reg write offset=4c, value=1
switch reg write offset=50, value=2001
switch reg write offset=70, value=ffffffff
switch reg write offset=98, value=7f7f
switch reg write offset=e4, value=7f
switch reg write offset=90, value=7f7f
sh: mii_mgr: not found
sh: mii_mgr: not found
sh: mii_mgr: not found
sh: mii_mgr: not found
sh: mii_mgr: not found
starting pid 236, tty '/dev/ttyS1': '/sbin/config_term'
************************************************************************
*                                 WLR-4100                             *
************************************************************************

KernelApp/Ramdisk Ver:3.1.0.1                    Date:2015/12/15
password:

Ok
There isn't wan interface in your current config. All ports are in internal lan. So at least add vlan eth0.2 for wan (and enable vid numbers upto 4095):

config switch
        option name 'rtl8367rb'
        option reset '1'
        option enable_vlan '1'
        option enable_vlan4k '1'

config switch_vlan
        option device 'rtl8367rb'
        option vlan '1'
        option ports '0 1 2 3 6t'

config switch_vlan
        option device 'rtl8367rb'
        option vlan '2'
        option ports '4  6t'

I don't know your device port layout so assume that physical port 4 is wan.
And add wan interface description something like:

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

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'xx'

But it's not the main problem. I don't see any traffic from lan segment. Is the device network accessible? ifconfig output shows no input pkts. This may be because of incorrect extif number. So check io statistics with swconfig on ports 6 and 7.
Next reason is internal switch config. So output of swconfig dev switch0 show

I had already tried defining a wan interface, but this did not work.

Port 6:

Expand
root@OpenWrt:/# swconfig dev switch1 show
Port 6:
        mib: Port 6 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 10585
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 74
etherStatsPkts128to255Octets        : 4
etherStatsPkts256to511Octets        : 13
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 10585
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 62
ifOutMulticastPkts                  : 9
ifOutBroadcastPkts                  : 20
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow

Port 7:

Expand
Port 7:
        mib: Port 7 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 0
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 0
etherStatsPkts128to255Octets        : 0
etherStatsPkts256to511Octets        : 0
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:7 link:down
root@OpenWrt:/# swconfig dev switch1 show
Expand
Global attributes:
        enable_vlan: 1
        enable_vlan4k: 0
        max_length: 1
Port 0:
        mib: Port 0 MIB counters
ifInOctets                          : 24476
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 148
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 18
ifInBroadcastPkts                   : 40
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 24476
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 155
etherStatsPkts65to127Octets         : 6
etherStatsPkts128to255Octets        : 12
etherStatsPkts256to511Octets        : 33
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 1:
        mib: Port 1 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 0
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 0
etherStatsPkts128to255Octets        : 0
etherStatsPkts256to511Octets        : 0
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:1 link:down
Port 2:
        mib: Port 2 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 0
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 0
etherStatsPkts128to255Octets        : 0
etherStatsPkts256to511Octets        : 0
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:2 link:down
Port 3:
        mib: Port 3 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 0
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 0
etherStatsPkts128to255Octets        : 0
etherStatsPkts256to511Octets        : 0
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
 dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:3 link:down
Port 4:
        mib: Port 4 MIB counters
ifInOctets                          : 465703
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 1092
ifInBroadcastPkts                   : 1153
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 465703
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 413
etherStatsPkts65to127Octets         : 1036
etherStatsPkts128to255Octets        : 143
etherStatsPkts256to511Octets        : 478
etherStatsPkts512to1023Octets       : 108
etherStatsPkts1024to1518Octets      : 67
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 2245
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 51
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:4 link:up speed:1000baseT full-duplex auto
Port 5:
        mib: Port 5 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 0
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 0
etherStatsPkts128to255Octets        : 0
etherStatsPkts256to511Octets        : 0
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:5 link:down
Port 6:
        mib: Port 6 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 25300
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 161
etherStatsPkts128to255Octets        : 12
etherStatsPkts256to511Octets        : 33
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 25300
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 148
ifOutMulticastPkts                  : 18
ifOutBroadcastPkts                  : 40
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
Port 7:
        mib: Port 7 MIB counters
ifInOctets                          : 0
dot3StatsFCSErrors                  : 0
dot3StatsSymbolErrors               : 0
dot3InPauseFrames                   : 0
dot3ControlInUnknownOpcodes         : 0
etherStatsFragments                 : 0
etherStatsJabbers                   : 0
ifInUcastPkts                       : 0
etherStatsDropEvents                : 0
ifInMulticastPkts                   : 0
ifInBroadcastPkts                   : 0
inMldChecksumError                  : 0
inIgmpChecksumError                 : 0
 inMldSpecificQuery                  : 0
inMldGeneralQuery                   : 0
inIgmpSpecificQuery                 : 0
inIgmpGeneralQuery                  : 0
inMldLeaves                         : 0
inIgmpLeaves                        : 0
etherStatsOctets                    : 0
etherStatsUnderSizePkts             : 0
etherOversizeStats                  : 0
etherStatsPkts64Octets              : 0
etherStatsPkts65to127Octets         : 0
etherStatsPkts128to255Octets        : 0
etherStatsPkts256to511Octets        : 0
etherStatsPkts512to1023Octets       : 0
etherStatsPkts1024to1518Octets      : 0
ifOutOctets                         : 0
dot3StatsSingleCollisionFrames      : 0
dot3StatMultipleCollisionFrames     : 0
dot3sDeferredTransmissions          : 0
dot3StatsLateCollisions             : 0
etherStatsCollisions                : 0
dot3StatsExcessiveCollisions        : 0
dot3OutPauseFrames                  : 0
ifOutDiscards                       : 0
dot1dTpPortInDiscards               : 0
ifOutUcastPkts                      : 0
ifOutMulticastPkts                  : 0
ifOutBroadcastPkts                  : 0
outOampduPkts                       : 0
inOampduPkts                        : 0
inIgmpJoinsSuccess                  : 0
inIgmpJoinsFail                     : 0
inMldJoinsSuccess                   : 0
inMldJoinsFail                      : 0
inReportSuppressionDrop             : 0
inLeaveSuppressionDrop              : 0
outIgmpReports                      : 0
outIgmpLeaves                       : 0
outIgmpGeneralQuery                 : 0
outIgmpSpecificQuery                : 0
outMldReports                       : 0
outMldLeaves                        : 0
outMldGeneralQuery                  : 0
outMldSpecificQuery                 : 0
inKnownMulticastPkts                : 0

        pvid: 1
        link: port:7 link:down
VLAN 1:
        info: VLAN 1: Ports: '01236t', members=004f, untag=000f, fid=0
        ports: 0 1 2 3 6t
root@OpenWrt:/# cat /etc/config/network
Expand
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 'fde6:92a0:32ec::/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 'xx'

config switch
        option name 'rtl8367rb'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'rtl8367rb'
        option vlan '1'
        option ports '0 1 2 3 6t'

config switch_vlan
        option name 'rtl8367rb'
        option vlan '2'
        option ports '4 6t'

config interface 'wan'
        option proto 'dhcp'
        option ifname 'eth0.2'
        option hostname 'wlr-4100'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'xx'

I am using extif1, which appears to be correct. When I compile using extif2, port 6 is shown as unconnected:

Port 6:
        mib: Port 6 MIB counters
[..]

        pvid: 7
        link: port:6 link:down

In the above configuration and output I did not add enable_vlan4k to the configuration, but when I did it made no difference. When I connect my laptop to one of the switchports and run wireshark, no traffic at all from the device is captured.

EDIT: don't pay too much attention to the pvids. I have since modified 02_network to setup the appropriate vlan/wan/lan configuration on boot, and still no input pkts.

Ok
Really need internal switch config swconfig dev switch0 show
Let's correct lan connection. To simplify discussion see this scheme:

        rt3352
        switch0     rtl8367rb
         +--+       switch1
eth0<--->|P6| rgmii +--+
         |P5|<--|?->|M7|
         +--+   |?->|M6|
                    |M5|
                    |M4|
                    |M3|
                    |M2|
                    |M1|
                    |M0|
                    +--+

where Pn - internal switch0 ports, Mn - external switch1 ports.
So eth0 is connected to internal switch0 only. And if config of internal switch0 is incorrect kernel cann't send/receive traffic to/from external switch1.
E.g. switch0 vlan is enabled and ports P6 P5 in vlan vid n (any not vid 1 or vid 2 as we config switch1) results in no traffic between eth0 <-> switch0 <-> switch1. BUT swconfig show real statistics in ports. That's why we need swconfig dev switch0 show.
Subtarget rt305x external switch is very very rare config :frowning:
So we must carefully inspect all available info to correct config.

To see that switch0 and switch1 is connected correctly input/output statistics must be !=0 on port P5.
And pkts send/receive statistics on eth0(ifconfig eth0),P5 (swconfig dev switch0 port 5 show) and M{6,7} (swconfig dev switch1 port {6,7} show) must be equal.

My apologies, I completely glossed over the fact you referred to switch0. Here it is.

Global attributes:
        enable_vlan: 0
        alternate_vlan_disable: 0
        bc_storm_protect: 0
        led_frequency: 0
Port 0:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:0 link:down
Port 1:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:1 link:down
Port 2:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:2 link:down
Port 3:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:3 link:down
Port 4:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:4 link:down
Port 5:
        disable: 0
        doubletag: 1
        untag: 1
        led: ???
        lan: 1
        recv_bad: 2
        recv_good: 6140
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:5 link:down
Port 6:
        disable: 0
        doubletag: 1
        untag: 1
        led: ???
        lan: ???
        recv_bad: ???
        recv_good: ???
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex
VLAN 0:
        ports: 0 1 2 3 4 5 6

I've just updated my message. But I see you answer :slight_smile:
So internal switch0 is unconfigured and vlan is off for it.
I don't remember switch0 working with tagged packets in this case (vlan disabled). In worst case you can try to duplicate vlans config in switch0. To force switch0 to accept tagged frame from switch1 you can:

swconfig dev switch0 set reset
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 ports '5t 6t`
swconfig dev switch0 vlan 2 ports '5t 6t'
swconfig dev switch0 set apply 1

UPD. In this config we simply enable vlan in switch0 and accept tagged vid 1 and vid 2 frame on port P5 from switch1 saving tag. This reduce uncertainty of "I don't remember switch0 working with tagged packets in this case (vlan disabled)" sentence :slight_smile:
Sorry, google translate and my awful English :slight_smile:

While the above commands didn't work directly, I think I'm getting closer.
I blindly copied the snippet below from the WL-351.dts file:

&esw {
        mediatek,portmap = <0x3f>;
        ralink,fct2 = <0x0002500c>;
        ralink,fpa2 = <0x1f003fff>;
};

After recompiling and running your swconfig commands for switch0, I now see the following:

Port 5:
        disable: 0
        doubletag: 0
        untag: 0
        led: ???
        lan: 1
        recv_bad: 706
        recv_good: 6356
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:5 link:up speed:1000baseT full-duplex
Port 6:
        disable: 0
        doubletag: 0
        untag: 0
        led: ???
        lan: ???
        recv_bad: ???
        recv_good: ???
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex
VLAN 1:
        ports: 5t 6t
VLAN 2:
        ports: 5t 6t

The RX counters now also report packets:

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr xx
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::66d1:xx/64 Scope:Link
          inet6 addr: fd0f:db42:cbac::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1030 (1.0 KiB)  TX bytes:3940 (3.8 KiB)

eth0      Link encap:Ethernet  HWaddr xx
          inet6 addr: fe80::66d1:xx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:198 errors:0 dropped:1 overruns:0 frame:2
          TX packets:232 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:38611 (37.7 KiB)  TX bytes:54117 (52.8 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr xx
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1030 (1.0 KiB)  TX bytes:3940 (3.8 KiB)

eth0.2    Link encap:Ethernet  HWaddr xx
          inet6 addr: fe80::66d1:xx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:111 errors:0 dropped:26 overruns:0 frame:0
          TX packets:102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16453 (16.0 KiB)  TX bytes:31212 (30.4 KiB)

I can however still not see any traffic actually leaving the device, so I suspect the &esw config part is not fully correct, though I don't really know what any of this bit of configuration means and how I should modify it.

It's something unclear. P5 shows traffic in one direction but eth0 in/out pkts is not zero.
Just for test add too:

&esw {
	ralink,rgmii = <1>;

I have tried it sometime before, but when I do it now I can again see packets being received in ifconfig. Still no actual working connectivity though.

This bit of configuration does stop the SoC switch from being exported, so I updated the configuration to reflect rtl8367rb as the switch.

P5 and M{6,7) must be configured in rgmii mode.

Is this what sets rgmii for P5?

&ethernet {
...
  port@5 {
    phy-mode = "rgmii";
  };
};

How would I set rgmii mode for M6 and M7? (or the other way around)