diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/arch/arm/mach-aspeed/ast_wdt.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/arch/arm/mach-aspeed/ast_wdt.c')
-rw-r--r-- | roms/u-boot/arch/arm/mach-aspeed/ast_wdt.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/roms/u-boot/arch/arm/mach-aspeed/ast_wdt.c b/roms/u-boot/arch/arm/mach-aspeed/ast_wdt.c new file mode 100644 index 000000000..5bc442ef3 --- /dev/null +++ b/roms/u-boot/arch/arm/mach-aspeed/ast_wdt.c @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2016 Google, Inc + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/wdt.h> +#include <linux/err.h> + +u32 ast_reset_mode_from_flags(ulong flags) +{ + return flags & WDT_CTRL_RESET_MASK; +} + +u32 ast_reset_mask_from_flags(ulong flags) +{ + return flags >> 2; +} + +ulong ast_flags_from_reset_mode_mask(u32 reset_mode, u32 reset_mask) +{ + ulong ret = reset_mode & WDT_CTRL_RESET_MASK; + + if (ret == WDT_CTRL_RESET_SOC) + ret |= (reset_mask << 2); + + return ret; +} |