Bringing support for realtek-poe to mainline OpenWrt

Someone was looking into this recently, as in two days ago:

1 Like

I was hoping that the presence of some additional chips on the board would give a clue as to whether or not I2C was used vs UART. I have a ZyXEL GS2210-8HP that has an ADuM1250 Dual I2C Isolator which I was suspecting might be an indicator that it used I2C to communicate with the STMicro STM32F100.

The GS2210 series uses the same firmware as the GS1920 series. At least according to the switch wiki. Since the GS1920-24HP uses I2C, I think it's likely that the GS2210 will do so too.

One thing to bear in mind, is that the BCM591xx PSE chips also use I2C to communicate with the MCU. The power domain isolation on a board could be placed between the SoC and MCU, or between MCU and PSE chips.

1 Like

If the Soc is using I2C to talk to the MCU shouldn't the MCU show up somewhere when using i2cdetect similar to what you found on the Unifi Switch Lite 16 PoE?

It should show up, yes. As long as you can provide a driver for the I2C master, at least. I'll have to update the PoE overview page too, as I've listed the USW Lite 16 PoE as using UART. Somehow I had a trace file titled "UART", but the (my) device documentation clearly says I2C...

@andyboeh Hey there -- RE: your i2c address mapping, this is the best thread to chat about using upcoming upstream device-tree syntax and bindings to map PSEs between i2c pins and ports.

Here was my initial throw on the ZyXEL GS1900-24HPv1 -- I know that it was torn apart a bit by others (@svanheule?): https://paste.c-net.org/RoundOutfit

I feel like the individual pse_lan nodes may be missing important information. For example does the node support PoE, PoE+ or PoE++? Some switches do have split support for some PoE nodes and some PoE+ nodes and I imagine that will also be true for PoE++.

Thanks, I completely forgot about this thread!
Shifting the mapping to the dts is a nice solution that should reduce the complexity and maintenance burden of the daemon(s). With my TI TPS ICs it's a bit special, since there is already a driver, but it's a hwmon driver. They are already in the dts with status = "disabled";, the only missing bit in my case is mapping those to LAN ports.
In the long the hwmon driver might be dropped in favor of a newer PSE-framework-based driver that is yet to be developed.

@stamatov My realtek-poe binary was still based on the 2022-07-19 codebase, I've uploaded a newer one which is based on the latest code (2022-08-28).

1 Like

We've set github to automagically build packages on PRs and merges:

1 Like

Even better. Also for 22.03?

Those master / snapshot packages 'currently' install and work fine on 22.03.

That is more of an accident, than intentional or guaranteed and can break after larger library updates in master (which may happen any day).

1 Like

True but hopefully realtek-poe will be backported to 22.03 when bigger incompatible changes to master/snapshot happen. But for testing it is workable right now, just download and intall a single package no dependencies and have functional PoE.

We can ask to submit realtek-poe as a package for 22.03, not just master. Not sure what the policy is on that.

We need a way to take the PoE info in /etc/board.json and generate a /etc/config/poe. Any takers?

Its a bit late for 22.03

Anyone can helps me to configure realtek poe on OpenWrt 22.03.2.
I have ZyXEL GS1900-8HP v2 Switch and I installed @Borromini package https://drive.proton.me/urls/3FR6AJR8BR#0mYGDBQaHeLS
I can't find any documentation how it works?
What am I missing, please? I have 4 raspberry Pi 4B on port 1,2, 3, 4.
option budget was tried to change from 170 to 70 or 77, no different

root@zyxel-gs1900-8-v2:~# cat /etc/config/poe
config global
        option budget   '170'

config port
        option enable   '1'
        option id       '1'
        option name     'lan1'
        option poe_plus '1'
        option priority '2'
root@zyxel-gs1900-8-v2:~# ubus call poe info
{
        "firmware": "v80.1",
        "budget": 170.000000,
        "consumption": 0.000000,
        "ports": {
                "lan1": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                }
        }
}

With your config just one port (lan1) should come up, you need to configure every port separately. The following works on my 8HP (v1):

config global
	option budget	'70'

config port
	option enable	'1'
	option id	'1'
	option name	'lan1'
	option poe_plus	'1'
	option priority	'2'

config port
        option enable   '1'
        option id       '2'
        option name     'lan2'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '3'
        option name     'lan3'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '4'
        option name     'lan4'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '5'
        option name     'lan5'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '6'
        option name     'lan6'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '7'
        option name     'lan7'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '8'
        option name     'lan8'
        option poe_plus '1'
        option priority '2'
1 Like

ok, now change the config with yours without port 8 but is the same

root@zyxel-gs1900-8-v2:~# ubus call poe info
{
        "firmware": "v80.1",
        "budget": 70.000000,
        "consumption": 0.000000,
        "ports": {
                "lan1": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan2": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan3": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan4": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan5": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan6": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan7": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                }
        }
}
root@zyxel-gs1900-8-v2:~# ubus call poe info
{
        "firmware": "v80.1",
        "budget": 70.000000,
        "consumption": 0.000000,
        "ports": {
                "lan1": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan2": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan3": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan4": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan5": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan6": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                },
                "lan7": {
                        "priority": 2,
                        "mode": "PoE+",
                        "status": "Searching"
                }
        }
}

The name of the interfaces are

Why without port 8?

Anyway, IIRC there was a recent discussion on probably different PoE controllers in the v2, so it might just not be supported.

EDIT: Sorry, the discussion was about the 10HP rev. B1. It shoudl just work on the 8HPv2.