1
1
openwrt/target/linux/realtek/modules.mk
Carlo Szelinsky d048137e85 realtek: add Hasivo MCU watchdog driver
Add a watchdog driver for the external management MCU on Hasivo /
Horaco network switches, reachable over I2C. Without periodic
keepalive the MCU resets the board every ~3 minutes.

The driver arms the MCU at probe and registers a struct
watchdog_device with WDOG_HW_RUNNING so the watchdog core feeds the
chip via a kernel timer until userspace opens the watchdog node.
Timeout is fixed at 15s; the hardware threshold is baked into MCU
firmware and is not software-configurable.

The I2C address is supplied per-board in the device tree via the
`reg` property. The driver does not constrain or probe a specific
address. Known addresses across current Hasivo / Horaco silicon:

  - 0x6F: Hasivo S1300WP-8XGT-4S+, Hasivo F5800W-12S+,
          Horaco ZX-SW82TS-L2P (default / most common)
  - 0x6E: alternate Hasivo / Horaco variant

The driver, its device-tree binding and the Kconfig/Makefile wiring
are added to the kernel tree as a realtek target patch and exposed as
the kmod-hasivo-mcu-wdt KernelPackage. Keeping the binding in the
kernel tree lets dt_binding_check exercise it during the build and
makes the whole driver easy to drop once it lands upstream.

Tested on Hasivo S1300WP-8XGT-4S+ (RTL9313). Unbinding the driver
causes the MCU to power-cycle the board within ~15s.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/23418
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-05-31 10:57:26 +02:00

42 lines
1.3 KiB
Makefile

#
# Copyright (C) 2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
MFD_MENU:=MultiFunction Device (MFD) Support
WATCHDOG_MENU:=Watchdog Timer Support
define KernelPackage/hasivo-mcu-wdt
SUBMENU:=$(WATCHDOG_MENU)
TITLE:=Hasivo MCU watchdog driver
KCONFIG:=CONFIG_HASIVO_MCU_WATCHDOG
FILES:=$(LINUX_DIR)/drivers/watchdog/hasivo-mcu-wdt.ko
DEPENDS:=@TARGET_realtek +kmod-i2c-core
AUTOLOAD:=$(call AutoProbe,hasivo-mcu-wdt,1)
endef
define KernelPackage/hasivo-mcu-wdt/description
Hardware watchdog driver for the external management MCU found on
Hasivo / Horaco network switches. Registers a Linux watchdog device;
the kernel watchdog core feeds it automatically via its own timer.
endef
$(eval $(call KernelPackage,hasivo-mcu-wdt))
define KernelPackage/mfd-hasivo-stc8
SUBMENU:=$(MFD_MENU)
TITLE:=Hasivo STC8 microcontroller support
KCONFIG:=CONFIG_MFD_HASIVO_STC8
FILES:=$(LINUX_DIR)/drivers/mfd/hasivo-stc8-mfd.ko
DEPENDS:=@TARGET_realtek +kmod-mfd +kmod-regmap-i2c
AUTOLOAD:=$(call AutoProbe,hasivo-stc8-mfd)
endef
define KernelPackage/mfd-hasivo-stc8/description
Kernel module for Hasivo STC8 microcontroller support
endef
$(eval $(call KernelPackage,mfd-hasivo-stc8))