Skip to contentSkip to conversation

watchdog - v3.9 merge window

GIT PULL Wim Van Sebroeck 1 participant 1 message Mar 1, 2013

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

Please pull from 'master' branch of
git://www.linux-watchdog.org/linux-watchdog.git

This contains:
* fixes and improvements
* devicetree bindings
* conversion to watchdog generic framework of the following drivers:
- booke_wdt
- bcm47xx_wdt.c
- at91sam9_wdt
* Removal of old STMP3xxx driver
* Addition of following new drivers:
- new driver for STMP3xxx and i.MX23/28
- Retu watchdog driver

This will update the following files:

 b/Documentation/devicetree/bindings/watchdog/atmel-at91rm9200-wdt.txt |    9 
 b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt            |    4 
 b/Documentation/devicetree/bindings/watchdog/marvel.txt               |    5 
 b/Documentation/devicetree/bindings/watchdog/pnx4008-wdt.txt          |    4 
 b/Documentation/devicetree/bindings/watchdog/qca-ar7130-wdt.txt       |   13 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt          |    3 
 b/Documentation/watchdog/watchdog-kernel-api.txt                      |   14 
 b/arch/mips/ath79/dev-common.c                                        |   15 
 b/drivers/rtc/rtc-stmp3xxx.c                                          |   64 +
 b/drivers/watchdog/Kconfig                                            |   35 -
 b/drivers/watchdog/Makefile                                           |    3 
 b/drivers/watchdog/at91rm9200_wdt.c                                   |    9 
 b/drivers/watchdog/at91sam9_wdt.c                                     |  168 +---
 b/drivers/watchdog/ath79_wdt.c                                        |   66 +
 b/drivers/watchdog/bcm47xx_wdt.c                                      |  339 ++++------
 b/drivers/watchdog/booke_wdt.c                                        |  185 +----
 b/drivers/watchdog/davinci_wdt.c                                      |   29 
 b/drivers/watchdog/gef_wdt.c                                          |    1 
 b/drivers/watchdog/omap_wdt.c                                         |    6 
 b/drivers/watchdog/orion_wdt.c                                        |   11 
 b/drivers/watchdog/pnx4008_wdt.c                                      |    7 
 b/drivers/watchdog/retu_wdt.c                                         |  178 +++++
 b/drivers/watchdog/s3c2410_wdt.c                                      |   48 -
 b/drivers/watchdog/sp5100_tco.c                                       |   27 
 b/drivers/watchdog/stmp3xxx_rtc_wdt.c                                 |  111 +++
 b/drivers/watchdog/watchdog_core.c                                    |   66 +
 b/drivers/watchdog/watchdog_dev.c                                     |    3 
 b/include/linux/bcm47xx_wdt.h                                         |    9 
 b/include/linux/stmp3xxx_rtc_wdt.h                                    |   15 
 b/include/linux/watchdog.h                                            |    9 
 drivers/watchdog/stmp3xxx_wdt.c                                       |  288 --------
 31 files changed, 888 insertions(+), 856 deletions(-)

with these Changes:

commit 41e9f3f71bc7a5d41a2b925cfdc0dc22a77f7d8c

Author: Alessandro Rubini <[email protected]>
Date:   Wed Feb 20 23:41:04 2013 +0100

watchdog: sp805_wdt depends on ARM

The SP805 driver is only used by the Spear machines, and uses writel_relaxed, which is not available on all architectures.

The dependency from CONFIG_ARM avoids compilation problems under randomconfig when CONFIG_ARM_AMBA is enabled for x86 builds.

commit e20880e60faadc03837f661533135adb4b7cde01

Author: Kumar, Anil <[email protected]>
Date:   Fri Feb 8 13:09:30 2013 +0530

watchdog: davinci_wdt: update to devm_* API

Update the code to use devm_* API so that driver core will manage resources.

commit 362ce5aeeb1b1828f91c2ca07327f72c24183ec9

Author: Mrugesh Katepallewar <[email protected]>
Date:   Wed Feb 6 16:56:01 2013 +0530

watchdog: davinci_wdt: use devm managed clk get

Get the clock using devm_clk_get().

commit a6a1bcd3700a792d89999a7ec89a9303534ccefc

Author: Joachim Eastwood <[email protected]>
Date:   Thu Feb 14 23:02:29 2013 +0100

watchdog: at91rm9200: add DT support

Add DT support for at91rm9200_wdt.

commit c1fd5f6402050b2463d0610b94f050fedf1b5019

Author: Fabio Porcedda <[email protected]>
Date:   Thu Feb 14 09:14:25 2013 +0100

watchdog: add timeout-sec property binding

this patchset add the timeout-sec property to the following drivers:
orion_wdt, pnx4008_wdt, s3c2410_wdt and at91sam9_wdt.

The at91sam9_wdt is tested on evk-pr3,
the other drivers are compile tested only.

Cc Andrew Lunn <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Masanari Iida <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Andrew Victor <[email protected]>
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc Nicolas Ferre <[email protected]>

commit 490ac7af8b71069ba0c733052c5f448ac070c947

Author: Wenyou Yang <[email protected]>
Date:   Fri Feb 1 15:06:21 2013 +0800

watchdog: at91sam9_wdt: Convert to use the watchdog framework

According to Documentation/watchdog/convert_drivers_to_kernel_api.txt, remove the file_operations struct, miscdevice, and obsolete includes

Since the at91sam watchdog inherent characteristics, add the watchdog
operations: at91wdt_start, at91wdt_stop and at91wdt_ping.

commit 2dd7b24467143c3fd17c6abcaf04fef7976b1528

Author: Pali Rohár <[email protected]>
Date:   Sun Feb 17 00:49:26 2013 +0100

watchdog: omap_wdt: Add option nowayout

Like other watchdog drivers, this patch adds new option nowayout which overwrite WATCHDOG_NOWAYOUT.

commit 3048253ed957fc6cdc34599178408559aa1e0062

Author: Fabio Porcedda <[email protected]>
Date:   Tue Jan 8 11:04:10 2013 +0100

watchdog: core: dt: add support for the timeout-sec dt property

Add support for watchdog drivers to initialize/set the timeout field of the watchdog_device structure. The timeout field is initialised either with the module timeout parameter value (if valid) or with the timeout-sec dt property (if valid). If both are invalid the initial value is unchanged.

commit e3e83d0001a77cdb337be9170e58b55488835ba0

Author: Hauke Mehrtens <[email protected]>
Date:   Sat Jan 12 18:14:11 2013 +0100

watchdog: bcm47xx_wdt.c: add hard timer

The more recent devices have a watchdog timer which could be configured for over 2 hours and not just 2 seconds like the first generation devices. For those devices do not use the extra software timer, but directly program the time into the register. This will automatically be used if the timer supports more than a minute.

commit 93aed1f02a7a67ce81e6bd2e37c3e1d994d33d5b

Author: Hauke Mehrtens <[email protected]>
Date:   Sat Jan 12 18:14:10 2013 +0100

watchdog: bcm47xx_wdt.c: rename wdt_time to timeout

Rename wdt_time to timeout to name it like the other watchdog driver do it.

commit a39068929a9a7c418c569c6d22990953b4f75df7

Author: Hauke Mehrtens <[email protected]>
Date:   Sat Jan 12 18:14:09 2013 +0100

watchdog: bcm47xx_wdt.c: rename ops methods

Rename the methods registered to struct watchdog_ops bcm47xx_wdt_ops in order to add an other struct watchdog_ops using different ops in the next patch.
Also rename WDT_MAX_TIME to WDT_SOFTTIMER_MAX.

commit f82dedf812ecdf0c19c6c240e85a4a487ab62016

Author: Hauke Mehrtens <[email protected]>
Date:   Thu Jan 24 18:13:34 2013 +0100

watchdog: bcm47xx_wdt.c: use platform device

Instead of accessing the function to set the watchdog timer directly, register a platform driver the platform could register to use this watchdog driver.

commit 5434a04db905bb0af281cdb758d1357fbecd0fe8

Author: Hauke Mehrtens <[email protected]>
Date:   Sat Jan 12 18:14:07 2013 +0100

watchdog: bcm47xx_wdt.c: convert to watchdog core api

Convert the bcm47xx_wdt.c driver to the new watchdog core api.

The nowayout parameter is now added unconditionally to the module.

commit 52e5cc4efa576223174ad4c08a335802a36cb18c

Author: Guenter Roeck <[email protected]>
Date:   Tue Feb 5 12:14:23 2013 -0800

watchdog: Convert BookE watchdog driver to watchdog infrastructure

commit 04ecc7dc8ee62580d7c2f039bfb6eab41e8b2a7d

Author: Jingoo Han <[email protected]>
Date:   Thu Jan 10 11:06:33 2013 +0900

watchdog: s3c2410_wdt: Use devm_* functions

Use devm_* functions to make cleanup paths more simple.

commit e4504daba1d9391968df4698406bb81318b340a0

Author: Wolfram Sang <[email protected]>
Date:   Tue Sep 27 22:53:15 2011 +0200

watchdog: remove old STMP3xxx driver

Now that the new driver is in place, we can remove the old one.

commit de6303ab934b1386cad1f62ea6e2200ab7be7d78

Author: Wolfram Sang <[email protected]>
Date:   Tue Sep 27 22:35:40 2011 +0200

watchdog: add new driver for STMP3xxx and i.MX23/28

Replace the existing STMP3xxx driver because it has enough drawbacks that a rewrite is apropriate. The new driver is designed to use the watchdog framework which makes it a lot smaller and avoids open coding the watchdog API again. It also uses now an explicitly exported function from the RTC driver to set up its registers (the old driver silently reused the hopefully(!) already remapped RTC registers). Also, this driver is mach independent, while the old one depends on a mach replaced by another one a year ago. Since the user interface is still the standard watchdog API, users don't need to adapt.

commit 1a71fb84fda651105e1e194c2d3a3a13a38210a9

Author: Wolfram Sang <[email protected]>
Date:   Tue Sep 27 22:21:37 2011 +0200

rtc: stmp3xxx: add wdt-accessor function

This RTC also includes a watchdog timer. Provide an accessor function for setting the watchdog timeout value which will be picked up by a watchdog driver. Also register the platform_device for the watchdog here to get the boot-time dependencies right.

commit 3d3a6d18abc66ba38e554fd5cb5991dfa805cd23

Author: Aaro Koskinen <[email protected]>
Date:   Thu Dec 27 22:58:29 2012 +0200

watchdog: introduce retu_wdt driver

Introduce Retu watchdog driver.

commit d1ec74ab5a48d794c5e3671a895d49d162d0f916

Author: Wim Van Sebroeck <[email protected]>
Date:   Thu Feb 7 21:14:36 2013 +0100

watchdog: intel_scu_watchdog: fix Kconfig dependency

Kernel symbol X86_MRST has been removed from the kernel. INTEL_SCU_WATCHDOG driver can never be compiled due dependence of X86_MRST which remained in the drivers/watchdog/Kconfig.

commit f3ea733e2e42fd11ea3bc6a468a325ae5878651a

Author: Lubomir Rintel <[email protected]>
Date:   Fri Jan 4 15:06:28 2013 +0100

watchdog: orion_wdt: Add platform alias

...so that it's automatically picked up on relevant platforms. Tested on Kirkwood-based GuruPlug.

commit 15920d12998a408efe4b1b25a28c21dfc48f6e69

Author: Gabor Juhos <[email protected]>
Date:   Sat Feb 2 10:34:54 2013 +0100

watchdog: ath79_wdt: add device tree matching

commit 09f5100a592d11dad06b218f41d560ff1f87f666

Author: Gabor Juhos <[email protected]>
Date:   Thu Dec 27 15:38:26 2012 +0100

watchdog: ath79_wdt: get register base from platform device's resources

The ath79_wdt driver uses a fixed memory address currently. Although this is working with each currently supported SoCs, but this may change in the future. Additionally, the driver includes platform specific header files in order to be able to get the memory base of the watchdog device.

The patch adds a memory resource to the platform device, and converts the driver to get the base address of the watchdog device from that.

commit 0f2ad9ed7c6fecb008372e8a709595a2a21059aa

Author: Gabor Juhos <[email protected]>
Date:   Thu Dec 27 15:38:25 2012 +0100

MIPS: ath79: use dynamically allocated watchdog device

Remove the static watchdog device variable and use the 'platform_device_register_simple' helper to allocate and register the device in one step.

This allows us to save a few bytes in the kernel image.

commit 5071a88475b758bf60191e53606463fe7290c71e

Author: Gabor Juhos <[email protected]>
Date:   Thu Dec 27 15:38:24 2012 +0100

watchdog: ath79_wdt: convert to use devm_clk_get

Use the managed version of clk_get. This allows to simplify the probe/remove functions a bit.

commit 41adafbd7b84c66c2cdad857b75d5d45032310a6

Author: Takahisa Tanaka <[email protected]>
Date:   Mon Jan 14 11:01:58 2013 +0900

watchdog: sp5100_tco: Write back the original value to reserved bits, instead of zero

In case of SP5100 or SB7x0 chipsets, the sp5100_tco module writes zero to reserved bits. The module, however, shouldn't depend on specific default value, and should perform a read-merge-write operation for the reserved bits.

This patch makes the sp5100_tco module perform a read-merge-write operation on all the chipset (sp5100, sb7x0, sb8x0 or later).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43176

commit 10ab329b5db7e592a3a60b4594e4e5f40b60c45c

Author: Takahisa Tanaka <[email protected]>
Date:   Mon Jan 14 11:01:57 2013 +0900

watchdog: sp5100_tco: Fix wrong indirect I/O access for getting value of reserved bits

In case of SB800 or later chipset and re-programming MMIO address(*), sp5100_tco module may read incorrect value of reserved bit, because the module reads a value from an incorrect I/O address. However, this bug doesn't cause a problem, because when re-programming MMIO address, by chance the module writes zero (this is BIOS's default value) to the low three bits of register.
* In most cases, PC with SB8x0 or later chipset doesn't need to re-programming MMIO address, because such PC can enable AcpiMmio and can use 0xfed80b00 for watchdog register base address.

This patch fixes this bug.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43176

commit 6737176569d1d6356c644694d60ea2b265cb3870

Author: Devendra Naga <[email protected]>
Date:   Fri Nov 2 14:15:39 2012 -0400

watchdog: gef_wdt.c: add missing remove callback

this module missed a remove callback in the platform ops.

commit 6c41e4748662b47d46331e0e79f3b62b6786d3b9

Author: Arnd Bergmann <[email protected]>
Date:   Fri Jan 25 14:14:27 2013 +0000

watchdog: at91sam9: at91_wdt_dt_ids cannot be __init

The device IDs are referenced by the driver and potentially used beyond the init time, as kbuild correctly warns about. Remove the __initconst annotation.

Without this patch, building at91_dt_defconfig results in:

WARNING: drivers/watchdog/built-in.o(.data+0x28): Section mismatch in reference from the variable at91wdt_driver to the (unknown reference) .init.rodata:(unknown) The variable at91wdt_driver references
the (unknown reference) __initconst (unknown)

commit 12a5c05cb143105d989abf728a8c769830670e54

Author: Randy Dunlap <[email protected]>
Date:   Mon Jan 28 08:29:48 2013 -0800

watchdog: da9055_wdt needs to select WATCHDOG_CORE

DA9055_WATCHDOG (introduced in v3.8) needs to select WATCHDOG_CORE so that it will build cleanly. Fixes these build errors:

da9055_wdt.c:(.text+0xe9bc7): undefined reference to watchdog_unregister_device' da9055_wdt.c:(.text+0xe9f4b): undefined reference to watchdog_register_device'

For completeness, I added the overal diff below.

Greetings,
Wim.

================================================================================

Documentation/devicetree/bindings/watchdog/atmel-at91rm9200-wdt.txt new file +9 -0
new file mode 100644
index 0000000..d4d86cf
@@ -0,0 +1,9 @@
+Atmel AT91RM9200 System Timer Watchdog
+
+Required properties:
+- compatible: must be "atmel,at91sam9260-wdt".
+
+Example:
+	watchdog@fffffd00 {
+		compatible = "atmel,at91rm9200-wdt";
+	};
Documentation/devicetree/bindings/watchdog/atmel-wdt.txt +4 -0
index 2957ebb..fcdd48f 100644
@@ -7,9 +7,13 @@ Required properties:
 - reg: physical base address of the controller and length of memory mapped
   region.
 
+Optional properties:
+- timeout-sec: contains the watchdog timeout in seconds.
+
 Example:
 
 	watchdog@fffffd40 {
 		compatible = "atmel,at91sam9260-wdt";
 		reg = <0xfffffd40 0x10>;
+		timeout-sec = <10>;
 	};
Documentation/devicetree/bindings/watchdog/marvel.txt +5 -0
index 0b2503a..5dc8d30 100644
@@ -5,10 +5,15 @@ Required Properties:
 - Compatibility : "marvell,orion-wdt"
 - reg		: Address of the timer registers
 
+Optional properties:
+
+- timeout-sec	: Contains the watchdog timeout in seconds
+
 Example:
 
 	wdt@20300 {
 		compatible = "marvell,orion-wdt";
 		reg = <0x20300 0x28>;
+		timeout-sec = <10>;
 		status = "okay";
 	};
Documentation/devicetree/bindings/watchdog/pnx4008-wdt.txt +4 -0
index 7c7f688..556d06c 100644
@@ -5,9 +5,13 @@ Required properties:
 - reg: physical base address of the controller and length of memory mapped
   region.
 
+Optional properties:
+- timeout-sec: contains the watchdog timeout in seconds.
+
 Example:
 
 	watchdog@4003C000 {
 		compatible = "nxp,pnx4008-wdt";
 		reg = <0x4003C000 0x1000>;
+		timeout-sec = <10>;
 	};
Documentation/devicetree/bindings/watchdog/qca-ar7130-wdt.txt new file +13 -0
new file mode 100644
index 0000000..7a89e5f
@@ -0,0 +1,13 @@
+* Qualcomm Atheros AR7130 Watchdog Timer (WDT) Controller
+
+Required properties:
+- compatible: must be "qca,ar7130-wdt"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+
+Example:
+
+wdt@18060008 {
+	compatible = "qca,ar9330-wdt", "qca,ar7130-wdt";
+	reg = <0x18060008 0x8>;
+};
Documentation/devicetree/bindings/watchdog/samsung-wdt.txt +3 -0
index ce0d8e7..2aa486c 100644
@@ -9,3 +9,6 @@ Required properties:
 - reg : base physical address of the controller and length of memory mapped
 	region.
 - interrupts : interrupt number to the cpu.
+
+Optional properties:
+- timeout-sec : contains the watchdog timeout in seconds.
Documentation/watchdog/watchdog-kernel-api.txt +13 -1
index 086638f..a0438f3 100644
@@ -1,6 +1,6 @@
 The Linux WatchDog Timer Driver Core kernel API.
 ===============================================
-Last reviewed: 22-May-2012
+Last reviewed: 12-Feb-2013
 
 Wim Van Sebroeck <[email protected]>
 
@@ -212,3 +212,15 @@ driver specific data to and a pointer to the data itself.
 The watchdog_get_drvdata function allows you to retrieve driver specific data.
 The argument of this function is the watchdog device where you want to retrieve
 data from. The function returns the pointer to the driver specific data.
+
+To initialize the timeout field, the following function can be used:
+
+extern int watchdog_init_timeout(struct watchdog_device *wdd,
+                                  unsigned int timeout_parm, struct device *dev);
+
+The watchdog_init_timeout function allows you to initialize the timeout field
+using the module timeout parameter or by retrieving the timeout-sec property from
+the device tree (if the module timeout parameter is invalid). Best practice is
+to set the default timeout value as timeout value in the watchdog_device and
+then use this function to set the user "preferred" timeout value.
+This routine returns zero on success and a negative errno code for failure.
arch/mips/ath79/dev-common.c +9 -6
index 45efc63..ea3a814 100644
@@ -101,12 +101,15 @@ void __init ath79_register_uart(void)
 	}
 }
 
-static struct platform_device ath79_wdt_device = {
-	.name		= "ath79-wdt",
-	.id		= -1,
-};
-
 void __init ath79_register_wdt(void)
 {
-	platform_device_register(&ath79_wdt_device);
+	struct resource res;
+
+	memset(&res, 0, sizeof(res));
+
+	res.flags = IORESOURCE_MEM;
+	res.start = AR71XX_RESET_BASE + AR71XX_RESET_REG_WDOG_CTRL;
+	res.end = res.start + 0x8 - 1;
+
+	platform_device_register_simple("ath79-wdt", -1, &res, 1);
 }
drivers/rtc/rtc-stmp3xxx.c +64 -0

100 lines not on this page · raw message

drivers/watchdog/Kconfig +26 -9
index 26e1fdb..9fcc70c 100644
@@ -79,6 +79,7 @@ config DA9052_WATCHDOG
 config DA9055_WATCHDOG
 	tristate "Dialog Semiconductor DA9055 Watchdog"
 	depends on MFD_DA9055
+	select WATCHDOG_CORE
 	help
 	  If you say yes here you get support for watchdog on the Dialog
 	  Semiconductor DA9055 PMIC.
@@ -108,7 +109,7 @@ config WM8350_WATCHDOG
 
 config ARM_SP805_WATCHDOG
 	tristate "ARM SP805 Watchdog"
-	depends on ARM_AMBA
+	depends on ARM && ARM_AMBA
 	select WATCHDOG_CORE
 	help
 	  ARM Primecell SP805 Watchdog timer. This will reboot your system when
@@ -116,7 +117,7 @@ config ARM_SP805_WATCHDOG
 
 config AT91RM9200_WATCHDOG
 	tristate "AT91RM9200 watchdog"
-	depends on ARCH_AT91RM9200
+	depends on ARCH_AT91
 	help
 	  Watchdog timer embedded into AT91RM9200 chips. This will reboot your
 	  system when the timeout is reached.
@@ -124,6 +125,7 @@ config AT91RM9200_WATCHDOG
 config AT91SAM9X_WATCHDOG
 	tristate "AT91SAM9X / AT91CAP9 watchdog"
 	depends on ARCH_AT91 && !ARCH_AT91RM9200
+	select WATCHDOG_CORE
 	help
 	  Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will
 	  reboot your system when the timeout is reached.
@@ -316,14 +318,15 @@ config TWL4030_WATCHDOG
 	  Support for TI TWL4030 watchdog.  Say 'Y' here to enable the
 	  watchdog timer support for TWL4030 chips.
 
-config STMP3XXX_WATCHDOG
-	tristate "Freescale STMP3XXX watchdog"
-	depends on ARCH_STMP3XXX
+config STMP3XXX_RTC_WATCHDOG
+	tristate "Freescale STMP3XXX & i.MX23/28 watchdog"
+	depends on RTC_DRV_STMP
+	select WATCHDOG_CORE
 	help
-	  Say Y here if to include support for the watchdog timer
-	  for the Sigmatel STMP37XX/378X SoC.
+	  Say Y here to include support for the watchdog timer inside
+	  the RTC for the STMP37XX/378X or i.MX23/28 SoC.
 	  To compile this driver as a module, choose M here: the
-	  module will be called stmp3xxx_wdt.
+	  module will be called stmp3xxx_rtc_wdt.
 
 config NUC900_WATCHDOG
 	tristate "Nuvoton NUC900 watchdog"
@@ -376,6 +379,18 @@ config UX500_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called ux500_wdt.
 
+config RETU_WATCHDOG
+	tristate "Retu watchdog"
+	depends on MFD_RETU
+	select WATCHDOG_CORE
+	help
+	  Retu watchdog driver for Nokia Internet Tablets (770, N800,
+	  N810). At least on N800 the watchdog cannot be disabled, so
+	  this driver is essential and you should enable it.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called retu_wdt.
+
 # AVR32 Architecture
 
 config AT32AP700X_WDT
@@ -593,7 +608,7 @@ config IE6XX_WDT
 
 config INTEL_SCU_WATCHDOG
 	bool "Intel SCU Watchdog for Mobile Platforms"
-	depends on X86_MRST
+	depends on X86_INTEL_MID
 	---help---
 	  Hardware driver for the watchdog time built into the Intel SCU
 	  for Intel Mobile Platforms.
@@ -983,6 +998,7 @@ config ATH79_WDT
 config BCM47XX_WDT
 	tristate "Broadcom BCM47xx Watchdog Timer"
 	depends on BCM47XX
+	select WATCHDOG_CORE
 	help
 	  Hardware driver for the Broadcom BCM47xx Watchdog Timer.
 
@@ -1131,6 +1147,7 @@ config PIKA_WDT
 config BOOKE_WDT
 	tristate "PowerPC Book-E Watchdog Timer"
 	depends on BOOKE || 4xx
+	select WATCHDOG_CORE
 	---help---
 	  Watchdog driver for PowerPC Book-E chips, such as the Freescale
 	  MPC85xx SOCs and the IBM PowerPC 440.
drivers/watchdog/Makefile +2 -1
index bec86ee..a300b94 100644
@@ -48,11 +48,12 @@ obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
 obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
 obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
-obj-$(CONFIG_STMP3XXX_WATCHDOG) += stmp3xxx_wdt.o
+obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
 obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
+obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
 
 # AVR32 Architecture
 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
drivers/watchdog/at91rm9200_wdt.c +9 -0
index 89831ed..1c75260 100644
@@ -24,6 +24,8 @@
 #include <linux/types.h>
 #include <linux/watchdog.h>
 #include <linux/uaccess.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 #include <mach/at91_st.h>
 
 #define WDT_DEFAULT_TIME	5	/* seconds */
@@ -252,6 +254,12 @@ static int at91wdt_resume(struct platform_device *pdev)
 #define at91wdt_resume	NULL
 #endif
 
+static const struct of_device_id at91_wdt_dt_ids[] = {
+	{ .compatible = "atmel,at91rm9200-wdt" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, at91_wdt_dt_ids);
+
 static struct platform_driver at91wdt_driver = {
 	.probe		= at91wdt_probe,
 	.remove		= at91wdt_remove,
@@ -261,6 +269,7 @@ static struct platform_driver at91wdt_driver = {
 	.driver		= {
 		.name	= "at91_wdt",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(at91_wdt_dt_ids),
 	},
 };
 
drivers/watchdog/at91sam9_wdt.c +46 -122

270 lines not on this page · raw message

drivers/watchdog/ath79_wdt.c +51 -15

148 lines not on this page · raw message

drivers/watchdog/bcm47xx_wdt.c +144 -195

445 lines not on this page · raw message

drivers/watchdog/booke_wdt.c +65 -120

251 lines not on this page · raw message

drivers/watchdog/davinci_wdt.c +6 -23
index e8e8724..7df1fdc 100644
@@ -69,7 +69,6 @@ static unsigned long wdt_status;
 #define WDT_REGION_INITED 2
 #define WDT_DEVICE_INITED 3
 
-static struct resource	*wdt_mem;
 static void __iomem	*wdt_base;
 struct clk		*wdt_clk;
 
@@ -201,10 +200,11 @@ static struct miscdevice davinci_wdt_miscdev = {
 
 static int davinci_wdt_probe(struct platform_device *pdev)
 {
-	int ret = 0, size;
+	int ret = 0;
 	struct device *dev = &pdev->dev;
+	struct resource  *wdt_mem;
 
-	wdt_clk = clk_get(dev, NULL);
+	wdt_clk = devm_clk_get(dev, NULL);
 	if (WARN_ON(IS_ERR(wdt_clk)))
 		return PTR_ERR(wdt_clk);
 
@@ -221,43 +221,26 @@ static int davinci_wdt_probe(struct platform_device *pdev)
 		return -ENOENT;
 	}
 
-	size = resource_size(wdt_mem);
-	if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
-		dev_err(dev, "failed to get memory region\n");
-		return -ENOENT;
-	}
-
-	wdt_base = ioremap(wdt_mem->start, size);
+	wdt_base = devm_request_and_ioremap(dev, wdt_mem);
 	if (!wdt_base) {
-		dev_err(dev, "failed to map memory region\n");
-		release_mem_region(wdt_mem->start, size);
-		wdt_mem = NULL;
-		return -ENOMEM;
+		dev_err(dev, "ioremap failed\n");
+		return -EADDRNOTAVAIL;
 	}
 
 	ret = misc_register(&davinci_wdt_miscdev);
 	if (ret < 0) {
 		dev_err(dev, "cannot register misc device\n");
-		release_mem_region(wdt_mem->start, size);
-		wdt_mem = NULL;
 	} else {
 		set_bit(WDT_DEVICE_INITED, &wdt_status);
 	}
 
-	iounmap(wdt_base);
 	return ret;
 }
 
 static int davinci_wdt_remove(struct platform_device *pdev)
 {
 	misc_deregister(&davinci_wdt_miscdev);
-	if (wdt_mem) {
-		release_mem_region(wdt_mem->start, resource_size(wdt_mem));
-		wdt_mem = NULL;
-	}
-
 	clk_disable_unprepare(wdt_clk);
-	clk_put(wdt_clk);
 
 	return 0;
 }
drivers/watchdog/gef_wdt.c +1 -0
index b9c5b58..257cfba 100644
@@ -310,6 +310,7 @@ static struct platform_driver gef_wdt_driver = {
 		.of_match_table = gef_wdt_ids,
 	},
 	.probe		= gef_wdt_probe,
+	.remove		= gef_wdt_remove,
 };
 
 static int __init gef_wdt_init(void)
drivers/watchdog/omap_wdt.c +5 -1
index b0e541d..af88ffd 100644
@@ -45,6 +45,11 @@
 
 #include "omap_wdt.h"
 
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+	"(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
 static unsigned timer_margin;
 module_param(timer_margin, uint, 0);
 MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
@@ -201,7 +206,6 @@ static const struct watchdog_ops omap_wdt_ops = {
 static int omap_wdt_probe(struct platform_device *pdev)
 {
 	struct omap_wd_timer_platform_data *pdata = pdev->dev.platform_data;
-	bool nowayout = WATCHDOG_NOWAYOUT;
 	struct watchdog_device *omap_wdt;
 	struct resource *res, *mem;
 	struct omap_wdt_dev *wdev;
drivers/watchdog/orion_wdt.c +5 -6
index 7c18b3b..da57798 100644
@@ -140,6 +140,7 @@ static const struct watchdog_ops orion_wdt_ops = {
 static struct watchdog_device orion_wdt = {
 	.info = &orion_wdt_info,
 	.ops = &orion_wdt_ops,
+	.min_timeout = 1,
 };
 
 static int orion_wdt_probe(struct platform_device *pdev)
@@ -164,12 +165,9 @@ static int orion_wdt_probe(struct platform_device *pdev)
 
 	wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
 
-	if ((heartbeat < 1) || (heartbeat > wdt_max_duration))
-		heartbeat = wdt_max_duration;
-
-	orion_wdt.timeout = heartbeat;
-	orion_wdt.min_timeout = 1;
+	orion_wdt.timeout = wdt_max_duration;
 	orion_wdt.max_timeout = wdt_max_duration;
+	watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev);
 
 	watchdog_set_nowayout(&orion_wdt, nowayout);
 	ret = watchdog_register_device(&orion_wdt);
@@ -179,7 +177,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
 	}
 
 	pr_info("Initial timeout %d sec%s\n",
-		heartbeat, nowayout ? ", nowayout" : "");
+		orion_wdt.timeout, nowayout ? ", nowayout" : "");
 	return 0;
 }
 
@@ -225,4 +223,5 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
 				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:orion_wdt");
 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
drivers/watchdog/pnx4008_wdt.c +3 -4
index de1f3fa..a3684a3 100644
@@ -142,6 +142,7 @@ static const struct watchdog_ops pnx4008_wdt_ops = {
 static struct watchdog_device pnx4008_wdd = {
 	.info = &pnx4008_wdt_ident,
 	.ops = &pnx4008_wdt_ops,
+	.timeout = DEFAULT_HEARTBEAT,
 	.min_timeout = 1,
 	.max_timeout = MAX_HEARTBEAT,
 };
@@ -151,8 +152,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
 	struct resource *r;
 	int ret = 0;
 
-	if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
-		heartbeat = DEFAULT_HEARTBEAT;
+	watchdog_init_timeout(&pnx4008_wdd, heartbeat, &pdev->dev);
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	wdt_base = devm_ioremap_resource(&pdev->dev, r);
@@ -167,7 +167,6 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
 	if (ret)
 		goto out;
 
-	pnx4008_wdd.timeout = heartbeat;
 	pnx4008_wdd.bootstatus = (readl(WDTIM_RES(wdt_base)) & WDOG_RESET) ?
 			WDIOF_CARDRESET : 0;
 	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
@@ -181,7 +180,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
 	}
 
 	dev_info(&pdev->dev, "PNX4008 Watchdog Timer: heartbeat %d sec\n",
-			heartbeat);
+		 pnx4008_wdd.timeout);
 
 	return 0;
 
drivers/watchdog/retu_wdt.c new file +178 -0

178 lines not on this page · raw message

drivers/watchdog/s3c2410_wdt.c +13 -35

122 lines not on this page · raw message

drivers/watchdog/sp5100_tco.c +8 -19
index 2b0e000..e3b8f75 100644
@@ -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 */
@@ -497,30 +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;
-		reserved_bit = inb(base_addr) & 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) & 0xf8, 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)) {
drivers/watchdog/stmp3xxx_rtc_wdt.c new file +111 -0

111 lines not on this page · raw message

drivers/watchdog/stmp3xxx_wdt.c deleted +0 -288

288 lines not on this page · raw message

drivers/watchdog/watchdog_core.c +57 -9

84 lines not on this page · raw message

drivers/watchdog/watchdog_dev.c +1 -2
index ef8edec..08b48bb 100644
@@ -200,8 +200,7 @@ static int watchdog_set_timeout(struct watchdog_device *wddev,
 	    !(wddev->info->options & WDIOF_SETTIMEOUT))
 		return -EOPNOTSUPP;
 
-	if ((wddev->max_timeout != 0) &&
-	    (timeout < wddev->min_timeout || timeout > wddev->max_timeout))
+	if (watchdog_timeout_invalid(wddev, timeout))
 		return -EINVAL;
 
 	mutex_lock(&wddev->lock);
include/linux/bcm47xx_wdt.h +9 -0
index e5dfc25..b708786 100644
@@ -1,7 +1,10 @@
 #ifndef LINUX_BCM47XX_WDT_H_
 #define LINUX_BCM47XX_WDT_H_
 
+#include <linux/notifier.h>
+#include <linux/timer.h>
 #include <linux/types.h>
+#include <linux/watchdog.h>
 
 
 struct bcm47xx_wdt {
@@ -10,6 +13,12 @@ struct bcm47xx_wdt {
 	u32 max_timer_ms;
 
 	void *driver_data;
+
+	struct watchdog_device wdd;
+	struct notifier_block notifier;
+
+	struct timer_list soft_timer;
+	atomic_t soft_ticks;
 };
 
 static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt)
include/linux/stmp3xxx_rtc_wdt.h new file +15 -0
new file mode 100644
index 0000000..1dd12c9
@@ -0,0 +1,15 @@
+/*
+ * stmp3xxx_rtc_wdt.h
+ *
+ * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
+ *
+ * This file is released under the GPLv2.
+ */
+#ifndef __LINUX_STMP3XXX_RTC_WDT_H
+#define __LINUX_STMP3XXX_RTC_WDT_H
+
+struct stmp3xxx_wdt_pdata {
+	void (*wdt_set_timeout)(struct device *dev, u32 timeout);
+};
+
+#endif /* __LINUX_STMP3XXX_RTC_WDT_H */
include/linux/watchdog.h +9 -0
index 3a9df2f..2a3038e 100644
@@ -118,6 +118,13 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway
 		set_bit(WDOG_NO_WAY_OUT, &wdd->status);
 }
 
+/* Use the following function to check if a timeout value is invalid */
+static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t)
+{
+	return ((wdd->max_timeout != 0) &&
+		(t < wdd->min_timeout || t > wdd->max_timeout));
+}
+
 /* Use the following functions to manipulate watchdog driver specific data */
 static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
 {
@@ -130,6 +137,8 @@ static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
 }
 
 /* drivers/watchdog/watchdog_core.c */
+extern int watchdog_init_timeout(struct watchdog_device *wdd,
+				  unsigned int timeout_parm, struct device *dev);
 extern int watchdog_register_device(struct watchdog_device *);
 extern void watchdog_unregister_device(struct watchdog_device *);