diff options
-rw-r--r-- | arch/ppc/kernel/setup.c | 8 | ||||
-rw-r--r-- | drivers/char/watchdog/Kconfig | 3 | ||||
-rw-r--r-- | drivers/char/watchdog/booke_wdt.c | 23 | ||||
-rw-r--r-- | include/asm-ppc/system.h | 4 |
4 files changed, 21 insertions, 17 deletions
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index 9c44588f0afb..545cfd0fab59 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c | |||
@@ -623,10 +623,8 @@ machine_init(unsigned long r3, unsigned long r4, unsigned long r5, | |||
623 | /* Checks wdt=x and wdt_period=xx command-line option */ | 623 | /* Checks wdt=x and wdt_period=xx command-line option */ |
624 | int __init early_parse_wdt(char *p) | 624 | int __init early_parse_wdt(char *p) |
625 | { | 625 | { |
626 | extern u32 wdt_enable; | ||
627 | |||
628 | if (p && strncmp(p, "0", 1) != 0) | 626 | if (p && strncmp(p, "0", 1) != 0) |
629 | wdt_enable = 1; | 627 | booke_wdt_enabled = 1; |
630 | 628 | ||
631 | return 0; | 629 | return 0; |
632 | } | 630 | } |
@@ -634,10 +632,8 @@ early_param("wdt", early_parse_wdt); | |||
634 | 632 | ||
635 | int __init early_parse_wdt_period (char *p) | 633 | int __init early_parse_wdt_period (char *p) |
636 | { | 634 | { |
637 | extern u32 wdt_period; | ||
638 | |||
639 | if (p) | 635 | if (p) |
640 | wdt_period = simple_strtoul(p, NULL, 0); | 636 | booke_wdt_period = simple_strtoul(p, NULL, 0); |
641 | 637 | ||
642 | return 0; | 638 | return 0; |
643 | } | 639 | } |
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig index 95335b443a8f..c3898afce3ae 100644 --- a/drivers/char/watchdog/Kconfig +++ b/drivers/char/watchdog/Kconfig | |||
@@ -349,6 +349,9 @@ config 8xx_WDT | |||
349 | config BOOKE_WDT | 349 | config BOOKE_WDT |
350 | tristate "PowerPC Book-E Watchdog Timer" | 350 | tristate "PowerPC Book-E Watchdog Timer" |
351 | depends on WATCHDOG && (BOOKE || 4xx) | 351 | depends on WATCHDOG && (BOOKE || 4xx) |
352 | ---help--- | ||
353 | Please see Documentation/watchdog/watchdog-api.txt for | ||
354 | more information. | ||
352 | 355 | ||
353 | # MIPS Architecture | 356 | # MIPS Architecture |
354 | 357 | ||
diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c index 7281f394f682..abc30cca6645 100644 --- a/drivers/char/watchdog/booke_wdt.c +++ b/drivers/char/watchdog/booke_wdt.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <asm/reg_booke.h> | 24 | #include <asm/reg_booke.h> |
25 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
26 | #include <asm/system.h> | ||
26 | 27 | ||
27 | /* If the kernel parameter wdt_enable=1, the watchdog will be enabled at boot. | 28 | /* If the kernel parameter wdt_enable=1, the watchdog will be enabled at boot. |
28 | * Also, the wdt_period sets the watchdog timer period timeout. | 29 | * Also, the wdt_period sets the watchdog timer period timeout. |
@@ -38,8 +39,8 @@ | |||
38 | #define WDT_PERIOD_DEFAULT 4 /* Refer to the PPC40x and PPC4xx manuals */ | 39 | #define WDT_PERIOD_DEFAULT 4 /* Refer to the PPC40x and PPC4xx manuals */ |
39 | #endif /* for timing information */ | 40 | #endif /* for timing information */ |
40 | 41 | ||
41 | u32 wdt_enable = 0; | 42 | u32 booke_wdt_enabled = 0; |
42 | u32 wdt_period = WDT_PERIOD_DEFAULT; | 43 | u32 booke_wdt_period = WDT_PERIOD_DEFAULT; |
43 | 44 | ||
44 | #ifdef CONFIG_FSL_BOOKE | 45 | #ifdef CONFIG_FSL_BOOKE |
45 | #define WDTP(x) ((((63-x)&0x3)<<30)|(((63-x)&0x3c)<<15)) | 46 | #define WDTP(x) ((((63-x)&0x3)<<30)|(((63-x)&0x3c)<<15)) |
@@ -55,7 +56,7 @@ static __inline__ void booke_wdt_enable(void) | |||
55 | u32 val; | 56 | u32 val; |
56 | 57 | ||
57 | val = mfspr(SPRN_TCR); | 58 | val = mfspr(SPRN_TCR); |
58 | val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(wdt_period)); | 59 | val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); |
59 | 60 | ||
60 | mtspr(SPRN_TCR, val); | 61 | mtspr(SPRN_TCR, val); |
61 | } | 62 | } |
@@ -108,12 +109,12 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file, | |||
108 | booke_wdt_ping(); | 109 | booke_wdt_ping(); |
109 | return 0; | 110 | return 0; |
110 | case WDIOC_SETTIMEOUT: | 111 | case WDIOC_SETTIMEOUT: |
111 | if (get_user(wdt_period, (u32 *) arg)) | 112 | if (get_user(booke_wdt_period, (u32 *) arg)) |
112 | return -EFAULT; | 113 | return -EFAULT; |
113 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(wdt_period)); | 114 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period)); |
114 | return 0; | 115 | return 0; |
115 | case WDIOC_GETTIMEOUT: | 116 | case WDIOC_GETTIMEOUT: |
116 | return put_user(wdt_period, (u32 *) arg); | 117 | return put_user(booke_wdt_period, (u32 *) arg); |
117 | case WDIOC_SETOPTIONS: | 118 | case WDIOC_SETOPTIONS: |
118 | if (get_user(tmp, (u32 *) arg)) | 119 | if (get_user(tmp, (u32 *) arg)) |
119 | return -EINVAL; | 120 | return -EINVAL; |
@@ -134,11 +135,11 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file, | |||
134 | */ | 135 | */ |
135 | static int booke_wdt_open (struct inode *inode, struct file *file) | 136 | static int booke_wdt_open (struct inode *inode, struct file *file) |
136 | { | 137 | { |
137 | if (wdt_enable == 0) { | 138 | if (booke_wdt_enabled == 0) { |
138 | wdt_enable = 1; | 139 | booke_wdt_enabled = 1; |
139 | booke_wdt_enable(); | 140 | booke_wdt_enable(); |
140 | printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n", | 141 | printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n", |
141 | wdt_period); | 142 | booke_wdt_period); |
142 | } | 143 | } |
143 | 144 | ||
144 | return 0; | 145 | return 0; |
@@ -180,9 +181,9 @@ static int __init booke_wdt_init(void) | |||
180 | return ret; | 181 | return ret; |
181 | } | 182 | } |
182 | 183 | ||
183 | if (wdt_enable == 1) { | 184 | if (booke_wdt_enabled == 1) { |
184 | printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n", | 185 | printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n", |
185 | wdt_period); | 186 | booke_wdt_period); |
186 | booke_wdt_enable(); | 187 | booke_wdt_enable(); |
187 | } | 188 | } |
188 | 189 | ||
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 82395f30004b..be6557746ab6 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h | |||
@@ -87,6 +87,10 @@ extern void cacheable_memzero(void *p, unsigned int nb); | |||
87 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); | 87 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); |
88 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); | 88 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); |
89 | extern void die(const char *, struct pt_regs *, long); | 89 | extern void die(const char *, struct pt_regs *, long); |
90 | #ifdef CONFIG_BOOKE_WDT | ||
91 | extern u32 booke_wdt_enabled; | ||
92 | extern u32 booke_wdt_period; | ||
93 | #endif /* CONFIG_BOOKE_WDT */ | ||
90 | 94 | ||
91 | struct device_node; | 95 | struct device_node; |
92 | extern void note_scsi_host(struct device_node *, void *); | 96 | extern void note_scsi_host(struct device_node *, void *); |