diff options
Diffstat (limited to 'drivers/watchdog/sp5100_tco.c')
-rw-r--r-- | drivers/watchdog/sp5100_tco.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 2b0e000d4377..e3b8f757d2d3 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c | |||
@@ -361,7 +361,7 @@ static unsigned char sp5100_tco_setupdevice(void) | |||
361 | { | 361 | { |
362 | struct pci_dev *dev = NULL; | 362 | struct pci_dev *dev = NULL; |
363 | const char *dev_name = NULL; | 363 | const char *dev_name = NULL; |
364 | u32 val; | 364 | u32 val, tmp_val; |
365 | u32 index_reg, data_reg, base_addr; | 365 | u32 index_reg, data_reg, base_addr; |
366 | 366 | ||
367 | /* Match the PCI device */ | 367 | /* Match the PCI device */ |
@@ -497,30 +497,19 @@ static unsigned char sp5100_tco_setupdevice(void) | |||
497 | pr_debug("Got 0x%04x from resource tree\n", val); | 497 | pr_debug("Got 0x%04x from resource tree\n", val); |
498 | } | 498 | } |
499 | 499 | ||
500 | /* Restore to the low three bits, if chipset is SB8x0(or later) */ | 500 | /* Restore to the low three bits */ |
501 | if (sp5100_tco_pci->revision >= 0x40) { | 501 | outb(base_addr+0, index_reg); |
502 | u8 reserved_bit; | 502 | tmp_val = val | (inb(data_reg) & 0x7); |
503 | reserved_bit = inb(base_addr) & 0x7; | ||
504 | val |= (u32)reserved_bit; | ||
505 | } | ||
506 | 503 | ||
507 | /* Re-programming the watchdog timer base address */ | 504 | /* Re-programming the watchdog timer base address */ |
508 | outb(base_addr+0, index_reg); | 505 | outb(base_addr+0, index_reg); |
509 | /* Low three bits of BASE are reserved */ | 506 | outb((tmp_val >> 0) & 0xff, data_reg); |
510 | outb((val >> 0) & 0xf8, data_reg); | ||
511 | outb(base_addr+1, index_reg); | 507 | outb(base_addr+1, index_reg); |
512 | outb((val >> 8) & 0xff, data_reg); | 508 | outb((tmp_val >> 8) & 0xff, data_reg); |
513 | outb(base_addr+2, index_reg); | 509 | outb(base_addr+2, index_reg); |
514 | outb((val >> 16) & 0xff, data_reg); | 510 | outb((tmp_val >> 16) & 0xff, data_reg); |
515 | outb(base_addr+3, index_reg); | 511 | outb(base_addr+3, index_reg); |
516 | outb((val >> 24) & 0xff, data_reg); | 512 | outb((tmp_val >> 24) & 0xff, data_reg); |
517 | |||
518 | /* | ||
519 | * Clear unnecessary the low three bits, | ||
520 | * if chipset is SB8x0(or later) | ||
521 | */ | ||
522 | if (sp5100_tco_pci->revision >= 0x40) | ||
523 | val &= ~0x7; | ||
524 | 513 | ||
525 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, | 514 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, |
526 | dev_name)) { | 515 | dev_name)) { |