1 --- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100
2 +++ linux-2.6.33/scripts/mod/modpost.c 2010-03-07 14:26:47.242168558 +0100
7 -#include "../../include/generated/autoconf.h"
8 +// PLD architectures don't use CONFIG_SYMBOL_PREFIX
9 +//#include "../../include/generated/autoconf.h"
10 #include "../../include/linux/license.h"
12 /* Some toolchains use a `_' prefix for all user symbols. */
14 --- linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh~ 2011-07-22 04:17:23.000000000 +0200
15 +++ linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh 2011-08-25 21:26:04.799150642 +0200
17 $cc -print-file-name=lib${lib}.${ext} | grep -q /
20 + for libt in tinfow tinfo ; do
21 + $cc -print-file-name=lib${libt}.${ext} | grep -q /
22 + if [ $? -eq 0 ]; then
30 diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
31 index 7a0c800..ec5ebbb 100644
32 --- a/drivers/net/ethernet/realtek/r8169.c
33 +++ b/drivers/net/ethernet/realtek/r8169.c
34 @@ -4103,6 +4103,14 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
36 for (i = 0; i < ETH_ALEN; i++)
37 dev->dev_addr[i] = RTL_R8(MAC0 + i);
39 + if (!is_valid_ether_addr(dev->dev_addr)) {
40 + /* Report it and use a random ethernet address instead */
41 + netdev_err(dev, "Invalid MAC address: %pM\n", dev->dev_addr);
42 + random_ether_addr(dev->dev_addr);
43 + netdev_info(dev, "Using random MAC address: %pM\n",
46 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
48 SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops);
53 --- linux-3.4/fs/unionfs/commonfops.c.org 2012-05-29 20:40:20.756489877 +0200
54 +++ linux-3.4/fs/unionfs/commonfops.c 2012-05-29 21:07:12.021252743 +0200
56 unsigned int cmd, unsigned long arg)
60 + unsigned long branchlist = 0;
61 int bstart = 0, bend = 0, bindex = 0;
62 int orig_bstart, orig_bend;
63 struct dentry *dentry, *lower_dentry;
65 bstart = dbstart(dentry);
68 - FD_ZERO(&branchlist);
70 for (bindex = bstart; bindex <= bend; bindex++) {
71 lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
74 if (likely(lower_dentry->d_inode))
75 - FD_SET(bindex, &branchlist);
76 + __set_bit(bindex, &branchlist);
77 /* purge any lower objects after partial_lookup */
78 if (bindex < orig_bstart || bindex > orig_bend) {
81 From patchwork Sun Aug 12 11:57:49 2012
82 Content-Type: text/plain; charset="utf-8"
84 Content-Transfer-Encoding: 7bit
85 Subject: sp5100_tco: Add SB8x0 chipset support
86 Date: Sun, 12 Aug 2012 11:57:49 -0000
87 From: Takahisa Tanaka <mc74hc00@gmail.com>
88 X-Patchwork-Id: 1309571
89 Message-Id: <1344772669-2872-1-git-send-email-mc74hc00@gmail.com>
90 To: linux-watchdog@vger.kernel.org
91 Cc: wim@iguana.be, stable@kernel.org,
92 paulepanter@users.sourceforge.net, post+kernel@ralfj.de,
93 linux-kernel@vger.kernel.org, Takahisa Tanaka <mc74hc00@gmail.com>
95 The current sp5100_tco driver only supports SP5100/SB7x0 chipset, doesn't
96 support SB8x0 chipset, because current sp5100_tco driver doesn't know that the
97 offset address for watchdog timer was changed from SB8x0 chipset.
99 The offset address of SP5100 and SB7x0 chipsets are as follows, quote from the
100 AMD SB700/710/750 Register Reference Guide(Page 164) and the AMD SP5100
101 Register Reference Guide(Page 166).
103 WatchDogTimerControl 69h
104 WatchDogTimerBase0 6Ch
105 WatchDogTimerBase1 6Dh
106 WatchDogTimerBase2 6Eh
107 WatchDogTimerBase3 6Fh
109 In contrast, the offset address of SB8x0 chipset is as follows, quote from
110 AMD SB800-Series Southbridges Register Reference Guide(Page 147).
113 WatchDogTimerConfig 4Ch
115 So, In the case of SB8x0 chipset, sp5100_tco reads meaningless MMIO
116 address(for example, 0xbafe00) from wrong offset address, and the following
119 SP5100 TCO timer: mmio address 0xbafe00 already in use
121 With this patch, sp5100_tco driver supports SB8x0 chipset, and can avoid
122 iomem resource conflict. The processing of this patch is as follows.
124 Step 1) Attempt to get the watchdog base address from indirect I/O(0xCD6
126 - Go to the step 7 if obtained address hasn't conflicted with other
127 resource. But, currently, the address(0xfec000f0) conflicts with the
128 IOAPIC MMIO address, and the following message is logged.
130 SP5100 TCO timer: mmio address 0xfec000f0 already in use
132 0xfec000f0 is recommended by AMD BIOS Developer's Guide. So, go to the
135 Step 2) Attempt to get the SBResource_MMIO base address from AcpiMmioEN(for
136 SB8x0, PM_Reg:24h) or SBResource_MMIO(SP5100/SB7x0, PCI_Reg:9Ch)
138 - Go to the step 7 if these register has enabled by BIOS, and obtained
139 address hasn't conflicted with other resource.
140 - If above condition isn't true, go to the next step.
142 Step 3) Attempt to get the free MMIO address from allocate_resource().
143 - Go to the step 7 if these register has enabled by BIOS, and obtained
144 address hasn't conflicted with other resource.
145 - Driver initialization has failed if obtained address has conflicted
146 with other resource, and no 'force_addr' parameter is specified.
148 Step 4) Use the specified address If 'force_addr' parameter is specified.
149 - allocate_resource() function may fail, when the PCI bridge device occupies
150 iomem resource from 0xf0000000 to 0xffffffff. To handle such a case,
151 I added 'force_addr' parameter to sp5100_tco driver. With 'force_addr'
152 parameter, sp5100_tco driver directly can assign MMIO address for watchdog
153 timer from free iomem region. Note that It's dangerous to specify wrong
154 address in the 'force_addr' parameter.
156 Example of force_addr parameter use
159 fec00000-fec003ff : IOAPIC 0
160 <--- free MMIO region
161 fec10000-fec1001f : pnp 00:0b
162 fec20000-fec203ff : IOAPIC 1
164 # cat /etc/modprobe.d/sp5100_tco.conf
165 options sp5100_tco force_addr=0xfec00800
166 # modprobe sp5100_tco
169 fec00000-fec003ff : IOAPIC 0
170 fec00800-fec00807 : SP5100 TCO <--- watchdog timer MMIO address
171 fec10000-fec1001f : pnp 00:0b
172 fec20000-fec203ff : IOAPIC 1
176 - Driver initialization has failed if specified address has conflicted
179 Step 5) Disable the watchdog timer
180 - To rewrite the watchdog timer register of the chipset, absolutely
181 guarantee that the watchdog timer is disabled.
183 Step 6) Re-program the watchdog timer MMIO address to chipset.
184 - Re-program the obtained MMIO address in Step 3 or Step 4 to chipset via
185 indirect I/O(0xCD6 and 0xCD7).
187 Step 7) Enable and setup the watchdog timer
189 This patch has worked fine on my test environment(ASUS M4A89GTD-PRO/USB3 and
190 DL165G7). therefore I believe that it's no problem to re-program the MMIO
191 address for watchdog timer to chipset during disabled watchdog. However,
192 I'm not sure about it, because I don't know much about chipset programming.
194 So, any comments will be welcome.
196 Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
197 CC: stable@kernel.org
198 Signed-off-by: Takahisa Tanaka <mc74hc00@gmail.com>
201 drivers/watchdog/sp5100_tco.c | 291 ++++++++++++++++++++++++++++++++++++------
202 drivers/watchdog/sp5100_tco.h | 46 +++++--
203 2 files changed, 286 insertions(+), 51 deletions(-)
205 diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
206 index ae5e82c..36e917f 100644
207 --- a/drivers/watchdog/sp5100_tco.c
208 +++ b/drivers/watchdog/sp5100_tco.c
210 * as published by the Free Software Foundation; either version
211 * 2 of the License, or (at your option) any later version.
213 - * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide"
214 + * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide",
215 + * AMD Publication 45482 "AMD SB800-Series Sourthbridges Register
221 #include "sp5100_tco.h"
223 /* Module and version information */
224 -#define TCO_VERSION "0.01"
225 +#define TCO_VERSION "0.03"
226 #define TCO_MODULE_NAME "SP5100 TCO timer"
227 #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION
229 /* internal variables */
230 static u32 tcobase_phys;
231 +static u32 resbase_phys;
232 static void __iomem *tcobase;
233 static unsigned int pm_iobase;
234 static DEFINE_SPINLOCK(tco_lock); /* Guards the hardware */
235 static unsigned long timer_alive;
236 static char tco_expect_close;
237 static struct pci_dev *sp5100_tco_pci;
238 +static struct resource wdt_res = {
239 + .name = "Watchdog Timer",
240 + .flags = IORESOURCE_MEM,
243 /* the watchdog platform device */
244 static struct platform_device *sp5100_tco_platform_device;
245 @@ -67,6 +74,12 @@ module_param(nowayout, bool, 0);
246 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"
247 " (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
249 +static unsigned int force_addr;
250 +module_param(force_addr, uint, 0);
251 +MODULE_PARM_DESC(force_addr, "Force the use of specified MMIO address, "
252 + "default is disabled. DON'T USE THIS PARAMETER ONLY "
253 + "IF YOU REALLY KNOW WHAT YOU ARE DOING");
256 * Some TCO specific functions
258 @@ -122,6 +135,79 @@ static int tco_timer_set_heartbeat(int t)
262 +static void tco_timer_enable(void)
266 + if (sp5100_tco_pci->revision >= 0x40) {
267 + /* For SB800 or later */
268 + /* Set the Watchdog timer resolution to 1 sec */
269 + outb(SB800_PM_WATCHDOG_CONFIG, SB800_IO_PM_INDEX_REG);
270 + val = inb(SB800_IO_PM_DATA_REG);
271 + val |= SB800_PM_WATCHDOG_SECOND_RES;
272 + outb(val, SB800_IO_PM_DATA_REG);
274 + /* Enable watchdog decode bit and watchdog timer */
275 + outb(SB800_PM_WATCHDOG_CONTROL, SB800_IO_PM_INDEX_REG);
276 + val = inb(SB800_IO_PM_DATA_REG);
277 + val |= SB800_PCI_WATCHDOG_DECODE_EN;
278 + val &= ~SB800_PM_WATCHDOG_DISABLE;
279 + outb(val, SB800_IO_PM_DATA_REG);
281 + /* For SP5100 or SB7x0 */
282 + /* Enable watchdog decode bit */
283 + pci_read_config_dword(sp5100_tco_pci,
284 + SP5100_PCI_WATCHDOG_MISC_REG,
287 + val |= SP5100_PCI_WATCHDOG_DECODE_EN;
289 + pci_write_config_dword(sp5100_tco_pci,
290 + SP5100_PCI_WATCHDOG_MISC_REG,
293 + /* Enable Watchdog timer and set the resolution to 1 sec */
294 + outb(SP5100_PM_WATCHDOG_CONTROL, SP5100_IO_PM_INDEX_REG);
295 + val = inb(SP5100_IO_PM_DATA_REG);
296 + val |= SP5100_PM_WATCHDOG_SECOND_RES;
297 + val &= ~SP5100_PM_WATCHDOG_DISABLE;
298 + outb(val, SP5100_IO_PM_DATA_REG);
302 +static void tco_timer_disable(void)
306 + if (sp5100_tco_pci->revision >= 0x40) {
307 + /* For SB800 or later */
308 + /* Enable watchdog decode bit and Disable watchdog timer */
309 + outb(SB800_PM_WATCHDOG_CONTROL, SB800_IO_PM_INDEX_REG);
310 + val = inb(SB800_IO_PM_DATA_REG);
311 + val |= SB800_PCI_WATCHDOG_DECODE_EN;
312 + val |= SB800_PM_WATCHDOG_DISABLE;
313 + outb(val, SB800_IO_PM_DATA_REG);
315 + /* For SP5100 or SB7x0 */
316 + /* Enable watchdog decode bit */
317 + pci_read_config_dword(sp5100_tco_pci,
318 + SP5100_PCI_WATCHDOG_MISC_REG,
321 + val |= SP5100_PCI_WATCHDOG_DECODE_EN;
323 + pci_write_config_dword(sp5100_tco_pci,
324 + SP5100_PCI_WATCHDOG_MISC_REG,
327 + /* Disable Watchdog timer */
328 + outb(SP5100_PM_WATCHDOG_CONTROL, SP5100_IO_PM_INDEX_REG);
329 + val = inb(SP5100_IO_PM_DATA_REG);
330 + val |= SP5100_PM_WATCHDOG_DISABLE;
331 + outb(val, SP5100_IO_PM_DATA_REG);
336 * /dev/watchdog handling
338 @@ -270,11 +356,12 @@ MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl);
340 * Init & exit routines
343 static unsigned char __devinit sp5100_tco_setupdevice(void)
345 struct pci_dev *dev = NULL;
346 + const char *dev_name = NULL;
348 + u32 index_reg, data_reg, base_addr;
350 /* Match the PCI device */
351 for_each_pci_dev(dev) {
352 @@ -287,29 +374,158 @@ static unsigned char __devinit sp5100_tco_setupdevice(void)
356 + pr_info("PCI Revision ID: 0x%x\n", sp5100_tco_pci->revision);
359 + * Determine type of southbridge chipset.
361 + if (sp5100_tco_pci->revision >= 0x40) {
362 + dev_name = SB800_DEVNAME;
363 + index_reg = SB800_IO_PM_INDEX_REG;
364 + data_reg = SB800_IO_PM_DATA_REG;
365 + base_addr = SB800_PM_WATCHDOG_BASE;
367 + dev_name = SP5100_DEVNAME;
368 + index_reg = SP5100_IO_PM_INDEX_REG;
369 + data_reg = SP5100_IO_PM_DATA_REG;
370 + base_addr = SP5100_PM_WATCHDOG_BASE;
373 /* Request the IO ports used by this driver */
374 pm_iobase = SP5100_IO_PM_INDEX_REG;
375 - if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) {
376 - pr_err("I/O address 0x%04x already in use\n", pm_iobase);
377 + if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, dev_name)) {
378 + pr_err("I/O address 0x%08x already in use\n", pm_iobase);
382 - /* Find the watchdog base address. */
383 - outb(SP5100_PM_WATCHDOG_BASE3, SP5100_IO_PM_INDEX_REG);
384 - val = inb(SP5100_IO_PM_DATA_REG);
385 - outb(SP5100_PM_WATCHDOG_BASE2, SP5100_IO_PM_INDEX_REG);
386 - val = val << 8 | inb(SP5100_IO_PM_DATA_REG);
387 - outb(SP5100_PM_WATCHDOG_BASE1, SP5100_IO_PM_INDEX_REG);
388 - val = val << 8 | inb(SP5100_IO_PM_DATA_REG);
389 - outb(SP5100_PM_WATCHDOG_BASE0, SP5100_IO_PM_INDEX_REG);
390 - /* Low three bits of BASE0 are reserved. */
391 - val = val << 8 | (inb(SP5100_IO_PM_DATA_REG) & 0xf8);
393 + * First, Find the watchdog timer MMIO address from indirect I/O.
395 + outb(base_addr+3, index_reg);
396 + val = inb(data_reg);
397 + outb(base_addr+2, index_reg);
398 + val = val << 8 | inb(data_reg);
399 + outb(base_addr+1, index_reg);
400 + val = val << 8 | inb(data_reg);
401 + outb(base_addr+0, index_reg);
402 + /* Low three bits of BASE are reserved */
403 + val = val << 8 | (inb(data_reg) & 0xf8);
405 + pr_debug("Got 0x%08x from indirect I/O\n", val);
407 + /* Check MMIO address conflict */
408 + if (request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE,
412 + pr_debug("MMIO address 0x%08x already in use\n", val);
415 + * Second, Find the watchdog timer MMIO address
416 + * from SBResource_MMIO register.
418 + if (sp5100_tco_pci->revision >= 0x40) {
419 + /* Read SBResource_MMIO from AcpiMmioEn(PM_Reg: 24h) */
420 + outb(SB800_PM_ACPI_MMIO_EN+3, SB800_IO_PM_INDEX_REG);
421 + val = inb(SB800_IO_PM_DATA_REG);
422 + outb(SB800_PM_ACPI_MMIO_EN+2, SB800_IO_PM_INDEX_REG);
423 + val = val << 8 | inb(SB800_IO_PM_DATA_REG);
424 + outb(SB800_PM_ACPI_MMIO_EN+1, SB800_IO_PM_INDEX_REG);
425 + val = val << 8 | inb(SB800_IO_PM_DATA_REG);
426 + outb(SB800_PM_ACPI_MMIO_EN+0, SB800_IO_PM_INDEX_REG);
427 + val = val << 8 | inb(SB800_IO_PM_DATA_REG);
429 + /* Read SBResource_MMIO from PCI config(PCI_Reg: 9Ch) */
430 + pci_read_config_dword(sp5100_tco_pci,
431 + SP5100_SB_RESOURCE_MMIO_BASE, &val);
434 + /* The SBResource_MMIO is enabled and mapped memory space? */
435 + if ((val & (SB800_ACPI_MMIO_DECODE_EN | SB800_ACPI_MMIO_SEL)) ==
436 + SB800_ACPI_MMIO_DECODE_EN) {
437 + /* Clear unnecessary the low twelve bits */
439 + /* Add the Watchdog Timer offset to base address. */
440 + val += SB800_PM_WDT_MMIO_OFFSET;
441 + /* Check mmio base address conflict */
442 + if (request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE,
444 + pr_debug("Got 0x%08x from SBResource_MMIO register\n",
448 + pr_debug("MMIO address 0x%08x already in use\n", val);
450 + pr_debug("SBResource_MMIO is disabled(0x%08x)\n", val);
453 + * Lastly re-programming the watchdog MMIO address,
454 + * This method is a last resort...
456 + * Before re-programming, to ensure that the watchdog timer
457 + * is disabled, disable the watchdog timer.
459 + tco_timer_disable();
462 + /* Force the use of base address */
464 + /* The alignment of the MMIO address to a 8byte boundary */
467 + pr_info("Force the use of 0x%08x as MMIO address\n", val);
470 + * Get empty slot into the resource tree for watchdog timer.
472 + if (allocate_resource(&iomem_resource,
474 + SP5100_WDT_MEM_MAP_SIZE,
480 + pr_err("MMIO allocation failed\n");
484 + val = resbase_phys = wdt_res.start;
485 + pr_debug("Got 0x%08x from resource tree\n", val);
488 + /* Restore to the low three bits, if chipset is SB8x0(or later) */
489 + if (sp5100_tco_pci->revision >= 0x40) {
491 + reserved_bit = inb(base_addr) & 0x7;
492 + val |= (u32)reserved_bit;
495 + /* Re-programming the watchdog timer base address */
496 + outb(base_addr+0, index_reg);
497 + /* Low three bits of BASE are reserved */
498 + outb((val >> 0) & 0xf8, data_reg);
499 + outb(base_addr+1, index_reg);
500 + outb((val >> 8) & 0xff, data_reg);
501 + outb(base_addr+2, index_reg);
502 + outb((val >> 16) & 0xff, data_reg);
503 + outb(base_addr+3, index_reg);
504 + outb((val >> 24) & 0xff, data_reg);
507 + * Clear unnecessary the low three bits,
508 + * if chipset is SB8x0(or later)
510 + if (sp5100_tco_pci->revision >= 0x40)
513 if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE,
515 - pr_err("mmio address 0x%04x already in use\n", val);
518 + pr_err("MMIO address 0x%08x already in use\n", val);
519 + goto unreg_resource;
525 tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE);
526 @@ -318,25 +534,12 @@ static unsigned char __devinit sp5100_tco_setupdevice(void)
527 goto unreg_mem_region;
530 - /* Enable watchdog decode bit */
531 - pci_read_config_dword(sp5100_tco_pci,
532 - SP5100_PCI_WATCHDOG_MISC_REG,
535 - val |= SP5100_PCI_WATCHDOG_DECODE_EN;
537 - pci_write_config_dword(sp5100_tco_pci,
538 - SP5100_PCI_WATCHDOG_MISC_REG,
540 + pr_info("Using 0x%08x for watchdog MMIO address\n", val);
542 - /* Enable Watchdog timer and set the resolution to 1 sec. */
543 - outb(SP5100_PM_WATCHDOG_CONTROL, SP5100_IO_PM_INDEX_REG);
544 - val = inb(SP5100_IO_PM_DATA_REG);
545 - val |= SP5100_PM_WATCHDOG_SECOND_RES;
546 - val &= ~SP5100_PM_WATCHDOG_DISABLE;
547 - outb(val, SP5100_IO_PM_DATA_REG);
548 + /* Setup the watchdog timer */
549 + tco_timer_enable();
551 - /* Check that the watchdog action is set to reset the system. */
552 + /* Check that the watchdog action is set to reset the system */
553 val = readl(SP5100_WDT_CONTROL(tcobase));
554 val &= ~SP5100_PM_WATCHDOG_ACTION_RESET;
555 writel(val, SP5100_WDT_CONTROL(tcobase));
556 @@ -355,6 +558,9 @@ static unsigned char __devinit sp5100_tco_setupdevice(void)
559 release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
562 + release_resource(&wdt_res);
564 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE);
566 @@ -400,14 +606,17 @@ static int __devinit sp5100_tco_init(struct platform_device *dev)
568 clear_bit(0, &timer_alive);
570 - pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n",
571 - tcobase, heartbeat, nowayout);
572 + pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d, "
573 + "force_addr=0x%x)\n",
574 + tcobase, heartbeat, nowayout, force_addr);
580 release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
582 + release_resource(&wdt_res);
583 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE);
586 @@ -422,6 +631,8 @@ static void __devexit sp5100_tco_cleanup(void)
587 misc_deregister(&sp5100_tco_miscdev);
589 release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
591 + release_resource(&wdt_res);
592 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE);
595 @@ -451,7 +662,7 @@ static int __init sp5100_tco_init_module(void)
599 - pr_info("SP5100 TCO WatchDog Timer Driver v%s\n", TCO_VERSION);
600 + pr_info("SP5100/SB800 TCO WatchDog Timer Driver v%s\n", TCO_VERSION);
602 err = platform_driver_register(&sp5100_tco_driver);
604 @@ -475,13 +686,13 @@ static void __exit sp5100_tco_cleanup_module(void)
606 platform_device_unregister(sp5100_tco_platform_device);
607 platform_driver_unregister(&sp5100_tco_driver);
608 - pr_info("SP5100 TCO Watchdog Module Unloaded\n");
609 + pr_info("SP5100/SB800 TCO Watchdog Module Unloaded\n");
612 module_init(sp5100_tco_init_module);
613 module_exit(sp5100_tco_cleanup_module);
615 MODULE_AUTHOR("Priyanka Gupta");
616 -MODULE_DESCRIPTION("TCO timer driver for SP5100 chipset");
617 +MODULE_DESCRIPTION("TCO timer driver for SP5100/SB800 chipset");
618 MODULE_LICENSE("GPL");
619 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
620 diff --git a/drivers/watchdog/sp5100_tco.h b/drivers/watchdog/sp5100_tco.h
621 index a5a16cc..71594a0 100644
622 --- a/drivers/watchdog/sp5100_tco.h
623 +++ b/drivers/watchdog/sp5100_tco.h
626 * Some address definitions for the Watchdog
629 #define SP5100_WDT_MEM_MAP_SIZE 0x08
630 #define SP5100_WDT_CONTROL(base) ((base) + 0x00) /* Watchdog Control */
631 #define SP5100_WDT_COUNT(base) ((base) + 0x04) /* Watchdog Count */
633 -#define SP5100_WDT_START_STOP_BIT 1
634 +#define SP5100_WDT_START_STOP_BIT (1 << 0)
635 #define SP5100_WDT_TRIGGER_BIT (1 << 7)
637 -#define SP5100_PCI_WATCHDOG_MISC_REG 0x41
638 -#define SP5100_PCI_WATCHDOG_DECODE_EN (1 << 3)
640 #define SP5100_PM_IOPORTS_SIZE 0x02
642 -/* These two IO registers are hardcoded and there doesn't seem to be a way to
644 + * These two IO registers are hardcoded and there doesn't seem to be a way to
645 * read them from a register.
648 +/* For SP5100/SB7x0 chipset */
649 #define SP5100_IO_PM_INDEX_REG 0xCD6
650 #define SP5100_IO_PM_DATA_REG 0xCD7
652 +#define SP5100_SB_RESOURCE_MMIO_BASE 0x9C
654 #define SP5100_PM_WATCHDOG_CONTROL 0x69
655 -#define SP5100_PM_WATCHDOG_BASE0 0x6C
656 -#define SP5100_PM_WATCHDOG_BASE1 0x6D
657 -#define SP5100_PM_WATCHDOG_BASE2 0x6E
658 -#define SP5100_PM_WATCHDOG_BASE3 0x6F
659 +#define SP5100_PM_WATCHDOG_BASE 0x6C
661 #define SP5100_PM_WATCHDOG_FIRED (1 << 1)
662 #define SP5100_PM_WATCHDOG_ACTION_RESET (1 << 2)
664 -#define SP5100_PM_WATCHDOG_DISABLE 1
665 +#define SP5100_PCI_WATCHDOG_MISC_REG 0x41
666 +#define SP5100_PCI_WATCHDOG_DECODE_EN (1 << 3)
668 +#define SP5100_PM_WATCHDOG_DISABLE (1 << 0)
669 #define SP5100_PM_WATCHDOG_SECOND_RES (3 << 1)
671 +#define SP5100_DEVNAME "SP5100 TCO"
674 +/* For SB8x0(or later) chipset */
675 +#define SB800_IO_PM_INDEX_REG 0xCD6
676 +#define SB800_IO_PM_DATA_REG 0xCD7
678 +#define SB800_PM_ACPI_MMIO_EN 0x24
679 +#define SB800_PM_WATCHDOG_CONTROL 0x48
680 +#define SB800_PM_WATCHDOG_BASE 0x48
681 +#define SB800_PM_WATCHDOG_CONFIG 0x4C
683 +#define SB800_PCI_WATCHDOG_DECODE_EN (1 << 0)
684 +#define SB800_PM_WATCHDOG_DISABLE (1 << 2)
685 +#define SB800_PM_WATCHDOG_SECOND_RES (3 << 0)
686 +#define SB800_ACPI_MMIO_DECODE_EN (1 << 0)
687 +#define SB800_ACPI_MMIO_SEL (1 << 2)
690 +#define SB800_PM_WDT_MMIO_OFFSET 0xB00
692 +#define SB800_DEVNAME "SB800 TCO"