Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51a73ba5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull watchdog updates from Wim Van Sebroeck:
 - new driver for NXP LPC18xx Watchdog Timer
 - new driver for SAMA5D4 watchdog timer
 - add support for MCP79 to nv_tco driver
 - clean-up and improvement of the mpc8xxx watchdog driver
 - improvements to gpio-wdt
 - at91sam9_wdt clock improvements
 ... and other small fixes and improvements

* git://www.linux-watchdog.org/linux-watchdog: (25 commits)
  Watchdog: Fix parent of watchdog_devices
  watchdog: at91rm9200: Correct check for syscon_node_to_regmap() errors
  watchdog: at91sam9: get and use slow clock
  Documentation: dt: binding: atmel-sama5d4-wdt: for SAMA5D4 watchdog driver
  watchdog: add a driver to support SAMA5D4 watchdog timer
  watchdog: mpc8xxx: allow to compile for MPC512x
  watchdog: mpc8xxx: use better error code when watchdog cannot be enabled
  watchdog: mpc8xxx: use dynamic memory for device specific data
  watchdog: mpc8xxx: use devm_ioremap_resource to map memory
  watchdog: mpc8xxx: make use of of_device_get_match_data
  watchdog: mpc8xxx: simplify registration
  watchdog: mpc8xxx: remove dead code
  watchdog: lpc18xx_wdt_get_timeleft() can be static
  DT: watchdog: Add NXP LPC18xx Watchdog Timer binding documentation
  watchdog: NXP LPC18xx Watchdog Timer Driver
  watchdog: gpio-wdt: ping already at startup for always running devices
  watchdog: gpio-wdt: be more strict about hw_algo matching
  Documentation: watchdog: at91sam9_wdt: add clocks property
  watchdog: booke_wdt: Use infrastructure to check timeout limits
  watchdog: (nv_tco) add support for MCP79
  ...
parents e91eb620 6551881c
Loading
Loading
Loading
Loading
+35 −0
Original line number Original line Diff line number Diff line
* Atmel SAMA5D4 Watchdog Timer (WDT) Controller

Required properties:
- compatible: "atmel,sama5d4-wdt"
- reg: base physical address and length of memory mapped region.

Optional properties:
- timeout-sec: watchdog timeout value (in seconds).
- interrupts: interrupt number to the CPU.
- atmel,watchdog-type: should be "hardware" or "software".
	"hardware": enable watchdog fault reset. A watchdog fault triggers
		    watchdog reset.
	"software": enable watchdog fault interrupt. A watchdog fault asserts
		    watchdog interrupt.
- atmel,idle-halt: present if you want to stop the watchdog when the CPU is
		   in idle state.
	CAUTION: This property should be used with care, it actually makes the
	watchdog not counting when the CPU is in idle state, therefore the
	watchdog reset time depends on mean CPU usage and will not reset at all
	if the CPU stop working while it is in idle state, which is probably
	not what you want.
- atmel,dbg-halt: present if you want to stop the watchdog when the CPU is
		  in debug state.

Example:
	watchdog@fc068640 {
		compatible = "atmel,sama5d4-wdt";
		reg = <0xfc068640 0x10>;
		interrupts = <4 IRQ_TYPE_LEVEL_HIGH 5>;
		timeout-sec = <10>;
		atmel,watchdog-type = "hardware";
		atmel,dbg-halt;
		atmel,idle-halt;
		status = "okay";
	};
+19 −0
Original line number Original line Diff line number Diff line
* NXP LPC18xx Watchdog Timer (WDT)

Required properties:
- compatible: Should be "nxp,lpc1850-wwdt"
- reg: Should contain WDT registers location and length
- clocks: Must contain an entry for each entry in clock-names.
- clock-names: Should contain "wdtclk" and "reg"; the watchdog counter
               clock and register interface clock respectively.
- interrupts: Should contain WDT interrupt

Examples:

watchdog@40080000 {
	compatible = "nxp,lpc1850-wwdt";
	reg = <0x40080000 0x24>;
	clocks = <&cgu BASE_SAFE_CLK>, <&ccu1 CLK_CPU_WWDT>;
	clock-names = "wdtclk", "reg";
	interrupts = <49>;
};
+17 −5
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ static void term(int sig)
int main(int argc, char *argv[])
int main(int argc, char *argv[])
{
{
    int flags;
    int flags;
    unsigned int ping_rate = 1;


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


@@ -63,22 +64,33 @@ int main(int argc, char *argv[])
	    fprintf(stderr, "Watchdog card enabled.\n");
	    fprintf(stderr, "Watchdog card enabled.\n");
	    fflush(stderr);
	    fflush(stderr);
	    goto end;
	    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);
	    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);
	} else {
	} else {
	    fprintf(stderr, "-d to disable, -e to enable.\n");
	    fprintf(stderr, "-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");
	    fprintf(stderr, "run by itself to tick the card.\n");
	    fflush(stderr);
	    fflush(stderr);
	    goto end;
	    goto end;
	}
	}
    } else {
    }

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


    signal(SIGINT, term);
    signal(SIGINT, term);


    while(1) {
    while(1) {
	keep_alive();
	keep_alive();
	sleep(1);
	sleep(ping_rate);
    }
    }
end:
end:
    close(fd);
    close(fd);
+1 −0
Original line number Original line Diff line number Diff line
@@ -364,6 +364,7 @@ int mei_watchdog_register(struct mei_device *dev)


	int ret;
	int ret;


	amt_wd_dev.parent = dev->dev;
	/* unlock to perserve correct locking order */
	/* unlock to perserve correct locking order */
	mutex_unlock(&dev->device_lock);
	mutex_unlock(&dev->device_lock);
	ret = watchdog_register_device(&amt_wd_dev);
	ret = watchdog_register_device(&amt_wd_dev);
+21 −1
Original line number Original line Diff line number Diff line
@@ -188,6 +188,15 @@ config AT91SAM9X_WATCHDOG
	  Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will
	  Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will
	  reboot your system when the timeout is reached.
	  reboot your system when the timeout is reached.


config SAMA5D4_WATCHDOG
	tristate "Atmel SAMA5D4 Watchdog Timer"
	depends on ARCH_AT91
	select WATCHDOG_CORE
	help
	  Atmel SAMA5D4 watchdog timer is embedded into SAMA5D4 chips.
	  Its Watchdog Timer Mode Register can be written more than once.
	  This will reboot your system when the timeout is reached.

config CADENCE_WATCHDOG
config CADENCE_WATCHDOG
	tristate "Cadence Watchdog Timer"
	tristate "Cadence Watchdog Timer"
	depends on HAS_IOMEM
	depends on HAS_IOMEM
@@ -558,6 +567,17 @@ config DIGICOLOR_WATCHDOG
	  To compile this driver as a module, choose M here: the
	  To compile this driver as a module, choose M here: the
	  module will be called digicolor_wdt.
	  module will be called digicolor_wdt.


config LPC18XX_WATCHDOG
	tristate "LPC18xx/43xx Watchdog"
	depends on ARCH_LPC18XX || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Say Y here if to include support for the watchdog timer
	  in NXP LPC SoCs family, which includes LPC18xx/LPC43xx
	  processors.
	  To compile this driver as a module, choose M here: the
	  module will be called lpc18xx_wdt.

# AVR32 Architecture
# AVR32 Architecture


config AT32AP700X_WDT
config AT32AP700X_WDT
@@ -1334,7 +1354,7 @@ config MPC5200_WDT


config 8xxx_WDT
config 8xxx_WDT
	tristate "MPC8xxx Platform Watchdog Timer"
	tristate "MPC8xxx Platform Watchdog Timer"
	depends on PPC_8xx || PPC_83xx || PPC_86xx
	depends on PPC_8xx || PPC_83xx || PPC_86xx || PPC_MPC512x
	select WATCHDOG_CORE
	select WATCHDOG_CORE
	help
	help
	  This driver is for a SoC level watchdog that exists on some
	  This driver is for a SoC level watchdog that exists on some
Loading