From nobody Wed Sep 25 07:13:20 2024 X-Original-To: freebsd-hardware@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XD8FX0D5Jz5X7pL for ; Wed, 25 Sep 2024 07:56:48 +0000 (UTC) (envelope-from Stephane.ROCHOY@stormshield.eu) Received: from mail.stormshield.eu (mail.stormshield.eu [91.212.116.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.stormshield.eu", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XD8FW3mtcz4M00 for ; Wed, 25 Sep 2024 07:56:47 +0000 (UTC) (envelope-from Stephane.ROCHOY@stormshield.eu) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stormshield.eu; s=signer2; t=1727251000; h=From:Subject:Date:Message-ID:To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To :References; bh=1vNvUiSKbn3iSQ5Ub5C0R8JKvoyb3CESgM0R9EXv5I4=; b=mBgNiHFkM eOfGLSQanPh2jxOMf2r+4H4AECfLhhByzwFkeOq3egBmovEhaHau53n+rQ8vQi1P3aiZxhTKM ur0dxeLCPtH3TR6O7ff2PTHJbtp+8x8zbUPzFbT4oguZ9UBkIxe9qk/PpMLQR7kgQsnIf9UGf Dv4+SiZTZntNA/13D6nBNUnnvNSNRuCME46qfc9eMhz8VMB+UQGNv3xNEch6Y0z1ASJiEWZ21 ATgu45J7YaOVD9cMVPXFjEyQpGB7Ydbx+g9QNJi2ho9CKcwKWEax974CqKakdMa/cUv9u2H7w JLjw+wcIUKdvlCJtCqzb7vtTK6OhEWQSX6nMy1KfQ==; References: <3065debc-8d4f-4487-abbb-c9408810cea6@sentex.net> <86plotbk5b.fsf@cthulhu.stephaner.labo.int> <9008b389-ab06-401d-9a95-84f849ca602a@sentex.net> User-agent: mu4e 1.10.7; emacs 29.4 From: Stephane Rochoy To: mike tancsa CC: Chris6 via freebsd-hardware Subject: Re: watchdog timer programming Date: Wed, 25 Sep 2024 09:13:20 +0200 In-Reply-To: <9008b389-ab06-401d-9a95-84f849ca602a@sentex.net> Message-ID: <86plosdv48.fsf@cthulhu.stephaner.labo.int> List-Id: General discussion of FreeBSD hardware List-Archive: https://lists.freebsd.org/archives/freebsd-hardware List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hardware@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ICTDCCEXCH003.one.local (10.180.4.3) To ICTDCCEXCH002.one.local (10.180.4.2) X-DKIM-Signer: DkimX (v3.60.360) X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR] X-Rspamd-Queue-Id: 4XD8FW3mtcz4M00 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated mike tancsa writes: > On 9/24/2024 2:46 AM, Stephane Rochoy wrote: >> >> mike tancsa writes: >> >>> I am trying to get >>> >>> superio0: at port=20 >>> 0x2e-0x2f on isa0 >>> itwd0: 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: 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: 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: 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