]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
4697abea | 2 | /* |
3 | * (C) Copyright 2016 Google, Inc | |
4697abea | 4 | */ |
5 | ||
d678a59d | 6 | #include <common.h> |
4697abea | 7 | #include <asm/io.h> |
8 | #include <asm/arch/wdt.h> | |
9 | #include <linux/err.h> | |
10 | ||
1eb0a464 | 11 | u32 ast_reset_mode_from_flags(ulong flags) |
12 | { | |
13 | return flags & WDT_CTRL_RESET_MASK; | |
14 | } | |
15 | ||
16 | u32 ast_reset_mask_from_flags(ulong flags) | |
17 | { | |
18 | return flags >> 2; | |
19 | } | |
20 | ||
21 | ulong ast_flags_from_reset_mode_mask(u32 reset_mode, u32 reset_mask) | |
22 | { | |
23 | ulong ret = reset_mode & WDT_CTRL_RESET_MASK; | |
24 | ||
25 | if (ret == WDT_CTRL_RESET_SOC) | |
26 | ret |= (reset_mask << 2); | |
27 | ||
28 | return ret; | |
29 | } |