Ravi Kumar Bokka | 6fde4c5 | 2020-08-25 15:47:59 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Ravi Kumar Bokka | 6fde4c5 | 2020-08-25 15:47:59 +0530 | [diff] [blame] | 3 | #include <soc/clock.h> |
Taniya Das | 310edec | 2021-06-23 08:53:39 +0530 | [diff] [blame] | 4 | #include <soc/watchdog.h> |
Ravi Kumar Bokka | 6fde4c5 | 2020-08-25 15:47:59 +0530 | [diff] [blame] | 5 | #include <device/mmio.h> |
| 6 | #include <vendorcode/google/chromeos/chromeos.h> |
| 7 | |
Taniya Das | 310edec | 2021-06-23 08:53:39 +0530 | [diff] [blame] | 8 | #define WDOG_RESET_BIT_MASK 1 |
| 9 | |
Ravi Kumar Bokka | 6fde4c5 | 2020-08-25 15:47:59 +0530 | [diff] [blame] | 10 | void check_wdog(void) |
| 11 | { |
| 12 | uint32_t wdog_sta = read32(&aoss->aoss_cc_reset_status); |
| 13 | |
| 14 | if (wdog_sta & WDOG_RESET_BIT_MASK) |
| 15 | mark_watchdog_tombstone(); |
| 16 | } |