upstream u-boot with additional patches for our devices/boards: https://lists.denx.de/pipermail/u-boot/2017-March/282789.html (AXP crashes) ; Gbit ethernet patch for some LIME2 revisions ; with SPI flash support
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
u-boot/drivers/sysreset/sysreset_ast.c

52 lines
944 B

// SPDX-License-Identifier: GPL-2.0
/*
* (C) Copyright 2016 Google, Inc
*/
#include <common.h>
#include <dm.h>
#include <errno.h>
#include <sysreset.h>
#include <wdt.h>
#include <asm/io.h>
#include <asm/arch/wdt.h>
#include <linux/err.h>
static int ast_sysreset_request(struct udevice *dev, enum sysreset_t type)
{
struct udevice *wdt;
u32 reset_mode;
int ret = uclass_first_device(UCLASS_WDT, &wdt);
if (ret)
return ret;
switch (type) {
case SYSRESET_WARM:
reset_mode = WDT_CTRL_RESET_CPU;
break;
case SYSRESET_COLD:
reset_mode = WDT_CTRL_RESET_CHIP;
break;
default:
return -EPROTONOSUPPORT;
}
ret = wdt_expire_now(wdt, reset_mode);
if (ret) {
debug("Sysreset failed: %d", ret);
return ret;
}
return -EINPROGRESS;
}
static struct sysreset_ops ast_sysreset = {
.request = ast_sysreset_request,
};
U_BOOT_DRIVER(sysreset_ast) = {
.name = "ast_sysreset",
.id = UCLASS_SYSRESET,
.ops = &ast_sysreset,
};