]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: rtl9303: enable PSE on Hasivo S600WP-5GT-2SX-SE 22245/head
authorCarlo Szelinsky <github@szelinsky.de>
Sat, 18 Jul 2026 14:52:34 +0000 (16:52 +0200)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 21 Jul 2026 16:59:27 +0000 (18:59 +0200)
Wire the HS104 controller (0x0d) on the PSE i2c-gpio bus and attach the
four PoE PHYs (lan1-4) via PHY_C45_PSE; lan5 is not PoE. Add the STC8 LED
MCU (0x4d) with per-port PoE LED triggers, and pull the HS104 PSE and STC8
kmods into the image.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/realtek/dts/rtl9303_hasivo_s600wp-5gt-2sx-se.dts
target/linux/realtek/image/rtl930x.mk

index 2aedd7ec8541dc06cd4cbfa58c6e3762078d2251..41a894d57c403819ea660ce30026391812bb4c9d 100644 (file)
@@ -22,6 +22,9 @@
                led-running = &led_sys;
                led-upgrade = &led_sys;
                label-mac-device = &ethernet0;
+               i2c0 = &i2c_scl23_sda22;
+               i2c1 = &i2c_sfp0;
+               i2c2 = &i2c_sfp1;
        };
 
        chosen {
                            (RTL93XX_LED_SET_NONE)>;
        };
 
-       /*
-        * TODO: I2C bus to the on-board HS104 PSE controller (PoE).
-        * Defined here for documentation/future use; currently unused
-        * because PSE/PoE support for this board is not yet wired up.
-        */
+       /* I2C bus to the on-board HS104 PSE controller (PoE) and STC8 LED MCU. */
        i2c_scl23_sda22: i2c-scl23-sda22 {
                compatible = "i2c-gpio";
                #address-cells = <1>;
 
                scl-gpios = <&gpio0 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                sda-gpios = <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+               clock-frequency = <100000>;
+
+               pse0: ethernet-pse@d {
+                       compatible = "hasivo,hs104";
+                       reg = <0x0d>;
+                       poll-interval-ms = <500>;
+                       status = "okay";
+
+                       pse-pis {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               pse0_pi0: pse-pi@0 {
+                                       reg = <0>;
+                                       #pse-cells = <0>;
+                               };
+                               pse0_pi1: pse-pi@1 {
+                                       reg = <1>;
+                                       #pse-cells = <0>;
+                               };
+                               pse0_pi2: pse-pi@2 {
+                                       reg = <2>;
+                                       #pse-cells = <0>;
+                               };
+                               pse0_pi3: pse-pi@3 {
+                                       reg = <3>;
+                                       #pse-cells = <0>;
+                               };
+                       };
+               };
+
+               stc8: stc8@4d {
+                       compatible = "hasivo,stc8-mfd", "syscon";
+                       reg = <0x4d>;
+                       #address-cells = <2>;
+                       #size-cells = <0>;
+                       hasivo,execute-bit = <0x40>;
+                       hasivo,execute-bit-registers = <0x01 0x02>;
+                       status = "okay";
+
+                       led_lan1_poe: led@1,0 {
+                               compatible = "register-bit-led";
+                               reg = <0x01 0x00>;
+                               mask = <0x08>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <1>;
+                               linux,default-trigger = "pse-0-000d:port0:delivering";
+                               default-state = "off";
+                       };
+
+                       led_lan2_poe: led@1,1 {
+                               compatible = "register-bit-led";
+                               reg = <0x01 0x01>;
+                               mask = <0x04>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <2>;
+                               linux,default-trigger = "pse-0-000d:port1:delivering";
+                               default-state = "off";
+                       };
+
+                       led_lan3_poe: led@1,2 {
+                               compatible = "register-bit-led";
+                               reg = <0x01 0x02>;
+                               mask = <0x02>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <3>;
+                               linux,default-trigger = "pse-0-000d:port2:delivering";
+                               default-state = "off";
+                       };
+
+                       led_lan4_poe: led@1,3 {
+                               compatible = "register-bit-led";
+                               reg = <0x01 0x03>;
+                               mask = <0x01>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <4>;
+                               linux,default-trigger = "pse-0-000d:port3:delivering";
+                               default-state = "off";
+                       };
+               };
        };
 
        i2c_sfp0: i2c-sfp0 {
 
 &mdio_bus0 {
        /* External RTL8221B PHYs */
-       PHY_C45(0, 1)
-       PHY_C45(8, 2)
-       PHY_C45(16, 3)
-       PHY_C45(20, 4)
+       PHY_C45_PSE(0, 1, pse0_pi0)
+       PHY_C45_PSE(8, 2, pse0_pi1)
+       PHY_C45_PSE(16, 3, pse0_pi2)
+       PHY_C45_PSE(20, 4, pse0_pi3)
 };
 
 &mdio_bus1 {
index a5313eaeac11d8700108f3c76edc188e4899797d..5d06c587064b8ce92e3a2e4b6dc3e1a98636ae0b 100644 (file)
@@ -76,6 +76,7 @@ define Device/hasivo_s600wp-5gt-2sx-se
   SOC := rtl9303
   DEVICE_VENDOR := Hasivo
   DEVICE_MODEL := S600WP-5GT-2SX-SE
+  DEVICE_PACKAGES := kmod-pse-hasivo-hs104 kmod-mfd-hasivo-stc8
   IMAGE_SIZE := 12288k
   $(Device/kernel-lzma)
 endef