]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: rtl9313: enable PSE on Hasivo S1300WP-8XGT-4S+
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:26 +0000 (18:59 +0200)
Wire the two HS104 controllers (0x0d/0x15) on the i2c_sys bus and attach
the 8 PoE PHYs via PHY_C45_PSE. Add the STC8 LED MCU (0x4d) with per-port
PoE LED triggers, enable LEDS_SYSCON, and pull the 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/rtl9313_hasivo_s1300wp-8xgt-4s-plus.dts
target/linux/realtek/image/rtl931x.mk
target/linux/realtek/rtl931x/config-6.18

index 8f6cdf4627c9ffc9ba193db492c235533f39ac36..9621fde91cbcfa71d03ccf15f2de20380badc0f7 100644 (file)
@@ -23,6 +23,7 @@
                led-failsafe = &led_sys;
                led-running = &led_sys;
                led-upgrade = &led_sys;
+               i2c0 = &i2c_sys;
        };
 
        chosen {
                                compatible = "hasivo,mcu-sensor";
                        };
                };
+
+               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>;
+                               };
+                       };
+               };
+
+               pse1: ethernet-pse@15 {
+                       compatible = "hasivo,hs104";
+                       reg = <0x15>;
+                       poll-interval-ms = <500>;
+                       status = "okay";
+
+                       pse-pis {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               pse1_pi0: pse-pi@0 {
+                                       reg = <0>;
+                                       #pse-cells = <0>;
+                               };
+                               pse1_pi1: pse-pi@1 {
+                                       reg = <1>;
+                                       #pse-cells = <0>;
+                               };
+                               pse1_pi2: pse-pi@2 {
+                                       reg = <2>;
+                                       #pse-cells = <0>;
+                               };
+                               pse1_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";
+                       };
+
+                       led_lan5_poe: led@2,0 {
+                               compatible = "register-bit-led";
+                               reg = <0x02 0x00>;
+                               mask = <0x08>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <5>;
+                               linux,default-trigger = "pse-0-0015:port0:delivering";
+                               default-state = "off";
+                       };
+
+                       led_lan6_poe: led@2,1 {
+                               compatible = "register-bit-led";
+                               reg = <0x02 0x01>;
+                               mask = <0x04>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <6>;
+                               linux,default-trigger = "pse-0-0015:port1:delivering";
+                               default-state = "off";
+                       };
+
+                       led_lan7_poe: led@2,2 {
+                               compatible = "register-bit-led";
+                               reg = <0x02 0x02>;
+                               mask = <0x02>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <7>;
+                               linux,default-trigger = "pse-0-0015:port2:delivering";
+                               default-state = "off";
+                       };
+
+                       led_lan8_poe: led@2,3 {
+                               compatible = "register-bit-led";
+                               reg = <0x02 0x03>;
+                               mask = <0x01>;
+                               color = <LED_COLOR_ID_ORANGE>;
+                               function = "poe";
+                               function-enumerator = <8>;
+                               linux,default-trigger = "pse-0-0015:port3:delivering";
+                               default-state = "off";
+                       };
+               };
        };
 
        leds {
                #size-cells = <0>;
                reg = <0>;
 
-               PHY_C45(0,  0)
-               PHY_C45(8,  1)
-               PHY_C45(16, 2)
-               PHY_C45(24, 3)
+               PHY_C45_PSE(0,  0, pse0_pi0)
+               PHY_C45_PSE(8,  1, pse0_pi1)
+               PHY_C45_PSE(16, 2, pse0_pi2)
+               PHY_C45_PSE(24, 3, pse0_pi3)
        };
 };
 
                #size-cells = <0>;
                reg = <4>;
 
-               PHY_C45(32, 4)
-               PHY_C45(40, 5)
-               PHY_C45(48, 6)
-               PHY_C45(50, 7)
+               PHY_C45_PSE(32, 4, pse1_pi0)
+               PHY_C45_PSE(40, 5, pse1_pi1)
+               PHY_C45_PSE(48, 6, pse1_pi2)
+               PHY_C45_PSE(50, 7, pse1_pi3)
        };
 };
 
index c3a49385324e98661f19dfbbcb107be56e583d8f..083144c3a868c146a7533d365ef72af07c04e5f3 100644 (file)
@@ -18,7 +18,8 @@ define Device/hasivo_s1300wp-8xgt-4s-plus
   DEVICE_MODEL := S1300WP-8XGT-4S+
   IMAGE_SIZE := 29696k
   DEVICE_PACKAGES := kmod-phy-realtek kmod-rtc-pcf8563 rtl826x-firmware \
-                    kmod-hasivo-mcu-wdt kmod-hasivo-mcu-sensor
+                    kmod-hasivo-mcu-wdt kmod-hasivo-mcu-sensor kmod-pse-hasivo-hs104 \
+                    kmod-mfd-hasivo-stc8
   $(Device/kernel-lzma)
 endef
 TARGET_DEVICES += hasivo_s1300wp-8xgt-4s-plus
index 835bce939272e43917e8cf12cdecf0b7ed988178..2d4a29badff7038839c9ca905cbb881173cd59f8 100644 (file)
@@ -115,6 +115,7 @@ CONFIG_JFFS2_ZLIB=y
 CONFIG_KMAP_LOCAL=y
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_RTL8231 is not set
+CONFIG_LEDS_SYSCON=y
 CONFIG_LIBFDT=y
 CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_MACH_REALTEK_RTL=y