Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pull watchdog updates from Wim Van Sebroeck:
 "This patchset contains:
   - Various small clean-ups and fixes
   - boot logic hanegs for mpc8xxx_wdt
   - it87_wdt: Work around non-working CIR interrupts
   - iTCO_wdt: Fix the parent device
   - Kconfig dependencies
   - simplification of code with devm_ioremap_resource() or
     platform_driver_probe()
   - conversion of xilinx watchdog driver to Generic watchdog Framework
   - addition of extra functionality and devices for the xilinx watchdog
     driver
   - Addition of Tegra watchdog"

* git://www.linux-watchdog.org/linux-watchdog: (38 commits)
  watchdog: Fix Elan SC520 dependencies
  watchdog: ib700wdt: Use platform_driver_probe
  watchdog: geodewdt: Use platform_driver_probe
  watchdog: advantechwdt: Use platform_driver_probe
  watchdog: acquirewdt: Use platform_driver_probe
  watchdog: iTCO_wdt: Fix the parent device
  watchdog: it87_wdt: Work around non-working CIR interrupts
  watchdog: bcm281xx: Fix Kconfig dependency
  watchdog: s3c2410_wdt: Check return value of clk_prepare_enable
  watchdog: s3c2410_wdt: Remove unneeded initialization
  watchdog: sunxi: Change compatibles
  watchdog: orion: prepare new Dove DT Kconfig variable
  watchdog: fix checkpatch warnings and error
  watchdog: Add tegra watchdog
  watchdog: xilinx: Remove no_timeout variable
  watchdog: xilinx: Enable this driver for Zynq
  watchdog: xilinx: Add missing binding
  watchdog: xilinx: Use correct comment indentation
  watchdog: xilinx: Use of_property_read_u32
  watchdog: xilinx: Fix all printk messages
  ...
  • Loading branch information
torvalds committed Apr 1, 2014
2 parents c12ac9f + 6d956e4 commit 0c8cfba
Show file tree
Hide file tree
Showing 55 changed files with 584 additions and 470 deletions.
23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Xilinx AXI/PLB soft-core watchdog Device Tree Bindings
---------------------------------------------------------

Required properties:
- compatible : Should be "xlnx,xps-timebase-wdt-1.00.a" or
"xlnx,xps-timebase-wdt-1.01.a".
- reg : Physical base address and size

Optional properties:
- clock-frequency : Frequency of clock in Hz
- xlnx,wdt-enable-once : 0 - Watchdog can be restarted
1 - Watchdog can be enabled just once
- xlnx,wdt-interval : Watchdog timeout interval in 2^<val> clock cycles,
<val> is integer from 8 to 31.

Example:
axi-timebase-wdt@40100000 {
clock-frequency = <50000000>;
compatible = "xlnx,xps-timebase-wdt-1.00.a";
reg = <0x40100000 0x10000>;
xlnx,wdt-enable-once = <0x0>;
xlnx,wdt-interval = <0x1b>;
} ;
6 changes: 3 additions & 3 deletions Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Allwinner SoCs Watchdog timer

Required properties:

- compatible : should be "allwinner,<soc-family>-wdt", the currently supported
SoC families being sun4i and sun6i
- compatible : should be either "allwinner,sun4i-a10-wdt" or
"allwinner,sun6i-a31-wdt"
- reg : Specifies base physical address and size of the registers.

Example:

wdt: watchdog@01c20c90 {
compatible = "allwinner,sun4i-wdt";
compatible = "allwinner,sun4i-a10-wdt";
reg = <0x01c20c90 0x10>;
};
7 changes: 7 additions & 0 deletions Documentation/watchdog/watchdog-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ nowayout: Disable watchdog shutdown on close
-------------------------------------------------
it87_wdt:
nogameport: Forbid the activation of game port, default=0
nocir: Forbid the use of CIR (workaround for some buggy setups); set to 1 if
system resets despite watchdog daemon running, default=0
exclusive: Watchdog exclusive device open, default=1
timeout: Watchdog timeout in seconds, default=60
testmode: Watchdog test mode (1 = no reboot), default=0
Expand Down Expand Up @@ -325,6 +327,11 @@ soft_noboot: Softdog action, set to 1 to ignore reboots, 0 to reboot
stmp3xxx_wdt:
heartbeat: Watchdog heartbeat period in seconds from 1 to 4194304, default 19
-------------------------------------------------
tegra_wdt:
heartbeat: Watchdog heartbeats in seconds. (default = 120)
nowayout: Watchdog cannot be stopped once started
(default=kernel config parameter)
-------------------------------------------------
ts72xx_wdt:
timeout: Watchdog timeout in seconds. (1 <= timeout <= 8, default=8)
nowayout: Disable watchdog shutdown on close
Expand Down
38 changes: 23 additions & 15 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ config WM8350_WATCHDOG
Support for the watchdog in the WM8350 AudioPlus PMIC. When
the watchdog triggers the system will be reset.

config XILINX_WATCHDOG
tristate "Xilinx Watchdog timer"
select WATCHDOG_CORE
help
Watchdog driver for the xps_timebase_wdt ip core.

To compile this driver as a module, choose M here: the
module will be called of_xilinx_wdt.

# ALPHA Architecture

# ARM Architecture
Expand Down Expand Up @@ -292,7 +301,7 @@ config DAVINCI_WATCHDOG

config ORION_WATCHDOG
tristate "Orion watchdog"
depends on ARCH_ORION5X || ARCH_KIRKWOOD || ARCH_DOVE
depends on ARCH_ORION5X || ARCH_KIRKWOOD || ARCH_DOVE || MACH_DOVE
select WATCHDOG_CORE
help
Say Y here if to include support for the watchdog timer
Expand Down Expand Up @@ -421,6 +430,17 @@ config SIRFSOC_WATCHDOG
Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
the watchdog triggers the system will be reset.

config TEGRA_WATCHDOG
tristate "Tegra watchdog"
depends on ARCH_TEGRA || COMPILE_TEST
select WATCHDOG_CORE
help
Say Y here to include support for the watchdog timer
embedded in NVIDIA Tegra SoCs.

To compile this driver as a module, choose M here: the
module will be called tegra_wdt.

# AVR32 Architecture

config AT32AP700X_WDT
Expand Down Expand Up @@ -533,7 +553,7 @@ config GEODE_WDT

config SC520_WDT
tristate "AMD Elan SC520 processor Watchdog"
depends on X86
depends on MELAN
help
This is the driver for the hardware watchdog built in to the
AMD "Elan" SC520 microcomputer commonly used in embedded systems.
Expand Down Expand Up @@ -1023,18 +1043,6 @@ config M54xx_WATCHDOG

# MicroBlaze Architecture

config XILINX_WATCHDOG
tristate "Xilinx Watchdog timer"
depends on MICROBLAZE
---help---
Watchdog driver for the xps_timebase_wdt ip core.

IMPORTANT: The xps_timebase_wdt parent must have the property
"clock-frequency" at device tree.

To compile this driver as a module, choose M here: the
module will be called of_xilinx_wdt.

# MIPS Architecture

config ATH79_WDT
Expand Down Expand Up @@ -1160,7 +1168,7 @@ config BCM2835_WDT

config BCM_KONA_WDT
tristate "BCM Kona Watchdog"
depends on ARCH_BCM
depends on ARCH_BCM_MOBILE
select WATCHDOG_CORE
help
Support for the watchdog timer on the following Broadcom BCM281xx
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o

# AVR32 Architecture
obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
Expand Down
21 changes: 9 additions & 12 deletions drivers/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static struct miscdevice acq_miscdev = {
* Init & exit routines
*/

static int acq_probe(struct platform_device *dev)
static int __init acq_probe(struct platform_device *dev)
{
int ret;

Expand Down Expand Up @@ -291,7 +291,6 @@ static void acq_shutdown(struct platform_device *dev)
}

static struct platform_driver acquirewdt_driver = {
.probe = acq_probe,
.remove = acq_remove,
.shutdown = acq_shutdown,
.driver = {
Expand All @@ -306,20 +305,18 @@ static int __init acq_init(void)

pr_info("WDT driver for Acquire single board computer initialising\n");

err = platform_driver_register(&acquirewdt_driver);
if (err)
return err;

acq_platform_device = platform_device_register_simple(DRV_NAME,
-1, NULL, 0);
if (IS_ERR(acq_platform_device)) {
err = PTR_ERR(acq_platform_device);
goto unreg_platform_driver;
}
if (IS_ERR(acq_platform_device))
return PTR_ERR(acq_platform_device);

err = platform_driver_probe(&acquirewdt_driver, acq_probe);
if (err)
goto unreg_platform_device;
return 0;

unreg_platform_driver:
platform_driver_unregister(&acquirewdt_driver);
unreg_platform_device:
platform_device_unregister(acq_platform_device);
return err;
}

Expand Down
21 changes: 9 additions & 12 deletions drivers/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static struct miscdevice advwdt_miscdev = {
* Init & exit routines
*/

static int advwdt_probe(struct platform_device *dev)
static int __init advwdt_probe(struct platform_device *dev)
{
int ret;

Expand Down Expand Up @@ -299,7 +299,6 @@ static void advwdt_shutdown(struct platform_device *dev)
}

static struct platform_driver advwdt_driver = {
.probe = advwdt_probe,
.remove = advwdt_remove,
.shutdown = advwdt_shutdown,
.driver = {
Expand All @@ -314,21 +313,19 @@ static int __init advwdt_init(void)

pr_info("WDT driver for Advantech single board computer initialising\n");

err = platform_driver_register(&advwdt_driver);
if (err)
return err;

advwdt_platform_device = platform_device_register_simple(DRV_NAME,
-1, NULL, 0);
if (IS_ERR(advwdt_platform_device)) {
err = PTR_ERR(advwdt_platform_device);
goto unreg_platform_driver;
}
if (IS_ERR(advwdt_platform_device))
return PTR_ERR(advwdt_platform_device);

err = platform_driver_probe(&advwdt_driver, advwdt_probe);
if (err)
goto unreg_platform_device;

return 0;

unreg_platform_driver:
platform_driver_unregister(&advwdt_driver);
unreg_platform_device:
platform_device_unregister(advwdt_platform_device);
return err;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/ar7_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>
Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/at32ap700x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,8 @@ static int __init at32_wdt_probe(struct platform_device *pdev)

wdt = devm_kzalloc(&pdev->dev, sizeof(struct wdt_at32ap700x),
GFP_KERNEL);
if (!wdt) {
dev_dbg(&pdev->dev, "no memory for wdt structure\n");
if (!wdt)
return -ENOMEM;
}

wdt->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
if (!wdt->regs) {
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/ath79_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/bcm2835_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
int err;

wdt = devm_kzalloc(dev, sizeof(struct bcm2835_wdt), GFP_KERNEL);
if (!wdt) {
dev_err(dev, "Failed to allocate memory for watchdog device");
if (!wdt)
return -ENOMEM;
}
platform_set_drvdata(pdev, wdt);

spin_lock_init(&wdt->lock);
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/bcm47xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/bcm47xx_wdt.h>
#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
Expand Down
2 changes: 0 additions & 2 deletions drivers/watchdog/bcm63xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
Expand Down Expand Up @@ -45,7 +44,6 @@
static struct {
void __iomem *regs;
struct timer_list timer;
int default_ticks;
unsigned long inuse;
atomic_t ticks;
} bcm63xx_wdt_device;
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/cpu5wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <linux/completion.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/cpwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/major.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/da9052_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ static int da9052_wdt_probe(struct platform_device *pdev)
driver_data = devm_kzalloc(&pdev->dev, sizeof(*driver_data),
GFP_KERNEL);
if (!driver_data) {
dev_err(da9052->dev, "Unable to alloacate watchdog device\n");
ret = -ENOMEM;
goto err;
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/da9055_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@ static int da9055_wdt_probe(struct platform_device *pdev)

driver_data = devm_kzalloc(&pdev->dev, sizeof(*driver_data),
GFP_KERNEL);
if (!driver_data) {
dev_err(da9055->dev, "Failed to allocate watchdog device\n");
if (!driver_data)
return -ENOMEM;
}

driver_data->da9055 = da9055;

Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/davinci_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/device.h>
Expand Down
19 changes: 6 additions & 13 deletions drivers/watchdog/ep93xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,9 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
int err;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENXIO;

if (!devm_request_mem_region(&pdev->dev, res->start,
resource_size(res), pdev->name))
return -EBUSY;

mmio_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (!mmio_base)
return -ENXIO;
mmio_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(mmio_base))
return PTR_ERR(mmio_base);

if (timeout < 1 || timeout > 3600) {
timeout = WDT_TIMEOUT;
Expand Down Expand Up @@ -172,9 +165,9 @@ static struct platform_driver ep93xx_wdt_driver = {

module_platform_driver(ep93xx_wdt_driver);

MODULE_AUTHOR("Ray Lehtiniemi <[email protected]>,"
"Alessandro Zummo <[email protected]>,"
"H Hartley Sweeten <[email protected]>");
MODULE_AUTHOR("Ray Lehtiniemi <[email protected]>");
MODULE_AUTHOR("Alessandro Zummo <[email protected]>");
MODULE_AUTHOR("H Hartley Sweeten <[email protected]>");
MODULE_DESCRIPTION("EP93xx Watchdog");
MODULE_LICENSE("GPL");
MODULE_VERSION(WDT_VERSION);
Loading

0 comments on commit 0c8cfba

Please sign in to comment.