Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pull watchdog updates from Wim Van Sebroeck:
 "Core:
   - min and max timeout improvements, WDOG_HW_RUNNING improvements,
     status funtionality
   - Add a device managed API for watchdog_register_device()

  New watchdog drivers:
   -  Aspeed SoCs
   -  Maxim PMIC MAX77620
   -  Amlogic Meson GXBB SoC

  Enhancements:
   - support for the r8a7796 watchdog device
   - support for F81866 watchdog device
   - support for 5th variation of Apollo Lake
   - support for MCP78S chipset
   - clean-up of softdog.c watchdog device driver
   - pic32-wdt and pic32-dmt fixes
   - Documentation/watchdog: watchdog-test improvements
   - several other fixes and improvements"

* git://www.linux-watchdog.org/linux-watchdog: (50 commits)
  watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()
  watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function
  watchdog: core: Fix error handling of watchdog_dev_init()
  watchdog: pic32-wdt: Fix return value check in pic32_wdt_drv_probe()
  watchdog: pic32-dmt: Remove .owner field for driver
  watchdog: pic32-wdt: Remove .owner field for driver
  watchdog: renesas-wdt: Add support for the r8a7796 wdt
  Documentation/watchdog: check return value for magic close
  watchdog: sbsa: Drop status function
  watchdog: Implement status function in watchdog core
  watchdog: tangox: Set max_hw_heartbeat_ms instead of max_timeout
  watchdog: change watchdog_need_worker logic
  watchdog: add support for MCP78S chipset in nv_tco
  watchdog: bcm2835_wdt: remove redundant ->set_timeout callback
  watchdog: bcm2835_wdt: constify _ops and _info structures
  dt-bindings: watchdog: Add Meson GXBB Watchdog bindings
  watchdog: Add Meson GXBB Watchdog Driver
  watchdog: qcom: configure BARK time in addition to BITE time
  watchdog: qcom: add option for standalone watchdog not in timer block
  watchdog: qcom: update device tree bindings
  ...
  • Loading branch information
Linus Torvalds committed Aug 1, 2016
2 parents ba929b6 + 1ac0656 commit 27acbec
Show file tree
Hide file tree
Showing 37 changed files with 1,062 additions and 187 deletions.
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Aspeed Watchdog Timer

Required properties:
- compatible: must be one of:
- "aspeed,ast2400-wdt"
- "aspeed,ast2500-wdt"

- reg: physical base address of the controller and length of memory mapped
region

Example:

wdt1: watchdog@1e785000 {
compatible = "aspeed,ast2400-wdt";
reg = <0x1e785000 0x1c>;
};
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/watchdog/meson-gxbb-wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Meson GXBB SoCs Watchdog timer

Required properties:

- compatible : should be "amlogic,meson-gxbb-wdt"
- reg : Specifies base physical address and size of the registers.
- clocks : Should be a phandle to the Watchdog clock source, for GXBB the xtal
is the default clock source.

Example:

wdt: watchdog@98d0 {
compatible = "amlogic,meson-gxbb-wdt";
reg = <0 0x98d0 0x0 0x10>;
clocks = <&xtal>;
};
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/watchdog/qcom-wdt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Required properties :
"qcom,kpss-wdt-msm8960"
"qcom,kpss-wdt-apq8064"
"qcom,kpss-wdt-ipq8064"
"qcom,kpss-wdt-ipq4019"
"qcom,kpss-timer"
"qcom,scss-timer"
"qcom,kpss-wdt"

- reg : shall contain base register location and length
- clocks : shall contain the input clock
Expand Down
6 changes: 5 additions & 1 deletion Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Renesas Watchdog Timer (WDT) Controller

Required properties:
- compatible : Should be "renesas,r8a7795-wdt", or "renesas,rcar-gen3-wdt"
- compatible : Should be "renesas,<soctype>-wdt", and
"renesas,rcar-gen3-wdt" as fallback.
Examples with soctypes are:
- "renesas,r8a7795-wdt" (R-Car H3)
- "renesas,r8a7796-wdt" (R-Car M3-W)

When compatible with the generic version, nodes must list the SoC-specific
version corresponding to the platform first, followed by the generic
Expand Down
3 changes: 3 additions & 0 deletions Documentation/driver-model/devres.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,6 @@ SLAVE DMA ENGINE

SPI
devm_spi_register_master()

WATCHDOG
devm_watchdog_register_device()
5 changes: 2 additions & 3 deletions Documentation/watchdog/hpwdt.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Last reviewed: 04/04/2016
Last reviewed: 05/20/2016

HPE iLO NMI Watchdog Driver
NMI sourcing for iLO based ProLiant Servers
Documentation and Driver by
Thomas Mingarelli <thomas.mingarelli@hpe.com>
Thomas Mingarelli

The HPE iLO NMI Watchdog driver is a kernel module that provides basic
watchdog functionality and the added benefit of NMI sourcing. Both the
Expand Down Expand Up @@ -95,4 +95,3 @@ Last reviewed: 04/04/2016


-- Tom Mingarelli
(thomas.mingarelli@hpe.com)
39 changes: 23 additions & 16 deletions Documentation/watchdog/src/watchdog-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Watchdog Driver Test Program
*/

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -13,6 +14,7 @@
#include <linux/watchdog.h>

int fd;
const char v = 'V';

/*
* This function simply sends an IOCTL to the driver, which in turn ticks
Expand All @@ -23,6 +25,7 @@ static void keep_alive(void)
{
int dummy;

printf(".");
ioctl(fd, WDIOC_KEEPALIVE, &dummy);
}

Expand All @@ -33,58 +36,59 @@ static void keep_alive(void)

static void term(int sig)
{
int ret = write(fd, &v, 1);

close(fd);
fprintf(stderr, "Stopping watchdog ticks...\n");
if (ret < 0)
printf("\nStopping watchdog ticks failed (%d)...\n", errno);
else
printf("\nStopping watchdog ticks...\n");
exit(0);
}

int main(int argc, char *argv[])
{
int flags;
unsigned int ping_rate = 1;
int ret;

setbuf(stdout, NULL);

fd = open("/dev/watchdog", O_WRONLY);

if (fd == -1) {
fprintf(stderr, "Watchdog device not enabled.\n");
fflush(stderr);
printf("Watchdog device not enabled.\n");
exit(-1);
}

if (argc > 1) {
if (!strncasecmp(argv[1], "-d", 2)) {
flags = WDIOS_DISABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card disabled.\n");
fflush(stderr);
printf("Watchdog card disabled.\n");
goto end;
} else if (!strncasecmp(argv[1], "-e", 2)) {
flags = WDIOS_ENABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card enabled.\n");
fflush(stderr);
printf("Watchdog card enabled.\n");
goto end;
} else if (!strncasecmp(argv[1], "-t", 2) && argv[2]) {
flags = atoi(argv[2]);
ioctl(fd, WDIOC_SETTIMEOUT, &flags);
fprintf(stderr, "Watchdog timeout set to %u seconds.\n", flags);
fflush(stderr);
printf("Watchdog timeout set to %u seconds.\n", flags);
goto end;
} else if (!strncasecmp(argv[1], "-p", 2) && argv[2]) {
ping_rate = strtoul(argv[2], NULL, 0);
fprintf(stderr, "Watchdog ping rate set to %u seconds.\n", ping_rate);
fflush(stderr);
printf("Watchdog ping rate set to %u seconds.\n", ping_rate);
} else {
fprintf(stderr, "-d to disable, -e to enable, -t <n> to set " \
printf("-d to disable, -e to enable, -t <n> to set " \
"the timeout,\n-p <n> to set the ping rate, and \n");
fprintf(stderr, "run by itself to tick the card.\n");
fflush(stderr);
printf("run by itself to tick the card.\n");
goto end;
}
}

fprintf(stderr, "Watchdog Ticking Away!\n");
fflush(stderr);
printf("Watchdog Ticking Away!\n");

signal(SIGINT, term);

Expand All @@ -93,6 +97,9 @@ int main(int argc, char *argv[])
sleep(ping_rate);
}
end:
ret = write(fd, &v, 1);
if (ret < 0)
printf("Stopping watchdog ticks failed (%d)...\n", errno);
close(fd);
return 0;
}
9 changes: 7 additions & 2 deletions Documentation/watchdog/watchdog-kernel-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ It contains following fields:
* max_timeout: the watchdog timer's maximum timeout value (in seconds),
as seen from userspace. If set, the maximum configurable value for
'timeout'. Not used if max_hw_heartbeat_ms is non-zero.
* min_hw_heartbeat_ms: Minimum time between heartbeats sent to the chip,
in milli-seconds.
* min_hw_heartbeat_ms: Hardware limit for minimum time between heartbeats,
in milli-seconds. This value is normally 0; it should only be provided
if the hardware can not tolerate lower intervals between heartbeats.
* max_hw_heartbeat_ms: Maximum hardware heartbeat, in milli-seconds.
If set, the infrastructure will send heartbeats to the watchdog driver
if 'timeout' is larger than max_hw_heartbeat_ms, unless WDOG_ACTIVE
Expand Down Expand Up @@ -166,6 +167,10 @@ they are supported. These optional routines/operations are:
info structure).
* status: this routine checks the status of the watchdog timer device. The
status of the device is reported with watchdog WDIOF_* status flags/bits.
WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING are reported by the watchdog core;
it is not necessary to report those bits from the driver. Also, if no status
function is provided by the driver, the watchdog core reports the status bits
provided in the bootstatus variable of struct watchdog_device.
* set_timeout: this routine checks and changes the timeout of the watchdog
timer device. It returns 0 on success, -EINVAL for "parameter out of range"
and -EIO for "could not write value to the watchdog". On success this
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5353,6 +5353,12 @@ T: git git://linuxtv.org/anttip/media_tree.git
S: Maintained
F: drivers/media/dvb-frontends/hd29l2*

HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER
M: Brian Boylston <brian.boylston@hpe.com>
S: Supported
F: Documentation/watchdog/hpwdt.txt
F: drivers/watchdog/hpwdt.c

HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
M: Don Brace <don.brace@microsemi.com>
L: iss_storagedev@hp.com
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/qcom-apq8064.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@
};

timer@200a000 {
compatible = "qcom,kpss-timer", "qcom,msm-timer";
compatible = "qcom,kpss-timer",
"qcom,kpss-wdt-apq8064", "qcom,msm-timer";
interrupts = <1 1 0x301>,
<1 2 0x301>,
<1 3 0x301>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/qcom-ipq4019.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
};

watchdog@b017000 {
compatible = "qcom,kpss-standalone";
compatible = "qcom,kpss-wdt", "qcom,kpss-wdt-ipq4019";
reg = <0xb017000 0x40>;
clocks = <&sleep_clk>;
timeout-sec = <10>;
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/qcom-ipq8064.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
};

timer@200a000 {
compatible = "qcom,kpss-timer", "qcom,msm-timer";
compatible = "qcom,kpss-timer",
"qcom,kpss-wdt-ipq8064", "qcom,msm-timer";
interrupts = <1 1 0x301>,
<1 2 0x301>,
<1 3 0x301>,
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/qcom-msm8960.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
};

timer@200a000 {
compatible = "qcom,kpss-timer", "qcom,msm-timer";
compatible = "qcom,kpss-timer",
"qcom,kpss-wdt-msm8960", "qcom,msm-timer";
interrupts = <1 1 0x301>,
<1 2 0x301>,
<1 3 0x301>;
Expand Down
10 changes: 6 additions & 4 deletions drivers/platform/x86/intel_pmc_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
* platform device and to export resources for those functions.
*/
#define TCO_DEVICE_NAME "iTCO_wdt"
#define SMI_EN_OFFSET 0x30
#define SMI_EN_OFFSET 0x40
#define SMI_EN_SIZE 4
#define TCO_BASE_OFFSET 0x60
#define TCO_REGS_SIZE 16
Expand All @@ -94,6 +94,8 @@
#define TELEM_SSRAM_SIZE 240
#define TELEM_PMC_SSRAM_OFFSET 0x1B00
#define TELEM_PUNIT_SSRAM_OFFSET 0x1A00
#define TCO_PMC_OFFSET 0x8
#define TCO_PMC_SIZE 0x4

static const int iTCO_version = 3;

Expand Down Expand Up @@ -502,7 +504,7 @@ static struct resource tco_res[] = {

static struct itco_wdt_platform_data tco_info = {
.name = "Apollo Lake SoC",
.version = 3,
.version = 5,
};

#define TELEMETRY_RESOURCE_PUNIT_SSRAM 0
Expand Down Expand Up @@ -572,8 +574,8 @@ static int ipc_create_tco_device(void)
res->end = res->start + SMI_EN_SIZE - 1;

res = tco_res + TCO_RESOURCE_GCR_MEM;
res->start = ipcdev.gcr_base;
res->end = res->start + ipcdev.gcr_size - 1;
res->start = ipcdev.gcr_base + TCO_PMC_OFFSET;
res->end = res->start + TCO_PMC_SIZE - 1;

ret = platform_device_add_resources(pdev, tco_res, ARRAY_SIZE(tco_res));
if (ret) {
Expand Down
33 changes: 32 additions & 1 deletion drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ config WATCHDOG_NOWAYOUT

config WATCHDOG_SYSFS
bool "Read different watchdog information through sysfs"
default n
help
Say Y here if you want to enable watchdog device status read through
sysfs attributes.
Expand Down Expand Up @@ -516,6 +515,15 @@ config MAX63XX_WATCHDOG
help
Support for memory mapped max63{69,70,71,72,73,74} watchdog timer.

config MAX77620_WATCHDOG
tristate "Maxim Max77620 Watchdog Timer"
depends on MFD_MAX77620
help
This is the driver for the Max77620 watchdog timer.
Say 'Y' here to enable the watchdog timer support for
MAX77620 chips. To compile this driver as a module,
choose M here: the module will be called max77620_wdt.

config IMX2_WDT
tristate "IMX2+ Watchdog"
depends on ARCH_MXC || ARCH_LAYERSCAPE
Expand Down Expand Up @@ -609,6 +617,16 @@ config QCOM_WDT
To compile this driver as a module, choose M here: the
module will be called qcom_wdt.

config MESON_GXBB_WATCHDOG
tristate "Amlogic Meson GXBB SoCs watchdog support"
depends on ARCH_MESON
select WATCHDOG_CORE
help
Say Y here to include support for the watchdog timer
in Amlogic Meson GXBB SoCs.
To compile this driver as a module, choose M here: the
module will be called meson_gxbb_wdt.

config MESON_WATCHDOG
tristate "Amlogic Meson SoCs watchdog support"
depends on ARCH_MESON
Expand Down Expand Up @@ -669,6 +687,19 @@ config RENESAS_WDT
This driver adds watchdog support for the integrated watchdogs in the
Renesas R-Car and other SH-Mobile SoCs (usually named RWDT or SWDT).

config ASPEED_WATCHDOG
tristate "Aspeed 2400 watchdog support"
depends on ARCH_ASPEED || COMPILE_TEST
select WATCHDOG_CORE
help
Say Y here to include support for the watchdog timer
in Apseed BMC SoCs.

This driver is required to reboot the SoC.

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

# AVR32 Architecture

config AT32AP700X_WDT
Expand Down
3 changes: 3 additions & 0 deletions drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
obj-$(CONFIG_MESON_GXBB_WATCHDOG) += meson_gxbb_wdt.o
obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o

# AVR32 Architecture
obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
Expand Down Expand Up @@ -203,6 +205,7 @@ obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
obj-$(CONFIG_MAX77620_WATCHDOG) += max77620_wdt.o
obj-$(CONFIG_ZIIRAVE_WATCHDOG) += ziirave_wdt.o
obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
Loading

0 comments on commit 27acbec

Please sign in to comment.