Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Nov 2022 18:45:26 +0900 (JST)
From:      UEMURA Tetsuya <t_uemura@macome.co.jp>
To:        freebsd-acpi@FreeBSD.org, freebsd-drivers@FreeBSD.org
Subject:   Request for adding ACPI WDAT watchdog driver
Message-ID:  <20221119094526.4598F9B8774@towerrecords.dyndns.org>

next in thread | raw e-mail | index | archive | help
--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Sorry for multiposting, as I can't guess where is the right list to post.

I've written a driver for ACPI WDAT (Watchdog Action Table) based
watchdog timer and I want this driver to be included in the future
FreeBSD versions. Please someone tell me how should I do.

Simply said, WDAT is an abstraction for the real WDT hardware. For
instance, to add a newer generation WDT to ichwd(4), one must know the
detailed hardware registers, etc.. Actually I tried to add Apollo Lake
Celeron and Coffee Lake Xeon support to ichwd(4) and I couldn't.

With WDAT, the necessary IO port accesses to operate the WDT are
comprehensively described in it and no hardware knowledge is required.
With this driver, I have successfully managed to use the WDT on
Advantech ARK-1124C, Dell R210 and Dell R240.
* R210 is also supported by ichwd(4). Others are not supported yet.

The unfortunate thing is that not all systems have WDAT defined.

Thanks in advance for your attention.

-- 
Tetsuya Uemura <t_uemura@macome.co.jp>

--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: application/octet-stream;
 name="patch-share__man__man4__wdatwd.4"
Content-Disposition: attachment;
 filename="patch-share__man__man4__wdatwd.4"
Content-Transfer-Encoding: base64

LS0tIC9kZXYvbnVsbAkyMDIyLTExLTE5IDE3OjI2OjA1LjQzNTg5MzAwMCArMDkwMAorKysgc2hh
cmUvbWFuL21hbjQvd2RhdHdkLjQJMjAyMi0xMS0xOSAxNjo0MjoxMi45OTIzNDQwMDAgKzA5MDAK
QEAgLTAsMCArMSw5OCBAQAorLlwiLQorLlwiIENvcHlyaWdodCAoYykgMjAyMiBUZXRzdXlhIFVl
bXVyYSA8dF91ZW11cmFAbWFjb21l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BvcnRlZCBieSBNaWNyb3NvZnQo
UikgV2luZG93cyBWaXN0YShSKSBhbmQgTWljcm9zb2Z0IFdpbmRvd3MgU2VydmVyKFIpIDIwMDgg
T3BlcmF0aW5nIFN5c3RlbXMKKy4lQSBNaWNyb3NvZnQgQ29ycG9yYXRpb24KKy5SZQorLlNoIEhJ
U1RPUlkKK1RoZQorLk5tCitkcml2ZXIgc3RpbGwgaW4tZGV2ZWxvcG1lbnQuCisuU2ggQVVUSE9S
UworLkFuIC1ub3NwbGl0CitUaGUKKy5ObQorZHJpdmVyIHdhcyB3cml0dGVuIGJ5CisuQW4gVGV0
c3V5YSBVZW11cmEgQXEgTXQgdF91ZW11cmFAbWFjb21lLmNvLmpwCitvZiBNQUNPTUUsIENvcnBv
cmF0aW9uLgo=
--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: application/octet-stream;
 name="patch-share__man__man4__Makefile"
Content-Disposition: attachment;
 filename="patch-share__man__man4__Makefile"
Content-Transfer-Encoding: base64

LS0tIHNoYXJlL21hbi9tYW40L01ha2VmaWxlLm9yaWcJMjAyMi0wNi0wNCAwNzo0MjoxOS4wMDAw
MDAwMDAgKzA5MDAKKysrIHNoYXJlL21hbi9tYW40L01ha2VmaWxlCTIwMjItMTEtMTkgMTY6NDY6
MjUuMzA2MDU3MDAwICswOTAwCkBAIC01OTcsNiArNTk3LDcgQEAgTUFOPQlhYWMuNCBcCiAJdnRu
ZXQuNCBcCiAJd2F0Y2hkb2cuNCBcCiAJJHtfd2J3ZC40fSBcCisJd2RhdHdkLjQgXAogCXdpdG5l
c3MuNCBcCiAJd2xhbi40IFwKIAl3bGFuX2FjbC40IFwK
--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: application/octet-stream;
 name="patch-sys__modules__Makefile"
Content-Disposition: attachment;
 filename="patch-sys__modules__Makefile"
Content-Transfer-Encoding: base64

LS0tIHN5cy9tb2R1bGVzL01ha2VmaWxlLm9yaWcJMjAyMi0wNi0yNCAwNzo0Mjo0NC4wMDAwMDAw
MDAgKzA5MDAKKysrIHN5cy9tb2R1bGVzL01ha2VmaWxlCTIwMjItMTEtMTEgMTQ6MjM6MzkuMTE4
MjYxMDAwICswOTAwCkBAIC0zOTcsNiArMzk3LDcgQEAgU1VCRElSPQlcCiAJdnIgXAogCXZ0ZSBc
CiAJJHtfd2J3ZH0gXAorCXdkYXR3ZCBcCiAJd2xhbiBcCiAJd2xhbl9hY2wgXAogCXdsYW5fYW1y
ciBcCg==
--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: application/octet-stream;
 name="patch-sys__modules__wdatwd__Makefile"
Content-Disposition: attachment;
 filename="patch-sys__modules__wdatwd__Makefile"
Content-Transfer-Encoding: base64

LS0tIC9kZXYvbnVsbAkyMDIyLTExLTE5IDE3OjI5OjUxLjY2NjIwODAwMCArMDkwMAorKysgc3lz
L21vZHVsZXMvd2RhdHdkL01ha2VmaWxlCTIwMjItMTEtMTEgMTQ6MjM6MzkuMTEzNjU4MDAwICsw
OTAwCkBAIC0wLDAgKzEsOSBAQAorIyAkRnJlZUJTRCQKKworLlBBVEg6ICR7U1JDVE9QfS9zeXMv
ZGV2L3dkYXR3ZAorCitLTU9EPQl3ZGF0d2QKK1NSQ1M9CXdkYXR3ZC5jCitTUkNTKz0Jb3B0X2Fj
cGkuaCBhY3BpX2lmLmggZGV2aWNlX2lmLmggYnVzX2lmLmgKKworLmluY2x1ZGUgPGJzZC5rbW9k
Lm1rPgo=
--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: application/octet-stream;
 name="patch-sys__conf__files"
Content-Disposition: attachment;
 filename="patch-sys__conf__files"
Content-Transfer-Encoding: base64

LS0tIHN5cy9jb25mL2ZpbGVzLm9yaWcJMjAyMi0wNy0zMCAwNzo0MjoxNS4wMDAwMDAwMDAgKzA5
MDAKKysrIHN5cy9jb25mL2ZpbGVzCTIwMjItMTEtMTEgMTQ6MjM6MzkuMTE3NTc5MDAwICswOTAw
CkBAIC0zNTI4LDYgKzM1MjgsNyBAQCBkZXYvdnQvdnRfZm9udC5jCQlvcHRpb25hbCB2dAogZGV2
L3Z0L3Z0X3N5c21vdXNlLmMJCW9wdGlvbmFsIHZ0CiBkZXYvdnRlL2lmX3Z0ZS5jCQlvcHRpb25h
bCB2dGUgcGNpCiBkZXYvd2F0Y2hkb2cvd2F0Y2hkb2cuYwkJc3RhbmRhcmQKK2Rldi93ZGF0d2Qv
d2RhdHdkLmMJCW9wdGlvbmFsIHdkYXR3ZAogZGV2L3dwaS9pZl93cGkuYwkJb3B0aW9uYWwgd3Bp
IHBjaQogd3BpZncuYwkJCW9wdGlvbmFsIHdwaWZ3CQkJCQlcCiAJY29tcGlsZS13aXRoCSIke0FX
S30gLWYgJFMvdG9vbHMvZndfc3R1Yi5hd2sgd3BpLmZ3OndwaWZ3OjE1MzIyOSAtbXdwaSAtYyR7
LlRBUkdFVH0iIFwK
--------_63789D9600000000DB11_MULTIPART_MIXED_
Content-Type: application/octet-stream;
 name="patch-sys__dev__wdatwd__wdatwd.c"
Content-Disposition: attachment;
 filename="patch-sys__dev__wdatwd__wdatwd.c"
Content-Transfer-Encoding: base64

LS0tIC9kZXYvbnVsbAkyMDIyLTExLTE5IDE3OjMxOjA4Ljg2Mzk2NTAwMCArMDkwMAorKysgc3lz
L2Rldi93ZGF0d2Qvd2RhdHdkLmMJMjAyMi0xMS0xNyAxMzowNzowMi41ODY0MTcxNzggKzA5MDAK
QEAgLTAsMCArMSw4MTAgQEAKKy8qLQorICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0y
LUNsYXVzZS1GcmVlQlNECisgKgorICogQ29weXJpZ2h0IChjKSAyMDIyIFRldHN1eWEgVWVtdXJh
IDx0X3VlbXVyYUBtYWNvbWUuY28uanA+CisgKgorICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBp
biBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CisgKiBtb2RpZmljYXRp
b24sIG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F0aWMgZHJpdmVyX3QJd2RhdHdkX2RyaXZlciA9IHsK
Kwkid2RhdHdkIiwKKwl3ZGF0d2RfbWV0aG9kcywKKwlzaXplb2Yoc3RydWN0IHdkYXR3ZF9zb2Z0
YyksCit9OworCitEUklWRVJfTU9EVUxFKHdkYXR3ZCwgYWNwaSwgd2RhdHdkX2RyaXZlciwgd2Rh
dHdkX2RldmNsYXNzLCAwLCAwKTsKK01PRFVMRV9ERVBFTkQod2RhdHdkLCBhY3BpLCAxLCAxLCAx
KTsK
--------_63789D9600000000DB11_MULTIPART_MIXED_--




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