Files
SDK_SG200x_V2/u-boot-2021.10/drivers/sysreset/sysreset_xtfpga.c
carbon 0545e9dc6d init version 2024-05-07
commit d1edce71135cc6d98c0a4b5729774542b676e769
Author: sophgo-forum-service <forum_service@sophgo.com>
Date:   Fri Mar 15 16:07:33 2024 +0800

    [fix] recommend using ssh method to clone repo.
    [fix] fix sensor driver repo branch name.
2024-05-07 19:36:36 +08:00

37 lines
720 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* 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:
writel(CONFIG_SYS_FPGAREG_RESET_CODE,
CONFIG_SYS_FPGAREG_RESET);
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,
};