1 // SPDX-License-Identifier: GPL-2.0
3 * (C) Copyright 2016 Google, Inc
12 #include <asm/arch/wdt.h>
13 #include <linux/err.h>
15 static int ast_sysreset_request(struct udevice *dev, enum sysreset_t type)
19 int ret = uclass_first_device(UCLASS_WDT, &wdt);
26 reset_mode = WDT_CTRL_RESET_CPU;
29 reset_mode = WDT_CTRL_RESET_CHIP;
32 return -EPROTONOSUPPORT;
35 ret = wdt_expire_now(wdt, reset_mode);
37 debug("Sysreset failed: %d", ret);
44 static struct sysreset_ops ast_sysreset = {
45 .request = ast_sysreset_request,
48 U_BOOT_DRIVER(sysreset_ast) = {
49 .name = "ast_sysreset",
50 .id = UCLASS_SYSRESET,