Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support for RTL830xMB (RTL8304MB/RTL8306MB) (IDFGH-11144) #17

Open
DjordjeMandic opened this issue Sep 27, 2023 · 9 comments
Assignees

Comments

@DjordjeMandic
Copy link

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.

@github-actions github-actions bot changed the title [Feature Request] Support for RTL830xMB (RTL8304MB/RTL8306MB) [Feature Request] Support for RTL830xMB (RTL8304MB/RTL8306MB) (IDFGH-11144) Sep 27, 2023
@kostaond
Copy link
Collaborator

@DjordjeMandic thanks for the suggestion. Actually, I've been also thinking about extending the offer of supported switch chips. I'll investigate.

@kostaond
Copy link
Collaborator

@DjordjeMandic are you aware if any devbaord of RTL8306MB exists? It could potentially ease development otherwise custom board would have to be designed...

@DjordjeMandic
Copy link
Author

DjordjeMandic commented Sep 27, 2023

@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/

@alexgoto
Copy link

@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

@DjordjeMandic
Copy link
Author

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)

@alexgoto
Copy link

alexgoto commented Mar 19, 2024

@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.

image

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.

@alexgoto
Copy link

alexgoto commented May 3, 2024

@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.

@DjordjeMandic
Copy link
Author

That's awesome, at least we have confirmed info so porting should be easy. Does vlan tagging and untagging work?

@alexgoto
Copy link

alexgoto commented May 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants