Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 1 | /* |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 2 | * drivers/watchdog/orion_wdt.c |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 3 | * |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 4 | * Watchdog driver for Orion/Kirkwood processors |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 5 | * |
| 6 | * Author: Sylver Bruneau <sylver.bruneau@googlemail.com> |
| 7 | * |
| 8 | * This file is licensed under the terms of the GNU General Public |
| 9 | * License version 2. This program is licensed "as is" without any |
| 10 | * warranty of any kind, whether express or implied. |
| 11 | */ |
| 12 | |
Joe Perches | 27c766a | 2012-02-15 15:06:19 -0800 | [diff] [blame] | 13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 14 | |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 15 | #include <linux/module.h> |
| 16 | #include <linux/moduleparam.h> |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/kernel.h> |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 19 | #include <linux/platform_device.h> |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 20 | #include <linux/watchdog.h> |
| 21 | #include <linux/init.h> |
Ezequiel Garcia | e97662e | 2014-02-10 20:00:24 -0300 | [diff] [blame] | 22 | #include <linux/interrupt.h> |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 23 | #include <linux/io.h> |
Andrew Lunn | 4f04be6 | 2012-03-04 16:57:31 +0100 | [diff] [blame] | 24 | #include <linux/clk.h> |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 25 | #include <linux/err.h> |
Andrew Lunn | 1e7bad0 | 2012-06-10 15:20:06 +0200 | [diff] [blame] | 26 | #include <linux/of.h> |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 27 | |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 28 | /* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */ |
| 29 | #define ORION_RSTOUT_MASK_OFFSET 0x20108 |
| 30 | |
| 31 | /* Internal registers can be configured at any 1 MiB aligned address */ |
| 32 | #define INTERNAL_REGS_MASK ~(SZ_1M - 1) |
| 33 | |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 34 | /* |
| 35 | * Watchdog timer block registers. |
| 36 | */ |
Jason Cooper | a855a7c | 2012-03-15 00:33:26 +0000 | [diff] [blame] | 37 | #define TIMER_CTRL 0x0000 |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 38 | #define WDT_EN 0x0010 |
Jason Cooper | a855a7c | 2012-03-15 00:33:26 +0000 | [diff] [blame] | 39 | #define WDT_VAL 0x0024 |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 40 | |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 41 | #define WDT_MAX_CYCLE_COUNT 0xffffffff |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 42 | |
Russell King | fa142ff | 2013-06-18 17:19:32 +0100 | [diff] [blame] | 43 | #define WDT_RESET_OUT_EN BIT(1) |
Russell King | fa142ff | 2013-06-18 17:19:32 +0100 | [diff] [blame] | 44 | |
Wim Van Sebroeck | 86a1e18 | 2012-03-05 16:51:11 +0100 | [diff] [blame] | 45 | static bool nowayout = WATCHDOG_NOWAYOUT; |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 46 | static int heartbeat = -1; /* module parameter (seconds) */ |
| 47 | static unsigned int wdt_max_duration; /* (seconds) */ |
Andrew Lunn | 4f04be6 | 2012-03-04 16:57:31 +0100 | [diff] [blame] | 48 | static struct clk *clk; |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 49 | static unsigned int wdt_tclk; |
Jason Cooper | a855a7c | 2012-03-15 00:33:26 +0000 | [diff] [blame] | 50 | static void __iomem *wdt_reg; |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 51 | static void __iomem *wdt_rstout; |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 52 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 53 | static int orion_wdt_ping(struct watchdog_device *wdt_dev) |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 54 | { |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 55 | /* Reload watchdog duration */ |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 56 | writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL); |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 57 | return 0; |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 58 | } |
| 59 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 60 | static int orion_wdt_start(struct watchdog_device *wdt_dev) |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 61 | { |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 62 | /* Set watchdog duration */ |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 63 | writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 64 | |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 65 | /* Enable watchdog timer */ |
Ezequiel Garcia | fc8cd2a | 2014-02-10 20:00:21 -0300 | [diff] [blame] | 66 | atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 67 | |
| 68 | /* Enable reset on watchdog */ |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 69 | atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN); |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 70 | return 0; |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 71 | } |
| 72 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 73 | static int orion_wdt_stop(struct watchdog_device *wdt_dev) |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 74 | { |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 75 | /* Disable reset on watchdog */ |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 76 | atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, 0); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 77 | |
| 78 | /* Disable watchdog timer */ |
Ezequiel Garcia | fc8cd2a | 2014-02-10 20:00:21 -0300 | [diff] [blame] | 79 | atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0); |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 80 | return 0; |
Wim Van Sebroeck | 6d0f0df | 2008-10-02 09:32:45 +0000 | [diff] [blame] | 81 | } |
| 82 | |
Ezequiel Garcia | d9d0c53 | 2014-02-10 20:00:23 -0300 | [diff] [blame] | 83 | static int orion_wdt_enabled(void) |
| 84 | { |
| 85 | bool enabled, running; |
| 86 | |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 87 | enabled = readl(wdt_rstout) & WDT_RESET_OUT_EN; |
Ezequiel Garcia | d9d0c53 | 2014-02-10 20:00:23 -0300 | [diff] [blame] | 88 | running = readl(wdt_reg + TIMER_CTRL) & WDT_EN; |
| 89 | |
| 90 | return enabled && running; |
| 91 | } |
| 92 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 93 | static unsigned int orion_wdt_get_timeleft(struct watchdog_device *wdt_dev) |
Wim Van Sebroeck | 6d0f0df | 2008-10-02 09:32:45 +0000 | [diff] [blame] | 94 | { |
Ezequiel Garcia | fc8cd2a | 2014-02-10 20:00:21 -0300 | [diff] [blame] | 95 | return readl(wdt_reg + WDT_VAL) / wdt_tclk; |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | static int orion_wdt_set_timeout(struct watchdog_device *wdt_dev, |
| 99 | unsigned int timeout) |
| 100 | { |
| 101 | wdt_dev->timeout = timeout; |
Wim Van Sebroeck | 6d0f0df | 2008-10-02 09:32:45 +0000 | [diff] [blame] | 102 | return 0; |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 103 | } |
| 104 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 105 | static const struct watchdog_info orion_wdt_info = { |
| 106 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, |
| 107 | .identity = "Orion Watchdog", |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 108 | }; |
| 109 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 110 | static const struct watchdog_ops orion_wdt_ops = { |
| 111 | .owner = THIS_MODULE, |
| 112 | .start = orion_wdt_start, |
| 113 | .stop = orion_wdt_stop, |
| 114 | .ping = orion_wdt_ping, |
| 115 | .set_timeout = orion_wdt_set_timeout, |
| 116 | .get_timeleft = orion_wdt_get_timeleft, |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 117 | }; |
| 118 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 119 | static struct watchdog_device orion_wdt = { |
| 120 | .info = &orion_wdt_info, |
| 121 | .ops = &orion_wdt_ops, |
Fabio Porcedda | c1fd5f6 | 2013-02-14 09:14:25 +0100 | [diff] [blame] | 122 | .min_timeout = 1, |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 123 | }; |
| 124 | |
Ezequiel Garcia | e97662e | 2014-02-10 20:00:24 -0300 | [diff] [blame] | 125 | static irqreturn_t orion_wdt_irq(int irq, void *devid) |
| 126 | { |
| 127 | panic("Watchdog Timeout"); |
| 128 | return IRQ_HANDLED; |
| 129 | } |
| 130 | |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 131 | /* |
| 132 | * The original devicetree binding for this driver specified only |
| 133 | * one memory resource, so in order to keep DT backwards compatibility |
| 134 | * we try to fallback to a hardcoded register address, if the resource |
| 135 | * is missing from the devicetree. |
| 136 | */ |
| 137 | static void __iomem *orion_wdt_ioremap_rstout(struct platform_device *pdev, |
| 138 | phys_addr_t internal_regs) |
| 139 | { |
| 140 | struct resource *res; |
| 141 | phys_addr_t rstout; |
| 142 | |
| 143 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 144 | if (res) |
| 145 | return devm_ioremap(&pdev->dev, res->start, |
| 146 | resource_size(res)); |
| 147 | |
| 148 | /* This workaround works only for "orion-wdt", DT-enabled */ |
| 149 | if (!of_device_is_compatible(pdev->dev.of_node, "marvell,orion-wdt")) |
| 150 | return NULL; |
| 151 | |
| 152 | rstout = internal_regs + ORION_RSTOUT_MASK_OFFSET; |
| 153 | |
| 154 | WARN(1, FW_BUG "falling back to harcoded RSTOUT reg 0x%x\n", rstout); |
| 155 | return devm_ioremap(&pdev->dev, rstout, 0x4); |
| 156 | } |
| 157 | |
Bill Pemberton | 2d991a1 | 2012-11-19 13:21:41 -0500 | [diff] [blame] | 158 | static int orion_wdt_probe(struct platform_device *pdev) |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 159 | { |
Jason Cooper | a855a7c | 2012-03-15 00:33:26 +0000 | [diff] [blame] | 160 | struct resource *res; |
Ezequiel Garcia | e97662e | 2014-02-10 20:00:24 -0300 | [diff] [blame] | 161 | int ret, irq; |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 162 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 163 | clk = devm_clk_get(&pdev->dev, NULL); |
Andrew Lunn | 4f04be6 | 2012-03-04 16:57:31 +0100 | [diff] [blame] | 164 | if (IS_ERR(clk)) { |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 165 | dev_err(&pdev->dev, "Orion Watchdog missing clock\n"); |
Ezequiel Garcia | bb02c66 | 2014-02-10 20:00:20 -0300 | [diff] [blame] | 166 | return PTR_ERR(clk); |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 167 | } |
Ezequiel Garcia | bb02c66 | 2014-02-10 20:00:20 -0300 | [diff] [blame] | 168 | ret = clk_prepare_enable(clk); |
| 169 | if (ret) |
| 170 | return ret; |
Andrew Lunn | 4f04be6 | 2012-03-04 16:57:31 +0100 | [diff] [blame] | 171 | wdt_tclk = clk_get_rate(clk); |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 172 | |
Jason Cooper | a855a7c | 2012-03-15 00:33:26 +0000 | [diff] [blame] | 173 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
Ezequiel Garcia | bb02c66 | 2014-02-10 20:00:20 -0300 | [diff] [blame] | 174 | if (!res) { |
| 175 | ret = -ENODEV; |
| 176 | goto disable_clk; |
| 177 | } |
| 178 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 179 | wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); |
Ezequiel Garcia | bb02c66 | 2014-02-10 20:00:20 -0300 | [diff] [blame] | 180 | if (!wdt_reg) { |
| 181 | ret = -ENOMEM; |
| 182 | goto disable_clk; |
| 183 | } |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 184 | |
Ezequiel Garcia | 868eb61 | 2014-02-10 20:00:25 -0300 | [diff] [blame] | 185 | wdt_rstout = orion_wdt_ioremap_rstout(pdev, res->start & |
| 186 | INTERNAL_REGS_MASK); |
| 187 | if (!wdt_rstout) { |
| 188 | ret = -ENODEV; |
| 189 | goto disable_clk; |
| 190 | } |
| 191 | |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 192 | wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk; |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 193 | |
Fabio Porcedda | c1fd5f6 | 2013-02-14 09:14:25 +0100 | [diff] [blame] | 194 | orion_wdt.timeout = wdt_max_duration; |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 195 | orion_wdt.max_timeout = wdt_max_duration; |
Fabio Porcedda | c1fd5f6 | 2013-02-14 09:14:25 +0100 | [diff] [blame] | 196 | watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev); |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 197 | |
Ezequiel Garcia | d9d0c53 | 2014-02-10 20:00:23 -0300 | [diff] [blame] | 198 | /* |
| 199 | * Let's make sure the watchdog is fully stopped, unless it's |
| 200 | * explicitly enabled. This may be the case if the module was |
| 201 | * removed and re-insterted, or if the bootloader explicitly |
| 202 | * set a running watchdog before booting the kernel. |
| 203 | */ |
| 204 | if (!orion_wdt_enabled()) |
| 205 | orion_wdt_stop(&orion_wdt); |
| 206 | |
Ezequiel Garcia | e97662e | 2014-02-10 20:00:24 -0300 | [diff] [blame] | 207 | /* Request the IRQ only after the watchdog is disabled */ |
| 208 | irq = platform_get_irq(pdev, 0); |
| 209 | if (irq > 0) { |
| 210 | /* |
| 211 | * Not all supported platforms specify an interrupt for the |
| 212 | * watchdog, so let's make it optional. |
| 213 | */ |
| 214 | ret = devm_request_irq(&pdev->dev, irq, orion_wdt_irq, 0, |
| 215 | pdev->name, &orion_wdt); |
| 216 | if (ret < 0) { |
| 217 | dev_err(&pdev->dev, "failed to request IRQ\n"); |
| 218 | goto disable_clk; |
| 219 | } |
| 220 | } |
| 221 | |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 222 | watchdog_set_nowayout(&orion_wdt, nowayout); |
| 223 | ret = watchdog_register_device(&orion_wdt); |
Ezequiel Garcia | bb02c66 | 2014-02-10 20:00:20 -0300 | [diff] [blame] | 224 | if (ret) |
| 225 | goto disable_clk; |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 226 | |
Joe Perches | 27c766a | 2012-02-15 15:06:19 -0800 | [diff] [blame] | 227 | pr_info("Initial timeout %d sec%s\n", |
Fabio Porcedda | c1fd5f6 | 2013-02-14 09:14:25 +0100 | [diff] [blame] | 228 | orion_wdt.timeout, nowayout ? ", nowayout" : ""); |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 229 | return 0; |
Ezequiel Garcia | bb02c66 | 2014-02-10 20:00:20 -0300 | [diff] [blame] | 230 | |
| 231 | disable_clk: |
| 232 | clk_disable_unprepare(clk); |
| 233 | return ret; |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 234 | } |
| 235 | |
Bill Pemberton | 4b12b89 | 2012-11-19 13:26:24 -0500 | [diff] [blame] | 236 | static int orion_wdt_remove(struct platform_device *pdev) |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 237 | { |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 238 | watchdog_unregister_device(&orion_wdt); |
Andrew Lunn | 4f04be6 | 2012-03-04 16:57:31 +0100 | [diff] [blame] | 239 | clk_disable_unprepare(clk); |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 240 | return 0; |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 241 | } |
| 242 | |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 243 | static void orion_wdt_shutdown(struct platform_device *pdev) |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 244 | { |
Axel Lin | 0dd6e48 | 2012-03-26 11:14:29 +0800 | [diff] [blame] | 245 | orion_wdt_stop(&orion_wdt); |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 246 | } |
| 247 | |
Bill Pemberton | 1d13136 | 2012-11-19 13:24:05 -0500 | [diff] [blame] | 248 | static const struct of_device_id orion_wdt_of_match_table[] = { |
Andrew Lunn | 1e7bad0 | 2012-06-10 15:20:06 +0200 | [diff] [blame] | 249 | { .compatible = "marvell,orion-wdt", }, |
| 250 | {}, |
| 251 | }; |
| 252 | MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table); |
| 253 | |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 254 | static struct platform_driver orion_wdt_driver = { |
| 255 | .probe = orion_wdt_probe, |
Bill Pemberton | 8226871 | 2012-11-19 13:21:12 -0500 | [diff] [blame] | 256 | .remove = orion_wdt_remove, |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 257 | .shutdown = orion_wdt_shutdown, |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 258 | .driver = { |
| 259 | .owner = THIS_MODULE, |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 260 | .name = "orion_wdt", |
Sachin Kamat | 85eee81 | 2013-09-30 10:12:51 +0530 | [diff] [blame] | 261 | .of_match_table = orion_wdt_of_match_table, |
Thomas Reitmayr | 9e058d4 | 2009-02-24 14:59:22 -0800 | [diff] [blame] | 262 | }, |
| 263 | }; |
| 264 | |
Axel Lin | b8ec611 | 2011-11-29 13:56:27 +0800 | [diff] [blame] | 265 | module_platform_driver(orion_wdt_driver); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 266 | |
| 267 | MODULE_AUTHOR("Sylver Bruneau <sylver.bruneau@googlemail.com>"); |
Nicolas Pitre | 3b937a7db | 2009-06-01 13:56:02 -0400 | [diff] [blame] | 268 | MODULE_DESCRIPTION("Orion Processor Watchdog"); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 269 | |
| 270 | module_param(heartbeat, int, 0); |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 271 | MODULE_PARM_DESC(heartbeat, "Initial watchdog heartbeat in seconds"); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 272 | |
Wim Van Sebroeck | 86a1e18 | 2012-03-05 16:51:11 +0100 | [diff] [blame] | 273 | module_param(nowayout, bool, 0); |
Thomas Reitmayr | df6707b | 2009-02-20 19:44:59 +0100 | [diff] [blame] | 274 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" |
| 275 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
Sylver Bruneau | 22ac923 | 2008-06-26 10:47:45 +0200 | [diff] [blame] | 276 | |
| 277 | MODULE_LICENSE("GPL"); |
Lubomir Rintel | f3ea733 | 2013-01-04 15:06:28 +0100 | [diff] [blame] | 278 | MODULE_ALIAS("platform:orion_wdt"); |