diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/Kconfig | 28 | ||||
-rw-r--r-- | drivers/watchdog/booke_wdt.c | 47 | ||||
-rw-r--r-- | drivers/watchdog/octeon-wdt-main.c | 1 | ||||
-rw-r--r-- | drivers/watchdog/sb_wdog.c | 12 | ||||
-rw-r--r-- | drivers/watchdog/ts72xx_wdt.c | 3 |
5 files changed, 75 insertions, 16 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index b036677df8c4..c356146bd712 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -213,11 +213,11 @@ config OMAP_WATCHDOG | |||
213 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. | 213 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. |
214 | 214 | ||
215 | config PNX4008_WATCHDOG | 215 | config PNX4008_WATCHDOG |
216 | tristate "PNX4008 Watchdog" | 216 | tristate "PNX4008 and LPC32XX Watchdog" |
217 | depends on ARCH_PNX4008 | 217 | depends on ARCH_PNX4008 || ARCH_LPC32XX |
218 | help | 218 | help |
219 | Say Y here if to include support for the watchdog timer | 219 | Say Y here if to include support for the watchdog timer |
220 | in the PNX4008 processor. | 220 | in the PNX4008 or LPC32XX processor. |
221 | This driver can be built as a module by choosing M. The module | 221 | This driver can be built as a module by choosing M. The module |
222 | will be called pnx4008_wdt. | 222 | will be called pnx4008_wdt. |
223 | 223 | ||
@@ -957,12 +957,32 @@ config PIKA_WDT | |||
957 | the Warp platform. | 957 | the Warp platform. |
958 | 958 | ||
959 | config BOOKE_WDT | 959 | config BOOKE_WDT |
960 | bool "PowerPC Book-E Watchdog Timer" | 960 | tristate "PowerPC Book-E Watchdog Timer" |
961 | depends on BOOKE || 4xx | 961 | depends on BOOKE || 4xx |
962 | ---help--- | 962 | ---help--- |
963 | Watchdog driver for PowerPC Book-E chips, such as the Freescale | ||
964 | MPC85xx SOCs and the IBM PowerPC 440. | ||
965 | |||
963 | Please see Documentation/watchdog/watchdog-api.txt for | 966 | Please see Documentation/watchdog/watchdog-api.txt for |
964 | more information. | 967 | more information. |
965 | 968 | ||
969 | config BOOKE_WDT_DEFAULT_TIMEOUT | ||
970 | int "PowerPC Book-E Watchdog Timer Default Timeout" | ||
971 | depends on BOOKE_WDT | ||
972 | default 38 if FSL_BOOKE | ||
973 | range 0 63 if FSL_BOOKE | ||
974 | default 3 if !FSL_BOOKE | ||
975 | range 0 3 if !FSL_BOOKE | ||
976 | help | ||
977 | Select the default watchdog timer period to be used by the PowerPC | ||
978 | Book-E watchdog driver. A watchdog "event" occurs when the bit | ||
979 | position represented by this number transitions from zero to one. | ||
980 | |||
981 | For Freescale Book-E processors, this is a number between 0 and 63. | ||
982 | For other Book-E processors, this is a number between 0 and 3. | ||
983 | |||
984 | The value can be overidden by the wdt_period command-line parameter. | ||
985 | |||
966 | # PPC64 Architecture | 986 | # PPC64 Architecture |
967 | 987 | ||
968 | config WATCHDOG_RTAS | 988 | config WATCHDOG_RTAS |
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 3d49671cdf5a..d11ffb091b0d 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Author: Matthew McClintock | 4 | * Author: Matthew McClintock |
5 | * Maintainer: Kumar Gala <galak@kernel.crashing.org> | 5 | * Maintainer: Kumar Gala <galak@kernel.crashing.org> |
6 | * | 6 | * |
7 | * Copyright 2005, 2008 Freescale Semiconductor Inc. | 7 | * Copyright 2005, 2008, 2010 Freescale Semiconductor Inc. |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify it | 9 | * This program is free software; you can redistribute it and/or modify it |
10 | * under the terms of the GNU General Public License as published by the | 10 | * under the terms of the GNU General Public License as published by the |
@@ -33,14 +33,8 @@ | |||
33 | * occur, and the final time the board will reset. | 33 | * occur, and the final time the board will reset. |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #ifdef CONFIG_FSL_BOOKE | ||
37 | #define WDT_PERIOD_DEFAULT 38 /* Ex. wdt_period=28 bus=333Mhz,reset=~40sec */ | ||
38 | #else | ||
39 | #define WDT_PERIOD_DEFAULT 3 /* Refer to the PPC40x and PPC4xx manuals */ | ||
40 | #endif /* for timing information */ | ||
41 | |||
42 | u32 booke_wdt_enabled; | 36 | u32 booke_wdt_enabled; |
43 | u32 booke_wdt_period = WDT_PERIOD_DEFAULT; | 37 | u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT; |
44 | 38 | ||
45 | #ifdef CONFIG_FSL_BOOKE | 39 | #ifdef CONFIG_FSL_BOOKE |
46 | #define WDTP(x) ((((x)&0x3)<<30)|(((x)&0x3c)<<15)) | 40 | #define WDTP(x) ((((x)&0x3)<<30)|(((x)&0x3c)<<15)) |
@@ -114,6 +108,27 @@ static void __booke_wdt_enable(void *data) | |||
114 | mtspr(SPRN_TCR, val); | 108 | mtspr(SPRN_TCR, val); |
115 | } | 109 | } |
116 | 110 | ||
111 | /** | ||
112 | * booke_wdt_disable - disable the watchdog on the given CPU | ||
113 | * | ||
114 | * This function is called on each CPU. It disables the watchdog on that CPU. | ||
115 | * | ||
116 | * TCR[WRC] cannot be changed once it has been set to non-zero, but we can | ||
117 | * effectively disable the watchdog by setting its period to the maximum value. | ||
118 | */ | ||
119 | static void __booke_wdt_disable(void *data) | ||
120 | { | ||
121 | u32 val; | ||
122 | |||
123 | val = mfspr(SPRN_TCR); | ||
124 | val &= ~(TCR_WIE | WDTP_MASK); | ||
125 | mtspr(SPRN_TCR, val); | ||
126 | |||
127 | /* clear status to make sure nothing is pending */ | ||
128 | __booke_wdt_ping(NULL); | ||
129 | |||
130 | } | ||
131 | |||
117 | static ssize_t booke_wdt_write(struct file *file, const char __user *buf, | 132 | static ssize_t booke_wdt_write(struct file *file, const char __user *buf, |
118 | size_t count, loff_t *ppos) | 133 | size_t count, loff_t *ppos) |
119 | { | 134 | { |
@@ -193,12 +208,21 @@ static int booke_wdt_open(struct inode *inode, struct file *file) | |||
193 | return nonseekable_open(inode, file); | 208 | return nonseekable_open(inode, file); |
194 | } | 209 | } |
195 | 210 | ||
211 | static int booke_wdt_release(struct inode *inode, struct file *file) | ||
212 | { | ||
213 | on_each_cpu(__booke_wdt_disable, NULL, 0); | ||
214 | booke_wdt_enabled = 0; | ||
215 | |||
216 | return 0; | ||
217 | } | ||
218 | |||
196 | static const struct file_operations booke_wdt_fops = { | 219 | static const struct file_operations booke_wdt_fops = { |
197 | .owner = THIS_MODULE, | 220 | .owner = THIS_MODULE, |
198 | .llseek = no_llseek, | 221 | .llseek = no_llseek, |
199 | .write = booke_wdt_write, | 222 | .write = booke_wdt_write, |
200 | .unlocked_ioctl = booke_wdt_ioctl, | 223 | .unlocked_ioctl = booke_wdt_ioctl, |
201 | .open = booke_wdt_open, | 224 | .open = booke_wdt_open, |
225 | .release = booke_wdt_release, | ||
202 | }; | 226 | }; |
203 | 227 | ||
204 | static struct miscdevice booke_wdt_miscdev = { | 228 | static struct miscdevice booke_wdt_miscdev = { |
@@ -237,4 +261,9 @@ static int __init booke_wdt_init(void) | |||
237 | 261 | ||
238 | return ret; | 262 | return ret; |
239 | } | 263 | } |
240 | device_initcall(booke_wdt_init); | 264 | |
265 | module_init(booke_wdt_init); | ||
266 | module_exit(booke_wdt_exit); | ||
267 | |||
268 | MODULE_DESCRIPTION("PowerPC Book-E watchdog driver"); | ||
269 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c index 2a410170eca6..909923800a02 100644 --- a/drivers/watchdog/octeon-wdt-main.c +++ b/drivers/watchdog/octeon-wdt-main.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #include <linux/cpu.h> | 64 | #include <linux/cpu.h> |
65 | #include <linux/smp.h> | 65 | #include <linux/smp.h> |
66 | #include <linux/fs.h> | 66 | #include <linux/fs.h> |
67 | #include <linux/irq.h> | ||
67 | 68 | ||
68 | #include <asm/mipsregs.h> | 69 | #include <asm/mipsregs.h> |
69 | #include <asm/uasm.h> | 70 | #include <asm/uasm.h> |
diff --git a/drivers/watchdog/sb_wdog.c b/drivers/watchdog/sb_wdog.c index 88c83aa57303..f31493e65b38 100644 --- a/drivers/watchdog/sb_wdog.c +++ b/drivers/watchdog/sb_wdog.c | |||
@@ -305,7 +305,7 @@ static int __init sbwdog_init(void) | |||
305 | if (ret) { | 305 | if (ret) { |
306 | printk(KERN_ERR "%s: failed to request irq 1 - %d\n", | 306 | printk(KERN_ERR "%s: failed to request irq 1 - %d\n", |
307 | ident.identity, ret); | 307 | ident.identity, ret); |
308 | return ret; | 308 | goto out; |
309 | } | 309 | } |
310 | 310 | ||
311 | ret = misc_register(&sbwdog_miscdev); | 311 | ret = misc_register(&sbwdog_miscdev); |
@@ -313,14 +313,20 @@ static int __init sbwdog_init(void) | |||
313 | printk(KERN_INFO "%s: timeout is %ld.%ld secs\n", | 313 | printk(KERN_INFO "%s: timeout is %ld.%ld secs\n", |
314 | ident.identity, | 314 | ident.identity, |
315 | timeout / 1000000, (timeout / 100000) % 10); | 315 | timeout / 1000000, (timeout / 100000) % 10); |
316 | } else | 316 | return 0; |
317 | free_irq(1, (void *)user_dog); | 317 | } |
318 | free_irq(1, (void *)user_dog); | ||
319 | out: | ||
320 | unregister_reboot_notifier(&sbwdog_notifier); | ||
321 | |||
318 | return ret; | 322 | return ret; |
319 | } | 323 | } |
320 | 324 | ||
321 | static void __exit sbwdog_exit(void) | 325 | static void __exit sbwdog_exit(void) |
322 | { | 326 | { |
323 | misc_deregister(&sbwdog_miscdev); | 327 | misc_deregister(&sbwdog_miscdev); |
328 | free_irq(1, (void *)user_dog); | ||
329 | unregister_reboot_notifier(&sbwdog_notifier); | ||
324 | } | 330 | } |
325 | 331 | ||
326 | module_init(sbwdog_init); | 332 | module_init(sbwdog_init); |
diff --git a/drivers/watchdog/ts72xx_wdt.c b/drivers/watchdog/ts72xx_wdt.c index 458c499c1223..18cdeb4c4258 100644 --- a/drivers/watchdog/ts72xx_wdt.c +++ b/drivers/watchdog/ts72xx_wdt.c | |||
@@ -449,6 +449,9 @@ static __devinit int ts72xx_wdt_probe(struct platform_device *pdev) | |||
449 | wdt->pdev = pdev; | 449 | wdt->pdev = pdev; |
450 | mutex_init(&wdt->lock); | 450 | mutex_init(&wdt->lock); |
451 | 451 | ||
452 | /* make sure that the watchdog is disabled */ | ||
453 | ts72xx_wdt_stop(wdt); | ||
454 | |||
452 | error = misc_register(&ts72xx_wdt_miscdev); | 455 | error = misc_register(&ts72xx_wdt_miscdev); |
453 | if (error) { | 456 | if (error) { |
454 | dev_err(&pdev->dev, "failed to register miscdev\n"); | 457 | dev_err(&pdev->dev, "failed to register miscdev\n"); |