Support for RTL838x based managed switches

There is now a pull request to add RTL838x support into OpenWRT master:


Would be cool if people could have a look and review a bit.
6 Likes

That's fine, I don't seriously expect them to be capable VPN servers. I do, however, expect them to do some sort of QoS or at least SQM, same as I would expect from an external router.

Fingers crossed for your pull request.

This is exciting!!! I have a Zyxel GS1900 16 port and I'm looking forward to running OpenWrt on it. Your project will make an open switch way more accessible to many more people. I've been looking for an open switch for a while now but it seems like all the other projects require expensive or niche hardware. Thanks for the excellent work!!!

2 Likes

Thanks to the support of so many of the OpenWRT developers, the patch just got committed to master.
Enjoy!

8 Likes

Thanks a bunch! I see the actual device support code has been split out (barring one)? I suppose the devs asked for that for the target to be merged?

Yep. The .dts needed to be really clean.
Also some userspace support code did not make it in. Like PoE.

1 Like

No cigar… I soldered the console pins but it's completely silent. I noticed there are two missing resistors in the connector path, as you see in the photo:

I tried to connect directly to the SoC with two external (4.7k) resistors, but also no luck. I see no other choice aside from directly dumping the SPI, but I'm open to suggestions. :confused:

1 Like

The switch definitely is based on an RTL83xx SoC, the layout and the RTL8231 companion chip look very familiar. But the firmware is suspiciously small and does not seem to be a uimage, or is encrypted. It could be an RTL8370N based switch. Those usually dont have a UART and have an internal 8051 processor:
https://biot.com/switches/dgs-1100_series
There is a datasheet for the 8370 processor as well as the 838x, maybe you can identify the chip by the pinout.

Congratulations on bringing another target to OpenWrt! Will you go on and add the devices? Absolutely no pressure, of course. It's just that support for 8 and especially 16 port switches is, in my opinion, one of the most exciting developments in recent memory.

4 Likes

Yes. There is more to come. The devices will follow. Often there are things like proper button support, installation via the OEM web-interface or led configuration missing, as the focus was to get the kernel drivers done, not perfect device support. If you have one of these devices you could take the .dts and few makefile lines from the repository mentioned above, do the finer testing and submit a patch yourself.
At the moment, the focus is on getting the kernel drivers cleaned up and refactored, biot and blogic want to get an rtl83xx architecture as fast as possible into Linux mainline. There is also support for the RTL839x nearly ready. What has been merged to OpenWRT will already boot on any of those devices with 28 to 52 ports. I have a booting Zyxel GS1900-48 with all 50 ports working nicely. What is missing is VLAN and other L2 stuff. And a concept for .dts files in that case: The one for the Zyxel is over 600 lines long because of all the ports repeating over and over.

3 Likes

No, it's definitely based on the RTL8380M, I'm quite sure of that. This is not a "stupid" switch at all:

There's the possibility this system is running VxWorks, or something like that, yes. I wouldn't call an 64 Mib SPI flash "small", though, it's more than enough for OpenWrt. :wink:

EDIT: Meanwhile, I found this:thinking:

EDIT 2: Ok, it's definitely VxWorks, but the utility I found doesn't know what to do with the firmware image. Rats.

Also RTL8370 based switches can have a web-interface.
Irrespective of the chip being 838x or a 7x, they both have an SPI or I2C interface for reading registers.
Maybe the header is for that purpose. With the datasheets available you can check what pins it is connected to. With 8Myte flash you could get it to run OpenWRT, indeed

from 8-10 port devices... which ones offer the best specs...? one or two with POE would be good too... price is not an issue... ( if 8-10 port good spec devices are limited 16-24 are fine too )... need a POE sw.. so.. should be able to help with adding support / testing...

supplimentary question... do any in this class have USB...? dont think so?

EDIT: ALLNET hard to source in AU...

this is close(or something like it:
Netgear GS110TP

the earlier support for the toughswitch/edgeswitch is very close too.. although they are a little pricey and under specced...

HPE OfficeConnect 1820 Gigabit 8 Port (4x PoE+ 65W) Web Managed Switch - (4) RJ-45 autosensing 10/100/1000 PoE+ ports, (4) RJ-45 autosensing 10/100/1000 ports - Memory and processor: ARM Cortex-A9 @ 400 MHz, 128 MB SDRAM, Packet buffer size: 1.5 MB, 16 MB flash

and another interesting device... no idea what SOC' tho'

1 Like

Could you add your device to the wiki at https://biot.com/switches/start ?
Ask biot for write access. This sounds like a very cool hacking target. If you are able to read and write the flash directly with e.g. a clamp, you could save the flash content and simply try to flash u-boot code for the 838x in case it is one of those SoCs.

Have a look at biot's wiki, there is an overview of what is known about RTL83xx based switches.
The big newer ones have USB, not that it is at present supported by OpenWRT. PoE is usually pricey. The cheapest 8-port device so far is the ALLNET SG8208M for <70Euros.

1 Like

Finally, the support for RTL839x based switches is done:

and 50 ports, including 2 SFP fibre ports are working:

The experimental code is here:


I'll start sending PR for the support of the Netgear GS1900-48 into OpenWRT master in the next days.
12 Likes

hi @anon13997276
Thank you for your work
i realy look for this in hope to replace some crapy factory FW which does not allow to disable Vlan1 on ports, or to make MGMN interface on another Vlan...etc
Before i start to experiment with your releases, i like to ask, what is the status of DSA?
I see on your picture that you using kernel v5.x so i assume it is new DSA approach

tnx

Yes, the network driver uses DSA with the features provided in the 5.x kernels and thus is based on switchdev for switch handling. It does not support the swconfig interface. You will need to use the brctrl, bridge, tc and ip command line utilities to configure the interfaces, vlans and mirroring. The code has seen very little testing in this area, so "experimenting" with it is the right thing to do.

1 Like

Hopefully not a totally dweeb question.
Reading through this - - - - - am I understanding correctly that I could run a L3 level managed switch using OpenWRT?

(Corollary question - - - - is all the other software there so this is like a complete managed switch software package?)

That isn't a dweeb question at all, but a very good one! The answer is: in principle yes.

The RTL838x and 839x based switches are marketed as L2+ switches and have some L3 routing functionality, the 9x based ones a bit more than the 8x ones (whatever L3 VPN MPLS is, while the 8x can do PTP in hardware it seems). But: Even the L2 kernel code hasn't seen any serious testing and the L3 kernel code hasn't been started. On the plus side: there is sufficient documentation in GPL dumps to get this done. Finally, there is also the issue with userspace tools, namely there's no fancy GUI.

So this is the time to give the code a good shakedown. There's a bunch of very determined people who would like to get all the features supported and push this up into Linux mainline.

2 Likes