Open DjordjeMandic opened 11 months ago
@DjordjeMandic thanks for the suggestion. Actually, I've been also thinking about extending the offer of supported switch chips. I'll investigate.
@DjordjeMandic are you aware if any devbaord of RTL8306MB exists? It could potentially ease development otherwise custom board would have to be designed...
@kostaond it does not afaik. Currently biggest issue is that I just cannot find datasheet that contains description of registers for both RTL8304MB or RTL8306MB.
RTL8306E-CG seems to have well documented datasheet but its little bit different(2x RMII) https://www.lcsc.com/product-detail/Ethernet-ICs_Realtek-Semicon-RTL8306E-CG_C129792.html https://datasheet.lcsc.com/lcsc/1808291248_Realtek-Semicon-RTL8306E-CG_C129792.pdf
Maybe there is something on https://csdn.net/
@DjordjeMandic Hey. Were you unable to find the datasheet at the moment? I have same chip in one project and have the same problem. Link from lcsc.com not works for me, unfortunately. I use this as a reference datasheet and tried to check out registers manually, with gdb. First 5-or-6 registers have been the same as reference, but another values turned out to be different
I put this project on the hold for now because of missing documentation and free time.
Alternative that I found promising is Realtek-Unmanaged-Switch-Arduino-Library. Realtek_switch_hacking is good place to start. You might be able to find some useful info there.
Are you trying just to connect it and configure it as unmanaged or you're trying to use all of the features in it?
Gigabit ones have 8051 in them for managing(web interface and etc) but there is no RMII, only MII. (I don't know a lot about MII interface but I guess MII is pretty easy to implement but uses a lot of gpio. On other hand small cheap FPGA can bridge MII or even SMII from switch to RMII on ESP32)
@DjordjeMandic thanks for reply. I'll study carefully into the links soon.
I trying to connect rtl8304mb to MCU with RMII for work with 2 ports. At the first view all works fine, but connection does not establish. And status register have 0 bit in Link Status.
I have found this project which includes realtek switch driver today. It contains some interesting addresses, which does not described in realtek datasheets. Additionally it have defines for RTL8305MB.
@DjordjeMandic Hey. I have done work with the switch. Driver code from https://github.com/lloves/RTL8309M-RK3288-KERNEL-3.4 has been working fine for my purpose. In my free time I could try to contribute my results to the project. But unfortunately I don't have experience with ESP-IDF previously and I isn't having any ESP's chip at this moment, for testing. My project target MCU was Gigadevice.
That's awesome, at least we have confirmed info so porting should be easy. Does vlan tagging and untagging work?
That's awesome, at least we have confirmed info so porting should be easy. Does vlan tagging and untagging work?
Yes. SDK API pdf at the link contains description for vlan functions of the driver. I used the default vlan config where PVID is 1 for all ports
I see good use for KSZ8863 driver. Similar driver for RTL8306MB would be nice because it is low cost and available and supports 100BASE-FX. Lot of 10/100M media converters use this chip. I see good use for integrated media converter and switch that also provides ethernet to ESP32. This is just cross post of IDFFGH-9043 because it doesn't belong there.