]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: rtl930x: add STC8 MCU support for Hasivo F1100W/WP-4SX-4XGT
authorLars Gierth <larsg@systemli.org>
Sun, 9 Aug 2026 14:44:16 +0000 (16:44 +0200)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 11 Aug 2026 20:20:13 +0000 (22:20 +0200)
This MCU is present on most Hasivo devices and controls basic things
such as watchdog, sensor, and RTC if available.
On devices with PoE PSE support, it also controls the PSE chip and LEDs.

One funny detail is that while the watchdog is present on most Hasivo devices
and (unless armed) resets the whole device, here it only resets the PoE LEDs.
The PoE LEDs reset and blink twice every 75s, even if PoE is unmanaged or off.

Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/24643
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/realtek/dts/rtl9303_hasivo_f1100w-4sx-4xgt-common.dtsi
target/linux/realtek/image/rtl930x.mk

index 99f5b24d09c1c101b99a91b586e7c53601ae5e93..089480af622678136079d19c43e7a6e854db123d 100644 (file)
                led-failsafe = &led_sys;
                led-running = &led_sys;
                led-upgrade = &led_sys;
+
+               /* Pin the STC8 to i2c0 so the PoE pse-0-* LED triggers bind. */
+               i2c0 = &i2c_stc8;
+               i2c1 = &i2c_sfp0;
+               i2c2 = &i2c_sfp1;
+               i2c3 = &i2c_sfp2;
+               i2c4 = &i2c_sfp3;
        };
 
        chosen {
                >;
        };
 
+       /* I2C bus to the STC8 MCU, which controls watchdog, sensor, and PoE. */
+       i2c_stc8: i2c-gpio {
+               compatible = "i2c-gpio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               scl-gpios = <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+               sda-gpios = <&gpio0 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+               clock-frequency = <100000>;
+
+               stc8: stc8@6e {
+                       compatible = "hasivo,stc8-mfd", "syscon";
+                       reg = <0x6e>;
+                       #address-cells = <2>;
+                       #size-cells = <0>;
+                       hasivo,execute-bit = <0x40>;
+                       hasivo,execute-bit-registers = <0x01 0x02>;
+                       status = "okay";
+
+                       watchdog {
+                               compatible = "hasivo,mcu-wdt";
+                       };
+
+                       sensor {
+                               compatible = "hasivo,mcu-sensor";
+                       };
+               };
+       };
+
        sfp0: sfp-p1 {
                compatible = "sff,sfp";
-               i2c-bus = <&i2c0>;
+               i2c-bus = <&i2c_sfp0>;
                mod-def0-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
                #thermal-sensor-cells = <0>;
        };
 
        sfp1: sfp-p2 {
                compatible = "sff,sfp";
-               i2c-bus = <&i2c1>;
+               i2c-bus = <&i2c_sfp1>;
                mod-def0-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
                #thermal-sensor-cells = <0>;
        };
 
        sfp2: sfp-p3 {
                compatible = "sff,sfp";
-               i2c-bus = <&i2c2>;
+               i2c-bus = <&i2c_sfp2>;
                mod-def0-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
                #thermal-sensor-cells = <0>;
        };
 
        sfp3: sfp-p4 {
                compatible = "sff,sfp";
-               i2c-bus = <&i2c3>;
+               i2c-bus = <&i2c_sfp3>;
                mod-def0-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
                #thermal-sensor-cells = <0>;
        };
 &i2c_mst1 {
        status = "okay";
 
-       i2c0: i2c@0 { reg = <0>; };
-       i2c1: i2c@1 { reg = <1>; };
-       i2c2: i2c@2 { reg = <2>; };
-       i2c3: i2c@3 { reg = <3>; };
+       i2c_sfp0: i2c@0 { reg = <0>; };
+       i2c_sfp1: i2c@1 { reg = <1>; };
+       i2c_sfp2: i2c@2 { reg = <2>; };
+       i2c_sfp3: i2c@3 { reg = <3>; };
 };
 
 &spi0 {
index 92841d74a0eb18262c003b5a26c23f88e338befc..025955b27c74991634a83bdf711953fd751d21e2 100644 (file)
@@ -29,7 +29,9 @@ define Device/hasivo_f1100w-4sx-4xgt-common
   DEVICE_MODEL := F1100W-4SX-4XGT
   DEVICE_ALT0_VENDOR := Hasivo
   DEVICE_ALT0_MODEL := F1100W-4SX-4XGT-SE
-  DEVICE_PACKAGES := kmod-phy-realtek rtl826x-firmware
+  DEVICE_PACKAGES := \
+    kmod-hasivo-mcu-sensor kmod-hasivo-mcu-wdt kmod-mfd-hasivo-stc8 \
+    kmod-phy-realtek rtl826x-firmware
   IMAGE_SIZE := 29696k
   $(Device/kernel-lzma)
 endef
@@ -52,7 +54,9 @@ define Device/hasivo_f1100wp-4sx-4xgt-common
   DEVICE_MODEL := F1100WP-4SX-4XGT
   DEVICE_ALT0_VENDOR := Hasivo
   DEVICE_ALT0_MODEL := F1100WP-4SX-4XGT-SE
-  DEVICE_PACKAGES := kmod-phy-realtek rtl826x-firmware
+  DEVICE_PACKAGES := \
+    kmod-hasivo-mcu-sensor kmod-hasivo-mcu-wdt kmod-mfd-hasivo-stc8 \
+    kmod-phy-realtek rtl826x-firmware
   IMAGE_SIZE := 29696k
   $(Device/kernel-lzma)
 endef