Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360584
b: refs/heads/master
c: 41adafb
h: refs/heads/master
v: v3
  • Loading branch information
Takahisa Tanaka authored and Wim Van Sebroeck committed Mar 1, 2013
1 parent 1e73fdc commit 2783f40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10ab329b5db7e592a3a60b4594e4e5f40b60c45c
refs/heads/master: 41adafbd7b84c66c2cdad857b75d5d45032310a6
28 changes: 8 additions & 20 deletions trunk/drivers/watchdog/sp5100_tco.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static unsigned char sp5100_tco_setupdevice(void)
{
struct pci_dev *dev = NULL;
const char *dev_name = NULL;
u32 val;
u32 val, tmp_val;
u32 index_reg, data_reg, base_addr;

/* Match the PCI device */
Expand Down Expand Up @@ -497,31 +497,19 @@ static unsigned char sp5100_tco_setupdevice(void)
pr_debug("Got 0x%04x from resource tree\n", val);
}

/* Restore to the low three bits, if chipset is SB8x0(or later) */
if (sp5100_tco_pci->revision >= 0x40) {
u8 reserved_bit;
outb(base_addr+0, index_reg);
reserved_bit = inb(data_reg) & 0x7;
val |= (u32)reserved_bit;
}
/* Restore to the low three bits */
outb(base_addr+0, index_reg);
tmp_val = val | (inb(data_reg) & 0x7);

/* Re-programming the watchdog timer base address */
outb(base_addr+0, index_reg);
/* Low three bits of BASE are reserved */
outb((val >> 0) & 0xff, data_reg);
outb((tmp_val >> 0) & 0xff, data_reg);
outb(base_addr+1, index_reg);
outb((val >> 8) & 0xff, data_reg);
outb((tmp_val >> 8) & 0xff, data_reg);
outb(base_addr+2, index_reg);
outb((val >> 16) & 0xff, data_reg);
outb((tmp_val >> 16) & 0xff, data_reg);
outb(base_addr+3, index_reg);
outb((val >> 24) & 0xff, data_reg);

/*
* Clear unnecessary the low three bits,
* if chipset is SB8x0(or later)
*/
if (sp5100_tco_pci->revision >= 0x40)
val &= ~0x7;
outb((tmp_val >> 24) & 0xff, data_reg);

if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE,
dev_name)) {
Expand Down

0 comments on commit 2783f40

Please sign in to comment.