diff options
author | Milton Miller <miltonm@us.ibm.com> | 2018-03-09 16:58:19 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2018-03-13 14:14:17 -0400 |
commit | d2fc8db691bf3197d43b2afb553311a9bf257bff (patch) | |
tree | 9daf53c3e3a8ac4992991efca232c53cda300d00 | |
parent | 977f6f68331f94bb72ad84ee96b7b87ce737d89d (diff) |
watchdog: aspeed: Fix translation of reset mode to ctrl register
Assert RESET_SYSTEM bit for any reset and set MODE field from reset
type.
The watchdog control register has a RESET_SYSTEM bit that is really
closer to activate a reset, and RESET_SYSTEM_MODE field that chooses
how much to reset.
Before this patch, a node without these optional property would do a
SOC reset, but a node with properties requesting a cpu or SOC reset
would do nothing and a node requesting a system reset would do a
SOC reset.
Fixes: b7f0b8ad25f3 ("drivers/watchdog: ASPEED reference dev tree properties for config")
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | drivers/watchdog/aspeed_wdt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c index ca5b91e2eb92..d1987d63b37c 100644 --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c | |||
@@ -232,11 +232,14 @@ static int aspeed_wdt_probe(struct platform_device *pdev) | |||
232 | wdt->ctrl |= WDT_CTRL_RESET_MODE_SOC | WDT_CTRL_RESET_SYSTEM; | 232 | wdt->ctrl |= WDT_CTRL_RESET_MODE_SOC | WDT_CTRL_RESET_SYSTEM; |
233 | } else { | 233 | } else { |
234 | if (!strcmp(reset_type, "cpu")) | 234 | if (!strcmp(reset_type, "cpu")) |
235 | wdt->ctrl |= WDT_CTRL_RESET_MODE_ARM_CPU; | 235 | wdt->ctrl |= WDT_CTRL_RESET_MODE_ARM_CPU | |
236 | WDT_CTRL_RESET_SYSTEM; | ||
236 | else if (!strcmp(reset_type, "soc")) | 237 | else if (!strcmp(reset_type, "soc")) |
237 | wdt->ctrl |= WDT_CTRL_RESET_MODE_SOC; | 238 | wdt->ctrl |= WDT_CTRL_RESET_MODE_SOC | |
239 | WDT_CTRL_RESET_SYSTEM; | ||
238 | else if (!strcmp(reset_type, "system")) | 240 | else if (!strcmp(reset_type, "system")) |
239 | wdt->ctrl |= WDT_CTRL_RESET_SYSTEM; | 241 | wdt->ctrl |= WDT_CTRL_RESET_MODE_FULL_CHIP | |
242 | WDT_CTRL_RESET_SYSTEM; | ||
240 | else if (strcmp(reset_type, "none")) | 243 | else if (strcmp(reset_type, "none")) |
241 | return -EINVAL; | 244 | return -EINVAL; |
242 | } | 245 | } |