aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 13:03:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 13:03:44 -0500
commit6150c32589d1976ca8a5c987df951088c05a7542 (patch)
tree94073696576323ff966e365d8c47b8ecd8372f97 /drivers/char/watchdog
parent44637a12f80b80157d9c1bc5b7d6ef09c9e05713 (diff)
parentbe42d5fa3772241b8ecebd443f1fb36247959c54 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'drivers/char/watchdog')
-rw-r--r--drivers/char/watchdog/mpc8xx_wdt.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/char/watchdog/mpc8xx_wdt.c b/drivers/char/watchdog/mpc8xx_wdt.c
index 56d62ba7c6ce..b2fc71e20850 100644
--- a/drivers/char/watchdog/mpc8xx_wdt.c
+++ b/drivers/char/watchdog/mpc8xx_wdt.c
@@ -18,6 +18,7 @@
18#include <linux/watchdog.h> 18#include <linux/watchdog.h>
19#include <asm/8xx_immap.h> 19#include <asm/8xx_immap.h>
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21#include <asm/io.h>
21#include <syslib/m8xx_wdt.h> 22#include <syslib/m8xx_wdt.h>
22 23
23static unsigned long wdt_opened; 24static unsigned long wdt_opened;
@@ -25,18 +26,26 @@ static int wdt_status;
25 26
26static void mpc8xx_wdt_handler_disable(void) 27static void mpc8xx_wdt_handler_disable(void)
27{ 28{
28 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 29 volatile uint __iomem *piscr;
30 piscr = (uint *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;
29 31
30 imap->im_sit.sit_piscr &= ~(PISCR_PIE | PISCR_PTE); 32 if (!m8xx_has_internal_rtc)
33 m8xx_wdt_stop_timer();
34 else
35 out_be32(piscr, in_be32(piscr) & ~(PISCR_PIE | PISCR_PTE));
31 36
32 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n"); 37 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n");
33} 38}
34 39
35static void mpc8xx_wdt_handler_enable(void) 40static void mpc8xx_wdt_handler_enable(void)
36{ 41{
37 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 42 volatile uint __iomem *piscr;
43 piscr = (uint *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;
38 44
39 imap->im_sit.sit_piscr |= PISCR_PIE | PISCR_PTE; 45 if (!m8xx_has_internal_rtc)
46 m8xx_wdt_install_timer();
47 else
48 out_be32(piscr, in_be32(piscr) | PISCR_PIE | PISCR_PTE);
40 49
41 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n"); 50 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n");
42} 51}
@@ -68,9 +77,6 @@ static int mpc8xx_wdt_release(struct inode *inode, struct file *file)
68static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len, 77static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len,
69 loff_t * ppos) 78 loff_t * ppos)
70{ 79{
71 if (ppos != &file->f_pos)
72 return -ESPIPE;
73
74 if (len) 80 if (len)
75 m8xx_wdt_reset(); 81 m8xx_wdt_reset();
76 82