aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/iTCO_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/iTCO_wdt.c')
-rw-r--r--drivers/watchdog/iTCO_wdt.c223
1 files changed, 170 insertions, 53 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 6a51edde6ea7..8da886035374 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * intel TCO Watchdog Driver (Used in i82801 and i63xxESB chipsets) 2 * intel TCO Watchdog Driver
3 * 3 *
4 * (c) Copyright 2006-2009 Wim Van Sebroeck <wim@iguana.be>. 4 * (c) Copyright 2006-2009 Wim Van Sebroeck <wim@iguana.be>.
5 * 5 *
@@ -14,47 +14,24 @@
14 * 14 *
15 * The TCO watchdog is implemented in the following I/O controller hubs: 15 * The TCO watchdog is implemented in the following I/O controller hubs:
16 * (See the intel documentation on http://developer.intel.com.) 16 * (See the intel documentation on http://developer.intel.com.)
17 * 82801AA (ICH) : document number 290655-003, 290677-014, 17 * document number 290655-003, 290677-014: 82801AA (ICH), 82801AB (ICHO)
18 * 82801AB (ICHO) : document number 290655-003, 290677-014, 18 * document number 290687-002, 298242-027: 82801BA (ICH2)
19 * 82801BA (ICH2) : document number 290687-002, 298242-027, 19 * document number 290733-003, 290739-013: 82801CA (ICH3-S)
20 * 82801BAM (ICH2-M) : document number 290687-002, 298242-027, 20 * document number 290716-001, 290718-007: 82801CAM (ICH3-M)
21 * 82801CA (ICH3-S) : document number 290733-003, 290739-013, 21 * document number 290744-001, 290745-025: 82801DB (ICH4)
22 * 82801CAM (ICH3-M) : document number 290716-001, 290718-007, 22 * document number 252337-001, 252663-008: 82801DBM (ICH4-M)
23 * 82801DB (ICH4) : document number 290744-001, 290745-025, 23 * document number 273599-001, 273645-002: 82801E (C-ICH)
24 * 82801DBM (ICH4-M) : document number 252337-001, 252663-008, 24 * document number 252516-001, 252517-028: 82801EB (ICH5), 82801ER (ICH5R)
25 * 82801E (C-ICH) : document number 273599-001, 273645-002, 25 * document number 300641-004, 300884-013: 6300ESB
26 * 82801EB (ICH5) : document number 252516-001, 252517-028, 26 * document number 301473-002, 301474-026: 82801F (ICH6)
27 * 82801ER (ICH5R) : document number 252516-001, 252517-028, 27 * document number 313082-001, 313075-006: 631xESB, 632xESB
28 * 6300ESB (6300ESB) : document number 300641-004, 300884-013, 28 * document number 307013-003, 307014-024: 82801G (ICH7)
29 * 82801FB (ICH6) : document number 301473-002, 301474-026, 29 * document number 313056-003, 313057-017: 82801H (ICH8)
30 * 82801FR (ICH6R) : document number 301473-002, 301474-026, 30 * document number 316972-004, 316973-012: 82801I (ICH9)
31 * 82801FBM (ICH6-M) : document number 301473-002, 301474-026, 31 * document number 319973-002, 319974-002: 82801J (ICH10)
32 * 82801FW (ICH6W) : document number 301473-001, 301474-026, 32 * document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH)
33 * 82801FRW (ICH6RW) : document number 301473-001, 301474-026, 33 * document number 320066-003, 320257-008: EP80597 (IICH)
34 * 631xESB (631xESB) : document number 313082-001, 313075-006, 34 * document number TBD : Cougar Point (CPT)
35 * 632xESB (632xESB) : document number 313082-001, 313075-006,
36 * 82801GB (ICH7) : document number 307013-003, 307014-024,
37 * 82801GR (ICH7R) : document number 307013-003, 307014-024,
38 * 82801GDH (ICH7DH) : document number 307013-003, 307014-024,
39 * 82801GBM (ICH7-M) : document number 307013-003, 307014-024,
40 * 82801GHM (ICH7-M DH) : document number 307013-003, 307014-024,
41 * 82801GU (ICH7-U) : document number 307013-003, 307014-024,
42 * 82801HB (ICH8) : document number 313056-003, 313057-017,
43 * 82801HR (ICH8R) : document number 313056-003, 313057-017,
44 * 82801HBM (ICH8M) : document number 313056-003, 313057-017,
45 * 82801HH (ICH8DH) : document number 313056-003, 313057-017,
46 * 82801HO (ICH8DO) : document number 313056-003, 313057-017,
47 * 82801HEM (ICH8M-E) : document number 313056-003, 313057-017,
48 * 82801IB (ICH9) : document number 316972-004, 316973-012,
49 * 82801IR (ICH9R) : document number 316972-004, 316973-012,
50 * 82801IH (ICH9DH) : document number 316972-004, 316973-012,
51 * 82801IO (ICH9DO) : document number 316972-004, 316973-012,
52 * 82801IBM (ICH9M) : document number 316972-004, 316973-012,
53 * 82801IEM (ICH9M-E) : document number 316972-004, 316973-012,
54 * 82801JIB (ICH10) : document number 319973-002, 319974-002,
55 * 82801JIR (ICH10R) : document number 319973-002, 319974-002,
56 * 82801JD (ICH10D) : document number 319973-002, 319974-002,
57 * 82801JDO (ICH10DO) : document number 319973-002, 319974-002
58 */ 35 */
59 36
60/* 37/*
@@ -122,6 +99,53 @@ enum iTCO_chipsets {
122 TCO_ICH10R, /* ICH10R */ 99 TCO_ICH10R, /* ICH10R */
123 TCO_ICH10D, /* ICH10D */ 100 TCO_ICH10D, /* ICH10D */
124 TCO_ICH10DO, /* ICH10DO */ 101 TCO_ICH10DO, /* ICH10DO */
102 TCO_PCH, /* PCH Desktop Full Featured */
103 TCO_PCHM, /* PCH Mobile Full Featured */
104 TCO_P55, /* P55 */
105 TCO_PM55, /* PM55 */
106 TCO_H55, /* H55 */
107 TCO_QM57, /* QM57 */
108 TCO_H57, /* H57 */
109 TCO_HM55, /* HM55 */
110 TCO_Q57, /* Q57 */
111 TCO_HM57, /* HM57 */
112 TCO_PCHMSFF, /* PCH Mobile SFF Full Featured */
113 TCO_QS57, /* QS57 */
114 TCO_3400, /* 3400 */
115 TCO_3420, /* 3420 */
116 TCO_3450, /* 3450 */
117 TCO_EP80579, /* EP80579 */
118 TCO_CPT1, /* Cougar Point */
119 TCO_CPT2, /* Cougar Point Desktop */
120 TCO_CPT3, /* Cougar Point Mobile */
121 TCO_CPT4, /* Cougar Point */
122 TCO_CPT5, /* Cougar Point */
123 TCO_CPT6, /* Cougar Point */
124 TCO_CPT7, /* Cougar Point */
125 TCO_CPT8, /* Cougar Point */
126 TCO_CPT9, /* Cougar Point */
127 TCO_CPT10, /* Cougar Point */
128 TCO_CPT11, /* Cougar Point */
129 TCO_CPT12, /* Cougar Point */
130 TCO_CPT13, /* Cougar Point */
131 TCO_CPT14, /* Cougar Point */
132 TCO_CPT15, /* Cougar Point */
133 TCO_CPT16, /* Cougar Point */
134 TCO_CPT17, /* Cougar Point */
135 TCO_CPT18, /* Cougar Point */
136 TCO_CPT19, /* Cougar Point */
137 TCO_CPT20, /* Cougar Point */
138 TCO_CPT21, /* Cougar Point */
139 TCO_CPT22, /* Cougar Point */
140 TCO_CPT23, /* Cougar Point */
141 TCO_CPT24, /* Cougar Point */
142 TCO_CPT25, /* Cougar Point */
143 TCO_CPT26, /* Cougar Point */
144 TCO_CPT27, /* Cougar Point */
145 TCO_CPT28, /* Cougar Point */
146 TCO_CPT29, /* Cougar Point */
147 TCO_CPT30, /* Cougar Point */
148 TCO_CPT31, /* Cougar Point */
125}; 149};
126 150
127static struct { 151static struct {
@@ -162,6 +186,53 @@ static struct {
162 {"ICH10R", 2}, 186 {"ICH10R", 2},
163 {"ICH10D", 2}, 187 {"ICH10D", 2},
164 {"ICH10DO", 2}, 188 {"ICH10DO", 2},
189 {"PCH Desktop Full Featured", 2},
190 {"PCH Mobile Full Featured", 2},
191 {"P55", 2},
192 {"PM55", 2},
193 {"H55", 2},
194 {"QM57", 2},
195 {"H57", 2},
196 {"HM55", 2},
197 {"Q57", 2},
198 {"HM57", 2},
199 {"PCH Mobile SFF Full Featured", 2},
200 {"QS57", 2},
201 {"3400", 2},
202 {"3420", 2},
203 {"3450", 2},
204 {"EP80579", 2},
205 {"Cougar Point", 2},
206 {"Cougar Point", 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},
165 {NULL, 0} 236 {NULL, 0}
166}; 237};
167 238
@@ -230,6 +301,53 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
230 { ITCO_PCI_DEVICE(0x3a16, TCO_ICH10R)}, 301 { ITCO_PCI_DEVICE(0x3a16, TCO_ICH10R)},
231 { ITCO_PCI_DEVICE(0x3a1a, TCO_ICH10D)}, 302 { ITCO_PCI_DEVICE(0x3a1a, TCO_ICH10D)},
232 { ITCO_PCI_DEVICE(0x3a14, TCO_ICH10DO)}, 303 { ITCO_PCI_DEVICE(0x3a14, TCO_ICH10DO)},
304 { ITCO_PCI_DEVICE(0x3b00, TCO_PCH)},
305 { ITCO_PCI_DEVICE(0x3b01, TCO_PCHM)},
306 { ITCO_PCI_DEVICE(0x3b02, TCO_P55)},
307 { ITCO_PCI_DEVICE(0x3b03, TCO_PM55)},
308 { ITCO_PCI_DEVICE(0x3b06, TCO_H55)},
309 { ITCO_PCI_DEVICE(0x3b07, TCO_QM57)},
310 { ITCO_PCI_DEVICE(0x3b08, TCO_H57)},
311 { ITCO_PCI_DEVICE(0x3b09, TCO_HM55)},
312 { ITCO_PCI_DEVICE(0x3b0a, TCO_Q57)},
313 { ITCO_PCI_DEVICE(0x3b0b, TCO_HM57)},
314 { ITCO_PCI_DEVICE(0x3b0d, TCO_PCHMSFF)},
315 { ITCO_PCI_DEVICE(0x3b0f, TCO_QS57)},
316 { ITCO_PCI_DEVICE(0x3b12, TCO_3400)},
317 { ITCO_PCI_DEVICE(0x3b14, TCO_3420)},
318 { ITCO_PCI_DEVICE(0x3b16, TCO_3450)},
319 { ITCO_PCI_DEVICE(0x5031, TCO_EP80579)},
320 { ITCO_PCI_DEVICE(0x1c41, TCO_CPT1)},
321 { ITCO_PCI_DEVICE(0x1c42, TCO_CPT2)},
322 { ITCO_PCI_DEVICE(0x1c43, TCO_CPT3)},
323 { ITCO_PCI_DEVICE(0x1c44, TCO_CPT4)},
324 { ITCO_PCI_DEVICE(0x1c45, TCO_CPT5)},
325 { ITCO_PCI_DEVICE(0x1c46, TCO_CPT6)},
326 { ITCO_PCI_DEVICE(0x1c47, TCO_CPT7)},
327 { ITCO_PCI_DEVICE(0x1c48, TCO_CPT8)},
328 { ITCO_PCI_DEVICE(0x1c49, TCO_CPT9)},
329 { ITCO_PCI_DEVICE(0x1c4a, TCO_CPT10)},
330 { ITCO_PCI_DEVICE(0x1c4b, TCO_CPT11)},
331 { ITCO_PCI_DEVICE(0x1c4c, TCO_CPT12)},
332 { ITCO_PCI_DEVICE(0x1c4d, TCO_CPT13)},
333 { ITCO_PCI_DEVICE(0x1c4e, TCO_CPT14)},
334 { ITCO_PCI_DEVICE(0x1c4f, TCO_CPT15)},
335 { ITCO_PCI_DEVICE(0x1c50, TCO_CPT16)},
336 { ITCO_PCI_DEVICE(0x1c51, TCO_CPT17)},
337 { ITCO_PCI_DEVICE(0x1c52, TCO_CPT18)},
338 { ITCO_PCI_DEVICE(0x1c53, TCO_CPT19)},
339 { ITCO_PCI_DEVICE(0x1c54, TCO_CPT20)},
340 { ITCO_PCI_DEVICE(0x1c55, TCO_CPT21)},
341 { ITCO_PCI_DEVICE(0x1c56, TCO_CPT22)},
342 { ITCO_PCI_DEVICE(0x1c57, TCO_CPT23)},
343 { ITCO_PCI_DEVICE(0x1c58, TCO_CPT24)},
344 { ITCO_PCI_DEVICE(0x1c59, TCO_CPT25)},
345 { ITCO_PCI_DEVICE(0x1c5a, TCO_CPT26)},
346 { ITCO_PCI_DEVICE(0x1c5b, TCO_CPT27)},
347 { ITCO_PCI_DEVICE(0x1c5c, TCO_CPT28)},
348 { ITCO_PCI_DEVICE(0x1c5d, TCO_CPT29)},
349 { ITCO_PCI_DEVICE(0x1c5e, TCO_CPT30)},
350 { ITCO_PCI_DEVICE(0x1c5f, TCO_CPT31)},
233 { 0, }, /* End of list */ 351 { 0, }, /* End of list */
234}; 352};
235MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl); 353MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl);
@@ -553,7 +671,7 @@ static long iTCO_wdt_ioctl(struct file *file, unsigned int cmd,
553 int new_heartbeat; 671 int new_heartbeat;
554 void __user *argp = (void __user *)arg; 672 void __user *argp = (void __user *)arg;
555 int __user *p = argp; 673 int __user *p = argp;
556 static struct watchdog_info ident = { 674 static const struct watchdog_info ident = {
557 .options = WDIOF_SETTIMEOUT | 675 .options = WDIOF_SETTIMEOUT |
558 WDIOF_KEEPALIVEPING | 676 WDIOF_KEEPALIVEPING |
559 WDIOF_MAGICCLOSE, 677 WDIOF_MAGICCLOSE,
@@ -667,7 +785,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
667 if (iTCO_wdt_private.iTCO_version == 2) { 785 if (iTCO_wdt_private.iTCO_version == 2) {
668 pci_read_config_dword(pdev, 0xf0, &base_address); 786 pci_read_config_dword(pdev, 0xf0, &base_address);
669 if ((base_address & 1) == 0) { 787 if ((base_address & 1) == 0) {
670 printk(KERN_ERR PFX "RCBA is disabled by harddware\n"); 788 printk(KERN_ERR PFX "RCBA is disabled by hardware\n");
671 ret = -ENODEV; 789 ret = -ENODEV;
672 goto out; 790 goto out;
673 } 791 }
@@ -677,8 +795,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
677 795
678 /* Check chipset's NO_REBOOT bit */ 796 /* Check chipset's NO_REBOOT bit */
679 if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { 797 if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
680 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, " 798 printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, "
681 "reboot disabled by hardware\n"); 799 "platform may have disabled it\n");
682 ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ 800 ret = -ENODEV; /* Cannot reset NO_REBOOT bit */
683 goto out_unmap; 801 goto out_unmap;
684 } 802 }
@@ -774,6 +892,7 @@ static void __devexit iTCO_wdt_cleanup(void)
774 892
775static int __devinit iTCO_wdt_probe(struct platform_device *dev) 893static int __devinit iTCO_wdt_probe(struct platform_device *dev)
776{ 894{
895 int ret = -ENODEV;
777 int found = 0; 896 int found = 0;
778 struct pci_dev *pdev = NULL; 897 struct pci_dev *pdev = NULL;
779 const struct pci_device_id *ent; 898 const struct pci_device_id *ent;
@@ -783,19 +902,17 @@ static int __devinit iTCO_wdt_probe(struct platform_device *dev)
783 for_each_pci_dev(pdev) { 902 for_each_pci_dev(pdev) {
784 ent = pci_match_id(iTCO_wdt_pci_tbl, pdev); 903 ent = pci_match_id(iTCO_wdt_pci_tbl, pdev);
785 if (ent) { 904 if (ent) {
786 if (!(iTCO_wdt_init(pdev, ent, dev))) { 905 found++;
787 found++; 906 ret = iTCO_wdt_init(pdev, ent, dev);
907 if (!ret)
788 break; 908 break;
789 }
790 } 909 }
791 } 910 }
792 911
793 if (!found) { 912 if (!found)
794 printk(KERN_INFO PFX "No card detected\n"); 913 printk(KERN_INFO PFX "No card detected\n");
795 return -ENODEV;
796 }
797 914
798 return 0; 915 return ret;
799} 916}
800 917
801static int __devexit iTCO_wdt_remove(struct platform_device *dev) 918static int __devexit iTCO_wdt_remove(struct platform_device *dev)