PINE64
Managed Ethernet switch on the Clusterboard - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64-LTS / SOPINE Compute Module (https://forum.pine64.org/forumdisplay.php?fid=66)
+--- Forum: Clusterboard (https://forum.pine64.org/forumdisplay.php?fid=91)
+--- Thread: Managed Ethernet switch on the Clusterboard (/showthread.php?tid=13181)



Managed Ethernet switch on the Clusterboard - dsimic - 02-20-2021

Hello,

The switch ASIC used on the Clusterboard is Realtek RTL8370N, which the wiki page declares as an unmanaged switch ASIC.  However, this switch ASIC actually includes all of the necessary logic to work as a managed switch, with a pretty complete feature set.  It also has a built-in Intel 8051, which can be used to implement a management interface.

As a confirmation, the RTL8370N ASIC is used in the D-Link DGS-1100-08, which is a managed Ethernet switch.  This D-Link switch includes no other management-related components, only the RTL8370N ASIC.

I am willing to work on implementing the required management interface and other software support, which would turn the RTL8370N into a managed Ethernet switch.  IMHO, that would be great, but it would require an SDK that can only be provided by Realtek.

@tllim, would you be able to provide the above-described SDK, please?


RE: Managed Ethernet switch on the Clusterboard - renze - 07-22-2021

This might be usefull information: https://github.com/libc0607/Realtek_switch_hacking
(Translated: https://github-com.translate.goog/libc0607/Realtek_switch_hacking?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=nl&_x_tr_pto=ajax,elem)


RE: Managed Ethernet switch on the Clusterboard - renze - 07-23-2021

I've dumped the contents of the EEPROM chip attached to the RTL8370N on the Clusterboard (using a SoPine on the Clusterboard itself Smile ).

The EEPROM appears to contain a series of register writes which the chip executes directly after starting from reset state. I've parsed the register writes that are executed into a table and I've documented what I did here: https://github.com/renzenicolai/uboot-pine64-clusterboard-instructions/tree/master/Ethernet%20switch

I suspect that configuring VLANs could be as easy as adding extra register writes to the EEPROM and resetting the ethernet switch chip.


RE: Managed Ethernet switch on the Clusterboard - renze - 07-25-2021

New day, new progress: I've made an editor for the EEPROM contents, which I will be improving over the next weeks. It can be found here: https://rtl8370.renzenicolai.nl/


RE: Managed Ethernet switch on the Clusterboard - dsimic - 07-28-2021

(07-22-2021, 06:09 PM)renze Wrote: This might be usefull information: https://github.com/libc0607/Realtek_switch_hacking
(Translated: https://github-com.translate.goog/libc0607/Realtek_switch_hacking?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=nl&_x_tr_pto=ajax,elem)

I've seen that GitHub repository quite a while ago, and the information available there is very useful.  I've also stumbled upon the source code of a Realtek "unmanaged switch" SDK (as Realtek called it), but that SDK unfortunately didn't contain the source code and the "magic blob" that's apparently required to turn RTL8370N into a managed switch, by enabling the built-in 8051 CPU, etc.

(07-23-2021, 05:34 PM)renze Wrote: I've dumped the contents of the EEPROM chip attached to the RTL8370N on the Clusterboard (using a SoPine on the Clusterboard itself Smile ).

The EEPROM appears to contain a series of register writes which the chip executes directly after starting from reset state. I've parsed the register writes that are executed into a table and I've documented what I did here: https://github.com/renzenicolai/uboot-pine64-clusterboard-instructions/tree/master/Ethernet%20switch

I suspect that configuring VLANs could be as easy as adding extra register writes to the EEPROM and resetting the ethernet switch chip.

This is very interesting!  However, please keep in mind that my original idea wasn't to create a "hacky" solution that configures VLANs through external register writes and "hacky" stuff like that.  Please, don't get me wrong, that's perfectly fine for some use cases, but my original idea was to create a feature-complete open-source firmware for RTL8370N, which would run on the built-in 8051 and be capable of accepting SSH connections and presenting a command-line interface that would allow all features of RTL8370N to be managed, port statistics to be collected, etc.


RE: Managed Ethernet switch on the Clusterboard - hazcam - 01-16-2024

Hi,

Was anyone successful in finding or writing a managed switch running on 8051 for the RTL8370 as I would like to implement this. If it has not been done yet, is anyone interested in contributing to this project


RE: Managed Ethernet switch on the Clusterboard - hazcam - 01-16-2024

Hi,

Has anyone achieved this yet

"create a feature-complete open-source firmware for RTL8370N, which would run on the built-in 8051 and be capable of accepting SSH connections and presenting a command-line interface that would allow all features of RTL8370N to be managed, port statistics to be collected, etc. "