iTCO_wdt.c 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. /*
  2. * intel TCO Watchdog Driver
  3. *
  4. * (c) Copyright 2006-2010 Wim Van Sebroeck <wim@iguana.be>.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. *
  11. * Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
  12. * provide warranty for any of this software. This material is
  13. * provided "AS-IS" and at no charge.
  14. *
  15. * The TCO watchdog is implemented in the following I/O controller hubs:
  16. * (See the intel documentation on http://developer.intel.com.)
  17. * document number 290655-003, 290677-014: 82801AA (ICH), 82801AB (ICHO)
  18. * document number 290687-002, 298242-027: 82801BA (ICH2)
  19. * document number 290733-003, 290739-013: 82801CA (ICH3-S)
  20. * document number 290716-001, 290718-007: 82801CAM (ICH3-M)
  21. * document number 290744-001, 290745-025: 82801DB (ICH4)
  22. * document number 252337-001, 252663-008: 82801DBM (ICH4-M)
  23. * document number 273599-001, 273645-002: 82801E (C-ICH)
  24. * document number 252516-001, 252517-028: 82801EB (ICH5), 82801ER (ICH5R)
  25. * document number 300641-004, 300884-013: 6300ESB
  26. * document number 301473-002, 301474-026: 82801F (ICH6)
  27. * document number 313082-001, 313075-006: 631xESB, 632xESB
  28. * document number 307013-003, 307014-024: 82801G (ICH7)
  29. * document number 322896-001, 322897-001: NM10
  30. * document number 313056-003, 313057-017: 82801H (ICH8)
  31. * document number 316972-004, 316973-012: 82801I (ICH9)
  32. * document number 319973-002, 319974-002: 82801J (ICH10)
  33. * document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH)
  34. * document number 320066-003, 320257-008: EP80597 (IICH)
  35. * document number 324645-001, 324646-001: Cougar Point (CPT)
  36. * document number TBD : Patsburg (PBG)
  37. * document number TBD : DH89xxCC
  38. */
  39. /*
  40. * Includes, defines, variables, module parameters, ...
  41. */
  42. /* Module and version information */
  43. #define DRV_NAME "iTCO_wdt"
  44. #define DRV_VERSION "1.06"
  45. #define PFX DRV_NAME ": "
  46. /* Includes */
  47. #include <linux/module.h> /* For module specific items */
  48. #include <linux/moduleparam.h> /* For new moduleparam's */
  49. #include <linux/types.h> /* For standard types (like size_t) */
  50. #include <linux/errno.h> /* For the -ENODEV/... values */
  51. #include <linux/kernel.h> /* For printk/panic/... */
  52. #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV
  53. (WATCHDOG_MINOR) */
  54. #include <linux/watchdog.h> /* For the watchdog specific items */
  55. #include <linux/init.h> /* For __init/__exit/... */
  56. #include <linux/fs.h> /* For file operations */
  57. #include <linux/platform_device.h> /* For platform_driver framework */
  58. #include <linux/pci.h> /* For pci functions */
  59. #include <linux/ioport.h> /* For io-port access */
  60. #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */
  61. #include <linux/uaccess.h> /* For copy_to_user/put_user/... */
  62. #include <linux/io.h> /* For inb/outb/... */
  63. #include "iTCO_vendor.h"
  64. /* TCO related info */
  65. enum iTCO_chipsets {
  66. TCO_ICH = 0, /* ICH */
  67. TCO_ICH0, /* ICH0 */
  68. TCO_ICH2, /* ICH2 */
  69. TCO_ICH2M, /* ICH2-M */
  70. TCO_ICH3, /* ICH3-S */
  71. TCO_ICH3M, /* ICH3-M */
  72. TCO_ICH4, /* ICH4 */
  73. TCO_ICH4M, /* ICH4-M */
  74. TCO_CICH, /* C-ICH */
  75. TCO_ICH5, /* ICH5 & ICH5R */
  76. TCO_6300ESB, /* 6300ESB */
  77. TCO_ICH6, /* ICH6 & ICH6R */
  78. TCO_ICH6M, /* ICH6-M */
  79. TCO_ICH6W, /* ICH6W & ICH6RW */
  80. TCO_631XESB, /* 631xESB/632xESB */
  81. TCO_ICH7, /* ICH7 & ICH7R */
  82. TCO_ICH7DH, /* ICH7DH */
  83. TCO_ICH7M, /* ICH7-M & ICH7-U */
  84. TCO_ICH7MDH, /* ICH7-M DH */
  85. TCO_NM10, /* NM10 */
  86. TCO_ICH8, /* ICH8 & ICH8R */
  87. TCO_ICH8DH, /* ICH8DH */
  88. TCO_ICH8DO, /* ICH8DO */
  89. TCO_ICH8M, /* ICH8M */
  90. TCO_ICH8ME, /* ICH8M-E */
  91. TCO_ICH9, /* ICH9 */
  92. TCO_ICH9R, /* ICH9R */
  93. TCO_ICH9DH, /* ICH9DH */
  94. TCO_ICH9DO, /* ICH9DO */
  95. TCO_ICH9M, /* ICH9M */
  96. TCO_ICH9ME, /* ICH9M-E */
  97. TCO_ICH10, /* ICH10 */
  98. TCO_ICH10R, /* ICH10R */
  99. TCO_ICH10D, /* ICH10D */
  100. TCO_ICH10DO, /* ICH10DO */
  101. TCO_PCH, /* PCH Desktop Full Featured */
  102. TCO_PCHM, /* PCH Mobile Full Featured */
  103. TCO_P55, /* P55 */
  104. TCO_PM55, /* PM55 */
  105. TCO_H55, /* H55 */
  106. TCO_QM57, /* QM57 */
  107. TCO_H57, /* H57 */
  108. TCO_HM55, /* HM55 */
  109. TCO_Q57, /* Q57 */
  110. TCO_HM57, /* HM57 */
  111. TCO_PCHMSFF, /* PCH Mobile SFF Full Featured */
  112. TCO_QS57, /* QS57 */
  113. TCO_3400, /* 3400 */
  114. TCO_3420, /* 3420 */
  115. TCO_3450, /* 3450 */
  116. TCO_EP80579, /* EP80579 */
  117. TCO_CPT1, /* Cougar Point */
  118. TCO_CPT2, /* Cougar Point Desktop */
  119. TCO_CPT3, /* Cougar Point Mobile */
  120. TCO_CPT4, /* Cougar Point */
  121. TCO_CPT5, /* Cougar Point */
  122. TCO_CPT6, /* Cougar Point */
  123. TCO_CPT7, /* Cougar Point */
  124. TCO_CPT8, /* Cougar Point */
  125. TCO_CPT9, /* Cougar Point */
  126. TCO_CPT10, /* Cougar Point */
  127. TCO_CPT11, /* Cougar Point */
  128. TCO_CPT12, /* Cougar Point */
  129. TCO_CPT13, /* Cougar Point */
  130. TCO_CPT14, /* Cougar Point */
  131. TCO_CPT15, /* Cougar Point */
  132. TCO_CPT16, /* Cougar Point */
  133. TCO_CPT17, /* Cougar Point */
  134. TCO_CPT18, /* Cougar Point */
  135. TCO_CPT19, /* Cougar Point */
  136. TCO_CPT20, /* Cougar Point */
  137. TCO_CPT21, /* Cougar Point */
  138. TCO_CPT22, /* Cougar Point */
  139. TCO_CPT23, /* Cougar Point */
  140. TCO_CPT24, /* Cougar Point */
  141. TCO_CPT25, /* Cougar Point */
  142. TCO_CPT26, /* Cougar Point */
  143. TCO_CPT27, /* Cougar Point */
  144. TCO_CPT28, /* Cougar Point */
  145. TCO_CPT29, /* Cougar Point */
  146. TCO_CPT30, /* Cougar Point */
  147. TCO_CPT31, /* Cougar Point */
  148. TCO_PBG1, /* Patsburg */
  149. TCO_PBG2, /* Patsburg */
  150. TCO_DH89XXCC, /* DH89xxCC */
  151. };
  152. static struct {
  153. char *name;
  154. unsigned int iTCO_version;
  155. } iTCO_chipset_info[] __devinitdata = {
  156. {"ICH", 1},
  157. {"ICH0", 1},
  158. {"ICH2", 1},
  159. {"ICH2-M", 1},
  160. {"ICH3-S", 1},
  161. {"ICH3-M", 1},
  162. {"ICH4", 1},
  163. {"ICH4-M", 1},
  164. {"C-ICH", 1},
  165. {"ICH5 or ICH5R", 1},
  166. {"6300ESB", 1},
  167. {"ICH6 or ICH6R", 2},
  168. {"ICH6-M", 2},
  169. {"ICH6W or ICH6RW", 2},
  170. {"631xESB/632xESB", 2},
  171. {"ICH7 or ICH7R", 2},
  172. {"ICH7DH", 2},
  173. {"ICH7-M or ICH7-U", 2},
  174. {"ICH7-M DH", 2},
  175. {"NM10", 2},
  176. {"ICH8 or ICH8R", 2},
  177. {"ICH8DH", 2},
  178. {"ICH8DO", 2},
  179. {"ICH8M", 2},
  180. {"ICH8M-E", 2},
  181. {"ICH9", 2},
  182. {"ICH9R", 2},
  183. {"ICH9DH", 2},
  184. {"ICH9DO", 2},
  185. {"ICH9M", 2},
  186. {"ICH9M-E", 2},
  187. {"ICH10", 2},
  188. {"ICH10R", 2},
  189. {"ICH10D", 2},
  190. {"ICH10DO", 2},
  191. {"PCH Desktop Full Featured", 2},
  192. {"PCH Mobile Full Featured", 2},
  193. {"P55", 2},
  194. {"PM55", 2},
  195. {"H55", 2},
  196. {"QM57", 2},
  197. {"H57", 2},
  198. {"HM55", 2},
  199. {"Q57", 2},
  200. {"HM57", 2},
  201. {"PCH Mobile SFF Full Featured", 2},
  202. {"QS57", 2},
  203. {"3400", 2},
  204. {"3420", 2},
  205. {"3450", 2},
  206. {"EP80579", 2},
  207. {"Cougar Point", 2},
  208. {"Cougar Point", 2},
  209. {"Cougar Point", 2},
  210. {"Cougar Point", 2},
  211. {"Cougar Point", 2},
  212. {"Cougar Point", 2},
  213. {"Cougar Point", 2},
  214. {"Cougar Point", 2},
  215. {"Cougar Point", 2},
  216. {"Cougar Point", 2},
  217. {"Cougar Point", 2},
  218. {"Cougar Point", 2},
  219. {"Cougar Point", 2},
  220. {"Cougar Point", 2},
  221. {"Cougar Point", 2},
  222. {"Cougar Point", 2},
  223. {"Cougar Point", 2},
  224. {"Cougar Point", 2},
  225. {"Cougar Point", 2},
  226. {"Cougar Point", 2},
  227. {"Cougar Point", 2},
  228. {"Cougar Point", 2},
  229. {"Cougar Point", 2},
  230. {"Cougar Point", 2},
  231. {"Cougar Point", 2},
  232. {"Cougar Point", 2},
  233. {"Cougar Point", 2},
  234. {"Cougar Point", 2},
  235. {"Cougar Point", 2},
  236. {"Cougar Point", 2},
  237. {"Cougar Point", 2},
  238. {"Patsburg", 2},
  239. {"Patsburg", 2},
  240. {"DH89xxCC", 2},
  241. {NULL, 0}
  242. };
  243. #define ITCO_PCI_DEVICE(dev, data) \
  244. .vendor = PCI_VENDOR_ID_INTEL, \
  245. .device = dev, \
  246. .subvendor = PCI_ANY_ID, \
  247. .subdevice = PCI_ANY_ID, \
  248. .class = 0, \
  249. .class_mask = 0, \
  250. .driver_data = data
  251. /*
  252. * This data only exists for exporting the supported PCI ids
  253. * via MODULE_DEVICE_TABLE. We do not actually register a
  254. * pci_driver, because the I/O Controller Hub has also other
  255. * functions that probably will be registered by other drivers.
  256. */
  257. static DEFINE_PCI_DEVICE_TABLE(iTCO_wdt_pci_tbl) = {
  258. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801AA_0, TCO_ICH)},
  259. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801AB_0, TCO_ICH0)},
  260. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801BA_0, TCO_ICH2)},
  261. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801BA_10, TCO_ICH2M)},
  262. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801CA_0, TCO_ICH3)},
  263. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801CA_12, TCO_ICH3M)},
  264. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801DB_0, TCO_ICH4)},
  265. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801DB_12, TCO_ICH4M)},
  266. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801E_0, TCO_CICH)},
  267. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801EB_0, TCO_ICH5)},
  268. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB_1, TCO_6300ESB)},
  269. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_0, TCO_ICH6)},
  270. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_1, TCO_ICH6M)},
  271. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_2, TCO_ICH6W)},
  272. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB2_0, TCO_631XESB)},
  273. { ITCO_PCI_DEVICE(0x2671, TCO_631XESB)},
  274. { ITCO_PCI_DEVICE(0x2672, TCO_631XESB)},
  275. { ITCO_PCI_DEVICE(0x2673, TCO_631XESB)},
  276. { ITCO_PCI_DEVICE(0x2674, TCO_631XESB)},
  277. { ITCO_PCI_DEVICE(0x2675, TCO_631XESB)},
  278. { ITCO_PCI_DEVICE(0x2676, TCO_631XESB)},
  279. { ITCO_PCI_DEVICE(0x2677, TCO_631XESB)},
  280. { ITCO_PCI_DEVICE(0x2678, TCO_631XESB)},
  281. { ITCO_PCI_DEVICE(0x2679, TCO_631XESB)},
  282. { ITCO_PCI_DEVICE(0x267a, TCO_631XESB)},
  283. { ITCO_PCI_DEVICE(0x267b, TCO_631XESB)},
  284. { ITCO_PCI_DEVICE(0x267c, TCO_631XESB)},
  285. { ITCO_PCI_DEVICE(0x267d, TCO_631XESB)},
  286. { ITCO_PCI_DEVICE(0x267e, TCO_631XESB)},
  287. { ITCO_PCI_DEVICE(0x267f, TCO_631XESB)},
  288. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_0, TCO_ICH7)},
  289. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_30, TCO_ICH7DH)},
  290. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_1, TCO_ICH7M)},
  291. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_31, TCO_ICH7MDH)},
  292. { ITCO_PCI_DEVICE(0x27bc, TCO_NM10)},
  293. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_0, TCO_ICH8)},
  294. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_2, TCO_ICH8DH)},
  295. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_3, TCO_ICH8DO)},
  296. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_4, TCO_ICH8M)},
  297. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_1, TCO_ICH8ME)},
  298. { ITCO_PCI_DEVICE(0x2918, TCO_ICH9)},
  299. { ITCO_PCI_DEVICE(0x2916, TCO_ICH9R)},
  300. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_2, TCO_ICH9DH)},
  301. { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_4, TCO_ICH9DO)},
  302. { ITCO_PCI_DEVICE(0x2919, TCO_ICH9M)},
  303. { ITCO_PCI_DEVICE(0x2917, TCO_ICH9ME)},
  304. { ITCO_PCI_DEVICE(0x3a18, TCO_ICH10)},
  305. { ITCO_PCI_DEVICE(0x3a16, TCO_ICH10R)},
  306. { ITCO_PCI_DEVICE(0x3a1a, TCO_ICH10D)},
  307. { ITCO_PCI_DEVICE(0x3a14, TCO_ICH10DO)},
  308. { ITCO_PCI_DEVICE(0x3b00, TCO_PCH)},
  309. { ITCO_PCI_DEVICE(0x3b01, TCO_PCHM)},
  310. { ITCO_PCI_DEVICE(0x3b02, TCO_P55)},
  311. { ITCO_PCI_DEVICE(0x3b03, TCO_PM55)},
  312. { ITCO_PCI_DEVICE(0x3b06, TCO_H55)},
  313. { ITCO_PCI_DEVICE(0x3b07, TCO_QM57)},
  314. { ITCO_PCI_DEVICE(0x3b08, TCO_H57)},
  315. { ITCO_PCI_DEVICE(0x3b09, TCO_HM55)},
  316. { ITCO_PCI_DEVICE(0x3b0a, TCO_Q57)},
  317. { ITCO_PCI_DEVICE(0x3b0b, TCO_HM57)},
  318. { ITCO_PCI_DEVICE(0x3b0d, TCO_PCHMSFF)},
  319. { ITCO_PCI_DEVICE(0x3b0f, TCO_QS57)},
  320. { ITCO_PCI_DEVICE(0x3b12, TCO_3400)},
  321. { ITCO_PCI_DEVICE(0x3b14, TCO_3420)},
  322. { ITCO_PCI_DEVICE(0x3b16, TCO_3450)},
  323. { ITCO_PCI_DEVICE(0x5031, TCO_EP80579)},
  324. { ITCO_PCI_DEVICE(0x1c41, TCO_CPT1)},
  325. { ITCO_PCI_DEVICE(0x1c42, TCO_CPT2)},
  326. { ITCO_PCI_DEVICE(0x1c43, TCO_CPT3)},
  327. { ITCO_PCI_DEVICE(0x1c44, TCO_CPT4)},
  328. { ITCO_PCI_DEVICE(0x1c45, TCO_CPT5)},
  329. { ITCO_PCI_DEVICE(0x1c46, TCO_CPT6)},
  330. { ITCO_PCI_DEVICE(0x1c47, TCO_CPT7)},
  331. { ITCO_PCI_DEVICE(0x1c48, TCO_CPT8)},
  332. { ITCO_PCI_DEVICE(0x1c49, TCO_CPT9)},
  333. { ITCO_PCI_DEVICE(0x1c4a, TCO_CPT10)},
  334. { ITCO_PCI_DEVICE(0x1c4b, TCO_CPT11)},
  335. { ITCO_PCI_DEVICE(0x1c4c, TCO_CPT12)},
  336. { ITCO_PCI_DEVICE(0x1c4d, TCO_CPT13)},
  337. { ITCO_PCI_DEVICE(0x1c4e, TCO_CPT14)},
  338. { ITCO_PCI_DEVICE(0x1c4f, TCO_CPT15)},
  339. { ITCO_PCI_DEVICE(0x1c50, TCO_CPT16)},
  340. { ITCO_PCI_DEVICE(0x1c51, TCO_CPT17)},
  341. { ITCO_PCI_DEVICE(0x1c52, TCO_CPT18)},
  342. { ITCO_PCI_DEVICE(0x1c53, TCO_CPT19)},
  343. { ITCO_PCI_DEVICE(0x1c54, TCO_CPT20)},
  344. { ITCO_PCI_DEVICE(0x1c55, TCO_CPT21)},
  345. { ITCO_PCI_DEVICE(0x1c56, TCO_CPT22)},
  346. { ITCO_PCI_DEVICE(0x1c57, TCO_CPT23)},
  347. { ITCO_PCI_DEVICE(0x1c58, TCO_CPT24)},
  348. { ITCO_PCI_DEVICE(0x1c59, TCO_CPT25)},
  349. { ITCO_PCI_DEVICE(0x1c5a, TCO_CPT26)},
  350. { ITCO_PCI_DEVICE(0x1c5b, TCO_CPT27)},
  351. { ITCO_PCI_DEVICE(0x1c5c, TCO_CPT28)},
  352. { ITCO_PCI_DEVICE(0x1c5d, TCO_CPT29)},
  353. { ITCO_PCI_DEVICE(0x1c5e, TCO_CPT30)},
  354. { ITCO_PCI_DEVICE(0x1c5f, TCO_CPT31)},
  355. { ITCO_PCI_DEVICE(0x1d40, TCO_PBG1)},
  356. { ITCO_PCI_DEVICE(0x1d41, TCO_PBG2)},
  357. { ITCO_PCI_DEVICE(0x2310, TCO_DH89XXCC)},
  358. { 0, }, /* End of list */
  359. };
  360. MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl);
  361. /* Address definitions for the TCO */
  362. /* TCO base address */
  363. #define TCOBASE (iTCO_wdt_private.ACPIBASE + 0x60)
  364. /* SMI Control and Enable Register */
  365. #define SMI_EN (iTCO_wdt_private.ACPIBASE + 0x30)
  366. #define TCO_RLD (TCOBASE + 0x00) /* TCO Timer Reload and Curr. Value */
  367. #define TCOv1_TMR (TCOBASE + 0x01) /* TCOv1 Timer Initial Value */
  368. #define TCO_DAT_IN (TCOBASE + 0x02) /* TCO Data In Register */
  369. #define TCO_DAT_OUT (TCOBASE + 0x03) /* TCO Data Out Register */
  370. #define TCO1_STS (TCOBASE + 0x04) /* TCO1 Status Register */
  371. #define TCO2_STS (TCOBASE + 0x06) /* TCO2 Status Register */
  372. #define TCO1_CNT (TCOBASE + 0x08) /* TCO1 Control Register */
  373. #define TCO2_CNT (TCOBASE + 0x0a) /* TCO2 Control Register */
  374. #define TCOv2_TMR (TCOBASE + 0x12) /* TCOv2 Timer Initial Value */
  375. /* internal variables */
  376. static unsigned long is_active;
  377. static char expect_release;
  378. static struct { /* this is private data for the iTCO_wdt device */
  379. /* TCO version/generation */
  380. unsigned int iTCO_version;
  381. /* The device's ACPIBASE address (TCOBASE = ACPIBASE+0x60) */
  382. unsigned long ACPIBASE;
  383. /* NO_REBOOT flag is Memory-Mapped GCS register bit 5 (TCO version 2)*/
  384. unsigned long __iomem *gcs;
  385. /* the lock for io operations */
  386. spinlock_t io_lock;
  387. /* the PCI-device */
  388. struct pci_dev *pdev;
  389. } iTCO_wdt_private;
  390. /* the watchdog platform device */
  391. static struct platform_device *iTCO_wdt_platform_device;
  392. /* module parameters */
  393. #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */
  394. static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */
  395. module_param(heartbeat, int, 0);
  396. MODULE_PARM_DESC(heartbeat, "Watchdog timeout in seconds. "
  397. "5..76 (TCO v1) or 3..614 (TCO v2), default="
  398. __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
  399. static int nowayout = WATCHDOG_NOWAYOUT;
  400. module_param(nowayout, int, 0);
  401. MODULE_PARM_DESC(nowayout,
  402. "Watchdog cannot be stopped once started (default="
  403. __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  404. /*
  405. * Some TCO specific functions
  406. */
  407. static inline unsigned int seconds_to_ticks(int seconds)
  408. {
  409. /* the internal timer is stored as ticks which decrement
  410. * every 0.6 seconds */
  411. return (seconds * 10) / 6;
  412. }
  413. static void iTCO_wdt_set_NO_REBOOT_bit(void)
  414. {
  415. u32 val32;
  416. /* Set the NO_REBOOT bit: this disables reboots */
  417. if (iTCO_wdt_private.iTCO_version == 2) {
  418. val32 = readl(iTCO_wdt_private.gcs);
  419. val32 |= 0x00000020;
  420. writel(val32, iTCO_wdt_private.gcs);
  421. } else if (iTCO_wdt_private.iTCO_version == 1) {
  422. pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
  423. val32 |= 0x00000002;
  424. pci_write_config_dword(iTCO_wdt_private.pdev, 0xd4, val32);
  425. }
  426. }
  427. static int iTCO_wdt_unset_NO_REBOOT_bit(void)
  428. {
  429. int ret = 0;
  430. u32 val32;
  431. /* Unset the NO_REBOOT bit: this enables reboots */
  432. if (iTCO_wdt_private.iTCO_version == 2) {
  433. val32 = readl(iTCO_wdt_private.gcs);
  434. val32 &= 0xffffffdf;
  435. writel(val32, iTCO_wdt_private.gcs);
  436. val32 = readl(iTCO_wdt_private.gcs);
  437. if (val32 & 0x00000020)
  438. ret = -EIO;
  439. } else if (iTCO_wdt_private.iTCO_version == 1) {
  440. pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
  441. val32 &= 0xfffffffd;
  442. pci_write_config_dword(iTCO_wdt_private.pdev, 0xd4, val32);
  443. pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
  444. if (val32 & 0x00000002)
  445. ret = -EIO;
  446. }
  447. return ret; /* returns: 0 = OK, -EIO = Error */
  448. }
  449. static int iTCO_wdt_start(void)
  450. {
  451. unsigned int val;
  452. spin_lock(&iTCO_wdt_private.io_lock);
  453. iTCO_vendor_pre_start(iTCO_wdt_private.ACPIBASE, heartbeat);
  454. /* disable chipset's NO_REBOOT bit */
  455. if (iTCO_wdt_unset_NO_REBOOT_bit()) {
  456. spin_unlock(&iTCO_wdt_private.io_lock);
  457. printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
  458. "reboot disabled by hardware/BIOS\n");
  459. return -EIO;
  460. }
  461. /* Force the timer to its reload value by writing to the TCO_RLD
  462. register */
  463. if (iTCO_wdt_private.iTCO_version == 2)
  464. outw(0x01, TCO_RLD);
  465. else if (iTCO_wdt_private.iTCO_version == 1)
  466. outb(0x01, TCO_RLD);
  467. /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */
  468. val = inw(TCO1_CNT);
  469. val &= 0xf7ff;
  470. outw(val, TCO1_CNT);
  471. val = inw(TCO1_CNT);
  472. spin_unlock(&iTCO_wdt_private.io_lock);
  473. if (val & 0x0800)
  474. return -1;
  475. return 0;
  476. }
  477. static int iTCO_wdt_stop(void)
  478. {
  479. unsigned int val;
  480. spin_lock(&iTCO_wdt_private.io_lock);
  481. iTCO_vendor_pre_stop(iTCO_wdt_private.ACPIBASE);
  482. /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */
  483. val = inw(TCO1_CNT);
  484. val |= 0x0800;
  485. outw(val, TCO1_CNT);
  486. val = inw(TCO1_CNT);
  487. /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
  488. iTCO_wdt_set_NO_REBOOT_bit();
  489. spin_unlock(&iTCO_wdt_private.io_lock);
  490. if ((val & 0x0800) == 0)
  491. return -1;
  492. return 0;
  493. }
  494. static int iTCO_wdt_keepalive(void)
  495. {
  496. spin_lock(&iTCO_wdt_private.io_lock);
  497. iTCO_vendor_pre_keepalive(iTCO_wdt_private.ACPIBASE, heartbeat);
  498. /* Reload the timer by writing to the TCO Timer Counter register */
  499. if (iTCO_wdt_private.iTCO_version == 2)
  500. outw(0x01, TCO_RLD);
  501. else if (iTCO_wdt_private.iTCO_version == 1) {
  502. /* Reset the timeout status bit so that the timer
  503. * needs to count down twice again before rebooting */
  504. outw(0x0008, TCO1_STS); /* write 1 to clear bit */
  505. outb(0x01, TCO_RLD);
  506. }
  507. spin_unlock(&iTCO_wdt_private.io_lock);
  508. return 0;
  509. }
  510. static int iTCO_wdt_set_heartbeat(int t)
  511. {
  512. unsigned int val16;
  513. unsigned char val8;
  514. unsigned int tmrval;
  515. tmrval = seconds_to_ticks(t);
  516. /* For TCO v1 the timer counts down twice before rebooting */
  517. if (iTCO_wdt_private.iTCO_version == 1)
  518. tmrval /= 2;
  519. /* from the specs: */
  520. /* "Values of 0h-3h are ignored and should not be attempted" */
  521. if (tmrval < 0x04)
  522. return -EINVAL;
  523. if (((iTCO_wdt_private.iTCO_version == 2) && (tmrval > 0x3ff)) ||
  524. ((iTCO_wdt_private.iTCO_version == 1) && (tmrval > 0x03f)))
  525. return -EINVAL;
  526. iTCO_vendor_pre_set_heartbeat(tmrval);
  527. /* Write new heartbeat to watchdog */
  528. if (iTCO_wdt_private.iTCO_version == 2) {
  529. spin_lock(&iTCO_wdt_private.io_lock);
  530. val16 = inw(TCOv2_TMR);
  531. val16 &= 0xfc00;
  532. val16 |= tmrval;
  533. outw(val16, TCOv2_TMR);
  534. val16 = inw(TCOv2_TMR);
  535. spin_unlock(&iTCO_wdt_private.io_lock);
  536. if ((val16 & 0x3ff) != tmrval)
  537. return -EINVAL;
  538. } else if (iTCO_wdt_private.iTCO_version == 1) {
  539. spin_lock(&iTCO_wdt_private.io_lock);
  540. val8 = inb(TCOv1_TMR);
  541. val8 &= 0xc0;
  542. val8 |= (tmrval & 0xff);
  543. outb(val8, TCOv1_TMR);
  544. val8 = inb(TCOv1_TMR);
  545. spin_unlock(&iTCO_wdt_private.io_lock);
  546. if ((val8 & 0x3f) != tmrval)
  547. return -EINVAL;
  548. }
  549. heartbeat = t;
  550. return 0;
  551. }
  552. static int iTCO_wdt_get_timeleft(int *time_left)
  553. {
  554. unsigned int val16;
  555. unsigned char val8;
  556. /* read the TCO Timer */
  557. if (iTCO_wdt_private.iTCO_version == 2) {
  558. spin_lock(&iTCO_wdt_private.io_lock);
  559. val16 = inw(TCO_RLD);
  560. val16 &= 0x3ff;
  561. spin_unlock(&iTCO_wdt_private.io_lock);
  562. *time_left = (val16 * 6) / 10;
  563. } else if (iTCO_wdt_private.iTCO_version == 1) {
  564. spin_lock(&iTCO_wdt_private.io_lock);
  565. val8 = inb(TCO_RLD);
  566. val8 &= 0x3f;
  567. if (!(inw(TCO1_STS) & 0x0008))
  568. val8 += (inb(TCOv1_TMR) & 0x3f);
  569. spin_unlock(&iTCO_wdt_private.io_lock);
  570. *time_left = (val8 * 6) / 10;
  571. } else
  572. return -EINVAL;
  573. return 0;
  574. }
  575. /*
  576. * /dev/watchdog handling
  577. */
  578. static int iTCO_wdt_open(struct inode *inode, struct file *file)
  579. {
  580. /* /dev/watchdog can only be opened once */
  581. if (test_and_set_bit(0, &is_active))
  582. return -EBUSY;
  583. /*
  584. * Reload and activate timer
  585. */
  586. iTCO_wdt_start();
  587. return nonseekable_open(inode, file);
  588. }
  589. static int iTCO_wdt_release(struct inode *inode, struct file *file)
  590. {
  591. /*
  592. * Shut off the timer.
  593. */
  594. if (expect_release == 42) {
  595. iTCO_wdt_stop();
  596. } else {
  597. printk(KERN_CRIT PFX
  598. "Unexpected close, not stopping watchdog!\n");
  599. iTCO_wdt_keepalive();
  600. }
  601. clear_bit(0, &is_active);
  602. expect_release = 0;
  603. return 0;
  604. }
  605. static ssize_t iTCO_wdt_write(struct file *file, const char __user *data,
  606. size_t len, loff_t *ppos)
  607. {
  608. /* See if we got the magic character 'V' and reload the timer */
  609. if (len) {
  610. if (!nowayout) {
  611. size_t i;
  612. /* note: just in case someone wrote the magic
  613. character five months ago... */
  614. expect_release = 0;
  615. /* scan to see whether or not we got the
  616. magic character */
  617. for (i = 0; i != len; i++) {
  618. char c;
  619. if (get_user(c, data + i))
  620. return -EFAULT;
  621. if (c == 'V')
  622. expect_release = 42;
  623. }
  624. }
  625. /* someone wrote to us, we should reload the timer */
  626. iTCO_wdt_keepalive();
  627. }
  628. return len;
  629. }
  630. static long iTCO_wdt_ioctl(struct file *file, unsigned int cmd,
  631. unsigned long arg)
  632. {
  633. int new_options, retval = -EINVAL;
  634. int new_heartbeat;
  635. void __user *argp = (void __user *)arg;
  636. int __user *p = argp;
  637. static const struct watchdog_info ident = {
  638. .options = WDIOF_SETTIMEOUT |
  639. WDIOF_KEEPALIVEPING |
  640. WDIOF_MAGICCLOSE,
  641. .firmware_version = 0,
  642. .identity = DRV_NAME,
  643. };
  644. switch (cmd) {
  645. case WDIOC_GETSUPPORT:
  646. return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
  647. case WDIOC_GETSTATUS:
  648. case WDIOC_GETBOOTSTATUS:
  649. return put_user(0, p);
  650. case WDIOC_SETOPTIONS:
  651. {
  652. if (get_user(new_options, p))
  653. return -EFAULT;
  654. if (new_options & WDIOS_DISABLECARD) {
  655. iTCO_wdt_stop();
  656. retval = 0;
  657. }
  658. if (new_options & WDIOS_ENABLECARD) {
  659. iTCO_wdt_keepalive();
  660. iTCO_wdt_start();
  661. retval = 0;
  662. }
  663. return retval;
  664. }
  665. case WDIOC_KEEPALIVE:
  666. iTCO_wdt_keepalive();
  667. return 0;
  668. case WDIOC_SETTIMEOUT:
  669. {
  670. if (get_user(new_heartbeat, p))
  671. return -EFAULT;
  672. if (iTCO_wdt_set_heartbeat(new_heartbeat))
  673. return -EINVAL;
  674. iTCO_wdt_keepalive();
  675. /* Fall */
  676. }
  677. case WDIOC_GETTIMEOUT:
  678. return put_user(heartbeat, p);
  679. case WDIOC_GETTIMELEFT:
  680. {
  681. int time_left;
  682. if (iTCO_wdt_get_timeleft(&time_left))
  683. return -EINVAL;
  684. return put_user(time_left, p);
  685. }
  686. default:
  687. return -ENOTTY;
  688. }
  689. }
  690. /*
  691. * Kernel Interfaces
  692. */
  693. static const struct file_operations iTCO_wdt_fops = {
  694. .owner = THIS_MODULE,
  695. .llseek = no_llseek,
  696. .write = iTCO_wdt_write,
  697. .unlocked_ioctl = iTCO_wdt_ioctl,
  698. .open = iTCO_wdt_open,
  699. .release = iTCO_wdt_release,
  700. };
  701. static struct miscdevice iTCO_wdt_miscdev = {
  702. .minor = WATCHDOG_MINOR,
  703. .name = "watchdog",
  704. .fops = &iTCO_wdt_fops,
  705. };
  706. /*
  707. * Init & exit routines
  708. */
  709. static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
  710. const struct pci_device_id *ent, struct platform_device *dev)
  711. {
  712. int ret;
  713. u32 base_address;
  714. unsigned long RCBA;
  715. unsigned long val32;
  716. /*
  717. * Find the ACPI/PM base I/O address which is the base
  718. * for the TCO registers (TCOBASE=ACPIBASE + 0x60)
  719. * ACPIBASE is bits [15:7] from 0x40-0x43
  720. */
  721. pci_read_config_dword(pdev, 0x40, &base_address);
  722. base_address &= 0x0000ff80;
  723. if (base_address == 0x00000000) {
  724. /* Something's wrong here, ACPIBASE has to be set */
  725. printk(KERN_ERR PFX "failed to get TCOBASE address, "
  726. "device disabled by hardware/BIOS\n");
  727. return -ENODEV;
  728. }
  729. iTCO_wdt_private.iTCO_version =
  730. iTCO_chipset_info[ent->driver_data].iTCO_version;
  731. iTCO_wdt_private.ACPIBASE = base_address;
  732. iTCO_wdt_private.pdev = pdev;
  733. /* Get the Memory-Mapped GCS register, we need it for the
  734. NO_REBOOT flag (TCO v2). To get access to it you have to
  735. read RCBA from PCI Config space 0xf0 and use it as base.
  736. GCS = RCBA + ICH6_GCS(0x3410). */
  737. if (iTCO_wdt_private.iTCO_version == 2) {
  738. pci_read_config_dword(pdev, 0xf0, &base_address);
  739. if ((base_address & 1) == 0) {
  740. printk(KERN_ERR PFX "RCBA is disabled by hardware"
  741. "/BIOS, device disabled\n");
  742. ret = -ENODEV;
  743. goto out;
  744. }
  745. RCBA = base_address & 0xffffc000;
  746. iTCO_wdt_private.gcs = ioremap((RCBA + 0x3410), 4);
  747. }
  748. /* Check chipset's NO_REBOOT bit */
  749. if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
  750. printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, "
  751. "device disabled by hardware/BIOS\n");
  752. ret = -ENODEV; /* Cannot reset NO_REBOOT bit */
  753. goto out_unmap;
  754. }
  755. /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
  756. iTCO_wdt_set_NO_REBOOT_bit();
  757. /* The TCO logic uses the TCO_EN bit in the SMI_EN register */
  758. if (!request_region(SMI_EN, 4, "iTCO_wdt")) {
  759. printk(KERN_ERR PFX
  760. "I/O address 0x%04lx already in use, "
  761. "device disabled\n", SMI_EN);
  762. ret = -EIO;
  763. goto out_unmap;
  764. }
  765. /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */
  766. val32 = inl(SMI_EN);
  767. val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */
  768. outl(val32, SMI_EN);
  769. /* The TCO I/O registers reside in a 32-byte range pointed to
  770. by the TCOBASE value */
  771. if (!request_region(TCOBASE, 0x20, "iTCO_wdt")) {
  772. printk(KERN_ERR PFX "I/O address 0x%04lx already in use "
  773. "device disabled\n", TCOBASE);
  774. ret = -EIO;
  775. goto unreg_smi_en;
  776. }
  777. printk(KERN_INFO PFX
  778. "Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n",
  779. iTCO_chipset_info[ent->driver_data].name,
  780. iTCO_chipset_info[ent->driver_data].iTCO_version,
  781. TCOBASE);
  782. /* Clear out the (probably old) status */
  783. outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */
  784. outw(0x0002, TCO2_STS); /* Clear SECOND_TO_STS bit */
  785. outw(0x0004, TCO2_STS); /* Clear BOOT_STS bit */
  786. /* Make sure the watchdog is not running */
  787. iTCO_wdt_stop();
  788. /* Check that the heartbeat value is within it's range;
  789. if not reset to the default */
  790. if (iTCO_wdt_set_heartbeat(heartbeat)) {
  791. iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT);
  792. printk(KERN_INFO PFX
  793. "timeout value out of range, using %d\n", heartbeat);
  794. }
  795. ret = misc_register(&iTCO_wdt_miscdev);
  796. if (ret != 0) {
  797. printk(KERN_ERR PFX
  798. "cannot register miscdev on minor=%d (err=%d)\n",
  799. WATCHDOG_MINOR, ret);
  800. goto unreg_region;
  801. }
  802. printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
  803. heartbeat, nowayout);
  804. return 0;
  805. unreg_region:
  806. release_region(TCOBASE, 0x20);
  807. unreg_smi_en:
  808. release_region(SMI_EN, 4);
  809. out_unmap:
  810. if (iTCO_wdt_private.iTCO_version == 2)
  811. iounmap(iTCO_wdt_private.gcs);
  812. out:
  813. iTCO_wdt_private.ACPIBASE = 0;
  814. return ret;
  815. }
  816. static void __devexit iTCO_wdt_cleanup(void)
  817. {
  818. /* Stop the timer before we leave */
  819. if (!nowayout)
  820. iTCO_wdt_stop();
  821. /* Deregister */
  822. misc_deregister(&iTCO_wdt_miscdev);
  823. release_region(TCOBASE, 0x20);
  824. release_region(SMI_EN, 4);
  825. if (iTCO_wdt_private.iTCO_version == 2)
  826. iounmap(iTCO_wdt_private.gcs);
  827. pci_dev_put(iTCO_wdt_private.pdev);
  828. iTCO_wdt_private.ACPIBASE = 0;
  829. }
  830. static int __devinit iTCO_wdt_probe(struct platform_device *dev)
  831. {
  832. int ret = -ENODEV;
  833. int found = 0;
  834. struct pci_dev *pdev = NULL;
  835. const struct pci_device_id *ent;
  836. spin_lock_init(&iTCO_wdt_private.io_lock);
  837. for_each_pci_dev(pdev) {
  838. ent = pci_match_id(iTCO_wdt_pci_tbl, pdev);
  839. if (ent) {
  840. found++;
  841. ret = iTCO_wdt_init(pdev, ent, dev);
  842. if (!ret)
  843. break;
  844. }
  845. }
  846. if (!found)
  847. printk(KERN_INFO PFX "No device detected.\n");
  848. return ret;
  849. }
  850. static int __devexit iTCO_wdt_remove(struct platform_device *dev)
  851. {
  852. if (iTCO_wdt_private.ACPIBASE)
  853. iTCO_wdt_cleanup();
  854. return 0;
  855. }
  856. static void iTCO_wdt_shutdown(struct platform_device *dev)
  857. {
  858. iTCO_wdt_stop();
  859. }
  860. #define iTCO_wdt_suspend NULL
  861. #define iTCO_wdt_resume NULL
  862. static struct platform_driver iTCO_wdt_driver = {
  863. .probe = iTCO_wdt_probe,
  864. .remove = __devexit_p(iTCO_wdt_remove),
  865. .shutdown = iTCO_wdt_shutdown,
  866. .suspend = iTCO_wdt_suspend,
  867. .resume = iTCO_wdt_resume,
  868. .driver = {
  869. .owner = THIS_MODULE,
  870. .name = DRV_NAME,
  871. },
  872. };
  873. static int __init iTCO_wdt_init_module(void)
  874. {
  875. int err;
  876. printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s\n",
  877. DRV_VERSION);
  878. err = platform_driver_register(&iTCO_wdt_driver);
  879. if (err)
  880. return err;
  881. iTCO_wdt_platform_device = platform_device_register_simple(DRV_NAME,
  882. -1, NULL, 0);
  883. if (IS_ERR(iTCO_wdt_platform_device)) {
  884. err = PTR_ERR(iTCO_wdt_platform_device);
  885. goto unreg_platform_driver;
  886. }
  887. return 0;
  888. unreg_platform_driver:
  889. platform_driver_unregister(&iTCO_wdt_driver);
  890. return err;
  891. }
  892. static void __exit iTCO_wdt_cleanup_module(void)
  893. {
  894. platform_device_unregister(iTCO_wdt_platform_device);
  895. platform_driver_unregister(&iTCO_wdt_driver);
  896. printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
  897. }
  898. module_init(iTCO_wdt_init_module);
  899. module_exit(iTCO_wdt_cleanup_module);
  900. MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>");
  901. MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver");
  902. MODULE_VERSION(DRV_VERSION);
  903. MODULE_LICENSE("GPL");
  904. MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);