2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2016-08-10 15:36:48 +00:00
|
|
|
/*
|
|
|
|
* Cadence Tensilica xtfpga system reset driver.
|
|
|
|
*
|
|
|
|
* (C) Copyright 2016 Cadence Design Systems Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <dm.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <sysreset.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
|
|
|
|
static int xtfpga_reset_request(struct udevice *dev, enum sysreset_t type)
|
|
|
|
{
|
|
|
|
switch (type) {
|
|
|
|
case SYSRESET_COLD:
|
2022-11-16 18:10:41 +00:00
|
|
|
writel(CFG_SYS_FPGAREG_RESET_CODE,
|
|
|
|
CFG_SYS_FPGAREG_RESET);
|
2016-08-10 15:36:48 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -EPROTONOSUPPORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -EINPROGRESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct sysreset_ops xtfpga_sysreset_ops = {
|
|
|
|
.request = xtfpga_reset_request,
|
|
|
|
};
|
|
|
|
|
|
|
|
U_BOOT_DRIVER(xtfpga_sysreset) = {
|
|
|
|
.name = "xtfpga_sysreset",
|
|
|
|
.id = UCLASS_SYSRESET,
|
|
|
|
.ops = &xtfpga_sysreset_ops,
|
|
|
|
};
|