You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge git://www.linux-watchdog.org/linux-watchdog
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 ...
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
* 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";
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
* 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>;
|
||||
};
|
||||
@@ -41,6 +41,7 @@ static void term(int sig)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int flags;
|
||||
unsigned int ping_rate = 1;
|
||||
|
||||
fd = open("/dev/watchdog", O_WRONLY);
|
||||
|
||||
@@ -63,22 +64,33 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "Watchdog card enabled.\n");
|
||||
fflush(stderr);
|
||||
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 {
|
||||
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");
|
||||
fflush(stderr);
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Watchdog Ticking Away!\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
fprintf(stderr, "Watchdog Ticking Away!\n");
|
||||
fflush(stderr);
|
||||
|
||||
signal(SIGINT, term);
|
||||
|
||||
while(1) {
|
||||
keep_alive();
|
||||
sleep(1);
|
||||
sleep(ping_rate);
|
||||
}
|
||||
end:
|
||||
close(fd);
|
||||
|
||||
@@ -364,6 +364,7 @@ int mei_watchdog_register(struct mei_device *dev)
|
||||
|
||||
int ret;
|
||||
|
||||
amt_wd_dev.parent = dev->dev;
|
||||
/* unlock to perserve correct locking order */
|
||||
mutex_unlock(&dev->device_lock);
|
||||
ret = watchdog_register_device(&amt_wd_dev);
|
||||
|
||||
@@ -188,6 +188,15 @@ config AT91SAM9X_WATCHDOG
|
||||
Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will
|
||||
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
|
||||
tristate "Cadence Watchdog Timer"
|
||||
depends on HAS_IOMEM
|
||||
@@ -558,6 +567,17 @@ config DIGICOLOR_WATCHDOG
|
||||
To compile this driver as a module, choose M here: the
|
||||
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
|
||||
|
||||
config AT32AP700X_WDT
|
||||
@@ -1334,7 +1354,7 @@ config MPC5200_WDT
|
||||
|
||||
config 8xxx_WDT
|
||||
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
|
||||
help
|
||||
This driver is for a SoC level watchdog that exists on some
|
||||
|
||||
@@ -41,6 +41,7 @@ obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
|
||||
obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
|
||||
obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
|
||||
obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
|
||||
obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
|
||||
obj-$(CONFIG_DW_WATCHDOG) += dw_wdt.o
|
||||
obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
|
||||
obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
|
||||
@@ -66,6 +67,7 @@ obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_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
|
||||
|
||||
# AVR32 Architecture
|
||||
obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
|
||||
|
||||
@@ -244,7 +244,7 @@ static int at91wdt_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
regmap_st = syscon_node_to_regmap(parent->of_node);
|
||||
if (!regmap_st)
|
||||
if (IS_ERR(regmap_st))
|
||||
return -ENODEV;
|
||||
|
||||
res = misc_register(&at91wdt_miscdev);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -90,6 +91,7 @@ struct at91wdt {
|
||||
unsigned long heartbeat; /* WDT heartbeat in jiffies */
|
||||
bool nowayout;
|
||||
unsigned int irq;
|
||||
struct clk *sclk;
|
||||
};
|
||||
|
||||
/* ......................................................................... */
|
||||
@@ -352,15 +354,25 @@ static int __init at91wdt_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(wdt->base))
|
||||
return PTR_ERR(wdt->base);
|
||||
|
||||
wdt->sclk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(wdt->sclk))
|
||||
return PTR_ERR(wdt->sclk);
|
||||
|
||||
err = clk_prepare_enable(wdt->sclk);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Could not enable slow clock\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
if (pdev->dev.of_node) {
|
||||
err = of_at91wdt_init(pdev->dev.of_node, wdt);
|
||||
if (err)
|
||||
return err;
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
err = at91_wdt_init(pdev, wdt);
|
||||
if (err)
|
||||
return err;
|
||||
goto err_clk;
|
||||
|
||||
platform_set_drvdata(pdev, wdt);
|
||||
|
||||
@@ -368,6 +380,11 @@ static int __init at91wdt_probe(struct platform_device *pdev)
|
||||
wdt->wdd.timeout, wdt->nowayout);
|
||||
|
||||
return 0;
|
||||
|
||||
err_clk:
|
||||
clk_disable_unprepare(wdt->sclk);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int __exit at91wdt_remove(struct platform_device *pdev)
|
||||
@@ -377,6 +394,7 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
|
||||
|
||||
pr_warn("I quit now, hardware will probably reboot!\n");
|
||||
del_timer(&wdt->timer);
|
||||
clk_disable_unprepare(wdt->sclk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
|
||||
#define AT91_WDT_MR 0x04 /* Watchdog Mode Register */
|
||||
#define AT91_WDT_WDV (0xfff << 0) /* Counter Value */
|
||||
#define AT91_WDT_SET_WDV(x) ((x) & AT91_WDT_WDV)
|
||||
#define AT91_WDT_WDFIEN (1 << 12) /* Fault Interrupt Enable */
|
||||
#define AT91_WDT_WDRSTEN (1 << 13) /* Reset Processor */
|
||||
#define AT91_WDT_WDRPROC (1 << 14) /* Timer Restart */
|
||||
#define AT91_WDT_WDDIS (1 << 15) /* Watchdog Disable */
|
||||
#define AT91_WDT_WDD (0xfff << 16) /* Delta Value */
|
||||
#define AT91_WDT_SET_WDD(x) (((x) << 16) & AT91_WDT_WDD)
|
||||
#define AT91_WDT_WDDBGHLT (1 << 28) /* Debug Halt */
|
||||
#define AT91_WDT_WDIDLEHLT (1 << 29) /* Idle Halt */
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
|
||||
watchdog_set_drvdata(&bcm2835_wdt_wdd, wdt);
|
||||
watchdog_init_timeout(&bcm2835_wdt_wdd, heartbeat, dev);
|
||||
watchdog_set_nowayout(&bcm2835_wdt_wdd, nowayout);
|
||||
bcm2835_wdt_wdd.parent = &pdev->dev;
|
||||
err = watchdog_register_device(&bcm2835_wdt_wdd);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to register watchdog device");
|
||||
|
||||
@@ -209,6 +209,7 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
|
||||
|
||||
wdt->wdd.info = &bcm47xx_wdt_info;
|
||||
wdt->wdd.timeout = WDT_DEFAULT_TIME;
|
||||
wdt->wdd.parent = &pdev->dev;
|
||||
ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout);
|
||||
if (ret)
|
||||
goto err_timer;
|
||||
|
||||
@@ -319,6 +319,7 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
|
||||
spin_lock_init(&wdt->lock);
|
||||
platform_set_drvdata(pdev, wdt);
|
||||
watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);
|
||||
bcm_kona_wdt_wdd.parent = &pdev->dev;
|
||||
|
||||
ret = bcm_kona_wdt_set_timeout_reg(&bcm_kona_wdt_wdd, 0);
|
||||
if (ret) {
|
||||
|
||||
@@ -186,8 +186,6 @@ static int booke_wdt_stop(struct watchdog_device *wdog)
|
||||
static int booke_wdt_set_timeout(struct watchdog_device *wdt_dev,
|
||||
unsigned int timeout)
|
||||
{
|
||||
if (timeout > MAX_WDT_TIMEOUT)
|
||||
return -EINVAL;
|
||||
wdt_dev->timeout = timeout;
|
||||
booke_wdt_set(wdt_dev);
|
||||
|
||||
@@ -211,7 +209,6 @@ static struct watchdog_device booke_wdt_dev = {
|
||||
.info = &booke_wdt_info,
|
||||
.ops = &booke_wdt_ops,
|
||||
.min_timeout = 1,
|
||||
.max_timeout = 0xFFFF
|
||||
};
|
||||
|
||||
static void __exit booke_wdt_exit(void)
|
||||
@@ -229,6 +226,7 @@ static int __init booke_wdt_init(void)
|
||||
booke_wdt_set_timeout(&booke_wdt_dev,
|
||||
period_to_sec(booke_wdt_period));
|
||||
watchdog_set_nowayout(&booke_wdt_dev, nowayout);
|
||||
booke_wdt_dev.max_timeout = MAX_WDT_TIMEOUT;
|
||||
if (booke_wdt_enabled)
|
||||
booke_wdt_start(&booke_wdt_dev);
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ static int __init coh901327_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
coh901327_wdt.timeout = 60;
|
||||
|
||||
coh901327_wdt.parent = &pdev->dev;
|
||||
ret = watchdog_register_device(&coh901327_wdt);
|
||||
if (ret == 0)
|
||||
dev_info(&pdev->dev,
|
||||
|
||||
@@ -195,6 +195,7 @@ static int da9052_wdt_probe(struct platform_device *pdev)
|
||||
da9052_wdt->timeout = DA9052_DEF_TIMEOUT;
|
||||
da9052_wdt->info = &da9052_wdt_info;
|
||||
da9052_wdt->ops = &da9052_wdt_ops;
|
||||
da9052_wdt->parent = &pdev->dev;
|
||||
watchdog_set_drvdata(da9052_wdt, driver_data);
|
||||
|
||||
kref_init(&driver_data->kref);
|
||||
|
||||
@@ -161,6 +161,7 @@ static int da9055_wdt_probe(struct platform_device *pdev)
|
||||
da9055_wdt->timeout = DA9055_DEF_TIMEOUT;
|
||||
da9055_wdt->info = &da9055_wdt_info;
|
||||
da9055_wdt->ops = &da9055_wdt_ops;
|
||||
da9055_wdt->parent = &pdev->dev;
|
||||
watchdog_set_nowayout(da9055_wdt, nowayout);
|
||||
watchdog_set_drvdata(da9055_wdt, driver_data);
|
||||
|
||||
|
||||
@@ -210,6 +210,7 @@ static int da9062_wdt_probe(struct platform_device *pdev)
|
||||
wdt->wdtdev.max_timeout = DA9062_WDT_MAX_TIMEOUT;
|
||||
wdt->wdtdev.timeout = DA9062_WDG_DEFAULT_TIMEOUT;
|
||||
wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
|
||||
wdt->wdtdev.parent = &pdev->dev;
|
||||
|
||||
watchdog_set_drvdata(&wdt->wdtdev, wdt);
|
||||
dev_set_drvdata(&pdev->dev, wdt);
|
||||
|
||||
@@ -175,6 +175,7 @@ static int da9063_wdt_probe(struct platform_device *pdev)
|
||||
wdt->wdtdev.min_timeout = DA9063_WDT_MIN_TIMEOUT;
|
||||
wdt->wdtdev.max_timeout = DA9063_WDT_MAX_TIMEOUT;
|
||||
wdt->wdtdev.timeout = DA9063_WDG_TIMEOUT;
|
||||
wdt->wdtdev.parent = &pdev->dev;
|
||||
|
||||
wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ static int davinci_wdt_probe(struct platform_device *pdev)
|
||||
wdd->min_timeout = 1;
|
||||
wdd->max_timeout = MAX_HEARTBEAT;
|
||||
wdd->timeout = DEFAULT_HEARTBEAT;
|
||||
wdd->parent = &pdev->dev;
|
||||
|
||||
watchdog_init_timeout(wdd, heartbeat, dev);
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ static int dc_wdt_probe(struct platform_device *pdev)
|
||||
}
|
||||
dc_wdt_wdd.max_timeout = U32_MAX / clk_get_rate(wdt->clk);
|
||||
dc_wdt_wdd.timeout = dc_wdt_wdd.max_timeout;
|
||||
dc_wdt_wdd.parent = &pdev->dev;
|
||||
|
||||
spin_lock_init(&wdt->lock);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user