diff options
Diffstat (limited to 'drivers/char/watchdog/i6300esb.c')
-rw-r--r-- | drivers/char/watchdog/i6300esb.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/drivers/char/watchdog/i6300esb.c b/drivers/char/watchdog/i6300esb.c index 575d6cd9e59a..93785f13242e 100644 --- a/drivers/char/watchdog/i6300esb.c +++ b/drivers/char/watchdog/i6300esb.c | |||
@@ -1,20 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * i6300esb 0.03: Watchdog timer driver for Intel 6300ESB chipset | 2 | * i6300esb: Watchdog timer driver for Intel 6300ESB chipset |
3 | * | 3 | * |
4 | * (c) Copyright 2004 Google Inc. | 4 | * (c) Copyright 2004 Google Inc. |
5 | * (c) Copyright 2005 David Härdeman <david@2gen.com> | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
8 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
9 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
10 | * | 11 | * |
11 | * based on i810-tco.c which is | 12 | * based on i810-tco.c which is in turn based on softdog.c |
12 | * | ||
13 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de> | ||
14 | * developed for | ||
15 | * Jentro AG, Haar/Munich (Germany) | ||
16 | * | ||
17 | * which is in turn based on softdog.c by Alan Cox <alan@redhat.com> | ||
18 | * | 13 | * |
19 | * The timer is implemented in the following I/O controller hubs: | 14 | * The timer is implemented in the following I/O controller hubs: |
20 | * (See the intel documentation on http://developer.intel.com.) | 15 | * (See the intel documentation on http://developer.intel.com.) |
@@ -47,14 +42,39 @@ | |||
47 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
48 | #include <asm/io.h> | 43 | #include <asm/io.h> |
49 | 44 | ||
50 | #include "i6300esb.h" | ||
51 | |||
52 | /* Module and version information */ | 45 | /* Module and version information */ |
53 | #define ESB_VERSION "0.03" | 46 | #define ESB_VERSION "0.03" |
54 | #define ESB_MODULE_NAME "i6300ESB timer" | 47 | #define ESB_MODULE_NAME "i6300ESB timer" |
55 | #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION | 48 | #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION |
56 | #define PFX ESB_MODULE_NAME ": " | 49 | #define PFX ESB_MODULE_NAME ": " |
57 | 50 | ||
51 | /* PCI configuration registers */ | ||
52 | #define ESB_CONFIG_REG 0x60 /* Config register */ | ||
53 | #define ESB_LOCK_REG 0x68 /* WDT lock register */ | ||
54 | |||
55 | /* Memory mapped registers */ | ||
56 | #define ESB_TIMER1_REG BASEADDR + 0x00 /* Timer1 value after each reset */ | ||
57 | #define ESB_TIMER2_REG BASEADDR + 0x04 /* Timer2 value after each reset */ | ||
58 | #define ESB_GINTSR_REG BASEADDR + 0x08 /* General Interrupt Status Register */ | ||
59 | #define ESB_RELOAD_REG BASEADDR + 0x0c /* Reload register */ | ||
60 | |||
61 | /* Lock register bits */ | ||
62 | #define ESB_WDT_FUNC ( 0x01 << 2 ) /* Watchdog functionality */ | ||
63 | #define ESB_WDT_ENABLE ( 0x01 << 1 ) /* Enable WDT */ | ||
64 | #define ESB_WDT_LOCK ( 0x01 << 0 ) /* Lock (nowayout) */ | ||
65 | |||
66 | /* Config register bits */ | ||
67 | #define ESB_WDT_REBOOT ( 0x01 << 5 ) /* Enable reboot on timeout */ | ||
68 | #define ESB_WDT_FREQ ( 0x01 << 2 ) /* Decrement frequency */ | ||
69 | #define ESB_WDT_INTTYPE ( 0x11 << 0 ) /* Interrupt type on timer1 timeout */ | ||
70 | |||
71 | /* Reload register bits */ | ||
72 | #define ESB_WDT_RELOAD ( 0x01 << 8 ) /* prevent timeout */ | ||
73 | |||
74 | /* Magic constants */ | ||
75 | #define ESB_UNLOCK1 0x80 /* Step 1 to unlock reset registers */ | ||
76 | #define ESB_UNLOCK2 0x86 /* Step 2 to unlock reset registers */ | ||
77 | |||
58 | /* internal variables */ | 78 | /* internal variables */ |
59 | static void __iomem *BASEADDR; | 79 | static void __iomem *BASEADDR; |
60 | static spinlock_t esb_lock; /* Guards the hardware */ | 80 | static spinlock_t esb_lock; /* Guards the hardware */ |