1 // SPDX-License-Identifier: GPL-2.0
3 * (C) Copyright 2016 Google, Inc
13 #include <asm/arch/wdt.h>
14 #include <linux/err.h>
17 static int ast_sysreset_request(struct udevice *dev, enum sysreset_t type)
21 int ret = uclass_first_device(UCLASS_WDT, &wdt);
28 reset_mode = WDT_CTRL_RESET_CPU;
31 reset_mode = WDT_CTRL_RESET_CHIP;
34 return -EPROTONOSUPPORT;
37 #if !defined(CONFIG_SPL_BUILD)
38 ret = wdt_expire_now(wdt, reset_mode);
40 debug("Sysreset failed: %d", ret);
50 static struct sysreset_ops ast_sysreset = {
51 .request = ast_sysreset_request,
54 U_BOOT_DRIVER(sysreset_ast) = {
55 .name = "ast_sysreset",
56 .id = UCLASS_SYSRESET,