Blame view

drivers/watchdog/intel_scu_watchdog.c 15 KB
57539c1cf   Donald Johnson   watchdog: Intel S...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  /*
   *      Intel_SCU 0.2:  An Intel SCU IOH Based Watchdog Device
   *			for Intel part #(s):
   *				- AF82MP20 PCH
   *
   *      Copyright (C) 2009-2010 Intel Corporation. All rights reserved.
   *
   *      This program is free software; you can redistribute it and/or
   *      modify it under the terms of version 2 of the GNU General
   *      Public License as published by the Free Software Foundation.
   *
   *      This program is distributed in the hope that it will be
   *      useful, but WITHOUT ANY WARRANTY; without even the implied
   *      warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
   *      PURPOSE.  See the GNU General Public License for more details.
   *      You should have received a copy of the GNU General Public
   *      License along with this program; if not, write to the Free
   *      Software Foundation, Inc., 59 Temple Place - Suite 330,
   *      Boston, MA  02111-1307, USA.
   *      The full GNU General Public License is included in this
   *      distribution in the file called COPYING.
   *
   */
27c766aaa   Joe Perches   watchdog: Use pr_...
24
  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
57539c1cf   Donald Johnson   watchdog: Intel S...
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  #include <linux/compiler.h>
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/moduleparam.h>
  #include <linux/types.h>
  #include <linux/miscdevice.h>
  #include <linux/watchdog.h>
  #include <linux/fs.h>
  #include <linux/notifier.h>
  #include <linux/reboot.h>
  #include <linux/init.h>
  #include <linux/jiffies.h>
  #include <linux/uaccess.h>
  #include <linux/slab.h>
  #include <linux/io.h>
  #include <linux/interrupt.h>
  #include <linux/delay.h>
  #include <linux/sched.h>
  #include <linux/signal.h>
  #include <linux/sfi.h>
57539c1cf   Donald Johnson   watchdog: Intel S...
45
  #include <asm/irq.h>
60063497a   Arun Sharma   atomic: use <linu...
46
  #include <linux/atomic.h>
57539c1cf   Donald Johnson   watchdog: Intel S...
47
48
  #include <asm/intel_scu_ipc.h>
  #include <asm/apb_timer.h>
05454c26e   Kuppuswamy Sathyanarayanan   intel_mid: Rename...
49
  #include <asm/intel-mid.h>
57539c1cf   Donald Johnson   watchdog: Intel S...
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
  
  #include "intel_scu_watchdog.h"
  
  /* Bounds number of times we will retry loading time count */
  /* This retry is a work around for a silicon bug.	   */
  #define MAX_RETRY 16
  
  #define IPC_SET_WATCHDOG_TIMER	0xF8
  
  static int timer_margin = DEFAULT_SOFT_TO_HARD_MARGIN;
  module_param(timer_margin, int, 0);
  MODULE_PARM_DESC(timer_margin,
  		"Watchdog timer margin"
  		"Time between interrupt and resetting the system"
  		"The range is from 1 to 160"
  		"This is the time for all keep alives to arrive");
  
  static int timer_set = DEFAULT_TIME;
  module_param(timer_set, int, 0);
  MODULE_PARM_DESC(timer_set,
  		"Default Watchdog timer setting"
  		"Complete cycle time"
  		"The range is from 1 to 170"
  		"This is the time for all keep alives to arrive");
  
  /* After watchdog device is closed, check force_boot. If:
   * force_boot == 0, then force boot on next watchdog interrupt after close,
   * force_boot == 1, then force boot immediately when device is closed.
   */
  static int force_boot;
  module_param(force_boot, int, 0);
  MODULE_PARM_DESC(force_boot,
  		"A value of 1 means that the driver will reboot"
  		"the system immediately if the /dev/watchdog device is closed"
  		"A value of 0 means that when /dev/watchdog device is closed"
  		"the watchdog timer will be refreshed for one more interval"
  		"of length: timer_set. At the end of this interval, the"
  		"watchdog timer will reset the system."
  		);
  
  /* there is only one device in the system now; this can be made into
   * an array in the future if we have more than one device */
  
  static struct intel_scu_watchdog_dev watchdog_device;
  
  /* Forces restart, if force_reboot is set */
  static void watchdog_fire(void)
  {
  	if (force_boot) {
27c766aaa   Joe Perches   watchdog: Use pr_...
99
100
  		pr_crit("Initiating system reboot
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
101
  		emergency_restart();
27c766aaa   Joe Perches   watchdog: Use pr_...
102
103
  		pr_crit("Reboot didn't ?????
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
104
105
106
  	}
  
  	else {
27c766aaa   Joe Perches   watchdog: Use pr_...
107
108
109
110
  		pr_crit("Immediate Reboot Disabled
  ");
  		pr_crit("System will reset when watchdog timer times out!
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
111
112
113
114
115
116
117
  	}
  }
  
  static int check_timer_margin(int new_margin)
  {
  	if ((new_margin < MIN_TIME_CYCLE) ||
  	    (new_margin > MAX_TIME - timer_set)) {
27c766aaa   Joe Perches   watchdog: Use pr_...
118
119
120
  		pr_debug("value of new_margin %d is out of the range %d to %d
  ",
  			 new_margin, MIN_TIME_CYCLE, MAX_TIME - timer_set);
57539c1cf   Donald Johnson   watchdog: Intel S...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
  		return -EINVAL;
  	}
  	return 0;
  }
  
  /*
   * IPC operations
   */
  static int watchdog_set_ipc(int soft_threshold, int threshold)
  {
  	u32	*ipc_wbuf;
  	u8	 cbuf[16] = { '\0' };
  	int	 ipc_ret = 0;
  
  	ipc_wbuf = (u32 *)&cbuf;
  	ipc_wbuf[0] = soft_threshold;
  	ipc_wbuf[1] = threshold;
  
  	ipc_ret = intel_scu_ipc_command(
  			IPC_SET_WATCHDOG_TIMER,
  			0,
  			ipc_wbuf,
  			2,
  			NULL,
  			0);
  
  	if (ipc_ret != 0)
  		pr_err("Error setting SCU watchdog timer: %x
  ", ipc_ret);
  
  	return ipc_ret;
  };
  
  /*
   *      Intel_SCU operations
   */
  
  /* timer interrupt handler */
  static irqreturn_t watchdog_timer_interrupt(int irq, void *dev_id)
  {
  	int int_status;
  	int_status = ioread32(watchdog_device.timer_interrupt_status_addr);
27c766aaa   Joe Perches   watchdog: Use pr_...
163
164
  	pr_debug("irq, int_status: %x
  ", int_status);
57539c1cf   Donald Johnson   watchdog: Intel S...
165
166
167
168
169
170
  
  	if (int_status != 0)
  		return IRQ_NONE;
  
  	/* has the timer been started? If not, then this is spurious */
  	if (watchdog_device.timer_started == 0) {
27c766aaa   Joe Perches   watchdog: Use pr_...
171
172
  		pr_debug("spurious interrupt received
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
  		return IRQ_HANDLED;
  	}
  
  	/* temporarily disable the timer */
  	iowrite32(0x00000002, watchdog_device.timer_control_addr);
  
  	/* set the timer to the threshold */
  	iowrite32(watchdog_device.threshold,
  		  watchdog_device.timer_load_count_addr);
  
  	/* allow the timer to run */
  	iowrite32(0x00000003, watchdog_device.timer_control_addr);
  
  	return IRQ_HANDLED;
  }
  
  static int intel_scu_keepalive(void)
  {
  
  	/* read eoi register - clears interrupt */
  	ioread32(watchdog_device.timer_clear_interrupt_addr);
  
  	/* temporarily disable the timer */
  	iowrite32(0x00000002, watchdog_device.timer_control_addr);
  
  	/* set the timer to the soft_threshold */
  	iowrite32(watchdog_device.soft_threshold,
  		  watchdog_device.timer_load_count_addr);
  
  	/* allow the timer to run */
  	iowrite32(0x00000003, watchdog_device.timer_control_addr);
  
  	return 0;
  }
  
  static int intel_scu_stop(void)
  {
  	iowrite32(0, watchdog_device.timer_control_addr);
  	return 0;
  }
  
  static int intel_scu_set_heartbeat(u32 t)
  {
  	int			 ipc_ret;
  	int			 retry_count;
  	u32			 soft_value;
57539c1cf   Donald Johnson   watchdog: Intel S...
219
220
221
222
223
224
225
226
  	u32			 hw_value;
  
  	watchdog_device.timer_set = t;
  	watchdog_device.threshold =
  		timer_margin * watchdog_device.timer_tbl_ptr->freq_hz;
  	watchdog_device.soft_threshold =
  		(watchdog_device.timer_set - timer_margin)
  		* watchdog_device.timer_tbl_ptr->freq_hz;
27c766aaa   Joe Perches   watchdog: Use pr_...
227
228
229
230
231
232
233
234
235
236
237
238
239
240
  	pr_debug("set_heartbeat: timer freq is %d
  ",
  		 watchdog_device.timer_tbl_ptr->freq_hz);
  	pr_debug("set_heartbeat: timer_set is %x (hex)
  ",
  		 watchdog_device.timer_set);
  	pr_debug("set_hearbeat: timer_margin is %x (hex)
  ", timer_margin);
  	pr_debug("set_heartbeat: threshold is %x (hex)
  ",
  		 watchdog_device.threshold);
  	pr_debug("set_heartbeat: soft_threshold is %x (hex)
  ",
  		 watchdog_device.soft_threshold);
57539c1cf   Donald Johnson   watchdog: Intel S...
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
  
  	/* Adjust thresholds by FREQ_ADJUSTMENT factor, to make the */
  	/* watchdog timing come out right. */
  	watchdog_device.threshold =
  		watchdog_device.threshold / FREQ_ADJUSTMENT;
  	watchdog_device.soft_threshold =
  		watchdog_device.soft_threshold / FREQ_ADJUSTMENT;
  
  	/* temporarily disable the timer */
  	iowrite32(0x00000002, watchdog_device.timer_control_addr);
  
  	/* send the threshold and soft_threshold via IPC to the processor */
  	ipc_ret = watchdog_set_ipc(watchdog_device.soft_threshold,
  				   watchdog_device.threshold);
  
  	if (ipc_ret != 0) {
  		/* Make sure the watchdog timer is stopped */
  		intel_scu_stop();
  		return ipc_ret;
  	}
  
  	/* Soft Threshold set loop. Early versions of silicon did */
  	/* not always set this count correctly.  This loop checks */
  	/* the value and retries if it was not set correctly.     */
  
  	retry_count = 0;
  	soft_value = watchdog_device.soft_threshold & 0xFFFF0000;
  	do {
  
  		/* Make sure timer is stopped */
  		intel_scu_stop();
  
  		if (MAX_RETRY < retry_count++) {
  			/* Unable to set timer value */
27c766aaa   Joe Perches   watchdog: Use pr_...
275
276
  			pr_err("Unable to set timer
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
277
278
279
280
281
282
283
284
  			return -ENODEV;
  		}
  
  		/* set the timer to the soft threshold */
  		iowrite32(watchdog_device.soft_threshold,
  			watchdog_device.timer_load_count_addr);
  
  		/* read count value before starting timer */
c303ca876   Alexander Shiyan   watchdog: intel_s...
285
  		ioread32(watchdog_device.timer_load_count_addr);
57539c1cf   Donald Johnson   watchdog: Intel S...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
  
  		/* Start the timer */
  		iowrite32(0x00000003, watchdog_device.timer_control_addr);
  
  		/* read the value the time loaded into its count reg */
  		hw_value = ioread32(watchdog_device.timer_load_count_addr);
  		hw_value = hw_value & 0xFFFF0000;
  
  
  	} while (soft_value != hw_value);
  
  	watchdog_device.timer_started = 1;
  
  	return 0;
  }
  
  /*
   * /dev/watchdog handling
   */
  
  static int intel_scu_open(struct inode *inode, struct file *file)
  {
  
  	/* Set flag to indicate that watchdog device is open */
  	if (test_and_set_bit(0, &watchdog_device.driver_open))
  		return -EBUSY;
  
  	/* Check for reopen of driver. Reopens are not allowed */
  	if (watchdog_device.driver_closed)
  		return -EPERM;
  
  	return nonseekable_open(inode, file);
  }
  
  static int intel_scu_release(struct inode *inode, struct file *file)
  {
  	/*
  	 * This watchdog should not be closed, after the timer
  	 * is started with the WDIPC_SETTIMEOUT ioctl
  	 * If force_boot is set watchdog_fire() will cause an
  	 * immediate reset. If force_boot is not set, the watchdog
  	 * timer is refreshed for one more interval. At the end
  	 * of that interval, the watchdog timer will reset the system.
  	 */
  
  	if (!test_and_clear_bit(0, &watchdog_device.driver_open)) {
27c766aaa   Joe Perches   watchdog: Use pr_...
332
333
  		pr_debug("intel_scu_release, without open
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
334
335
336
337
338
  		return -ENOTTY;
  	}
  
  	if (!watchdog_device.timer_started) {
  		/* Just close, since timer has not been started */
27c766aaa   Joe Perches   watchdog: Use pr_...
339
340
  		pr_debug("closed, without starting timer
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
341
342
  		return 0;
  	}
27c766aaa   Joe Perches   watchdog: Use pr_...
343
344
  	pr_crit("Unexpected close of /dev/watchdog!
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
  
  	/* Since the timer was started, prevent future reopens */
  	watchdog_device.driver_closed = 1;
  
  	/* Refresh the timer for one more interval */
  	intel_scu_keepalive();
  
  	/* Reboot system (if force_boot is set) */
  	watchdog_fire();
  
  	/* We should only reach this point if force_boot is not set */
  	return 0;
  }
  
  static ssize_t intel_scu_write(struct file *file,
  			      char const *data,
  			      size_t len,
  			      loff_t *ppos)
  {
  
  	if (watchdog_device.timer_started)
  		/* Watchdog already started, keep it alive */
  		intel_scu_keepalive();
  	else
  		/* Start watchdog with timer value set by init */
  		intel_scu_set_heartbeat(watchdog_device.timer_set);
  
  	return len;
  }
  
  static long intel_scu_ioctl(struct file *file,
  			   unsigned int cmd,
  			   unsigned long arg)
  {
  	void __user *argp = (void __user *)arg;
  	u32 __user *p = argp;
  	u32 new_margin;
  
  
  	static const struct watchdog_info ident = {
  		.options =          WDIOF_SETTIMEOUT
  				    | WDIOF_KEEPALIVEPING,
  		.firmware_version = 0,  /* @todo Get from SCU via
  						 ipc_get_scu_fw_version()? */
  		.identity =         "Intel_SCU IOH Watchdog"  /* len < 32 */
  	};
  
  	switch (cmd) {
  	case WDIOC_GETSUPPORT:
  		return copy_to_user(argp,
  				    &ident,
  				    sizeof(ident)) ? -EFAULT : 0;
  	case WDIOC_GETSTATUS:
  	case WDIOC_GETBOOTSTATUS:
  		return put_user(0, p);
  	case WDIOC_KEEPALIVE:
  		intel_scu_keepalive();
  
  		return 0;
  	case WDIOC_SETTIMEOUT:
  		if (get_user(new_margin, p))
  			return -EFAULT;
  
  		if (check_timer_margin(new_margin))
  			return -EINVAL;
  
  		if (intel_scu_set_heartbeat(new_margin))
  			return -EINVAL;
  		return 0;
  	case WDIOC_GETTIMEOUT:
  		return put_user(watchdog_device.soft_threshold, p);
  
  	default:
  		return -ENOTTY;
  	}
  }
  
  /*
   *      Notifier for system down
   */
  static int intel_scu_notify_sys(struct notifier_block *this,
  			       unsigned long code,
  			       void *another_unused)
  {
  	if (code == SYS_DOWN || code == SYS_HALT)
  		/* Turn off the watchdog timer. */
  		intel_scu_stop();
  	return NOTIFY_DONE;
  }
  
  /*
   *      Kernel Interfaces
   */
  static const struct file_operations intel_scu_fops = {
  	.owner          = THIS_MODULE,
  	.llseek         = no_llseek,
  	.write          = intel_scu_write,
  	.unlocked_ioctl = intel_scu_ioctl,
  	.open           = intel_scu_open,
  	.release        = intel_scu_release,
  };
  
  static int __init intel_scu_watchdog_init(void)
  {
  	int ret;
  	u32 __iomem *tmp_addr;
  
  	/*
  	 * We don't really need to check this as the SFI timer get will fail
  	 * but if we do so we can exit with a clearer reason and no noise.
  	 *
  	 * If it isn't an intel MID device then it doesn't have this watchdog
  	 */
712b6aa87   Kuppuswamy Sathyanarayanan   intel_mid: Rename...
458
  	if (!intel_mid_identify_cpu())
57539c1cf   Donald Johnson   watchdog: Intel S...
459
460
461
462
463
464
465
  		return -ENODEV;
  
  	/* Check boot parameters to verify that their initial values */
  	/* are in range. */
  	/* Check value of timer_set boot parameter */
  	if ((timer_set < MIN_TIME_CYCLE) ||
  	    (timer_set > MAX_TIME - MIN_TIME_CYCLE)) {
27c766aaa   Joe Perches   watchdog: Use pr_...
466
467
468
  		pr_err("value of timer_set %x (hex) is out of range from %x to %x (hex)
  ",
  		       timer_set, MIN_TIME_CYCLE, MAX_TIME - MIN_TIME_CYCLE);
57539c1cf   Donald Johnson   watchdog: Intel S...
469
470
471
472
473
474
475
476
477
478
  		return -EINVAL;
  	}
  
  	/* Check value of timer_margin boot parameter */
  	if (check_timer_margin(timer_margin))
  		return -EINVAL;
  
  	watchdog_device.timer_tbl_ptr = sfi_get_mtmr(sfi_mtimer_num-1);
  
  	if (watchdog_device.timer_tbl_ptr == NULL) {
27c766aaa   Joe Perches   watchdog: Use pr_...
479
480
  		pr_debug("timer is not available
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
481
482
483
484
  		return -ENODEV;
  	}
  	/* make sure the timer exists */
  	if (watchdog_device.timer_tbl_ptr->phys_addr == 0) {
27c766aaa   Joe Perches   watchdog: Use pr_...
485
486
487
  		pr_debug("timer %d does not have valid physical memory
  ",
  			 sfi_mtimer_num);
57539c1cf   Donald Johnson   watchdog: Intel S...
488
489
490
491
  		return -ENODEV;
  	}
  
  	if (watchdog_device.timer_tbl_ptr->irq == 0) {
27c766aaa   Joe Perches   watchdog: Use pr_...
492
493
  		pr_debug("timer %d invalid irq
  ", sfi_mtimer_num);
57539c1cf   Donald Johnson   watchdog: Intel S...
494
495
496
497
498
499
500
  		return -ENODEV;
  	}
  
  	tmp_addr = ioremap_nocache(watchdog_device.timer_tbl_ptr->phys_addr,
  			20);
  
  	if (tmp_addr == NULL) {
27c766aaa   Joe Perches   watchdog: Use pr_...
501
502
  		pr_debug("timer unable to ioremap
  ");
57539c1cf   Donald Johnson   watchdog: Intel S...
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
  		return -ENOMEM;
  	}
  
  	watchdog_device.timer_load_count_addr = tmp_addr++;
  	watchdog_device.timer_current_value_addr = tmp_addr++;
  	watchdog_device.timer_control_addr = tmp_addr++;
  	watchdog_device.timer_clear_interrupt_addr = tmp_addr++;
  	watchdog_device.timer_interrupt_status_addr = tmp_addr++;
  
  	/* Set the default time values in device structure */
  
  	watchdog_device.timer_set = timer_set;
  	watchdog_device.threshold =
  		timer_margin * watchdog_device.timer_tbl_ptr->freq_hz;
  	watchdog_device.soft_threshold =
  		(watchdog_device.timer_set - timer_margin)
  		* watchdog_device.timer_tbl_ptr->freq_hz;
  
  
  	watchdog_device.intel_scu_notifier.notifier_call =
  		intel_scu_notify_sys;
  
  	ret = register_reboot_notifier(&watchdog_device.intel_scu_notifier);
  	if (ret) {
27c766aaa   Joe Perches   watchdog: Use pr_...
527
528
  		pr_err("cannot register notifier %d)
  ", ret);
57539c1cf   Donald Johnson   watchdog: Intel S...
529
530
531
532
533
534
535
536
537
  		goto register_reboot_error;
  	}
  
  	watchdog_device.miscdev.minor = WATCHDOG_MINOR;
  	watchdog_device.miscdev.name = "watchdog";
  	watchdog_device.miscdev.fops = &intel_scu_fops;
  
  	ret = misc_register(&watchdog_device.miscdev);
  	if (ret) {
27c766aaa   Joe Perches   watchdog: Use pr_...
538
539
540
  		pr_err("cannot register miscdev %d err =%d
  ",
  		       WATCHDOG_MINOR, ret);
57539c1cf   Donald Johnson   watchdog: Intel S...
541
542
543
544
545
546
547
548
  		goto misc_register_error;
  	}
  
  	ret = request_irq((unsigned int)watchdog_device.timer_tbl_ptr->irq,
  		watchdog_timer_interrupt,
  		IRQF_SHARED, "watchdog",
  		&watchdog_device.timer_load_count_addr);
  	if (ret) {
27c766aaa   Joe Perches   watchdog: Use pr_...
549
550
  		pr_err("error requesting irq %d
  ", ret);
57539c1cf   Donald Johnson   watchdog: Intel S...
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
  		goto request_irq_error;
  	}
  	/* Make sure timer is disabled before returning */
  	intel_scu_stop();
  	return 0;
  
  /* error cleanup */
  
  request_irq_error:
  	misc_deregister(&watchdog_device.miscdev);
  misc_register_error:
  	unregister_reboot_notifier(&watchdog_device.intel_scu_notifier);
  register_reboot_error:
  	intel_scu_stop();
  	iounmap(watchdog_device.timer_load_count_addr);
  	return ret;
  }
  
  static void __exit intel_scu_watchdog_exit(void)
  {
  
  	misc_deregister(&watchdog_device.miscdev);
  	unregister_reboot_notifier(&watchdog_device.intel_scu_notifier);
  	/* disable the timer */
  	iowrite32(0x00000002, watchdog_device.timer_control_addr);
  	iounmap(watchdog_device.timer_load_count_addr);
  }
  
  late_initcall(intel_scu_watchdog_init);
  module_exit(intel_scu_watchdog_exit);
  
  MODULE_AUTHOR("Intel Corporation");
  MODULE_DESCRIPTION("Intel SCU Watchdog Device Driver");
  MODULE_LICENSE("GPL");
57539c1cf   Donald Johnson   watchdog: Intel S...
585
  MODULE_VERSION(WDT_VER);