Realtek PoE LEDs not working

I have been probing a D-link-dgs PoE board and concluded that the LEDs probably never will work without some implementation of LED control in the realtek poe daemon. On this device there is no connection between the PoE MCU and the shift registers driving the LEDs. The only way the PoE MCU can communicate with anything outside the PoE board seems to be trough the UART. Maybe all devices where PoE status LEDs are working use shift registers directly connected to the PoE MCU while those that don’t work rely on external software?

To test the concept of software control I have mapped the possible PoE port statuses to a “LED status” according to this:

[0] = "Disabled", = 0x00
[1] = "Searching", = 0x00
[2] = "Delivering power", =0x05
[4] = "Fault", =0x28
[5] = "Other fault", =0x28
[6] = "Requesting power", =0x04

and then manually set the LED_SW_P_p_CTRL registers to one of these values for port “p” according to svanheules (https://svanheule.net/switches/led_control#port_led_user_control) very impressive documentation. The values above work on the D-link-dgs series but probably needs to be read from some config file to work on all targets.

I can toggle led user control on/off by setting LED_n_SW_P_EN_CTRL and the LEDs then switch between showing Link activity and the set PoE-status above.
So, if the realtek poe-daemon could set the LED_SW_P_p_CTRL after polling port status this would work? Or is this a totally stupid idea?

I have a lot to learn before I can solve this myself so I just want to have some input on this.

AFAIK, all what you said is about right and has been known for quite some time. Unfortunately, the Realtek-thread isn't exactly easy to read.

That said, the main problem is that the realtek target is still missing, among other things, a proper LED driver. There has been work by numerous people to fix that, but nothing has landed in the git tree. See the following PR for an example:

I doubt that realtek-poe is going to implement a hack by using the debug registers to add LED control. There has also been some work in the realtek-poe repo:

2 Likes

Thank you, i didn't see that a driver was under development. That is of course the proper solution, just didn't thought someone would make the effort. Thanks to everyone involved in that.

Then i just wait for the driver and in the meanwhile i can implement the hack with a shell script, at least the LEDs will be correct every time i press the mode button.