[PATCH v5 4/4] watchdog: Add support for VIA/WonderMedia SoC watchdog functionality

Alexey Charkov alchark at gmail.com
Thu May 22 00:45:33 PDT 2025


On Wed, May 21, 2025 at 9:24 PM Daniel Lezcano
<daniel.lezcano at linaro.org> wrote:
>
> On Wed, May 21, 2025 at 05:00:12PM +0400, Alexey Charkov wrote:
> > VIA/WonderMedia SoCs can use their system timer's first channel as a
> > watchdog device which will reset the system if the clocksource counter
> > matches the value given in its match register 0 and if the watchdog
> > function is enabled.
> >
> > Since the watchdog function is tightly coupled to the timer itself, it
> > is implemented as an auxiliary device of the timer device
> >
> > Signed-off-by: Alexey Charkov <alchark at gmail.com>
> > ---
> >  MAINTAINERS                   |  1 +
> >  drivers/watchdog/Kconfig      | 15 ++++++++
> >  drivers/watchdog/Makefile     |  1 +
> >  drivers/watchdog/vt8500-wdt.c | 88 +++++++++++++++++++++++++++++++++++++++++++
> >  4 files changed, 105 insertions(+)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 5362095240627f613638197fda275db6edc16cf7..97d1842625dbdf7fdca3556260662dab469ed091 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -3447,6 +3447,7 @@ F:      drivers/tty/serial/vt8500_serial.c
> >  F:   drivers/video/fbdev/vt8500lcdfb.*
> >  F:   drivers/video/fbdev/wm8505fb*
> >  F:   drivers/video/fbdev/wmt_ge_rops.*
> > +F:   drivers/watchdog/vt8500-wdt.c
> >  F:   include/linux/vt8500-timer.h
> >
> >  ARM/ZYNQ ARCHITECTURE
> > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> > index 0d8d37f712e8cfb4bf8156853baa13c23a57d6d9..2e59303306feba7e15a015c2fce25b1290dc4cbc 100644
> > --- a/drivers/watchdog/Kconfig
> > +++ b/drivers/watchdog/Kconfig
> > @@ -1115,6 +1115,21 @@ config SUNPLUS_WATCHDOG
> >         To compile this driver as a module, choose M here: the
> >         module will be called sunplus_wdt.
> >
> > +config VT8500_WATCHDOG
> > +     tristate "VIA/WonderMedia VT8500 watchdog support"
> > +     depends on ARCH_VT8500 || COMPILE_TEST
> > +     select WATCHDOG_CORE
> > +     select AUXILIARY_BUS
> > +     help
> > +       VIA/WonderMedia SoCs can use their system timer as a hardware
> > +       watchdog, as long as the first timer channel is free from other
> > +       uses and respective function is enabled in its registers. To
> > +       make use of it, say Y here and ensure that the device tree
> > +       lists at least two interrupts for the VT8500 timer device.
> > +
> > +       To compile this driver as a module, choose M here.
> > +       The module will be called vt8500-wdt.
>
> Module is not supported by the timers. That will change in a very near
> future but unloading won't be supported, you should consider tying the
> wdt life cycle with the subsystem it is connected to.

But there's an auxiliary bus between the timer and this module, so it
should be possible to boot a system with the timer initialized as
usual, and then load the watchdog if/when needed. Which also saves a
bit of space in the main kernel image.

Or am I missing anything here?

Best regards,
Alexey



More information about the linux-arm-kernel mailing list