Support for RTL838x based managed switches

Flashing should work as the partition layout is identical. What you need to try out is whether the network system will come up without finding the SFP ports. In that case you need to edit the .dts of the -10 and remove the references to ports 24/26 (the SFP ones) and recompile.

1 Like

I'd assume it works fine, to the point that the sfp ports will show up as interfaces :wink: Should have its own DTS for this reason.

Wrt flashing: OpenWrt with a writable rootfs must boot from the RUNTIME1 partition. So I recommend keeping a stock firmware in RUNTIME2. This allows easy switching between the two installations.

You can't yet flash OpenWrt directly from the stock web UI. I have a patch here: https://github.com/bmork/openwrt/commit/8eb01d82272a1a0a2af07fe4ea75d60a129051b9

This makes the initramfs flashable from stock web UI. The stock flash tool will cut the image according to the u-image header, so any image with a rootfs outside the u-image will not work. But this is good enough to install OpenWrt in two steps: flash initframfs from stock first, and then sysupgrade after booting the initramfs image.

I will submit that patch at some point. But it depends on a modified magic, which again depends on changes to the mtdsplitter. So I am waiting to see if my proposed changes for that goes in. It would allow us to keep the special magic in DTS and image/Makefile only.

But since you have console it is easier to ram boot the initramfs and sysupgrade from there anyway. Then you don't have to worry about modifying magic. U-Boot will not verify it. This is different from e.g. the Netgear switches.

Repeating instructions from further up the thread:

rtk network on
tftpboot 0x84f00000 openwrt-snapshot-realtek-generic-zyxel_gs1900-10hp-initramfs-kernel.bin
bootm
(wait for it to boot and transfer sysupgrade image)
sysupgrade -v openwrt-snapshot-realtek-generic-zyxel_gs1900-10hp-squashfs-sysupgrade.bin 

You should obviously verify that the system works properly after ram booting. And you might want to take the opportuity to back up the flash before writing anything.

1 Like

I also just auctioned one of these buggers for 20 bucks. However, what you have seems to be a version 2 device which shares the PCB with the GS1900-10HP. While my version 1 device has a different GS1900-8HP distinct PCB. Does your label say anything about being a version 2 device? Anyway, I will also join once I receive mine hopefully early next week.

@sumo,

On the bottom of the switch on product label: Rev B1

regards Richard

1 Like

I have console access, so I want to do it with tftp.

I get from Borromini the image so then I will try to install it. I will report the results later

wasn't this about the builders failing to build current OpenWrt snapshots for the realtek target? The log is here: https://buildbot.openwrt.org/master/images/builders/realtek%2Fgeneric/builds/27/steps/images/logs/stdio

This is caused by rtl83xx-phy using symbols from the ethernet driver. Which won't work when the rtl83xx-phy is built as a module. Which it will be because it is hidden behind the existing CONFIG_REALTEK_PHY. Which is defined by KernelPackage/phy-realtek in package/kernel/linux/modules/netdevices.mk

The proper fix is obviously to clean up the symbol sharing between the phy and the ethernet drivers. This will be (or is?) done as part of the upstreaming effort.

A quickfix for the current OpenWrt would be to simply drop target/linux/realtek/patches-5.4/705-add-rtl-phy.patch

No, I did mention that earlier, but it's not related (running my own builds). I tried a patch in blogic's staging tree. Still investigating.

@bmork Concerning your patch to upgrade from the OEM firmware:

It's not applying to the OpenWrt master tree because of the UIMAGE_MAGIC := 0x83800000 line not being there (anymore?). Is this needed or can I try your patch on the current OpenWrt master without the UIMAGE_MAGIC number?

The UIMAGE_MAGIC is needed for stock UI flashing. But as noted: if you change that, then you also have to fix the mtdsplitter! Or you won't have a rootfs.

This has never been in OpenWrt. You'll see it in my branch, but that's the only place.

1 Like

@anon13997276 I've switched back and forth between builds with and without commit 4af1445ab671b06d7f3b25e4e0b6536857099631 from blogic's Realtek staging tree today. Configuration was kept.

At first I thought the GS1900-10HP had rebooted into the OEM firmware, but serial showed it was booting into OpenWrt just fine. The first weird thing is I cannot ping the switch, or SSH into it. As weird as it sounds, however, it seemed like traffic still passed through it. It sits right in between my router and access point; if it cut out completely I wouldn't have had any network at all I think.

Plugging in or unplugging cables shows the corresponding link coming up or going down, so nothing wrong there it seems (but still unable to ping the other end of the link or SSH in). I'm not seeing any errors in dmesg.

Dmesg looks okay:

[    0.000000] Linux version 5.4.86 (1800x@crunchbot) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r15355+9-19d7e73ecc)) #0 Thu Dec 31 10:55:20 2020
[    0.000000] SoC Type: RTL8380
[    0.000000] Kernel command line: console=ttyS0,115200 mem=64M quiet 
[    0.000000] CPU0 revision is: 00019070 (MIPS 4KEc)
[    0.000000] MIPS: machine is Zyxel GS1900-10HP Switch
[    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] On node 0 totalpages: 32768
[    0.000000]   Normal zone: 288 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    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: console=ttyS0,115200
[    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: 123412K/131072K available (4359K kernel code, 153K rwdata, 408K rodata, 1216K init, 198K bss, 7660K reserved, 0K cma-r)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 32
[    0.000000] random: get_random_bytes called from 0x804d09fc with crng_init=0
[    0.000000] CPU frequency from device tree: 500000000
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041786 ns
[    0.000017] sched_clock: 32 bits at 250MHz, resolution 4ns, wraps every 8589934590ns
[    0.000098] Calibrating delay loop... 497.66 BogoMIPS (lpj=995328)
[    0.028095] pid_max: default: 32768 minimum: 301
[    0.028567] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.028634] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.040456] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.040517] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.040791] pinctrl core: initialized pinctrl subsystem
[    0.041861] NET: Registered protocol family 16
[    0.119103] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.127639] clocksource: Switched to clocksource MIPS
[    0.130527] NET: Registered protocol family 2
[    0.132141] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.132261] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.132329] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.132393] TCP: Hash tables configured (established 1024 bind 1024)
[    0.132978] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.133074] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.133733] NET: Registered protocol family 1
[    0.147700] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.165500] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.165533] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.221486] pinctrl-single bb001000.pinmux: 32 pins, size 4
[    0.222019] Probing RTL8231 GPIOs
[    0.222067] rtl8231_init called, MDIO bus ID: 0
[    0.272468] GPIO line 173 (poe_enable) hogged as output/high
[    0.273746] Probing RTL838X GPIOs
[    0.379913] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.382054] printk: console [ttyS0] disabled
[    0.382186] b8002000.uart: ttyS0 at MMIO 0xb8002000 (irq = 3, base_baud = 12500000) is a 16550A
[    1.137068] printk: console [ttyS0] enabled
[    1.143309] b8002100.uart: ttyS1 at MMIO 0xb8002100 (irq = 30, base_baud = 12500000) is a 16550A
[    1.219696] random: fast init done
[    1.224971] brd: module loaded
[    1.229213] Initializing rtl838x_nor_driver
[    1.234090] SPI resource base is b8001200
[    1.238665] Address mode is 3 bytes
[    1.242625] rtl838x_nor_init called
[    1.249472] rtl838x-nor b8001200.spi: mx25l12805d (16384 Kbytes)
[    1.256398] 7 fixed-partitions partitions found on MTD device rtl838x_nor
[    1.264071] Creating 7 MTD partitions on "rtl838x_nor":
[    1.270002] 0x000000000000-0x000000040000 : "u-boot"
[    1.277756] 0x000000040000-0x000000050000 : "u-boot-env"
[    1.285870] 0x000000050000-0x000000060000 : "u-boot-env2"
[    1.294185] 0x000000060000-0x000000160000 : "jffs"
[    1.301721] 0x000000160000-0x000000260000 : "jffs2"
[    1.309438] 0x000000260000-0x000000930000 : "firmware"
[    1.336957] 2 uimage-fw partitions found on MTD device firmware
[    1.343712] Creating 2 MTD partitions on "firmware":
[    1.349361] 0x000000000000-0x000000250000 : "kernel"
[    1.357212] 0x000000250000-0x0000006d0000 : "rootfs"
[    1.364930] mtd: device 7 (rootfs) set to be root filesystem
[    1.371433] 1 squashfs-split partitions found on MTD device rootfs
[    1.378453] 0x000000530000-0x0000006d0000 : "rootfs_data"
[    1.386598] 0x000000930000-0x000001000000 : "runtime2"
[    1.396019] libphy: Fixed MDIO Bus: probed
[    1.401547] Probing RTL838X eth device pdev: 87c74a00, dev: 87c74a10
[    1.453318] Found SoC ID: 8380: RTL8380, family 8380
[    1.458946] rtl8380_init_mac
[    1.462276] Using MAC 0000bccf4f743c15
[    1.466540] rtl838x_mdio_init called
[    1.470952] rtl838x_mdio_reset called
[    1.475160] libphy: rtl838x-eth-mdio: probed
[    1.519882] In rtl838x_validate
[    1.523456] In rtl838x_validate
[    1.530595] NET: Registered protocol family 10
[    1.548682] Segment Routing with IPv6
[    1.553077] NET: Registered protocol family 17
[    1.558957] 8021q: 802.1Q VLAN Support v1.8
[    1.565076] i2c-gpio i2c-gpio-0: Slow GPIO pins might wreak havoc into I2C/SMBus bus timing
[    1.574826] i2c-gpio i2c-gpio-0: using lines 184 (SDA) and 185 (SCL)
[    1.582436] i2c-gpio i2c-gpio-1: Slow GPIO pins might wreak havoc into I2C/SMBus bus timing
[    1.592158] i2c-gpio i2c-gpio-1: using lines 190 (SDA) and 191 (SCL)
[    1.644250] libphy: rtl838x slave mii: probed
[    3.696673] rtl83xx-switch switch@bb000000 lan1 (uninitialized): PHY [mdio-bus:08] driver [Generic PHY]
[    3.722125] rtl83xx-switch switch@bb000000 lan2 (uninitialized): PHY [mdio-bus:09] driver [Generic PHY]
[    3.747060] rtl83xx-switch switch@bb000000 lan3 (uninitialized): PHY [mdio-bus:0a] driver [Generic PHY]
[    3.771477] rtl83xx-switch switch@bb000000 lan4 (uninitialized): PHY [mdio-bus:0b] driver [Generic PHY]
[    3.796410] rtl83xx-switch switch@bb000000 lan5 (uninitialized): PHY [mdio-bus:0c] driver [Generic PHY]
[    3.821348] rtl83xx-switch switch@bb000000 lan6 (uninitialized): PHY [mdio-bus:0d] driver [Generic PHY]
[    3.845858] rtl83xx-switch switch@bb000000 lan7 (uninitialized): PHY [mdio-bus:0e] driver [Generic PHY]
[    3.870370] rtl83xx-switch switch@bb000000 lan8 (uninitialized): PHY [mdio-bus:0f] driver [Generic PHY]
[    3.886698] rtl83xx-switch switch@bb000000: configuring for fixed/internal link mode
[    3.895834] DSA: tree 0 setup
[    3.899245] In rtl83xx_setup_qos
[    3.902942] Setting up RTL838X QoS
[    3.906806] RTL838X_PRI_SEL_TBL_CTRL(i): 00033112
[    3.912128] Current Intprio2queue setting: 00000000
[    3.917656] QM_PKT2CPU_INTPRI_MAP: 00fac688
[    3.922425] rtl838x_dbgfs_init called
[    3.947516] rtl83xx-switch switch@bb000000: Link is Up - 1Gbps/Full - flow control off
[    3.962194] VFS: Mounted root (squashfs filesystem) readonly on device 31:7.
[    3.984135] Freeing unused kernel memory: 1216K
[    3.989293] This architecture does not have kernel memory protection.
[    3.996553] Run /sbin/init as init process
[    4.802189] init: Console is alive
[    5.099274] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.221849] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.244321] init: - preinit -
[    6.793893] random: jshn: uninitialized urandom read (4 bytes read)
[    6.995488] random: jshn: uninitialized urandom read (4 bytes read)
[    7.826701] random: jshn: uninitialized urandom read (4 bytes read)
[    7.901686] random: jshn: uninitialized urandom read (4 bytes read)
[    8.058298] random: jshn: uninitialized urandom read (4 bytes read)
[   12.662142] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
[   12.670319] jffs2_build_filesystem(): unlocking the mtd device... 
[   12.670330] done.
[   12.679437] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[   18.951887] done.
[   18.962519] jffs2: notice: (1104) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and .
[   18.982562] mount_root: overlay filesystem has not been fully initialized yet
[   18.994900] mount_root: switching to jffs2 overlay
[   19.004182] overlayfs: upper fs does not support tmpfile.
[   20.005948] urandom-seed: Seed file not found (/etc/urandom.seed)
[   20.133626] procd: - early -
[   22.429041] procd: - ubus -
[   22.525389] urandom_read: 1 callbacks suppressed
[   22.525403] random: ubusd: uninitialized urandom read (4 bytes read)
[   22.539157] random: ubusd: uninitialized urandom read (4 bytes read)
[   22.547282] random: ubusd: uninitialized urandom read (4 bytes read)
[   22.558290] procd: - init -
[   24.125731] kmodloader: loading kernel modules from /etc/modules.d/*
[   24.203736] Mirror/redirect action on
[   24.263785] u32 classifier
[   24.266823]     input device check on
[   24.271002]     Actions configured
[   24.388021] xt_time: kernel timezone is -0000
[   24.474009] kmodloader: done loading kernel modules from /etc/modules.d/*
[   24.508980] urngd: v1.0.2 started.
[   24.667868] random: crng init done
[   24.671796] random: 1 urandom warning(s) missed due to ratelimiting
[   38.618746] In rtl838x_set_mac_hw
[   38.622652] Using MAC 0000bccf4f743c15
[   38.666466] rtl838x_eth_open called: RX rings 8, TX rings 2
[   38.672867] RESETTING 8380, CPU_PORT 28
[   39.275311] rtl838x-eth bb00a300.ethernet eth0: configuring for fixed/internal link mode
[   39.284359] In rtl838x_mac_config, mode 1
[   39.292447] In rtl838x_mac_config, mode 1
[   39.297039] In rtl838x_mac_link_up
[   39.300972] rtl838x-eth bb00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   39.419823] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   40.568146] device eth0 entered promiscuous mode
[   40.573482] rtl83xx-switch switch@bb000000 lan1: configuring for phy/internal link mode
[   40.583263] 8021q: adding VLAN 0 to HW filter on device lan1
[   40.616329] switch: port 1(lan1) entered blocking state
[   40.622291] switch: port 1(lan1) entered disabled state
[   40.629039] device lan1 entered promiscuous mode
[   40.801627] rtl83xx-switch switch@bb000000 lan10: configuring for fixed/rgmii-id link mode
[   40.811247] 8021q: adding VLAN 0 to HW filter on device lan10
[   40.818238] rtl83xx-switch switch@bb000000 lan10: Link is Up - 1Gbps/Full - flow control rx/tx
[   40.912426] switch: port 2(lan10) entered blocking state
[   40.918483] switch: port 2(lan10) entered disabled state
[   40.925191] device lan10 entered promiscuous mode
[   40.931347] switch: port 2(lan10) entered blocking state
[   40.937418] switch: port 2(lan10) entered forwarding state
[   40.944061] IPv6: ADDRCONF(NETDEV_CHANGE): switch: link becomes ready
[   40.991911] IPv6: ADDRCONF(NETDEV_CHANGE): switch.1: link becomes ready
[   41.236341] rtl83xx-switch switch@bb000000 lan2: configuring for phy/internal link mode
[   41.246205] 8021q: adding VLAN 0 to HW filter on device lan2
[   41.267784] rtl83xx-switch switch@bb000000 lan2: Link is Up - 1Gbps/Full - flow control rx/tx
[   41.464402] switch: port 3(lan2) entered blocking state
[   41.470370] switch: port 3(lan2) entered disabled state
[   41.539810] device lan2 entered promiscuous mode
[   41.545642] switch: port 3(lan2) entered blocking state
[   41.551646] switch: port 3(lan2) entered forwarding state
[   41.688188] rtl83xx-switch switch@bb000000 lan3: configuring for phy/internal link mode
[   41.697932] 8021q: adding VLAN 0 to HW filter on device lan3
[   41.776480] switch: port 4(lan3) entered blocking state
[   41.782439] switch: port 4(lan3) entered disabled state
[   41.839808] device lan3 entered promiscuous mode
[   41.933179] rtl83xx-switch switch@bb000000 lan4: configuring for phy/internal link mode
[   41.942894] 8021q: adding VLAN 0 to HW filter on device lan4
[   42.072400] switch: port 5(lan4) entered blocking state
[   42.078363] switch: port 5(lan4) entered disabled state
[   42.139942] device lan4 entered promiscuous mode
[   42.240812] rtl83xx-switch switch@bb000000 lan5: configuring for phy/internal link mode
[   42.250255] 8021q: adding VLAN 0 to HW filter on device lan5
[   42.436413] switch: port 6(lan5) entered blocking state
[   42.442384] switch: port 6(lan5) entered disabled state
[   42.448977] device lan5 entered promiscuous mode
[   42.568048] rtl83xx-switch switch@bb000000 lan6: configuring for phy/internal link mode
[   42.577919] 8021q: adding VLAN 0 to HW filter on device lan6
[   42.624410] switch: port 7(lan6) entered blocking state
[   42.630382] switch: port 7(lan6) entered disabled state
[   42.636975] device lan6 entered promiscuous mode
[   42.694704] rtl83xx-switch switch@bb000000 lan7: configuring for phy/internal link mode
[   42.704404] 8021q: adding VLAN 0 to HW filter on device lan7
[   42.792405] switch: port 8(lan7) entered blocking state
[   42.798364] switch: port 8(lan7) entered disabled state
[   42.804957] device lan7 entered promiscuous mode
[   42.858835] rtl83xx-switch switch@bb000000 lan8: configuring for phy/internal link mode
[   42.868721] 8021q: adding VLAN 0 to HW filter on device lan8
[   43.018838] switch: port 9(lan8) entered blocking state
[   43.024810] switch: port 9(lan8) entered disabled state
[   43.031391] device lan8 entered promiscuous mode
[   43.089807] rtl83xx-switch switch@bb000000 lan9: configuring for fixed/rgmii-id link mode
[   43.099323] 8021q: adding VLAN 0 to HW filter on device lan9
[   43.106177] rtl83xx-switch switch@bb000000 lan9: Link is Up - 1Gbps/Full - flow control rx/tx
[   43.133063] switch: port 10(lan9) entered blocking state
[   43.139133] switch: port 10(lan9) entered disabled state
[   43.145807] device lan9 entered promiscuous mode
[   43.151678] switch: port 10(lan9) entered blocking state
[   43.157705] switch: port 10(lan9) entered forwarding state
[   67.909874] rtl83xx-switch switch@bb000000 lan2: Link is Down
[   67.916494] switch: port 3(lan2) entered disabled state
[   70.982905] rtl83xx-switch switch@bb000000 lan2: Link is Up - 1Gbps/Full - flow control rx/tx
[   70.992606] switch: port 3(lan2) entered blocking state
[   70.998582] switch: port 3(lan2) entered forwarding state

VLANs look OK, still like before:

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

With the commit reverted, behaviour is back to normal, and it just works like before. Dmesg on a build without the commit is below. I've checked the VLAN layout, it's still all VLAN ID 1.

[    0.000000] Linux version 5.4.86 (1800x@crunchbot) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r15355+9-19d7e73ecc)) #0 Thu Dec 31 13:47:06 2020
[    0.000000] SoC Type: RTL8380
[    0.000000] Kernel command line: console=ttyS0,115200 mem=64M quiet 
[    0.000000] CPU0 revision is: 00019070 (MIPS 4KEc)
[    0.000000] MIPS: machine is Zyxel GS1900-10HP Switch
[    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] On node 0 totalpages: 32768
[    0.000000]   Normal zone: 288 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    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: console=ttyS0,115200
[    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: 123412K/131072K available (4354K kernel code, 158K rwdata, 408K rodata, 1216K init, 198K bss, 7660K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 32
[    0.000000] random: get_random_bytes called from 0x804d09fc with crng_init=0
[    0.000000] CPU frequency from device tree: 500000000
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041786 ns
[    0.000016] sched_clock: 32 bits at 250MHz, resolution 4ns, wraps every 8589934590ns
[    0.000098] Calibrating delay loop... 497.66 BogoMIPS (lpj=995328)
[    0.028108] pid_max: default: 32768 minimum: 301
[    0.028563] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.028635] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.039055] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.039120] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.039396] pinctrl core: initialized pinctrl subsystem
[    0.040595] NET: Registered protocol family 16
[    0.118245] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.126813] clocksource: Switched to clocksource MIPS
[    0.129653] NET: Registered protocol family 2
[    0.131390] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.131514] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.131586] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.131652] TCP: Hash tables configured (established 1024 bind 1024)
[    0.132240] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.132336] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.132992] NET: Registered protocol family 1
[    0.147032] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.164331] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.164365] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.220158] pinctrl-single bb001000.pinmux: 32 pins, size 4
[    0.220698] Probing RTL8231 GPIOs
[    0.220747] rtl8231_init called, MDIO bus ID: 0
[    0.271166] GPIO line 173 (poe_enable) hogged as output/high
[    0.272461] Probing RTL838X GPIOs
[    0.380502] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.382638] printk: console [ttyS0] disabled
[    0.382767] b8002000.uart: ttyS0 at MMIO 0xb8002000 (irq = 3, base_baud = 12500000) is a 16550A
[    1.139458] printk: console [ttyS0] enabled
[    1.145705] b8002100.uart: ttyS1 at MMIO 0xb8002100 (irq = 30, base_baud = 12500000) is a 16550A
[    1.210861] random: fast init done
[    1.226725] brd: module loaded
[    1.231103] Initializing rtl838x_nor_driver
[    1.235939] SPI resource base is b8001200
[    1.240511] Address mode is 3 bytes
[    1.244476] rtl838x_nor_init called
[    1.251893] rtl838x-nor b8001200.spi: mx25l12805d (16384 Kbytes)
[    1.258875] 7 fixed-partitions partitions found on MTD device rtl838x_nor
[    1.266526] Creating 7 MTD partitions on "rtl838x_nor":
[    1.272466] 0x000000000000-0x000000040000 : "u-boot"
[    1.280336] 0x000000040000-0x000000050000 : "u-boot-env"
[    1.288641] 0x000000050000-0x000000060000 : "u-boot-env2"
[    1.296961] 0x000000060000-0x000000160000 : "jffs"
[    1.304601] 0x000000160000-0x000000260000 : "jffs2"
[    1.312365] 0x000000260000-0x000000930000 : "firmware"
[    1.340089] 2 uimage-fw partitions found on MTD device firmware
[    1.346850] Creating 2 MTD partitions on "firmware":
[    1.352501] 0x000000000000-0x000000250000 : "kernel"
[    1.360347] 0x000000250000-0x0000006d0000 : "rootfs"
[    1.368092] mtd: device 7 (rootfs) set to be root filesystem
[    1.374595] 1 squashfs-split partitions found on MTD device rootfs
[    1.381618] 0x000000530000-0x0000006d0000 : "rootfs_data"
[    1.389769] 0x000000930000-0x000001000000 : "runtime2"
[    1.399226] libphy: Fixed MDIO Bus: probed
[    1.404735] Probing RTL838X eth device pdev: 87c74a00, dev: 87c74a10
[    1.456497] Found SoC ID: 8380: RTL8380, family 8380
[    1.462133] rtl8380_init_mac
[    1.465465] Using MAC 0000bccf4f743c15
[    1.469727] rtl838x_mdio_init called
[    1.474105] rtl838x_mdio_reset called
[    1.478313] libphy: rtl838x-eth-mdio: probed
[    1.523066] In rtl838x_validate
[    1.526665] In rtl838x_validate
[    1.533820] NET: Registered protocol family 10
[    1.551345] Segment Routing with IPv6
[    1.555771] NET: Registered protocol family 17
[    1.561649] 8021q: 802.1Q VLAN Support v1.8
[    1.567896] i2c-gpio i2c-gpio-0: Slow GPIO pins might wreak havoc into I2C/SMBus bus timing
[    1.577684] i2c-gpio i2c-gpio-0: using lines 184 (SDA) and 185 (SCL)
[    1.585322] i2c-gpio i2c-gpio-1: Slow GPIO pins might wreak havoc into I2C/SMBus bus timing
[    1.595088] i2c-gpio i2c-gpio-1: using lines 190 (SDA) and 191 (SCL)
[    1.647705] libphy: rtl838x slave mii: probed
[    3.695841] rtl83xx-switch switch@bb000000 lan1 (uninitialized): PHY [mdio-bus:08] driver [Generic PHY]
[    3.721301] rtl83xx-switch switch@bb000000 lan2 (uninitialized): PHY [mdio-bus:09] driver [Generic PHY]
[    3.745716] rtl83xx-switch switch@bb000000 lan3 (uninitialized): PHY [mdio-bus:0a] driver [Generic PHY]
[    3.770131] rtl83xx-switch switch@bb000000 lan4 (uninitialized): PHY [mdio-bus:0b] driver [Generic PHY]
[    3.794540] rtl83xx-switch switch@bb000000 lan5 (uninitialized): PHY [mdio-bus:0c] driver [Generic PHY]
[    3.819569] rtl83xx-switch switch@bb000000 lan6 (uninitialized): PHY [mdio-bus:0d] driver [Generic PHY]
[    3.844607] rtl83xx-switch switch@bb000000 lan7 (uninitialized): PHY [mdio-bus:0e] driver [Generic PHY]
[    3.869014] rtl83xx-switch switch@bb000000 lan8 (uninitialized): PHY [mdio-bus:0f] driver [Generic PHY]
[    3.885349] rtl83xx-switch switch@bb000000: configuring for fixed/internal link mode
[    3.894218] DSA: tree 0 setup
[    3.918931] rtl83xx-switch switch@bb000000: Link is Up - 1Gbps/Full - flow control off
[    3.933643] VFS: Mounted root (squashfs filesystem) readonly on device 31:7.
[    3.955613] Freeing unused kernel memory: 1216K
[    3.960774] This architecture does not have kernel memory protection.
[    3.968047] Run /sbin/init as init process
[    4.779045] init: Console is alive
[    5.077766] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.201325] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.223481] init: - preinit -
[    6.781086] random: jshn: uninitialized urandom read (4 bytes read)
[    6.984196] random: jshn: uninitialized urandom read (4 bytes read)
[    7.830267] random: jshn: uninitialized urandom read (4 bytes read)
[    7.905832] random: jshn: uninitialized urandom read (4 bytes read)
[    8.063896] random: jshn: uninitialized urandom read (4 bytes read)
[   12.683820] jffs2: notice: (1103) jffs2_build_xattr_subsystem: complete building xattr subsystem, 10 of xdatum (6 unchecked, 1 orphan) and 12 of xref (1 dead, 0 orphan) found.
[   12.704162] mount_root: switching to jffs2 overlay
[   12.715664] overlayfs: upper fs does not support tmpfile.
[   12.732983] urandom-seed: Seeding with /etc/urandom.seed
[   12.876193] procd: - early -
[   15.200905] procd: - ubus -
[   15.298677] urandom_read: 1 callbacks suppressed
[   15.298693] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.312467] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.320697] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.331618] procd: - init -
[   16.916950] kmodloader: loading kernel modules from /etc/modules.d/*
[   16.990926] Mirror/redirect action on
[   17.054994] u32 classifier
[   17.058031]     input device check on
[   17.062194]     Actions configured
[   17.184578] xt_time: kernel timezone is -0000
[   17.267214] kmodloader: done loading kernel modules from /etc/modules.d/*
[   17.293812] urngd: v1.0.2 started.
[   17.453583] random: crng init done
[   17.457522] random: 1 urandom warning(s) missed due to ratelimiting
[   28.406500] In rtl838x_set_mac_hw
[   28.410412] Using MAC 0000bccf4f743c15
[   28.530990] rtl838x_eth_open called: RX rings 8, TX rings 2
[   28.537378] RESETTING 8380, CPU_PORT 28
[   29.139825] rtl838x-eth bb00a300.ethernet eth0: configuring for fixed/internal link mode
[   29.148872] In rtl838x_mac_config, mode 1
[   29.155683] In rtl838x_mac_config, mode 1
[   29.160282] In rtl838x_mac_link_up
[   29.164218] rtl838x-eth bb00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   29.190422] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   30.340047] device eth0 entered promiscuous mode
[   30.345369] rtl83xx-switch switch@bb000000 lan1: configuring for phy/internal link mode
[   30.355101] 8021q: adding VLAN 0 to HW filter on device lan1
[   30.389225] switch: port 1(lan1) entered blocking state
[   30.395198] switch: port 1(lan1) entered disabled state
[   30.401953] device lan1 entered promiscuous mode
[   30.592001] rtl83xx-switch switch@bb000000 lan10: configuring for fixed/rgmii-id link mode
[   30.601622] 8021q: adding VLAN 0 to HW filter on device lan10
[   30.608615] rtl83xx-switch switch@bb000000 lan10: Link is Up - 1Gbps/Full - flow control rx/tx
[   30.702035] switch: port 2(lan10) entered blocking state
[   30.708100] switch: port 2(lan10) entered disabled state
[   30.714770] device lan10 entered promiscuous mode
[   30.720971] switch: port 2(lan10) entered blocking state
[   30.727039] switch: port 2(lan10) entered forwarding state
[   30.733672] IPv6: ADDRCONF(NETDEV_CHANGE): switch: link becomes ready
[   30.775088] IPv6: ADDRCONF(NETDEV_CHANGE): switch.1: link becomes ready
[   31.016051] rtl83xx-switch switch@bb000000 lan2: configuring for phy/internal link mode
[   31.025939] 8021q: adding VLAN 0 to HW filter on device lan2
[   31.040939] rtl83xx-switch switch@bb000000 lan2: Link is Up - 1Gbps/Full - flow control rx/tx
[   31.259664] switch: port 3(lan2) entered blocking state
[   31.265634] switch: port 3(lan2) entered disabled state
[   31.331027] device lan2 entered promiscuous mode
[   31.336891] switch: port 3(lan2) entered blocking state
[   31.342886] switch: port 3(lan2) entered forwarding state
[   31.476517] rtl83xx-switch switch@bb000000 lan3: configuring for phy/internal link mode
[   31.486252] 8021q: adding VLAN 0 to HW filter on device lan3
[   31.567695] switch: port 4(lan3) entered blocking state
[   31.573660] switch: port 4(lan3) entered disabled state
[   31.627065] device lan3 entered promiscuous mode
[   31.719463] rtl83xx-switch switch@bb000000 lan4: configuring for phy/internal link mode
[   31.729039] 8021q: adding VLAN 0 to HW filter on device lan4
[   31.847676] switch: port 5(lan4) entered blocking state
[   31.853646] switch: port 5(lan4) entered disabled state
[   31.919055] device lan4 entered promiscuous mode
[   32.002188] rtl83xx-switch switch@bb000000 lan5: configuring for phy/internal link mode
[   32.011722] 8021q: adding VLAN 0 to HW filter on device lan5
[   32.218341] switch: port 6(lan5) entered blocking state
[   32.224321] switch: port 6(lan5) entered disabled state
[   32.231025] device lan5 entered promiscuous mode
[   32.360573] rtl83xx-switch switch@bb000000 lan6: configuring for phy/internal link mode
[   32.370148] 8021q: adding VLAN 0 to HW filter on device lan6
[   32.420829] switch: port 7(lan6) entered blocking state
[   32.426853] switch: port 7(lan6) entered disabled state
[   32.433589] device lan6 entered promiscuous mode
[   32.514238] rtl83xx-switch switch@bb000000 lan7: configuring for phy/internal link mode
[   32.523954] 8021q: adding VLAN 0 to HW filter on device lan7
[   32.619659] switch: port 8(lan7) entered blocking state
[   32.625629] switch: port 8(lan7) entered disabled state
[   32.632220] device lan7 entered promiscuous mode
[   32.690080] rtl83xx-switch switch@bb000000 lan8: configuring for phy/internal link mode
[   32.699825] 8021q: adding VLAN 0 to HW filter on device lan8
[   32.844226] switch: port 9(lan8) entered blocking state
[   32.850189] switch: port 9(lan8) entered disabled state
[   32.856793] device lan8 entered promiscuous mode
[   32.919387] rtl83xx-switch switch@bb000000 lan9: configuring for fixed/rgmii-id link mode
[   32.928905] 8021q: adding VLAN 0 to HW filter on device lan9
[   32.935778] rtl83xx-switch switch@bb000000 lan9: Link is Up - 1Gbps/Full - flow control rx/tx
[   32.962090] switch: port 10(lan9) entered blocking state
[   32.968479] switch: port 10(lan9) entered disabled state
[   32.975302] device lan9 entered promiscuous mode
[   32.981106] switch: port 10(lan9) entered blocking state
[   32.987179] switch: port 10(lan9) entered forwarding state
[  109.955508] rtl83xx-switch switch@bb000000 lan2: Link is Down
[  109.962126] switch: port 3(lan2) entered disabled state
[  113.028969] rtl83xx-switch switch@bb000000 lan2: Link is Up - 1Gbps/Full - flow control rx/tx
[  113.038676] switch: port 3(lan2) entered blocking state
[  113.044663] switch: port 3(lan2) entered forwarding state

Thanks. I'll hold off on that for now, serial is a bit clumsy in comparison but it still works.

Don't think I've tested exactly that code. But I do not that there is a weird unsyncronized change of

-+#ifdef CONFIG_NET_DSA_RTL83XX
++#ifdef CONFIG_NET_DSA_RTL838X

in the target/linux/realtek/patches-5.4/701-net-dsa-add-rtl838x-support-for-tag-trailer.patch

There is no matching change in the config. So this will make the DSA tagging fail, and I believe that would explain the symptoms you see.

1 Like

Cool, thanks. I just checked blogic's tree again, not seeing any other realtek patches I might have missed and should have added.

Grepping present master for CONFIG_NET_DSA_RTL83 returns this:

$ git grep CONFIG_NET_DSA_RTL8
target/linux/realtek/config-5.4:CONFIG_NET_DSA_RTL83XX=y
target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/Makefile:obj-$(CONFIG_NET_DSA_RTL83XX)   += common.o dsa.o \
target/linux/realtek/patches-5.4/701-net-dsa-add-rtl838x-support-for-tag-trailer.patch:+#ifdef CONFIG_NET_DSA_RTL83XX
target/linux/realtek/patches-5.4/701-net-dsa-add-rtl838x-support-for-tag-trailer.patch:+#endif /* CONFIG_NET_DSA_RTL83XX */
target/linux/realtek/patches-5.4/701-net-dsa-add-rtl838x-support-for-tag-trailer.patch:+#ifdef CONFIG_NET_DSA_RTL83XX

I suppose the RTL83XX stuff is shared between 8380, 8390 etc., and RTL838X is for a more specific subset? target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/Makefile seems to be both for 838X and 839X judging from the object files in it. So not sure whether the Makefile should be changed to CONFIG_NET_DSA_RTL838X as well.

@anon13997276 Could you comment?

Well I have the image running on my zyxel GS1900-8HP.

Running the first bootm, before I could do an sysupgrade, I got some vlan 100 and the wan vlan 1, and there was no port untagged at the lan side. I als noticed the the ip adress was not 192.168.1.1 anymore but 10.0.0.254.

After changing a LAN port into untagged en change the ip address, I restarted the network service , and I could scp de sysugrade image to the switch. After the sysupgrade I also changed it again , and remove lan 9 en lan 10 in the network config file.

No I go to try to add some port to my AP's en my edgerouter x , to see of the vlan trunking is working and do some performance tests.

Nothing unexpected about that - I told you in our private conversation my image comes up with 10.0.0.254 as default IP.

@kroon040 I owe you an apology, I did point out the firmware uses 10.0.0.254 but the sample config I shared with you in another post was set to 192.168.1.1. My apologies for the confusion.

1 Like

Hi,

I had to find in this post the commands for everything :

ubus -v call poe port '{"enable":true,"port":1}'
ubus -v call poe info
bridge vlan
brctl show

Trunks ports working fine and all vlan tags went well. 3 vlans trunk tested to different ip subnets on an aruba accesspoint and to an edgerouter-x.

root@OpenWrt:~# bridge vlan
port              vlan-id  
lan1              10
                  90
                  99 PVID Egress Untagged
lan2              10
                  90
                  99 PVID Egress Untagged
lan3              10 PVID Egress Untagged
lan4              10 PVID Egress Untagged
lan5              10 PVID Egress Untagged
lan6              10 PVID Egress Untagged
lan7              10 PVID Egress Untagged
lan8              99 PVID Egress Untagged
switch            10
                  90
                  99

performance looking also very good, this test also to another switch where the device is connected

  5] local 192.168.180.135 port 45336 connected to 192.168.180.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   112 MBytes   942 Mbits/sec    0    554 KBytes       
[  5]   1.00-2.00   sec   113 MBytes   948 Mbits/sec    0    619 KBytes       
[  5]   2.00-3.00   sec   111 MBytes   933 Mbits/sec    0    683 KBytes       
[  5]   3.00-4.00   sec   112 MBytes   944 Mbits/sec    0    751 KBytes       
[  5]   4.00-5.00   sec   112 MBytes   944 Mbits/sec    0    751 KBytes       
[  5]   5.00-6.00   sec   111 MBytes   933 Mbits/sec    0    751 KBytes       
[  5]   6.00-7.00   sec   112 MBytes   944 Mbits/sec    0    858 KBytes       
[  5]   7.00-8.00   sec   111 MBytes   933 Mbits/sec    0    858 KBytes       
[  5]   8.00-9.00   sec   111 MBytes   933 Mbits/sec   92    626 KBytes       
[  5]   9.00-10.00  sec   112 MBytes   944 Mbits/sec    0    626 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   940 Mbits/sec   92             sender
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec                  receiver

POE is also working

root@OpenWrt:~# ubus -v call poe info
{
	"ports": [
		"4W",
		"off",
		"off",
		"off",
		"off",
		"off",
		"off",
		"off"
	],
	"power_budget": "65W",
	"power_consumption": "4W"
}

The only thing that is missing are vlan tagging and poe missing in the lua web interface. Also setting poe on the port, after reboot this is gone, but this should be something that should be done in a config file?

1 Like

Yes, just enable it on the ports you want. And upate the budget as well, when you're at it. It's supposed to be 77W on this switch, I believe. I have

root@gs1900-10hp:~# cat /etc/config/poe 
config poe poe
        option budget   77
        option port1    1
        option port2    1
        option port3    1
        option port4    1
        option port5    1
        option port6    1
        option port7    1
        option port8    1

EDIT: and as this shows: Enabling PoE on every port should not hurt. It's negotiated anyway. So instead of "off" you'll see "enabled" on the other ports:

root@gs1900-10hp:~# ubus call poe info
{
        "ports": [
                "enabled",
                "enabled",
                "enabled",
                "enabled",
                "enabled",
                "enabled",
                "3.8W",
                "3.8W"
        ],
        "power_budget": "77W",
        "power_consumption": "7.7W"
}
2 Likes

Thnx works well

root@OpenWrt:~# ubus call poe info
{
	"ports": [
		"5.8W",
		"5.4W",
		"5.9W",
		"enabled",
		"enabled",
		"0W",
		"enabled",
		"enabled"
	],
	"power_budget": "77W",
	"power_consumption": "17W"
}

I replaced it with my HPE aruba 2530-8 POE+ swtich and everythhing is looking good. I take a look in that switch of this also has an RTL838x chipset

Is there aslo coming in the luci interface something like this for the RLL838x swtich? (this is screenshot from my edgerouter-x)

DSA has no LuCI support yet AFAIK. But it's planned, since next stable release will have DSA by default for some targets.

Realtek target won't be in the next release, target is probably too fresh and too much in flux for that.

@kroon040 Anything in the OEM boot logs that identifies your model as a B1? There's an older A1 model with a different PCB (bmork pointed that out to me).

I got a GS1900-8HP second hand as well but unsure yet what revision it is.