2 * (C) Copyright 2016 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0
13 #include <asm/arch/wdt.h>
14 #include <linux/err.h>
16 static int ast_sysreset_request(struct udevice *dev, enum sysreset_t type)
20 int ret = uclass_first_device(UCLASS_WDT, &wdt);
27 reset_mode = WDT_CTRL_RESET_CPU;
30 reset_mode = WDT_CTRL_RESET_CHIP;
33 return -EPROTONOSUPPORT;
36 ret = wdt_expire_now(wdt, reset_mode);
38 debug("Sysreset failed: %d", ret);
45 static struct sysreset_ops ast_sysreset = {
46 .request = ast_sysreset_request,
49 U_BOOT_DRIVER(sysreset_ast) = {
50 .name = "ast_sysreset",
51 .id = UCLASS_SYSRESET,