Support for RTL838x based managed switches

When I last tried VLAN tags on my XGS1210, I had weird issues where packets would come out one side or the other missing tags, when they should have been tagged according to the config. Try filtering by something other than vlan in tcpdump, and run tcpdump with -e to show mac addresses and VLAN tags.

1 Like

Only if you configure things to do so, right? As all the switching simply happens inside of the switch bit of the chip.

"trivial" depending on what you want to do :slight_smile:
You can probably flash a managed firmware to the switch from tendnet or someone else with the same peripherials. E.g. rtl930x; 5x 2.5G and same led config. Some data may be needed (mac addresses etc).

Now if you want it to run openwrt; then we can start talking :slight_smile: Can you upload your pics and info into the svanheule.net/switches wiki? Did you try booting the xgs-1250 firmware? You can netboot it (info on the wiki afaik) the xgs-1010 is probably closer, but we don't have official images yet.

ANyway, step one, is to get the devicetree for this switch sorted :slight_smile:

1 Like

hmm, I am definitely seeing all broadcast packets on eth0 in the default config with tcpdump (which is going to set the if to promiscuous, if that matters), except they are not quite ethernet frames, but I can pick out IP addresses and data payload stuff there. I set up an old laptop and a usb-ethernet as a dumb bridge to run tcpdump on, and I can see the DHCP request leave the USW-Aggregation and the reply come back, the addresses look good to me in wireshark after pulling a pcap. No VLANs involved in this setup. I don't think I see the router's response on eth0, but I definitely see the outbound packet. I don't really understand the frames I'm seeing on the internal interface, but there are some interesting messages there that I don't think I see on the laptop-bridge. Is this a known protocol?

@DanaGoyette I think this might be it, I do see the DHCP request was sent with a VLAN 1 tag on it, even though that's not configured. The DHCP response doesn't have it, but obviously the request was heard, perhaps this is why the switch discards the response.

Confirmed on master and on realtek-wip, looks like if I attach a device sending tagged vlan 1 it can use the network through the switch. I think that means the isolation problem (at least for me) is because we are not actually untagging packets on egress, but are tagging untagged packets (into the switch0) on ingress.

root@OpenWrt:/# bridge vlan
port              vlan-id
lan8              1 PVID Egress Untagged
lan7              1 PVID Egress Untagged
lan2              1 PVID Egress Untagged
lan1              1 PVID Egress Untagged
lan4              1 PVID Egress Untagged
lan3              1 PVID Egress Untagged
lan6              1 PVID Egress Untagged
lan5              1 PVID Egress Untagged
switch            1

Should be untagging vlan 1 on lan1, no? Or is this a config problem?

but the aggregation switch is pure SFP isn't it?

Could it be the CPU tag? https://elixir.bootlin.com/linux/latest/C/ident/DSA_TAG_PROTO_RTL8_4 for example for the older switches, I think we are still 'compatible' ...

idk, I'm not super familar with openwrt defaults and configs :frowning:

Aha, I figured out quotes, maybe there's a more ergonomic way, but it works.

but the aggregation switch is pure SFP isn't it?

Yes, but I am using SFP+ 10GBase-T devices successfully (fwiw they report themselves as 10GBase-SR), laptop is 1G, but it works. Uplink is 10G and also works.

CPU tag

Will take a look, I briefly looked at writing a wireshark dissector (it's quite evident which fields are which in the hex) but then realized it was the weekend :slight_smile: I'll look at that doc and see if it matches.

configs

Ok, so more information on the current state. Isolation (in the classical sense of networking config) is in effect: client on port 7 can reach the internet, but not other devices attached to the switch or switches upstream of it. Those devices cannot reach it either, their ARP requests are heard by the client but its responses are not received despite being sent. VLAN tagging is messed up: the client device only works if it tags its outbound packets and listens for tagged inbound packets (although broadcast packets are untagged), despite the switch being configured for PVID 1 untagged. I wonder if this has to do with the double tagging RTL930x supports, usually this is used for wonky aggregator setups, and maybe we're only clearing one of two?

Is anyone working on the Zyxel GS1920 series? They are listed in the svanheule Wiki as RTL839x ...

There is then maybe no restart GPIO and it should be removed from your device's dts. Maybe someone more knowledgeable can give an opinion on this?

Would anyone be able to explain or assist, how I could do a test build with a modified dts?
I don't have much knowledge in programming.
Currently any newer build than from 21.02.x is pretty much useless, as the device is not able to perform a reboot.

It's really pretty straightforward (as far as pre-reqs and build setup) for OpenWRT
You can just follow the guides from the base OpenWRT website

Install a build system

then get the source and build

Once you've confirmed it's as-per existing binary behaviour, then you can tweak the DTS file for your board and rebuild.

Thanks, but I am not sure what you mean by that

I have a somewhat odd request here. I need to embed a switch into a product that needs to allow some limited ethernet "chaining," i.e. where we can connect several units together in daisy chain fashion. We do this now with an unmanaged RTL8370, which works mostly fine, and even allows some limited access via SMI, which we have tested with what is apparently some SDK code from realtek, which we found online.

HOWEVER, One of the issues we have is that customers sometimes create loops, which causes all sorts of issues on the network. To solve this, we use some managed switches to detect the storm, switch off the port, or have RSTP break up the network.

For a new version however, we want to embed RSTP support in the product itself, which would be a decent upgrade. Performance of the CPU is not an issue for this application.

So I have a few questions.

  1. can the Openwrt stack be fully booted without any Mfg specific booting code on any of the managed switch chips? like even RTL8380 would be ok.... I'm concerned with low level code required to get the switch chip initialized and the kernel running here, not a dts type thing. I can edit and make one of those.
  2. Does RSTP work? did not find any particularly good answers to this yet.
  3. It seems biot's account and cache of realtek's docs has disappeared.. is that available anywhere new? Sadly small manufacturers get about the same response from realtek as all of you.. basically none.
  4. has anyone done this for another project and care to share?

Thanks for any help here.

FYI: The systems we deploy have LOTS of nodes, can be as many as 5000, and network reliability is important, so being able to intentionally create loops is a plus, hence the interest. In addition we would love it if had a USB host port since we have some accessories that use that. We only need to support USB-serial drivers, and not high bandwidth devices like drives or cameras etc. We generally only use 3 ports, always copper, maybe sometimes 4. We don't use SFP, and our POE is basically open loop.

Currently any newer build than from 21.02.x is pretty much useless, as the device is not able to perform a reboot.

You should test the build you create for this as-per existing behaviour before you go making changes. So you say that anything post 21.02.x doesn't work for reboot. So build the master, confirm it doesn't reboot.
Then you fix it (with the modified DTS), and submit the patch back to the OpenWRT project :slight_smile:

1 Like

I've recently obtained a GS316EP (which is the lower power, 180W, version of the GS316EPP). It has 16 ports; 15 1000baseT + 1 SFP. Chip is an RTL8282. Only wrinkle so far has been the fact the supplied u-boot zeros out the second half (i.e. the entire image name) of the u-boot header before calculating the checksum.

Currently using the following DTS. Port 16 isn't correct - it should be the SFP rather than an internal port. There does appear to be an RTL8231 GPIO device according to the boot logs, but it's not on bus id 0 or 31. The reset + power LED GPIOs don't match the GS310TP, so not sure how to find them yet. PoE looks to be driven by a Nuvoton chip so hopefully supported but it looks like realtek-poe isn't in master at present so I don't have it handy to try - is there a different tree I should be using?

// SPDX-License-Identifier: GPL-2.0-or-later
                                                       
#include "rtl838x.dtsi"                                
                                                       
#include <dt-bindings/input/input.h>                   
#include <dt-bindings/gpio/gpio.h>                     
                                                       
/ {              
        compatible = "netgear,gs316ep-v1", "realtek,rtl8382-soc";
        model = "Netgear GS316EP v1";                  
                                                       
        memory@0 {                                     
                device_type = "memory";      
                reg = <0x0 0x8000000>;                                                                        
        };           

        gpio1: rtl8231-gpio {
                compatible = "realtek,rtl8231-gpio";
                #gpio-cells = <2>;
                gpio-controller;
                indirect-access-bus-id = <0>;
        };           
};
                                                       
&ethernet0 {
        mdio: mdio-bus {
                compatible = "realtek,rtl838x-mdio";
                regmap = <&ethernet0>;
                #address-cells = <1>;
                #size-cells = <0>;

                EXTERNAL_PHY(0)
                EXTERNAL_PHY(1)
                EXTERNAL_PHY(2)
                EXTERNAL_PHY(3)
                EXTERNAL_PHY(4)
                EXTERNAL_PHY(5)
                EXTERNAL_PHY(6)
                EXTERNAL_PHY(7)

                INTERNAL_PHY(8)
                INTERNAL_PHY(9)
                INTERNAL_PHY(10)
                INTERNAL_PHY(11)
                INTERNAL_PHY(12)
                INTERNAL_PHY(13)
                INTERNAL_PHY(14)
                INTERNAL_PHY(15)
        };
};

&spi0 {
        status = "okay";

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

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

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

                        partition@e0000 {
                                label = "u-boot-env";
                                reg = <0x00e0000 0x0010000>;
                        };

                        partition@f0000 {
                                label = "u-boot-env2";
                                reg = <0x00f0000 0x0010000>;
                        };

                        partition@100000 {
                                label = "jffs";
                                reg = <0x0100000 0x0100000>;
                                read-only;
                        };

                        partition@200000 {
                                label = "jffs2";
                                reg = <0x0200000 0x0100000>;
                                read-only;
                        };

                        partition@300000 {
                                label = "firmware";
                                compatible = "openwrt,uimage", "denx,uimage";
                                reg = <0x0300000 0x0e80000>;
                        };

                        partition@1180000 {
                                label = "runtime2";
                                reg = <0x1180000 0x0e80000>;
                                read-only;
                        };
                };
        };
};

&switch0 {
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                SWITCH_PORT(0, 1, qsgmii)
                SWITCH_PORT(1, 2, qsgmii)
                SWITCH_PORT(2, 3, qsgmii)
                SWITCH_PORT(3, 4, qsgmii)
                SWITCH_PORT(4, 5, qsgmii)
                SWITCH_PORT(5, 6, qsgmii)
                SWITCH_PORT(6, 7, qsgmii)
                SWITCH_PORT(7, 8, qsgmii)

                SWITCH_PORT(8, 9, internal)
                SWITCH_PORT(9, 10, internal)
                SWITCH_PORT(10, 11, internal)
                SWITCH_PORT(11, 12, internal)
                SWITCH_PORT(12, 13, internal)
                SWITCH_PORT(13, 14, internal)
                SWITCH_PORT(14, 15, internal)
                SWITCH_PORT(15, 16, internal)

                port@28 {
                        ethernet = <&ethernet0>;
                        reg = <28>;
                        phy-mode = "internal";
                        fixed-link {
                                speed = <1000>;
                                full-duplex;
                        };
                };
        };
};

&uart1 {
        status = "okay";
};

OpenWRT boot:


U-Boot 2011.12.(3.6.2.56) (Aug 12 2021 - 17:21:49)

Board: RTL838x CPU:500MHz LXB:200MHz MEM:300MHz
DRAM:  128 MB
SPI-F: 1x32 MB
Loading 65536B env. variables from offset 0xe0000
Net:   Net Initialization Skipped
No ethernet found.
RTCORE Driver Module Initialize
  IOAL init
  Hardware-profile probe (GS316EP_RTL8380_8218D)
  Hardware-profile init
  GPIO probe (unit 0): (found)
  GPIO Init
  SPI init (unit 0) 
  I2C probe (unit 0)
  I2C init (unit 0)
  RTL8231 probe (unit 0): (found)
  RTL8231 init (unit 0)
  NIC probe (unit 0)
  Loader RTNIC Driver Module Initialize
  IOAL init
  MAC probe (unit 0)
    Chip 8382 (found)
Hit Esc key to stop autoboot:  0 
RTL838x# set ipaddr 192.168.100.100
Unknown command 'set' - try 'help'
RTL838x# setenv ipaddr 192.168.100.100
RTL838x# rtk network on
Enable network
RTK Driver Module Initialize
 dal_mgmt_init had already been initialized!
  MAC probe (unit 0)
    Chip 8382 (found)
  MAC init (unit 0)
  PHY probe (unit 0)
  Chip Construct (unit 0)
    Chip Construct
    Disable PHY Polling
    PHY Reset
    MAC Construct
    Serdes Construct
    PHY Construct
    Enable PHY Polling
    PHY Power Off
  PHY init (unit 0)
  Mgmt_dev init (unit 0) 
Please wait for PHY init-time ...

RTL838x# tftpboot 0x81000000 192.168.100.1:openwrt-realtek-rtl838x-netgear_gs316ep-v1-initramfs-kernel.bin
Using rtl8380#0 device
TFTP from server 192.168.100.1; our IP address is 192.168.100.100
Filename 'openwrt-realtek-rtl838x-netgear_gs316ep-v1-initramfs-kernel.bin'.
Load address: 0x81000000
Loading: #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##################################
done
Bytes transferred = 7170396 (6d695c hex)
RTL838x# bootm                                                                                            
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   MIPS OpenWrt Linux-5.15.102
   Created:      2023-03-18  11:47:48 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    7170331 Bytes = 6.8 MB
   Load Address: 80100000
   Entry Point:  80100000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 5.15.102 (noodles@youmian) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r22307-4bfbecbd9a) 12.2.0, GNU ld (GNU Binutils) 2.40.0) #0 Sat Mar 18 11:47:48 2023
[    0.000000] RTL838X model is 83826800
[    0.000000] SoC Type: RTL8382
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019070 (MIPS 4KEc)
[    0.000000] MIPS: machine is Netgear GS316EP v1
[    0.000000] earlycon: ns16550a0 at MMIO 0x18002000 (options '115200n8')
[    0.000000] printk: bootconsole [ns16550a0] enabled
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Using appended Device Tree.
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
[    0.000000] Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    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: 32480
[    0.000000] Kernel command line: earlycon
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 108856K/131072K available (6095K kernel code, 608K rwdata, 1332K rodata, 12628K init, 209K bss, 22216K 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] rtl83xx-clk: initialized, CPU 500 MHz, MEM 300 MHz (8 Bit DDR3), LXB 200 MHz
[    0.000000] clocksource: realtek_otto_timer: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 38225208801 ns
[    0.000005] sched_clock: 28 bits at 3125kHz, resolution 320ns, wraps every 42949672800ns
[    0.009303] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)
[    0.136030] pid_max: default: 32768 minimum: 301
[    0.141762] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.150026] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.166438] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.182469] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.193507] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.201410] pinctrl core: initialized pinctrl subsystem
[    0.209936] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.249869] rtl83xx-clk clock-controller: rate setting enabled, CPU 300-625 MHz, MEM 300-300 MHz, LXB 200-200 MHz, OVERCLOCK AT OWN RISK
[    0.267538] clocksource: Switched to clocksource realtek_otto_timer
[    0.276997] NET: Registered PF_INET protocol family
[    0.283183] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.292759] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.302254] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.311001] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.319681] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.327676] TCP: Hash tables configured (established 1024 bind 1024)
[    0.335274] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.342761] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.351366] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.437992] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.454457] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.461084] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.519108] pinctrl-single 1b001000.pinmux: 32 pins, size 4
[    0.526060] pinctrl-single 1b00a000.pinmux: 32 pins, size 4
[    0.534501] Probing RTL8231 GPIOs
[    0.538355] rtl8231_init called, MDIO bus ID: 0
[    0.543440] rtl8231-gpio rtl8231-gpio: no device found at bus address 0
[    0.652679] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.662156] printk: console [ttyS0] disabled
[    0.667057] 18002000.uart: ttyS0 at MMIO 0x18002000 (irq = 31, base_baud = 12500000) is a 16550A
[    0.677012] printk: console [ttyS0] enabled
[    0.677012] printk: console [ttyS0] enabled
[    0.686468] printk: bootconsole [early0] disabled
[    0.686468] printk: bootconsole [early0] disabled
[    0.697084] printk: bootconsole [ns16550a0] disabled
[    0.697084] printk: bootconsole [ns16550a0] disabled
[    0.709805] 18002100.uart: ttyS1 at MMIO 0x18002100 (irq = 30, base_baud = 12500000) is a 16550A
[    1.301263] brd: module loaded
[    1.320122] spi-nor spi0.0: mx25l25635e (32768 Kbytes)
[    1.326026] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.333336] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
[    1.340531] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
[    1.348157] Creating 7 MTD partitions on "spi0.0":
[    1.353569] 0x000000000000-0x0000000e0000 : "u-boot"
[    1.408320] 0x0000000e0000-0x0000000f0000 : "u-boot-env"
[    1.417160] 0x0000000f0000-0x000000100000 : "u-boot-env2"
[    1.438282] 0x000000100000-0x000000200000 : "jffs"
[    1.448309] 0x000000200000-0x000000300000 : "jffs2"
[    1.468201] 0x000000300000-0x000001180000 : "firmware"
[    1.511948] 0x000001180000-0x000002000000 : "runtime2"
[    1.544411] Probing RTL838X eth device pdev: 82094400, dev: 82094410
[    1.602022] Found SoC ID: 8382: RTL8382, family 8380
[    1.607860] rtl8380_init_mac
[    1.611154] Using MAC 000000e04c000000
[    2.575422] Realtek RTL8218B (internal) mdio-bus:08: Detected internal RTL8218B
[    2.583736] Firmware loaded. Size 1184, magic: 83808380
[    5.375663] i2c_dev: i2c /dev entries driver
[    5.386578] NET: Registered PF_INET6 protocol family
[    5.418894] Segment Routing with IPv6
[    5.423235] In-situ OAM (IOAM) with IPv6
[    5.428038] NET: Registered PF_PACKET protocol family
[    5.434686] 8021q: 802.1Q VLAN Support v1.8
[    5.809364] Realtek RTL8218B (internal) rtl838x slave mii-0:08: Detected internal RTL8218B
[    5.818749] Firmware loaded. Size 1184, magic: 83808380
[    8.795360] In rtl83xx_vlan_setup
[    8.799238] UNKNOWN_MC_PMASK: 000000001fffffff
[    8.804234] VLAN profile 0: L2 learning: 1, UNKN L2MC FLD PMSK 511, 		UNKN IPMC FLD PMSK 511, UNKN IPv6MC FLD PMSK: 511
[    9.857570] rtl83xx_enable_phy_polling:             ffff
[   10.898268] rtl83xx-switch switch@1b000000: configuring for fixed/internal link mode
[   10.907337] rtl83xx-switch switch@1b000000: Link is Up - 1Gbps/Full - flow control off
[   10.917790] rtl83xx-switch switch@1b000000 lan1 (uninitialized): PHY [mdio-bus:00] driver [REALTEK RTL8218D] (irq=POLL)
[   10.933236] rtl83xx-switch switch@1b000000 lan2 (uninitialized): PHY [mdio-bus:01] driver [REALTEK RTL8218D] (irq=POLL)
[   10.951907] rtl83xx-switch switch@1b000000 lan3 (uninitialized): PHY [mdio-bus:02] driver [REALTEK RTL8218D] (irq=POLL)
[   10.967360] rtl83xx-switch switch@1b000000 lan4 (uninitialized): PHY [mdio-bus:03] driver [REALTEK RTL8218D] (irq=POLL)
[   10.986076] rtl83xx-switch switch@1b000000 lan5 (uninitialized): PHY [mdio-bus:04] driver [REALTEK RTL8218D] (irq=POLL)
[   11.001565] rtl83xx-switch switch@1b000000 lan6 (uninitialized): PHY [mdio-bus:05] driver [REALTEK RTL8218D] (irq=POLL)
[   11.020373] rtl83xx-switch switch@1b000000 lan7 (uninitialized): PHY [mdio-bus:06] driver [REALTEK RTL8218D] (irq=POLL)
[   11.035890] rtl83xx-switch switch@1b000000 lan8 (uninitialized): PHY [mdio-bus:07] driver [REALTEK RTL8218D] (irq=POLL)
[   11.054496] rtl83xx-switch switch@1b000000 lan9 (uninitialized): PHY [mdio-bus:08] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.071067] rtl83xx-switch switch@1b000000 lan10 (uninitialized): PHY [mdio-bus:09] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.090996] rtl83xx-switch switch@1b000000 lan11 (uninitialized): PHY [mdio-bus:0a] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.107859] rtl83xx-switch switch@1b000000 lan12 (uninitialized): PHY [mdio-bus:0b] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.127768] rtl83xx-switch switch@1b000000 lan13 (uninitialized): PHY [mdio-bus:0c] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.144432] rtl83xx-switch switch@1b000000 lan14 (uninitialized): PHY [mdio-bus:0d] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.164236] rtl83xx-switch switch@1b000000 lan15 (uninitialized): PHY [mdio-bus:0e] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.180983] rtl83xx-switch switch@1b000000 lan16 (uninitialized): PHY [mdio-bus:0f] driver [Realtek RTL8218B (internal)] (irq=POLL)
[   11.196406] DSA: tree 0 setup
[   11.200012] LINK state irq: 20
[   11.203525] In rtl83xx_setup_qos
[   11.207152] Setting up RTL838X QoS
[   11.211051] RTL838X_PRI_SEL_TBL_CTRL(i): 00033112
[   11.216339] Current Intprio2queue setting: 00000000
[   11.221870] QM_PKT2CPU_INTPRI_MAP: 00fac688
[   11.226808] rtl838x_dbgfs_init called
[   11.232073] rtl83xx_fib_event_work_do: FIB4 default rule failed
[   11.242105] rtl83xx_fib_event_work_do: FIB4 default rule failed
[   11.394966] Freeing unused kernel image (initmem) memory: 12628K
[   11.401871] This architecture does not have kernel memory protection.
[   11.409200] Run /init as init process
[   11.413327]   with arguments:
[   11.416643]     /init
[   11.419294]   with environment:
[   11.422830]     HOME=/
[   11.425469]     TERM=linux
[   12.722400] init: Console is alive
[   12.727175] init: - watchdog -
[   12.770304] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[   12.791981] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   12.811202] init: - preinit -
[   13.306481] random: jshn: uninitialized urandom read (4 bytes read)
[   13.471357] random: jshn: uninitialized urandom read (4 bytes read)
[   15.309529] random: jshn: uninitialized urandom read (4 bytes read)
[   15.417224] random: jshn: uninitialized urandom read (4 bytes read)
[   15.699326] random: jshn: uninitialized urandom read (4 bytes read)
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
sh: out of range
[   16.849884] RESETTING 8380, CPU_PORT 28
[   17.055054] rtl838x-eth 1b00a300.ethernet eth0: configuring for fixed/internal link mode
[   17.064145] In rtl838x_mac_config, mode 1
[   17.073142] rtl83xx-switch switch@1b000000 lan1: configuring for phy/qsgmii link mode
[   17.082315] rtl838x-eth 1b00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   17.092007] 8021q: adding VLAN 0 to HW filter on device lan1
[   17.099136] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   17.106262] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   17.113846] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   17.163776] rtl83xx_fib_event_work_do: FIB4 failed
[   17.169295] RTL8380 Link change: status: 1, ports 1
[   17.187834] rtl83xx_fib_event_work_do: FIB4 failed
[   17.193378] rtl83xx_fib_event_work_do: FIB4 failed
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
[   18.897653] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   19.557886] rtl83xx_fib4_del: no such gateway: 0.0.0.0
[   19.563703] rtl83xx_fib4_del: no such gateway: 0.0.0.0
[   19.587726] rtl83xx_fib4_del: no such gateway: 0.0.0.0
[   19.630328] procd: - early -
[   19.634236] procd: - watchdog -
[   22.297820] procd: - watchdog -
[   22.302557] procd: - ubus -
[   22.326282] random: ubusd: uninitialized urandom read (4 bytes read)
[   22.357624] random: ubusd: uninitialized urandom read (4 bytes read)
[   22.365926] random: ubusd: uninitialized urandom read (4 bytes read)
[   22.380779] procd: - init -
Please press Enter to activate this console.
[   23.599274] random: jshn: uninitialized urandom read (4 bytes read)
[   23.647159] random: ubusd: uninitialized urandom read (4 bytes read)
[   23.773390] kmodloader: loading kernel modules from /etc/modules.d/*
[   23.803593] GACT probability on
[   23.820801] Mirror/redirect action on
[   23.883145] u32 classifier
[   23.886212]     input device check on
[   23.890445]     Actions configured
[   24.281329] kmodloader: done loading kernel modules from /etc/modules.d/*
[   24.359487] urngd: v1.0.2 started.
[   24.624945] random: crng init done
[   24.628943] random: 15 urandom warning(s) missed due to ratelimiting
[   30.430126] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   49.418967] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   49.503857] in rtl838x_eth_stop
[   49.507685] rtl838x-eth 1b00a300.ethernet eth0: Link is Down
[   50.050209] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   50.057759] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   50.065157] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   50.072687] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   50.844040] Using MAC 0000941865807563
[   50.848856] RESETTING 8380, CPU_PORT 28
[   51.054022] rtl838x-eth 1b00a300.ethernet eth0: configuring for fixed/internal link mode
[   51.063089] In rtl838x_mac_config, mode 1
[   51.068064] rtl838x-eth 1b00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   51.077376] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   51.084646] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   51.092255] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   51.108768] rtl83xx-switch switch@1b000000 lan1: configuring for phy/qsgmii link mode
[   51.129252] 8021q: adding VLAN 0 to HW filter on device lan1
[   51.162826] switch: port 1(lan1) entered blocking state
[   51.168831] switch: port 1(lan1) entered disabled state
[   51.175944] device lan1 entered promiscuous mode
[   51.181306] device eth0 entered promiscuous mode
[   51.238854] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   51.258886] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   51.359441] rtl83xx-switch switch@1b000000 lan2: configuring for phy/qsgmii link mode
[   51.395714] 8021q: adding VLAN 0 to HW filter on device lan2
[   51.496258] switch: port 2(lan2) entered blocking state
[   51.502275] switch: port 2(lan2) entered disabled state
[   51.534916] device lan2 entered promiscuous mode
[   51.598201] rtl83xx-switch switch@1b000000 lan3: configuring for phy/qsgmii link mode
[   51.628038] 8021q: adding VLAN 0 to HW filter on device lan3
[   51.680864] switch: port 3(lan3) entered blocking state
[   51.686769] switch: port 3(lan3) entered disabled state
[   51.708131] device lan3 entered promiscuous mode
[   51.765871] rtl83xx-switch switch@1b000000 lan4: configuring for phy/qsgmii link mode
[   51.785642] 8021q: adding VLAN 0 to HW filter on device lan4
[   51.837443] switch: port 4(lan4) entered blocking state
[   51.843488] switch: port 4(lan4) entered disabled state
[   51.861436] device lan4 entered promiscuous mode
[   51.923581] rtl83xx-switch switch@1b000000 lan5: configuring for phy/qsgmii link mode
[   51.942774] 8021q: adding VLAN 0 to HW filter on device lan5
[   52.017058] switch: port 5(lan5) entered blocking state
[   52.023089] switch: port 5(lan5) entered disabled state
[   52.048247] device lan5 entered promiscuous mode
[   52.096239] rtl83xx-switch switch@1b000000 lan6: configuring for phy/qsgmii link mode
[   52.128061] 8021q: adding VLAN 0 to HW filter on device lan6
[   52.177884] switch: port 6(lan6) entered blocking state
[   52.183785] switch: port 6(lan6) entered disabled state
[   52.190842] device lan6 entered promiscuous mode
[   52.235895] rtl83xx-switch switch@1b000000 lan7: configuring for phy/qsgmii link mode
[   52.257985] 8021q: adding VLAN 0 to HW filter on device lan7
[   52.265006] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   52.272614] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   52.340284] switch: port 7(lan7) entered blocking state
[   52.346188] switch: port 7(lan7) entered disabled state
[   52.353256] device lan7 entered promiscuous mode
[   52.435430] rtl83xx-switch switch@1b000000 lan8: configuring for phy/qsgmii link mode
[   52.480975] 8021q: adding VLAN 0 to HW filter on device lan8
[   52.561309] switch: port 8(lan8) entered blocking state
[   52.567209] switch: port 8(lan8) entered disabled state
[   52.574276] device lan8 entered promiscuous mode
[   52.656253] rtl83xx-switch switch@1b000000 lan9: configuring for phy/internal link mode
[   52.707939] 8021q: adding VLAN 0 to HW filter on device lan9
[   52.813254] switch: port 9(lan9) entered blocking state
[   52.819266] switch: port 9(lan9) entered disabled state
[   52.826266] device lan9 entered promiscuous mode
[   52.932916] rtl83xx-switch switch@1b000000 lan10: configuring for phy/internal link mode
[   52.966272] 8021q: adding VLAN 0 to HW filter on device lan10
[   53.017970] switch: port 10(lan10) entered blocking state
[   53.024063] switch: port 10(lan10) entered disabled state
[   53.031423] device lan10 entered promiscuous mode
[   53.093866] rtl83xx-switch switch@1b000000 lan11: configuring for phy/internal link mode
[   53.117955] 8021q: adding VLAN 0 to HW filter on device lan11
[   53.189181] switch: port 11(lan11) entered blocking state
[   53.195274] switch: port 11(lan11) entered disabled state
[   53.202676] device lan11 entered promiscuous mode
[   53.264248] rtl83xx-switch switch@1b000000 lan12: configuring for phy/internal link mode
[   53.298252] 8021q: adding VLAN 0 to HW filter on device lan12
[   53.356394] switch: port 12(lan12) entered blocking state
[   53.362602] switch: port 12(lan12) entered disabled state
[   53.370036] device lan12 entered promiscuous mode
[   53.443691] rtl83xx-switch switch@1b000000 lan13: configuring for phy/internal link mode
[   53.467942] 8021q: adding VLAN 0 to HW filter on device lan13
[   53.519768] switch: port 13(lan13) entered blocking state
[   53.525864] switch: port 13(lan13) entered disabled state
[   53.533349] device lan13 entered promiscuous mode
[   53.601429] rtl83xx-switch switch@1b000000 lan14: configuring for phy/internal link mode
[   53.627942] 8021q: adding VLAN 0 to HW filter on device lan14
[   53.681749] switch: port 14(lan14) entered blocking state
[   53.687952] switch: port 14(lan14) entered disabled state
[   53.695316] device lan14 entered promiscuous mode
[   53.754180] rtl83xx-switch switch@1b000000 lan15: configuring for phy/internal link mode
[   53.777992] 8021q: adding VLAN 0 to HW filter on device lan15
[   53.830221] switch: port 15(lan15) entered blocking state
[   53.836320] switch: port 15(lan15) entered disabled state
[   53.843872] device lan15 entered promiscuous mode
[   53.903060] rtl83xx-switch switch@1b000000 lan16: configuring for phy/internal link mode
[   53.927948] 8021q: adding VLAN 0 to HW filter on device lan16
[   53.983528] switch: port 16(lan16) entered blocking state
[   53.989734] switch: port 16(lan16) entered disabled state
[   53.997225] device lan16 entered promiscuous mode
[   54.050893] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   54.214578] RTL8380 Link change: status: 1, ports 1
[   54.266291] rtl83xx-switch switch@1b000000 lan1: Link is Up - 1Gbps/Full - flow control off
[   54.300895] switch: port 1(lan1) entered blocking state
[   54.306800] switch: port 1(lan1) entered forwarding state
[   54.357733] IPv6: ADDRCONF(NETDEV_CHANGE): switch: link becomes ready
[   54.365912] IPv6: ADDRCONF(NETDEV_CHANGE): switch.1: link becomes ready
[   55.457968] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   55.465442] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported



BusyBox v1.36.0 (2023-03-18 11:47:48 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r22307-4bfbecbd9a
 -----------------------------------------------------
=== 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:/#

To reply to myself: I just received several GS1920-24HP switches and I'll see what I can do.
@svanheule you mentioned that you had such a device and that it has a different bootloader? Do you remember any details that might give me a head start?

The bootloader is BootBase/ZynOS. For some pointers:

https://svanheule.net/switches/image_formats/zyxel

It's been a while since I looked at the GS1920, and I don't remember getting very far with the bootloader shell itself. It doesn't seem to support TFTP, so you are stuck with file transfers over serial.

So that's going to be fun then :slight_smile: And it will take some time, you mentioned that the PoE controller is attached via i2c instead of UART. Let's see, thanks for the fast reply!

Yes, but the protocol is identical otherwise IIRC. There was an earlier attempt to add I2C support to realtek-poe, but it was deemed too hacky.

Yeah, but i was curious how you connect to your laptop? E.g. an RJ45 SFP? Would be good to know those work, if so which one? I'm in the market for one :slight_smile: Looking at https://www.fs.com/products/74680.html right now ...

Thanks for digging into this, I've written a regmap driver, rewritten the i2c driver, and testing those now. I may have accidentally overwritten the eeprom on my DAC though ... making testing a little harder :frowning: anyway

I've pushed my latest WIP status with dts fixes too...

These work: https://www.amazon.com/gp/product/B01M5LIUK5
I have another random one from "Fluxlight" (before amazon FSXWR brand era, I guess) that also works. They show up as "10GBase-SR" in ethtool but work just fine. I haven't tried DAC or optical at all, though I have those around and can test them since I'm using a XGS1250 on OEM fw (for now...) nearby as an access switch.

I've pushed my latest WIP status with dts fixes

Do I need to enable a driver/kmod for this lexra thing? Boot fails:

[    0.000000] Failed to iomap (timer:(null))
[    0.000000] rttm_probe: setup of timer 0 failed
[    0.000000] rttm_probe: timer registration failed
[    0.000000] Failed to initialize '/lexra-peripherial-bus/timer@18003200': -22
[    0.000000] timer_probe: no matching timers found
[    0.000000] Failed to request irq 7 (timer)