Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 2024 09:13:20 +0200
From:      Stephane Rochoy <stephane.rochoy@stormshield.eu>
To:        mike tancsa <mike@sentex.net>
Cc:        Chris6 via freebsd-hardware <freebsd-hardware@freebsd.org>
Subject:   Re: watchdog timer programming
Message-ID:  <86plosdv48.fsf@cthulhu.stephaner.labo.int>
In-Reply-To: <9008b389-ab06-401d-9a95-84f849ca602a@sentex.net>
References:  <3065debc-8d4f-4487-abbb-c9408810cea6@sentex.net> <86plotbk5b.fsf@cthulhu.stephaner.labo.int> <9008b389-ab06-401d-9a95-84f849ca602a@sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help

mike tancsa <mike@sentex.net> writes:

> On 9/24/2024 2:46 AM, Stephane Rochoy wrote:
>>
>> mike tancsa <mike@sentex.net> writes:
>>
>>> I am trying to get
>>>
>>> superio0: <ITE IT8613 SuperIO (revision 0x0c)> at port=20
>>> 0x2e-0x2f on isa0
>>> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on=20
>>> superio0
>>> itwd0: Configured for system reset on timeout
>>>
>>> working on FreeBSD.  The driver seems to load / attach fine,=20
>>> but it does
>>> not want to reboot the box.  Adding a #define DIAGNOSTICS 1
>>>
>>> shows
>>>
>>> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on=20
>>> superio0
>>> itwd0: Configured for system reset on timeout
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>>
>>> when I do
>>>
>>>  watchdogd -t 3
>>>  killall -9 watchdogd
>>>
>>> but never a reboot :(
>>>
>>> Any idea how to get this hardware working ?
>>
>> Do you know if, at least, the pre-timeout is working?
>
>     How do I check that ?

Using --pretimeout and --pretimeout-action. See watchdogd(8) for
more details.

>> By the way, do you have the datasheet of the ITE chip? (I know=20
>> I
>> must be very optimistic to ask such a question ;))
>
> I dont have the datasheet sadly. However, they do seem to be at
> =E2=80=A6
> and are publicly available according to the
> Linux driver.
>
> I did load up ubuntu on the box, and the watchdog does seem to=20
> work
> correctly.   sysctl doesnt seem to allow for setting those=20
> values

The .nmi and .irq are FreeBSD-specific I guess. And they have to
be set via loader.conf(5). Note sysctl !=3D tunable but tunable is,
most of the time, made available as sysctl.

> sysctl -A dev.itwd
> dev.itwd.0.%parent: superio0
> dev.itwd.0.%pnpinfo: type=3DWDT
> dev.itwd.0.%location: ldn=3D0x07
> dev.itwd.0.%driver: itwd
> dev.itwd.0.%desc: Watchdog Timer on ITE SuperIO
> dev.itwd.%parent:
>
> On linux,
> modprobe it87_wdt
> ] it87_wdt: Chip IT8613 revision 12 initialized. timeout=3D60 sec
> (nowayout=3D0 testmode=3D0)
>
> wdctl
> Device:        /dev/watchdog0
> Identity:      IT87 WDT [version 1]
> Timeout:       60 seconds
> Pre-timeout:    0 seconds
> FLAG           DESCRIPTION               STATUS BOOT-STATUS
> KEEPALIVEPING  Keep alive ping reply          1           0
> MAGICCLOSE     Supports magic close char      0           0
> SETTIMEOUT     Set timeout (in seconds)       0           0
>
> The code is at
> https://github.com/torvalds/linux/blob/master/drivers/watchdog/it87_wdt.c
> if that helps shed any light.

So chip is IT8613.

> i tried defining the irq and playing with the nmi at 1 or 0, and=20
> still
> no luck. e.g. setting it to 0x05 and nmi 0, kldload (with boot=20
> verbose)
> and then starting up watchdogd -t 8... wait 9 seconds,  and then=20
> killall
> -9 watchdogd, still does not reboot the box
>
> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on=20
> superio0
> ioapic0: routing intpin 5 (ISA IRQ 5) to lapic 0 vector 56
> itwd0: Using IRQ5 to signal timeout
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: got interrupt, wdt status =3D 1
>
> Same with irq at 0x0f with and without nmi=3D0 or 1.
>
> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on=20
> superio0
> itwd0: Using IRQ15 to signal timeout
> itwd0: setting timeout to 16
> itwd0: setting timeout to 16
> itwd0: setting timeout to 16
> itwd0: setting timeout to 16
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4

OK no luck. The Linux driver don't seems to set IRQ either.

Regards,
--=20
St=C3=A9phane Rochoy
O: Stormshield



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86plosdv48.fsf>