Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

aspeed: watchdog: Set bootstatus during probe

Check the aspeed timeout status register to see if the system has booted
from the secondary boot source. If so, set the watchdog device
bootstatus flag for "Card previously reset the CPU."

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>

authored by

Eddie James and committed by
Wim Van Sebroeck
49d4d277 fdac6a90

+7
+7
drivers/watchdog/aspeed_wdt.c
··· 55 55 #define WDT_CTRL_WDT_INTR BIT(2) 56 56 #define WDT_CTRL_RESET_SYSTEM BIT(1) 57 57 #define WDT_CTRL_ENABLE BIT(0) 58 + #define WDT_TIMEOUT_STATUS 0x10 59 + #define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1) 58 60 59 61 /* 60 62 * WDT_RESET_WIDTH controls the characteristics of the external pulse (if ··· 194 192 struct device_node *np; 195 193 const char *reset_type; 196 194 u32 duration; 195 + u32 status; 197 196 int ret; 198 197 199 198 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); ··· 309 306 */ 310 307 writel(duration - 1, wdt->base + WDT_RESET_WIDTH); 311 308 } 309 + 310 + status = readl(wdt->base + WDT_TIMEOUT_STATUS); 311 + if (status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY) 312 + wdt->wdd.bootstatus = WDIOF_CARDRESET; 312 313 313 314 ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd); 314 315 if (ret) {