xref: /linux/drivers/watchdog/shwdt.c (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
12874c5fdSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
2b7e04f8cSWim Van Sebroeck /*
3b1fa888eSPaul Mundt  * drivers/watchdog/shwdt.c
4b7e04f8cSWim Van Sebroeck  *
5b7e04f8cSWim Van Sebroeck  * Watchdog driver for integrated watchdog in the SuperH processors.
6b7e04f8cSWim Van Sebroeck  *
740968126SPaul Mundt  * Copyright (C) 2001 - 2012  Paul Mundt <lethal@linux-sh.org>
8b7e04f8cSWim Van Sebroeck  *
9b7e04f8cSWim Van Sebroeck  * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
10b7e04f8cSWim Van Sebroeck  *     Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
11b7e04f8cSWim Van Sebroeck  *
12b7e04f8cSWim Van Sebroeck  * 19-Apr-2002 Rob Radez <rob@osinvestor.com>
13b7e04f8cSWim Van Sebroeck  *     Added expect close support, made emulated timeout runtime changeable
14b7e04f8cSWim Van Sebroeck  *     general cleanups, add some ioctls
15b7e04f8cSWim Van Sebroeck  */
1627c766aaSJoe Perches 
1727c766aaSJoe Perches #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1827c766aaSJoe Perches 
19b7e04f8cSWim Van Sebroeck #include <linux/module.h>
20b7e04f8cSWim Van Sebroeck #include <linux/moduleparam.h>
218f5585ecSPaul Mundt #include <linux/platform_device.h>
22b7e04f8cSWim Van Sebroeck #include <linux/init.h>
23b7e04f8cSWim Van Sebroeck #include <linux/types.h>
24f9fb360cSPaul Mundt #include <linux/spinlock.h>
25b7e04f8cSWim Van Sebroeck #include <linux/watchdog.h>
268c013d96SPaul Mundt #include <linux/pm_runtime.h>
27b7e04f8cSWim Van Sebroeck #include <linux/fs.h>
28b7e04f8cSWim Van Sebroeck #include <linux/mm.h>
298f5585ecSPaul Mundt #include <linux/slab.h>
3070b814ecSAlan Cox #include <linux/io.h>
319ea64046SPaul Mundt #include <linux/clk.h>
326330c707SSachin Kamat #include <linux/err.h>
3358cf4198SAdrian Bunk #include <asm/watchdog.h>
34b7e04f8cSWim Van Sebroeck 
358f5585ecSPaul Mundt #define DRV_NAME "sh-wdt"
36b7e04f8cSWim Van Sebroeck 
37b7e04f8cSWim Van Sebroeck /*
38b7e04f8cSWim Van Sebroeck  * Default clock division ratio is 5.25 msecs. For an additional table of
39b7e04f8cSWim Van Sebroeck  * values, consult the asm-sh/watchdog.h. Overload this at module load
40b7e04f8cSWim Van Sebroeck  * time.
41b7e04f8cSWim Van Sebroeck  *
42b7e04f8cSWim Van Sebroeck  * In order for this to work reliably we need to have HZ set to 1000 or
43b7e04f8cSWim Van Sebroeck  * something quite higher than 100 (or we need a proper high-res timer
44b7e04f8cSWim Van Sebroeck  * implementation that will deal with this properly), otherwise the 10ms
45b7e04f8cSWim Van Sebroeck  * resolution of a jiffy is enough to trigger the overflow. For things like
46b7e04f8cSWim Van Sebroeck  * the SH-4 and SH-5, this isn't necessarily that big of a problem, though
47b7e04f8cSWim Van Sebroeck  * for the SH-2 and SH-3, this isn't recommended unless the WDT is absolutely
48b7e04f8cSWim Van Sebroeck  * necssary.
49b7e04f8cSWim Van Sebroeck  *
50b7e04f8cSWim Van Sebroeck  * As a result of this timing problem, the only modes that are particularly
5125985edcSLucas De Marchi  * feasible are the 4096 and the 2048 divisors, which yield 5.25 and 2.62ms
52b7e04f8cSWim Van Sebroeck  * overflow periods respectively.
53b7e04f8cSWim Van Sebroeck  *
54b7e04f8cSWim Van Sebroeck  * Also, since we can't really expect userspace to be responsive enough
55ee0fc097SJoe Perches  * before the overflow happens, we maintain two separate timers .. One in
56b7e04f8cSWim Van Sebroeck  * the kernel for clearing out WOVF every 2ms or so (again, this depends on
57b7e04f8cSWim Van Sebroeck  * HZ == 1000), and another for monitoring userspace writes to the WDT device.
58b7e04f8cSWim Van Sebroeck  *
59b7e04f8cSWim Van Sebroeck  * As such, we currently use a configurable heartbeat interval which defaults
60b7e04f8cSWim Van Sebroeck  * to 30s. In this case, the userspace daemon is only responsible for periodic
61b7e04f8cSWim Van Sebroeck  * writes to the device before the next heartbeat is scheduled. If the daemon
62b7e04f8cSWim Van Sebroeck  * misses its deadline, the kernel timer will allow the WDT to overflow.
63b7e04f8cSWim Van Sebroeck  */
64b7e04f8cSWim Van Sebroeck static int clock_division_ratio = WTCSR_CKS_4096;
65bea19066SDavid Engraf #define next_ping_period(cks)	(jiffies + msecs_to_jiffies(cks - 4))
66b7e04f8cSWim Van Sebroeck 
67b7e04f8cSWim Van Sebroeck #define WATCHDOG_HEARTBEAT 30			/* 30 sec default heartbeat */
68b7e04f8cSWim Van Sebroeck static int heartbeat = WATCHDOG_HEARTBEAT;	/* in seconds */
6986a1e189SWim Van Sebroeck static bool nowayout = WATCHDOG_NOWAYOUT;
708f5585ecSPaul Mundt static unsigned long next_heartbeat;
71b7e04f8cSWim Van Sebroeck 
728f5585ecSPaul Mundt struct sh_wdt {
738f5585ecSPaul Mundt 	void __iomem		*base;
748f5585ecSPaul Mundt 	struct device		*dev;
759ea64046SPaul Mundt 	struct clk		*clk;
76f9fb360cSPaul Mundt 	spinlock_t		lock;
778f5585ecSPaul Mundt 
788f5585ecSPaul Mundt 	struct timer_list	timer;
798f5585ecSPaul Mundt };
808f5585ecSPaul Mundt 
sh_wdt_start(struct watchdog_device * wdt_dev)811950f499SPaul Mundt static int sh_wdt_start(struct watchdog_device *wdt_dev)
82b7e04f8cSWim Van Sebroeck {
831950f499SPaul Mundt 	struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev);
8470b814ecSAlan Cox 	unsigned long flags;
858f5585ecSPaul Mundt 	u8 csr;
8670b814ecSAlan Cox 
878c013d96SPaul Mundt 	pm_runtime_get_sync(wdt->dev);
88d42c9744SPaul Mundt 	clk_enable(wdt->clk);
898c013d96SPaul Mundt 
90f9fb360cSPaul Mundt 	spin_lock_irqsave(&wdt->lock, flags);
91b7e04f8cSWim Van Sebroeck 
92b7e04f8cSWim Van Sebroeck 	next_heartbeat = jiffies + (heartbeat * HZ);
938f5585ecSPaul Mundt 	mod_timer(&wdt->timer, next_ping_period(clock_division_ratio));
94b7e04f8cSWim Van Sebroeck 
95b7e04f8cSWim Van Sebroeck 	csr = sh_wdt_read_csr();
96b7e04f8cSWim Van Sebroeck 	csr |= WTCSR_WT | clock_division_ratio;
97b7e04f8cSWim Van Sebroeck 	sh_wdt_write_csr(csr);
98b7e04f8cSWim Van Sebroeck 
99b7e04f8cSWim Van Sebroeck 	sh_wdt_write_cnt(0);
100b7e04f8cSWim Van Sebroeck 
101b7e04f8cSWim Van Sebroeck 	/*
102b7e04f8cSWim Van Sebroeck 	 * These processors have a bit of an inconsistent initialization
103b7e04f8cSWim Van Sebroeck 	 * process.. starting with SH-3, RSTS was moved to WTCSR, and the
104b7e04f8cSWim Van Sebroeck 	 * RSTCSR register was removed.
105b7e04f8cSWim Van Sebroeck 	 *
106b7e04f8cSWim Van Sebroeck 	 * On the SH-2 however, in addition with bits being in different
107b7e04f8cSWim Van Sebroeck 	 * locations, we must deal with RSTCSR outright..
108b7e04f8cSWim Van Sebroeck 	 */
109b7e04f8cSWim Van Sebroeck 	csr = sh_wdt_read_csr();
110b7e04f8cSWim Van Sebroeck 	csr |= WTCSR_TME;
111b7e04f8cSWim Van Sebroeck 	csr &= ~WTCSR_RSTS;
112b7e04f8cSWim Van Sebroeck 	sh_wdt_write_csr(csr);
113b7e04f8cSWim Van Sebroeck 
114b7e04f8cSWim Van Sebroeck #ifdef CONFIG_CPU_SH2
115b7e04f8cSWim Van Sebroeck 	csr = sh_wdt_read_rstcsr();
116b7e04f8cSWim Van Sebroeck 	csr &= ~RSTCSR_RSTS;
117b7e04f8cSWim Van Sebroeck 	sh_wdt_write_rstcsr(csr);
118b7e04f8cSWim Van Sebroeck #endif
119f9fb360cSPaul Mundt 	spin_unlock_irqrestore(&wdt->lock, flags);
1201950f499SPaul Mundt 
1211950f499SPaul Mundt 	return 0;
122b7e04f8cSWim Van Sebroeck }
123b7e04f8cSWim Van Sebroeck 
sh_wdt_stop(struct watchdog_device * wdt_dev)1241950f499SPaul Mundt static int sh_wdt_stop(struct watchdog_device *wdt_dev)
125b7e04f8cSWim Van Sebroeck {
1261950f499SPaul Mundt 	struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev);
12770b814ecSAlan Cox 	unsigned long flags;
1288f5585ecSPaul Mundt 	u8 csr;
12970b814ecSAlan Cox 
130f9fb360cSPaul Mundt 	spin_lock_irqsave(&wdt->lock, flags);
131b7e04f8cSWim Van Sebroeck 
1328f5585ecSPaul Mundt 	del_timer(&wdt->timer);
133b7e04f8cSWim Van Sebroeck 
134b7e04f8cSWim Van Sebroeck 	csr = sh_wdt_read_csr();
135b7e04f8cSWim Van Sebroeck 	csr &= ~WTCSR_TME;
136b7e04f8cSWim Van Sebroeck 	sh_wdt_write_csr(csr);
1378f5585ecSPaul Mundt 
138f9fb360cSPaul Mundt 	spin_unlock_irqrestore(&wdt->lock, flags);
1391950f499SPaul Mundt 
140d42c9744SPaul Mundt 	clk_disable(wdt->clk);
1418c013d96SPaul Mundt 	pm_runtime_put_sync(wdt->dev);
1428c013d96SPaul Mundt 
1431950f499SPaul Mundt 	return 0;
144b7e04f8cSWim Van Sebroeck }
145b7e04f8cSWim Van Sebroeck 
sh_wdt_keepalive(struct watchdog_device * wdt_dev)1461950f499SPaul Mundt static int sh_wdt_keepalive(struct watchdog_device *wdt_dev)
147b7e04f8cSWim Van Sebroeck {
148f9fb360cSPaul Mundt 	struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev);
14970b814ecSAlan Cox 	unsigned long flags;
15070b814ecSAlan Cox 
151f9fb360cSPaul Mundt 	spin_lock_irqsave(&wdt->lock, flags);
152b7e04f8cSWim Van Sebroeck 	next_heartbeat = jiffies + (heartbeat * HZ);
153f9fb360cSPaul Mundt 	spin_unlock_irqrestore(&wdt->lock, flags);
1541950f499SPaul Mundt 
1551950f499SPaul Mundt 	return 0;
156b7e04f8cSWim Van Sebroeck }
157b7e04f8cSWim Van Sebroeck 
sh_wdt_set_heartbeat(struct watchdog_device * wdt_dev,unsigned t)1581950f499SPaul Mundt static int sh_wdt_set_heartbeat(struct watchdog_device *wdt_dev, unsigned t)
159b7e04f8cSWim Van Sebroeck {
160f9fb360cSPaul Mundt 	struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev);
16170b814ecSAlan Cox 	unsigned long flags;
16270b814ecSAlan Cox 
16370b814ecSAlan Cox 	if (unlikely(t < 1 || t > 3600)) /* arbitrary upper limit */
164b7e04f8cSWim Van Sebroeck 		return -EINVAL;
165b7e04f8cSWim Van Sebroeck 
166f9fb360cSPaul Mundt 	spin_lock_irqsave(&wdt->lock, flags);
167b7e04f8cSWim Van Sebroeck 	heartbeat = t;
1681950f499SPaul Mundt 	wdt_dev->timeout = t;
169f9fb360cSPaul Mundt 	spin_unlock_irqrestore(&wdt->lock, flags);
1701950f499SPaul Mundt 
171b7e04f8cSWim Van Sebroeck 	return 0;
172b7e04f8cSWim Van Sebroeck }
173b7e04f8cSWim Van Sebroeck 
sh_wdt_ping(struct timer_list * t)174e99e88a9SKees Cook static void sh_wdt_ping(struct timer_list *t)
175b7e04f8cSWim Van Sebroeck {
176e99e88a9SKees Cook 	struct sh_wdt *wdt = from_timer(wdt, t, timer);
17770b814ecSAlan Cox 	unsigned long flags;
17870b814ecSAlan Cox 
179f9fb360cSPaul Mundt 	spin_lock_irqsave(&wdt->lock, flags);
180b7e04f8cSWim Van Sebroeck 	if (time_before(jiffies, next_heartbeat)) {
1818f5585ecSPaul Mundt 		u8 csr;
182b7e04f8cSWim Van Sebroeck 
183b7e04f8cSWim Van Sebroeck 		csr = sh_wdt_read_csr();
184b7e04f8cSWim Van Sebroeck 		csr &= ~WTCSR_IOVF;
185b7e04f8cSWim Van Sebroeck 		sh_wdt_write_csr(csr);
186b7e04f8cSWim Van Sebroeck 
187b7e04f8cSWim Van Sebroeck 		sh_wdt_write_cnt(0);
188b7e04f8cSWim Van Sebroeck 
1898f5585ecSPaul Mundt 		mod_timer(&wdt->timer, next_ping_period(clock_division_ratio));
190b7e04f8cSWim Van Sebroeck 	} else
1918f5585ecSPaul Mundt 		dev_warn(wdt->dev, "Heartbeat lost! Will not ping "
192b7e04f8cSWim Van Sebroeck 		         "the watchdog\n");
193f9fb360cSPaul Mundt 	spin_unlock_irqrestore(&wdt->lock, flags);
194b7e04f8cSWim Van Sebroeck }
195b7e04f8cSWim Van Sebroeck 
19670b814ecSAlan Cox static const struct watchdog_info sh_wdt_info = {
197b7e04f8cSWim Van Sebroeck 	.options		= WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
198b7e04f8cSWim Van Sebroeck 				  WDIOF_MAGICCLOSE,
199b7e04f8cSWim Van Sebroeck 	.firmware_version	= 1,
200b7e04f8cSWim Van Sebroeck 	.identity		= "SH WDT",
201b7e04f8cSWim Van Sebroeck };
202b7e04f8cSWim Van Sebroeck 
2031950f499SPaul Mundt static const struct watchdog_ops sh_wdt_ops = {
2041950f499SPaul Mundt 	.owner		= THIS_MODULE,
2051950f499SPaul Mundt 	.start		= sh_wdt_start,
2061950f499SPaul Mundt 	.stop		= sh_wdt_stop,
2071950f499SPaul Mundt 	.ping		= sh_wdt_keepalive,
2081950f499SPaul Mundt 	.set_timeout	= sh_wdt_set_heartbeat,
2091950f499SPaul Mundt };
2101950f499SPaul Mundt 
2111950f499SPaul Mundt static struct watchdog_device sh_wdt_dev = {
2121950f499SPaul Mundt 	.info	= &sh_wdt_info,
2131950f499SPaul Mundt 	.ops	= &sh_wdt_ops,
214b7e04f8cSWim Van Sebroeck };
215b7e04f8cSWim Van Sebroeck 
sh_wdt_probe(struct platform_device * pdev)2162d991a16SBill Pemberton static int sh_wdt_probe(struct platform_device *pdev)
2178f5585ecSPaul Mundt {
2188f5585ecSPaul Mundt 	struct sh_wdt *wdt;
2198f5585ecSPaul Mundt 	int rc;
2208f5585ecSPaul Mundt 
2218f5585ecSPaul Mundt 	/*
2228f5585ecSPaul Mundt 	 * As this driver only covers the global watchdog case, reject
2238f5585ecSPaul Mundt 	 * any attempts to register per-CPU watchdogs.
2248f5585ecSPaul Mundt 	 */
2258f5585ecSPaul Mundt 	if (pdev->id != -1)
2268f5585ecSPaul Mundt 		return -EINVAL;
2278f5585ecSPaul Mundt 
2288f5585ecSPaul Mundt 	wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL);
2299ea64046SPaul Mundt 	if (unlikely(!wdt))
2309ea64046SPaul Mundt 		return -ENOMEM;
2318f5585ecSPaul Mundt 
2328f5585ecSPaul Mundt 	wdt->dev = &pdev->dev;
2338f5585ecSPaul Mundt 
2342f7b9b48SJingoo Han 	wdt->clk = devm_clk_get(&pdev->dev, NULL);
2359ea64046SPaul Mundt 	if (IS_ERR(wdt->clk)) {
2369ea64046SPaul Mundt 		/*
2379ea64046SPaul Mundt 		 * Clock framework support is optional, continue on
2389ea64046SPaul Mundt 		 * anyways if we don't find a matching clock.
2399ea64046SPaul Mundt 		 */
2409ea64046SPaul Mundt 		wdt->clk = NULL;
2419ea64046SPaul Mundt 	}
2429ea64046SPaul Mundt 
2430f0a6a28SGuenter Roeck 	wdt->base = devm_platform_ioremap_resource(pdev, 0);
2442f7b9b48SJingoo Han 	if (IS_ERR(wdt->base))
2452f7b9b48SJingoo Han 		return PTR_ERR(wdt->base);
2469ea64046SPaul Mundt 
247f9fb360cSPaul Mundt 	watchdog_set_nowayout(&sh_wdt_dev, nowayout);
248f9fb360cSPaul Mundt 	watchdog_set_drvdata(&sh_wdt_dev, wdt);
2496551881cSPratyush Anand 	sh_wdt_dev.parent = &pdev->dev;
250f9fb360cSPaul Mundt 
251f9fb360cSPaul Mundt 	spin_lock_init(&wdt->lock);
252f9fb360cSPaul Mundt 
2531950f499SPaul Mundt 	rc = sh_wdt_set_heartbeat(&sh_wdt_dev, heartbeat);
2548f5585ecSPaul Mundt 	if (unlikely(rc)) {
2551950f499SPaul Mundt 		/* Default timeout if invalid */
2561950f499SPaul Mundt 		sh_wdt_set_heartbeat(&sh_wdt_dev, WATCHDOG_HEARTBEAT);
2571950f499SPaul Mundt 
2581950f499SPaul Mundt 		dev_warn(&pdev->dev,
2591950f499SPaul Mundt 			 "heartbeat value must be 1<=x<=3600, using %d\n",
2601950f499SPaul Mundt 			 sh_wdt_dev.timeout);
2611950f499SPaul Mundt 	}
2621950f499SPaul Mundt 
2631950f499SPaul Mundt 	dev_info(&pdev->dev, "configured with heartbeat=%d sec (nowayout=%d)\n",
2641950f499SPaul Mundt 		 sh_wdt_dev.timeout, nowayout);
2651950f499SPaul Mundt 
2661950f499SPaul Mundt 	rc = watchdog_register_device(&sh_wdt_dev);
2671950f499SPaul Mundt 	if (unlikely(rc)) {
2681950f499SPaul Mundt 		dev_err(&pdev->dev, "Can't register watchdog (err=%d)\n", rc);
2692f7b9b48SJingoo Han 		return rc;
2708f5585ecSPaul Mundt 	}
2718f5585ecSPaul Mundt 
272e99e88a9SKees Cook 	timer_setup(&wdt->timer, sh_wdt_ping, 0);
2738f5585ecSPaul Mundt 	wdt->timer.expires	= next_ping_period(clock_division_ratio);
2748f5585ecSPaul Mundt 
2758f5585ecSPaul Mundt 	dev_info(&pdev->dev, "initialized.\n");
2768f5585ecSPaul Mundt 
2778c013d96SPaul Mundt 	pm_runtime_enable(&pdev->dev);
2788c013d96SPaul Mundt 
2798f5585ecSPaul Mundt 	return 0;
2808f5585ecSPaul Mundt }
2818f5585ecSPaul Mundt 
sh_wdt_remove(struct platform_device * pdev)282*70b5b2b2SUwe Kleine-König static void sh_wdt_remove(struct platform_device *pdev)
2838f5585ecSPaul Mundt {
2841950f499SPaul Mundt 	watchdog_unregister_device(&sh_wdt_dev);
2858f5585ecSPaul Mundt 
2868c013d96SPaul Mundt 	pm_runtime_disable(&pdev->dev);
2878f5585ecSPaul Mundt }
2888f5585ecSPaul Mundt 
sh_wdt_shutdown(struct platform_device * pdev)28940968126SPaul Mundt static void sh_wdt_shutdown(struct platform_device *pdev)
29040968126SPaul Mundt {
2911950f499SPaul Mundt 	sh_wdt_stop(&sh_wdt_dev);
29240968126SPaul Mundt }
29340968126SPaul Mundt 
2948f5585ecSPaul Mundt static struct platform_driver sh_wdt_driver = {
2958f5585ecSPaul Mundt 	.driver		= {
2968f5585ecSPaul Mundt 		.name	= DRV_NAME,
2978f5585ecSPaul Mundt 	},
2988f5585ecSPaul Mundt 
2998f5585ecSPaul Mundt 	.probe		= sh_wdt_probe,
300*70b5b2b2SUwe Kleine-König 	.remove_new	= sh_wdt_remove,
30140968126SPaul Mundt 	.shutdown	= sh_wdt_shutdown,
3028f5585ecSPaul Mundt };
3038f5585ecSPaul Mundt 
sh_wdt_init(void)304b7e04f8cSWim Van Sebroeck static int __init sh_wdt_init(void)
305b7e04f8cSWim Van Sebroeck {
3068f5585ecSPaul Mundt 	if (unlikely(clock_division_ratio < 0x5 ||
3078f5585ecSPaul Mundt 		     clock_division_ratio > 0x7)) {
308b7e04f8cSWim Van Sebroeck 		clock_division_ratio = WTCSR_CKS_4096;
3098f5585ecSPaul Mundt 
31027c766aaSJoe Perches 		pr_info("divisor must be 0x5<=x<=0x7, using %d\n",
31127c766aaSJoe Perches 			clock_division_ratio);
312b7e04f8cSWim Van Sebroeck 	}
313b7e04f8cSWim Van Sebroeck 
3148f5585ecSPaul Mundt 	return platform_driver_register(&sh_wdt_driver);
315b7e04f8cSWim Van Sebroeck }
316b7e04f8cSWim Van Sebroeck 
sh_wdt_exit(void)317b7e04f8cSWim Van Sebroeck static void __exit sh_wdt_exit(void)
318b7e04f8cSWim Van Sebroeck {
3198f5585ecSPaul Mundt 	platform_driver_unregister(&sh_wdt_driver);
320b7e04f8cSWim Van Sebroeck }
3218f5585ecSPaul Mundt module_init(sh_wdt_init);
3228f5585ecSPaul Mundt module_exit(sh_wdt_exit);
323b7e04f8cSWim Van Sebroeck 
324b7e04f8cSWim Van Sebroeck MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
325b7e04f8cSWim Van Sebroeck MODULE_DESCRIPTION("SuperH watchdog driver");
326b7e04f8cSWim Van Sebroeck MODULE_LICENSE("GPL");
3278f5585ecSPaul Mundt MODULE_ALIAS("platform:" DRV_NAME);
328b7e04f8cSWim Van Sebroeck 
329b7e04f8cSWim Van Sebroeck module_param(clock_division_ratio, int, 0);
330a77dba7eSWim Van Sebroeck MODULE_PARM_DESC(clock_division_ratio,
331a77dba7eSWim Van Sebroeck 	"Clock division ratio. Valid ranges are from 0x5 (1.31ms) "
33276550d32SRandy Dunlap 	"to 0x7 (5.25ms). (default=" __MODULE_STRING(WTCSR_CKS_4096) ")");
333b7e04f8cSWim Van Sebroeck 
334b7e04f8cSWim Van Sebroeck module_param(heartbeat, int, 0);
33570b814ecSAlan Cox MODULE_PARM_DESC(heartbeat,
33670b814ecSAlan Cox 	"Watchdog heartbeat in seconds. (1 <= heartbeat <= 3600, default="
33770b814ecSAlan Cox 				__MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
338b7e04f8cSWim Van Sebroeck 
33986a1e189SWim Van Sebroeck module_param(nowayout, bool, 0);
34070b814ecSAlan Cox MODULE_PARM_DESC(nowayout,
34170b814ecSAlan Cox 	"Watchdog cannot be stopped once started (default="
34270b814ecSAlan Cox 				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
343