diff options
author | Aaron Sierra <asierra@xes-inc.com> | 2012-04-20 15:14:11 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-09 11:20:09 -0400 |
commit | 887c8ec7219fc8eba78bb8f44a74c660934e9b98 (patch) | |
tree | c7f5b2d24c984a7ca57120dd057cd3cd2f6efee2 /drivers/watchdog/iTCO_vendor_support.c | |
parent | 16c5c023aac86228e3e94c4bf6d19708ea861a05 (diff) |
watchdog: Convert iTCO_wdt driver to mfd model
This patch converts the iTCO_wdt driver to use the multi-function device
driver model. It uses resources discovered by the lpc_ich driver, so that
it no longer does its own PCI scanning.
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/watchdog/iTCO_vendor_support.c')
-rw-r--r-- | drivers/watchdog/iTCO_vendor_support.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/watchdog/iTCO_vendor_support.c b/drivers/watchdog/iTCO_vendor_support.c index 2721d29ce243..b6b2f90b5d44 100644 --- a/drivers/watchdog/iTCO_vendor_support.c +++ b/drivers/watchdog/iTCO_vendor_support.c | |||
@@ -35,11 +35,6 @@ | |||
35 | 35 | ||
36 | #include "iTCO_vendor.h" | 36 | #include "iTCO_vendor.h" |
37 | 37 | ||
38 | /* iTCO defines */ | ||
39 | #define SMI_EN (acpibase + 0x30) /* SMI Control and Enable Register */ | ||
40 | #define TCOBASE (acpibase + 0x60) /* TCO base address */ | ||
41 | #define TCO1_STS (TCOBASE + 0x04) /* TCO1 Status Register */ | ||
42 | |||
43 | /* List of vendor support modes */ | 38 | /* List of vendor support modes */ |
44 | /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */ | 39 | /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */ |
45 | #define SUPERMICRO_OLD_BOARD 1 | 40 | #define SUPERMICRO_OLD_BOARD 1 |
@@ -82,24 +77,24 @@ MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=" | |||
82 | * 20.6 seconds. | 77 | * 20.6 seconds. |
83 | */ | 78 | */ |
84 | 79 | ||
85 | static void supermicro_old_pre_start(unsigned long acpibase) | 80 | static void supermicro_old_pre_start(struct resource *smires) |
86 | { | 81 | { |
87 | unsigned long val32; | 82 | unsigned long val32; |
88 | 83 | ||
89 | /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */ | 84 | /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */ |
90 | val32 = inl(SMI_EN); | 85 | val32 = inl(smires->start); |
91 | val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */ | 86 | val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */ |
92 | outl(val32, SMI_EN); /* Needed to activate watchdog */ | 87 | outl(val32, smires->start); /* Needed to activate watchdog */ |
93 | } | 88 | } |
94 | 89 | ||
95 | static void supermicro_old_pre_stop(unsigned long acpibase) | 90 | static void supermicro_old_pre_stop(struct resource *smires) |
96 | { | 91 | { |
97 | unsigned long val32; | 92 | unsigned long val32; |
98 | 93 | ||
99 | /* Bit 13: TCO_EN -> 1 = Enables the TCO logic to generate SMI# */ | 94 | /* Bit 13: TCO_EN -> 1 = Enables the TCO logic to generate SMI# */ |
100 | val32 = inl(SMI_EN); | 95 | val32 = inl(smires->start); |
101 | val32 |= 0x00002000; /* Turn on SMI clearing watchdog */ | 96 | val32 |= 0x00002000; /* Turn on SMI clearing watchdog */ |
102 | outl(val32, SMI_EN); /* Needed to deactivate watchdog */ | 97 | outl(val32, smires->start); /* Needed to deactivate watchdog */ |
103 | } | 98 | } |
104 | 99 | ||
105 | /* | 100 | /* |
@@ -270,66 +265,66 @@ static void supermicro_new_pre_set_heartbeat(unsigned int heartbeat) | |||
270 | * Don't use this fix if you don't need to!!! | 265 | * Don't use this fix if you don't need to!!! |
271 | */ | 266 | */ |
272 | 267 | ||
273 | static void broken_bios_start(unsigned long acpibase) | 268 | static void broken_bios_start(struct resource *smires) |
274 | { | 269 | { |
275 | unsigned long val32; | 270 | unsigned long val32; |
276 | 271 | ||
277 | val32 = inl(SMI_EN); | 272 | val32 = inl(smires->start); |
278 | /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# | 273 | /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# |
279 | Bit 0: GBL_SMI_EN -> 0 = No SMI# will be generated by ICH. */ | 274 | Bit 0: GBL_SMI_EN -> 0 = No SMI# will be generated by ICH. */ |
280 | val32 &= 0xffffdffe; | 275 | val32 &= 0xffffdffe; |
281 | outl(val32, SMI_EN); | 276 | outl(val32, smires->start); |
282 | } | 277 | } |
283 | 278 | ||
284 | static void broken_bios_stop(unsigned long acpibase) | 279 | static void broken_bios_stop(struct resource *smires) |
285 | { | 280 | { |
286 | unsigned long val32; | 281 | unsigned long val32; |
287 | 282 | ||
288 | val32 = inl(SMI_EN); | 283 | val32 = inl(smires->start); |
289 | /* Bit 13: TCO_EN -> 1 = Enables TCO logic generating an SMI# | 284 | /* Bit 13: TCO_EN -> 1 = Enables TCO logic generating an SMI# |
290 | Bit 0: GBL_SMI_EN -> 1 = Turn global SMI on again. */ | 285 | Bit 0: GBL_SMI_EN -> 1 = Turn global SMI on again. */ |
291 | val32 |= 0x00002001; | 286 | val32 |= 0x00002001; |
292 | outl(val32, SMI_EN); | 287 | outl(val32, smires->start); |
293 | } | 288 | } |
294 | 289 | ||
295 | /* | 290 | /* |
296 | * Generic Support Functions | 291 | * Generic Support Functions |
297 | */ | 292 | */ |
298 | 293 | ||
299 | void iTCO_vendor_pre_start(unsigned long acpibase, | 294 | void iTCO_vendor_pre_start(struct resource *smires, |
300 | unsigned int heartbeat) | 295 | unsigned int heartbeat) |
301 | { | 296 | { |
302 | switch (vendorsupport) { | 297 | switch (vendorsupport) { |
303 | case SUPERMICRO_OLD_BOARD: | 298 | case SUPERMICRO_OLD_BOARD: |
304 | supermicro_old_pre_start(acpibase); | 299 | supermicro_old_pre_start(smires); |
305 | break; | 300 | break; |
306 | case SUPERMICRO_NEW_BOARD: | 301 | case SUPERMICRO_NEW_BOARD: |
307 | supermicro_new_pre_start(heartbeat); | 302 | supermicro_new_pre_start(heartbeat); |
308 | break; | 303 | break; |
309 | case BROKEN_BIOS: | 304 | case BROKEN_BIOS: |
310 | broken_bios_start(acpibase); | 305 | broken_bios_start(smires); |
311 | break; | 306 | break; |
312 | } | 307 | } |
313 | } | 308 | } |
314 | EXPORT_SYMBOL(iTCO_vendor_pre_start); | 309 | EXPORT_SYMBOL(iTCO_vendor_pre_start); |
315 | 310 | ||
316 | void iTCO_vendor_pre_stop(unsigned long acpibase) | 311 | void iTCO_vendor_pre_stop(struct resource *smires) |
317 | { | 312 | { |
318 | switch (vendorsupport) { | 313 | switch (vendorsupport) { |
319 | case SUPERMICRO_OLD_BOARD: | 314 | case SUPERMICRO_OLD_BOARD: |
320 | supermicro_old_pre_stop(acpibase); | 315 | supermicro_old_pre_stop(smires); |
321 | break; | 316 | break; |
322 | case SUPERMICRO_NEW_BOARD: | 317 | case SUPERMICRO_NEW_BOARD: |
323 | supermicro_new_pre_stop(); | 318 | supermicro_new_pre_stop(); |
324 | break; | 319 | break; |
325 | case BROKEN_BIOS: | 320 | case BROKEN_BIOS: |
326 | broken_bios_stop(acpibase); | 321 | broken_bios_stop(smires); |
327 | break; | 322 | break; |
328 | } | 323 | } |
329 | } | 324 | } |
330 | EXPORT_SYMBOL(iTCO_vendor_pre_stop); | 325 | EXPORT_SYMBOL(iTCO_vendor_pre_stop); |
331 | 326 | ||
332 | void iTCO_vendor_pre_keepalive(unsigned long acpibase, unsigned int heartbeat) | 327 | void iTCO_vendor_pre_keepalive(struct resource *smires, unsigned int heartbeat) |
333 | { | 328 | { |
334 | if (vendorsupport == SUPERMICRO_NEW_BOARD) | 329 | if (vendorsupport == SUPERMICRO_NEW_BOARD) |
335 | supermicro_new_pre_set_heartbeat(heartbeat); | 330 | supermicro_new_pre_set_heartbeat(heartbeat); |