Support for RTL838x based managed switches

Using a copper (10GBase-T) SFP, I'm not seeing traffic passing. ethtool shows '500B' received on lan1 (and the ethtool properties look sane), which is better than I was getting. I can try a DAC or fiber later.

Possibly this:

[    5.681418] rtl83xx-switch switch@1b000000 lan1 (uninitialized): validation with support 0000000,00000000,00006440 failed: -22

I encountered similar issues on my patch, there were some hardcodes in dsa.c and friends IIRC causing validation to fail, but haven't looked at this branch.

This is an "issue" with the .dts, which wants a 10g fibre:
phy-mode = "10gbase-kr";
The copper SFP very likely has a PHY on board which would need to be accessed via the I2C bus connecting to the SFP module. Unfortunately the I2C hardware of the RTL9300 only speaks SMBus. We are not the first to hit that problem:
https://bootlin.com/blog/sfp-modules-on-a-board-running-linux/
I added SMBus support for the SFP module itself along the lines of these patches, but I did not add that for a PHY on such a module. In fact I even disabled I2C for any such PHY on an SFP module. My impression is that the Linux kernel is not able to do any auto-detection of SFP modules of a type different than the one given in the .dts. Please try the 10G Fibre module, that is what works for me.

I think this is one the issues the i2c demuxer tries to solve. You could have two pins, which can be muxed as GPIO or as SMBus master. Then, for these pins, you specify two I2C masters: a bitbanged master using the GPIO functionality to provide a fully functional I2C bus, and the SMBus master for hardware offloading when possible.

Of course, this also requires a proper pincontroller to be implemented, and those tend to be quite a bit of code :confused:

Plus one would need to add support for sharing the SCL pin between different I2C controllers for the i2c over gpio driver and accommodate for that in the pincontrols. It would probably be easier to add the SMBus support for PHYs on an SFP module, the code already exists and many linux kernel areas can speak both I2C and SMBus. For example the regmap driver which was causing issues with access to the PCA9555a when I2C was available but nicely fell back to SMBus. In any case there is no support for hot swapping SFP modules of different types in the LInux kernel and SFP modules with an Ethernet port are kind of rare. I would be more interested to get the 1GBit modules working in the SFP+ ports at this point, plus the DAC cables.

The current code does not change the calibrations done for the cable in u-boot. Does the DAC cable work if you set in u-boot e.g.

uboot> # rtk 10g 0 20 dac300cm
10gMedia set Unit 0 Port 20

Note that Port 20 corresponds to lan1, see the .dts.

Also I believe that there is a pull-up close to both INT pins (pin 1) on the PCA9555a, so there is likely a GPIO for that interrupt, have you been able to figure that out? It would mean a lot less polling on the I2C bus.

I don't understand what you mean by this. AFAICS, there is all the support you need. Your DSA driver just needs to dynamically reconfigure the mac-phy link when the module type changes to something requiring a different interface mode.

I am not able to find where the kernel tells the DSA driver that there is e.g. a 50cm DAC cable now in the SFP+ port vs a 100m LC fibre or vs a 300cm cable, because that is what is needed to reconfigure the mac-phy link on the RTL93xx. I understand that one can learn that there is now a 10GB Fibre module in there vs a 1G copper one (10G-KR vs 1000T) but that is in not enough information to configure the SoC. I tried it in u-boot: Without the right setting you do not get a link, and the settings are more concrete, especially for the DAC:
rtk 10g UNIT PORT [none | fiber10g | fiber1g | fiber100m | dac50cm | dac100cm | dac300cm] - Set 10g port media
But maybe I am missing something?

Is this something you've ever seen outside the realtek SDK?

I frankly have not enough experience with that. What I see is that some vendors are able to do some auto-config on top of that API once they have the router running, but I don't understand to what extent. I will try to make that medium choice of the SDK available through ethtool, then we can see what it brings and look into auto-config. It is a bit like the combined Fibre+Ethernet ports on the 8380, where it is also the user which selects which is being used.

Could you try the pie-5.10-rtl9313 branch in brainslayer's repository again? I can now boot again an 8390 successfully. There is initially quite a bit of debug output since we are still testing SMP+ new IRQ driver, but once the switch is up it is more limited...

root@OpenWrt:/# cat /proc/cpuinfo 
system type             : RTL8393
machine                 : Zyxel GS1900-48
processor               : 0
cpu model               : MIPS 34Kc V5.5
BogoMIPS                : 465.71
wait instruction        : no
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
Options implemented     : tlb 4kex 4k_cache 32fpr prefetch mcheck ejtag llsc pindexed_dcache userlocal vint perf_cntr_intr_bit perf
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VPE                     : 0
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 1
cpu model               : MIPS 34Kc V5.5
BogoMIPS                : 361.26
wait instruction        : no
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
Options implemented     : tlb 4kex 4k_cache 32fpr prefetch mcheck ejtag llsc pindexed_dcache userlocal vint perf_cntr_intr_bit perf
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VPE                     : 1
VCED exceptions         : not available
VCEI exceptions         : not available

root@OpenWrt:/# cat /proc/interrupts 
           CPU0       CPU1       
  7:      58805      58827      MIPS   7  timer
  8:      22380      24001      MIPS   0  IPI call
  9:        636        637      MIPS   1  IPI resched
 20:          2          0  realtek-rtl-intc  20  rtl839x-link-state
 24:        376          0  realtek-rtl-intc  24  eth0
 31:      36066          0  realtek-rtl-intc  31  ttyS0
ERR:          7

Thank you for this useful table / list / info

i have few pcs of doomed T1600G-28TSv2 which is same as v1 (at least firmware is interchangeable) so i learned here it is BCM5301x
no joy for me, but at least i have the info
thank you

Guys,

I have got two GS1900-48 switches here, both seem to have a corrupt image, probably because of interrupted fw upgrade.
Any chance to load the Openwrt image from the RTL bootloader? I have serial access, but I have no recovery process guide for these.

## Booting image from partition ... 1
   Version:   V2.50.0
   Created:   2019-10-21  15:23:59 UTC
   Size:      6428671 Bytes = 6.1 MB
   Verifying Checksum ... OK
   Uncompressing Image ... OK

Starting ...

SIGSEGV

SIGSEGV
#

This is fortunately easy. Interrupt the boot-process on the console immediately by pressing space. The use a tftp server to load and run an OpenWRT image. In the following it is assumed the tftp server is at 192.168.2.150:

U-Boot Version: 2.0.0.59413 (Jul 08 2015 - 10:01:28)

CPU:   750MHz
DRAM:  128 MB
FLASH: 16 MB
Model: ZyXEL_GS1900_48
SN:    S192L36003302
MAC:   BC:CF:4F:5C:5A:8F - BC:CF:4F:5C:5A:C1

Press SPACE to abort boot script:  0 
RTL839x# rtk network on
Enable network
Please wait for PHY init-time ...

RTL839x# setenv ipaddr 192.168.2.21
RTL839x# tftpboot 0x84f00000 192.168.2.150:openwrt-realtek-rtl839x-zyxel_gs1900-48-initramfs-kernel.bin
Using rtl8390#0 device
TFTP from server 192.168.2.150; our IP address is 192.168.2.21
Filename 'openwrt-realtek-rtl839x-zyxel_gs1900-48-initramfs-kernel.bin'.
Load address: 0x84f00000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############
done
Bytes transferred = 6890627 (692483 hex)
RTL839x# bootm
   Version:   MIPS OpenWrt Linux-5.10.72
   Created:   2021-11-29  12:36:50 UTC
   Size:      6890563 Bytes = 6.6 MB
   Verifying Checksum ... OK
   Uncompressing Image ... OK

Starting ...

[    0.000000] Linux version 5.10.72 (birger@AMDDesktop) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r17799-15fc9eea42) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 SMP Mon Nov 29 12:36:50 2021
[    0.000000] RTL838X model is ffffffff
[    0.000000] RTL839X model is 83936806
[    0.000000] SoC Type: RTL8393
[...]

Once OpenWRT is running, you can install an image onto flash with the usual means.

Thanks kobi, can you point out please where this image can be downloaded from?

BTW, I think the problem might be something else. After boot process is interrupted, and the environment parameters are set, none of the ports links up. So no chance to load an image through TFTP...

This is the image I used: https://famko.zapto.org/s/bkjp5K6BMofCDDE
It is what I have at hand, bleeding edge end full of chatty debug stuff. You will need to build a proper one to install yourself with LuCI and the like.
You need to do the "rtk network on" in order to enable the network and make a port led indicate a connection.

Thank you kobi!

It did load the image, but after issuing "bootm" - I guess this starts the uploaded image, it seems to stop the CPU at some point and enters a loop.

U-Boot Version: 2.0.0.59413 (Jul 08 2015 - 10:01:28)

CPU:   750MHz
DRAM:  128 MB
FLASH: 16 MB
Model: ZyXEL_GS1900_48
[WARN] Serdes 4 initail fail bb00a878 0
[WARN] Serdes 5 initail fail bb00a978 0
SN:    S152L47001182
MAC:   04:BF:6D:16:B0:69 - 04:BF:6D:16:B0:9B

Press SPACE to abort boot script:  0
RTL839x#
RTL839x#
RTL839x#
RTL839x#
RTL839x#
RTL839x# rtk network on
Enable network
Please wait for PHY init-time ...

RTL839x# tftpboot 0x84f00000 192.168.1.33:openwrt-realtek-rtl839x-zyxel_gs1900-48-initramfs-kernel.bin
Using rtl8390#0 device
TFTP from server 192.168.1.33; our IP address is 192.168.1.1
Filename 'openwrt-realtek-rtl839x-zyxel_gs1900-48-initramfs-kernel.bin'.
Load address: 0x84f00000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############
done
Bytes transferred = 6890627 (692483 hex)
RTL839x# bootm
   Version:   MIPS OpenWrt Linux-5.10.72
   Created:   2021-11-29  12:36:50 UTC
   Size:      6890563 Bytes = 6.6 MB
   Verifying Checksum ... OK
   Uncompressing Image ... OK

Starting ...

[    0.000000] Linux version 5.10.72 (birger@AMDDesktop) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r17799-15fc9eea42) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 SMP Mon Nov 29 12:36:50 2021
[    0.000000] RTL838X model is ffffffff
[    0.000000] RTL839X model is 83936802
[    0.000000] SoC Type: RTL8393
[    0.000000] Kernel command line: console=ttyS0,115200 mem=64M quiet
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.72 #0
[    0.000000] Stack : 80694cdc 83f40000 80000400 8007d054 80790000 80695a14 00000000 00000000
[    0.000000]         8070be24 81080000 8066e0bc 80716078 80715ba7 00000001 8070bdc8 00000000
[    0.000000]         00000000 00000000 8066e0bc 8070bc60 ffffefff 00000000 00000000 ffffffea
[    0.000000]         00000006 8070bc6c 00000006 8071b020 00000000 00000000 00000000 80670000
[    0.000000]         81080000 83f40000 83f3902c 83f40000 00000018 00000030 83dffb18 fffffffe
[    0.000000]         ...
[    0.000000] Call Trace:
[    0.000000] [<80006fa4>] show_stack+0x30/0x100
[    0.000000] [<802f9144>] dump_stack+0x9c/0xcc
[    0.000000] [<8000fd30>] register_smp_ops+0x1c/0x4c
[    0.000000] [<8079dfb8>] setup_arch+0x24/0x78
[    0.000000] [<807998f0>] start_kernel+0x74/0x544
[    0.000000]
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019555 (MIPS 34Kc)
[    0.000000] plat_mem_setup
[    0.000000] MIPS: machine is Zyxel GS1900-48
[    0.000000] Registering _machine_restart
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Using appended Device Tree.
[    0.000000] Detected 1 available secondary CPU(s)
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-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] percpu: Embedded 14 pages/cpu s26576 r8192 d22576 u57344
[    0.000000] pcpu-alloc: s26576 r8192 d22576 u57344 alloc=14*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    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] Writing ErrCtl register=0004e020
[    0.000000] Readback ErrCtl register=0004e020
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 112520K/131072K available (5953K kernel code, 574K rwdata, 1244K rodata, 9116K init, 206K bss, 18552K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64
[    0.000000] realtek_rtl_of_init: new handler with base 0 b8003000 and base 1 b8003018
[    0.000000] Domain data 00000000
[    0.000000] map_interrupts, chip data 00000000
[    0.000000] map_interrupts: 0 writing 00000000 to b8003014
[    0.000000] map_interrupts: 1 writing 00000000 to b8003010
[    0.000000] map_interrupts: 2 writing 44434500 to b800300c
[    0.000000] map_interrupts: 3 writing 21511114 to b8003008
[    0.000000] 0 00000000 00000000 21511114 44434500 00000000 00000000
[    0.000000] 1 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] random: get_random_bytes called from start_kernel+0x32c/0x544 with crng_init=0
[    0.000000] CPU frequency from device tree: 700MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] mips_clockevent_init: ################## 1
[    0.000000] mips_clockevent_init: ################## 2
[    0.000000] tick_check_new_device 0
[    0.000000] tick_check_new_device 1
[    0.000000] tick_check_new_device 2
[    0.000000] init_mips_clocksource: ################## 1
[    0.000000] init_mips_clocksource: ################## 2
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.72 #0
[    0.000000] Stack : 80694cdc 83f40000 80000400 8007d054 80790000 80695a14 00000000 00000000
[    0.000000]         8070bdec 81080000 8066e0bc 80716078 80715ba7 00000001 8070bd90 bb3ea812
[    0.000000]         00000000 00000000 8066e0bc 8070bc28 ffffefff 00000000 00000000 ffffffea
[    0.000000]         0000004b 8070bc34 0000004b 8071b020 00000000 00000000 00000000 80670000
[    0.000000]         81080000 83f40000 83f3902c 83f40000 00000018 00000030 83dffb18 fffffffe
[    0.000000]         ...
[    0.000000] Call Trace:
[    0.000000] [<80006fa4>] show_stack+0x30/0x100
[    0.000000] [<802f9144>] dump_stack+0x9c/0xcc
[    0.000000] [<800a40cc>] __clocksource_update_freq_scale+0x264/0x434
[    0.000000] [<800a42dc>] __clocksource_register_scale+0x40/0x174
[    0.000000] [<8079ee54>] init_r4k_clocksource+0x9c/0xd8
[    0.000000] [<80799bd8>] start_kernel+0x35c/0x544
[    0.000000]
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5460744132 ns
[    0.000010] sched_clock: 32 bits at 350MHz, resolution 2ns, wraps every 6135667710ns
[    0.009239] Calibrating delay loop... 464.48 BogoMIPS (lpj=2322432)
[    0.076520] pid_max: default: 32768 minimum: 301
[    0.082151] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090742] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.103047] mips_smp_ipi_allocate: a ipidomain :cpuintc-6
[    0.109342] mips_smp_ipi_allocate: b ipidomain :cpuintc-6
[    0.116074] rcu: Hierarchical SRCU implementation.
[    0.122092] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.131548] smp: Bringing up secondary CPUs ...
[    0.137856] vsmp_boot_secondary ++++++++++++++
[    0.143163] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.143183] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.143291] mips_clockevent_init: ################## 1
[    0.143303] mips_clockevent_init: ################## 2
[    0.143328] tick_check_new_device 1
[    0.143336] tick_check_new_device 1
[    0.143342] tick_check_new_device 2
[    0.143356] vsmp_init_secondary ++++++++++++++
[    0.143368] CPU1 revision is: 00019555 (MIPS 34Kc)
[    0.203204] Synchronize counters for CPU 1: done.
[    0.261115] smp: Brought up 1 node, 2 CPUs
[    0.275633] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.10.72 #0
[    0.282646] Stack : 80694cdc 80799094 81080000 8007d054 80790000 80695a14 00000000 00000000
[    0.292507]         82023d6c 81080000 8066e0bc 820383b8 80715ba7 00000001 82023d10 bb3ea812
[    0.302373]         00000000 00000000 8066e0bc 82023ba8 ffffefff 00000000 00000000 ffffffea
[    0.312239]         00000071 82023bb4 00000071 8071b020 00000000 00000001 00000000 80670000
[    0.322105]         81080000 80707c6c 807c3edc 80799094 00000018 00000030 00000000 81080000
[    0.331971]         ...
[    0.334851] Call Trace:
[    0.337761] [<80006fa4>] show_stack+0x30/0x100
[    0.342996] [<802f9144>] dump_stack+0x9c/0xcc
[    0.348134] [<800a40cc>] __clocksource_update_freq_scale+0x264/0x434
[    0.355624] [<800a42dc>] __clocksource_register_scale+0x40/0x174
[    0.362713] [<80000644>] do_one_initcall+0x50/0x1ac
[    0.368490] [<80799ec0>] do_initcalls+0x100/0x14c
[    0.374022] [<8079a104>] kernel_init_freeable+0x188/0x1c4
[    0.380391] [<805ca2a0>] kernel_init+0x10/0x100
[    0.385736] [<80001db8>] ret_from_kernel_thread+0x14/0x1c
[    0.392102]
[    0.393920] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.405554] futex hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.413713] pinctrl core: initialized pinctrl subsystem
[    0.420719] NET: Registered protocol family 16
[    0.436971] intc_map mapping hw-irq 31 linux irq 31
[    0.443337] intc_map mapping hw-irq 23 linux irq 23
[    0.450786] intc_map mapping hw-irq 24 linux irq 24
[    0.457026] intc_map mapping hw-irq 20 linux irq 20
[    0.529293] clocksource: Switched to clocksource MIPS
[    0.537765] NET: Registered protocol family 2
[    0.543221] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.553304] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.563446] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.572585] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.580969] TCP: Hash tables configured (established 1024 bind 1024)
[    0.588844] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.596652] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.605690] NET: Registered protocol family 1
[    0.659255] random: fast init done
[    0.893763] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.909841] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.916653] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.931905] pinctrl-single 1b001000.pinmux: 32 pins, size 4
[    0.939174] pinctrl-single 1b00a000.pinmux: 32 pins, size 4
[    0.946731] Probing RTL8231 GPIOs
[    0.950787] rtl8231_init called, MDIO bus ID: 3
[    0.958418] Probing RTL838X GPIOs for 00008393
[    1.074099] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    1.084096] printk: console [ttyS0] disabled
[    1.089371] 18002000.uart: ttyS0 at MMIO 0x18002000 (irq = 31, base_baud = 12500000) is a 16550A
[    1.099943] printk: console [ttyS0] enabled
[    1.099943] printk: console [ttyS0] enabled
[    1.109906] printk: bootconsole [early0] disabled
[    1.109906] printk: bootconsole [early0] disabled
[    1.331375] brd: module loaded
[    1.336232] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.10.72 #0
[    1.343451] Stack : 80694cdc 80799094 81080000 8007d054 80790000 80695a14 00000000 00000000
[    1.353515]         82023c7c 81080000 8066e0bc 820383b8 80715ba7 00000001 82023c20 bb3ea812
[    1.363574]         00000000 00000000 8066e0bc 82023ab8 ffffefff 00000000 00000000 ffffffea
[    1.373634]         000000a4 82023ac4 000000a4 8071b020 00000000 00000001 00000000 80670000
[    1.383686]         8078c6d4 810b0000 00000000 80799094 00000018 80354704 00000000 81080000
[    1.393746]         ...
[    1.396684] Call Trace:
[    1.399629] [<80006fa4>] show_stack+0x30/0x100
[    1.404960] [<802f9144>] dump_stack+0x9c/0xcc
[    1.410193] [<803a2ca4>] realtek_rtl_spi_probe+0x24/0x140
[    1.416666] [<80366c60>] platform_drv_probe+0x40/0x94
[    1.422719] [<8036494c>] really_probe+0x108/0x4d8
[    1.428350] [<803653cc>] device_driver_attach+0x120/0x130
[    1.434817] [<80365458>] __driver_attach+0x7c/0x13c
[    1.440662] [<803624ac>] bus_for_each_dev+0x68/0xa4
[    1.446497] [<80363ba8>] bus_add_driver+0x1c8/0x210
[    1.452345] [<80365c3c>] driver_register+0x98/0x154
[    1.458190] [<80000644>] do_one_initcall+0x50/0x1ac
[    1.464050] [<80799ec0>] do_initcalls+0x100/0x14c
[    1.469694] [<8079a104>] kernel_init_freeable+0x188/0x1c4
[    1.476160] [<805ca2a0>] kernel_init+0x10/0x100
[    1.481594] [<80001db8>] ret_from_kernel_thread+0x14/0x1c
[    1.488056]
[    1.493815] spi-nor spi0.0: mx25l12805d (16384 Kbytes)
[    1.500169] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.507807] Creating 7 MTD partitions on "spi0.0":
[    1.513678] 0x000000000000-0x000000040000 : "u-boot"
[    1.521190] 0x000000040000-0x000000050000 : "u-boot-env"
[    1.529379] 0x000000050000-0x000000060000 : "u-boot-env2"
[    1.537620] 0x000000060000-0x000000160000 : "jffs"
[    1.545072] 0x000000160000-0x000000260000 : "jffs2"
[    1.553503] 0x000000260000-0x000001000000 : "firmware"
[    1.573114] 0x000000930000-0x000001000000 : "runtime2"
[    1.592077] libphy: Fixed MDIO Bus: probed
[    1.603071] Probing RTL838X switch device
[    1.608016] SOC ID 8393, FAMILY ID 8390
[    1.612703] Chip version A
[    1.616019] rtl83xx_sw_probe calling rtl83xx_mdio_probe
[    1.622362] In rtl83xx_mdio_probe
[    1.626460] Found compatible MDIO node!
[    1.631155] Deferring probe of mdio bus
[    1.635829] rtl83xx_sw_probe returned -517
[    1.640827] rtl83xx_sw_probe Delaying probe for now
[    1.647207] Probing RTL838X eth device pdev: 820d9a00, dev: 820d9a10
[    1.655044] Allocate 4710564 bytes for DMA
[    1.684609] Found SoC ID: 8393: RTL8393, family 8390
[    1.690686] Using MAC 000004bf6d16b069
[    1.695318] rtl838x_mdio_init: looking at port 0
[    1.700974] rtl838x_mdio_init: looking at port 1
[    1.706594] rtl838x_mdio_init: looking at port 2
[    1.712249] rtl838x_mdio_init: looking at port 3
[    1.717875] rtl838x_mdio_init: looking at port 4
[    1.723522] rtl838x_mdio_init: looking at port 5
[    1.729143] rtl838x_mdio_init: looking at port 6
[    1.734815] rtl838x_mdio_init: looking at port 7
[    1.740467] rtl838x_mdio_init: looking at port 8
[    1.746083] rtl838x_mdio_init: looking at port 9
[    1.751739] rtl838x_mdio_init: looking at port 10
[    1.757462] rtl838x_mdio_init: looking at port 11
[    1.763225] rtl838x_mdio_init: looking at port 12
[    1.768948] rtl838x_mdio_init: looking at port 13
[    1.774727] rtl838x_mdio_init: looking at port 14
[    1.780481] rtl838x_mdio_init: looking at port 15
[    1.786199] rtl838x_mdio_init: looking at port 16
[    1.791955] rtl838x_mdio_init: looking at port 17
[    1.797680] rtl838x_mdio_init: looking at port 18
[    1.803425] rtl838x_mdio_init: looking at port 19
[    1.809146] rtl838x_mdio_init: looking at port 20
[    1.814919] rtl838x_mdio_init: looking at port 21
[    1.820679] rtl838x_mdio_init: looking at port 22
[    1.826397] rtl838x_mdio_init: looking at port 23
[    1.832156] rtl838x_mdio_init: looking at port 24
[    1.837878] rtl838x_mdio_init: looking at port 25
[    1.843621] rtl838x_mdio_init: looking at port 26
[    1.849380] rtl838x_mdio_init: looking at port 27
[    1.855109] rtl838x_mdio_init: looking at port 28
[    1.860865] rtl838x_mdio_init: looking at port 29
[    1.866591] rtl838x_mdio_init: looking at port 30
[    1.872344] rtl838x_mdio_init: looking at port 31
[    1.878085] rtl838x_mdio_init: looking at port 32
[    1.883821] rtl838x_mdio_init: looking at port 33
[    1.889510] rtl838x_mdio_init: looking at port 34
[    1.895144] rtl838x_mdio_init: looking at port 35
[    1.900843] rtl838x_mdio_init: looking at port 36
[    1.906477] rtl838x_mdio_init: looking at port 37
[    1.912174] rtl838x_mdio_init: looking at port 38
[    1.917811] rtl838x_mdio_init: looking at port 39
[    1.923509] rtl838x_mdio_init: looking at port 40
[    1.929144] rtl838x_mdio_init: looking at port 41
[    1.934824] rtl838x_mdio_init: looking at port 42
[    1.940528] rtl838x_mdio_init: looking at port 43
[    1.946163] rtl838x_mdio_init: looking at port 44
[    1.951843] rtl838x_mdio_init: looking at port 45
[    1.957476] rtl838x_mdio_init: looking at port 46
[    1.963175] rtl838x_mdio_init: looking at port 47
[    1.968809] rtl838x_mdio_init: looking at port 48
[    1.974492] rtl838x_mdio_init: looking at port 49
[    1.982143] libphy: rtl839x-eth-mdio: probed
[    2.296631] mdio_bus mdio-bus: MDIO device at address 16 is missing.
[    2.305394] mdio_bus mdio-bus: MDIO device at address 17 is missing.
[    2.314144] mdio_bus mdio-bus: MDIO device at address 18 is missing.
[    2.322912] mdio_bus mdio-bus: MDIO device at address 19 is missing.
[    2.331678] mdio_bus mdio-bus: MDIO device at address 20 is missing.
[    2.340448] mdio_bus mdio-bus: MDIO device at address 21 is missing.
[    2.348750] mdio_bus mdio-bus: MDIO device at address 22 is missing.
[    2.357076] mdio_bus mdio-bus: MDIO device at address 23 is missing.
[    2.844633] rtl8393_serdes_probe: id: 48
[    2.849566] Realtek RTL8393 SERDES mdio-bus:30: Detected internal RTL8390 SERDES
[    2.876612] rtl8393_serdes_probe: id: 49
[    2.881448] Realtek RTL8393 SERDES mdio-bus:31: Detected internal RTL8390 SERDES
[    2.897298] NET: Registered protocol family 10
[    2.908381] Segment Routing with IPv6
[    2.913043] NET: Registered protocol family 17
[    2.918929] 8021q: 802.1Q VLAN Support v1.8
[    2.924849] i2c-gpio i2c-gpio-0: Slow GPIO pins might wreak havoc into I2C/SMBus bus timing
[    2.935162] i2c-gpio i2c-gpio-0: using lines 184 (SDA) and 185 (SCL)
[    2.943725] i2c-gpio i2c-gpio-1: Slow GPIO pins might wreak havoc into I2C/SMBus bus timing
[    2.954276] i2c-gpio i2c-gpio-1: using lines 190 (SDA) and 191 (SCL)
[    2.963649] libphy: SFP I2C Bus: probed
[    2.968920] sfp sfp-p9: Host maximum power 1.0W
[    2.976169] libphy: SFP I2C Bus: probed
[    2.981468] sfp sfp-p10: Host maximum power 1.0W
[    2.989326] Probing RTL838X switch device
[    2.994270] SOC ID 8393, FAMILY ID 8390
[    2.998934] Chip version A
[    3.002256] rtl83xx_sw_probe calling rtl83xx_mdio_probe
[    3.008507] In rtl83xx_mdio_probe
[    3.012549] Found compatible MDIO node!
[   24.789222] rcu: INFO: rcu_sched self-detected stall on CPU
[   24.795942] rcu:     0-....: (2099 ticks this GP) idle=b0e/1/0x40000002 softirq=566/566 fqs=1050
[   24.806242]  (t=2100 jiffies g=-659 q=89)
[   24.811039] NMI backtrace for cpu 0
[   24.815211] CPU: 0 PID: 32 Comm: kworker/0:1 Not tainted 5.10.72 #0
[   24.822721] Workqueue: events deferred_probe_work_func
[   24.828872] Stack : 80694cdc 807130e0 8200bcfc 8007d054 8066e0bc 80710000 820cc700 80670000
[   24.838924]         00000000 80710000 80710000 8007d17c 80715ba7 00000001 8200bcb8 bb3ea812
[   24.848975]         00000000 00000000 8066e0bc 8200bb38 ffffefff 00000000 00000000 ffffffea
[   24.859025]         0000012a 8200bb44 0000012a 8071b020 00000000 00000000 00000000 80670000
[   24.869076]         00000000 80710000 80710000 807130e0 00000018 80354704 00000000 81080000
[   24.879128]         ...
[   24.882061] Call Trace:
[   24.885004] [<80006fa4>] show_stack+0x30/0x100
[   24.890339] [<802f9144>] dump_stack+0x9c/0xcc
[   24.895557] [<802ffa98>] nmi_cpu_backtrace+0xf8/0x13c
[   24.901604] [<802ffc30>] nmi_trigger_cpumask_backtrace+0x154/0x184
[   24.909003] [<8008ffe4>] rcu_dump_cpu_stacks+0x128/0x17c
[   24.915362] [<800915d4>] print_cpu_stall+0x1ac/0x26c
[   24.921312] [<800939ec>] check_cpu_stall+0x114/0x28c
[   24.927254] [<800965c8>] rcu_sched_clock_irq+0xc0/0x20c
[   24.933509] [<8009be98>] update_process_times+0xb4/0x110
[   24.939878] [<800ad7c4>] tick_handle_periodic+0x34/0xbc
[   24.946128] [<8000d988>] c0_compare_interrupt+0x80/0x94
[   24.952386] [<80080464>] __handle_irq_event_percpu+0x70/0x1b0
[   24.959267] [<800805c4>] handle_irq_event_percpu+0x20/0x78
[   24.965842] [<80085e00>] handle_percpu_irq+0x88/0xb8
[   24.971805] [<8007fa58>] generic_handle_irq+0x44/0x5c
[   24.977859] [<805cf424>] do_IRQ+0x1c/0x2c
[   24.982664] [<8031561c>] plat_irq_dispatch+0x68/0xf0
[   24.988607] [<800022c8>] except_vec_vi_end+0xb8/0xc4
[   24.994563] [<803cf534>] rtl839x_read_phy+0xb4/0x110
[   25.000521] [<803dc008>] rtl839x_mdio_read+0x3c/0x58
[   25.006474] [<803b0eb0>] __mdiobus_read+0x44/0x134
[   25.012211] [<803b1080>] mdiobus_read+0x40/0x6c
[   25.017636] [<803ae768>] get_phy_device+0x80/0x158
[   25.023375] [<803b073c>] mdiobus_scan+0x44/0x1d8
[   25.028904] [<803b13c8>] __mdiobus_register+0x1d0/0x360
[   25.035164] [<807b2b50>] rtl83xx_mdio_probe+0x13c/0x3e0
[   25.041419] [<807b3194>] rtl83xx_sw_probe+0x3a0/0x858
[   25.047477] [<80366c60>] platform_drv_probe+0x40/0x94
[   25.053527] [<8036494c>] really_probe+0x108/0x4d8
[   25.059158] [<80362558>] bus_for_each_drv+0x70/0xb0
[   25.064999] [<80364f20>] __device_attach+0xe4/0x15c
[   25.070845] [<8036385c>] bus_probe_device+0x9c/0xb8
[   25.076686] [<80363d98>] deferred_probe_work_func+0x90/0xd0
[   25.083368] [<8004508c>] process_one_work+0x208/0x46c
[   25.089421] [<80045afc>] worker_thread+0x360/0x5dc
[   25.095158] [<8004b764>] kthread+0x13c/0x144
[   25.100275] [<80001db8>] ret_from_kernel_thread+0x14/0x1c
[   25.106731]

Interesting. This boots for me...
@svanheule also has a GS1900-48, maybe he can share a .dts that works with master or an image.

Just tried the second switch, and that boots up. Now I need to find a Zyxel image to load and reflash them.
How impossible is to find such files online?

You can flash this: https://famko.zapto.org/s/GxBiASea7s9eRQ3 it has luci. But beware of the strange initial network configuration requiring a vlan set up on your workstation. Alternatively go in via the serial line and set it up differently.

Maybe later this week, bit busy with work and some other patches at the moment. Didn't you have a GS1900-48 DTS from long ago? Maybe that can more easily be reworked for master. I tested my WDT driver, and that works to restart the device, so the RTL838x DTS should work (sans the networking and pinctrls) @Peppino, you can always try spinning up an OpenWrt build environment for a quick learning experience :wink:

2 Likes