blob: ab71ea11a0b20e78d6f0068c35892946cb8b7fd9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Chris Zankel05d0c5d2016-08-10 18:36:48 +03002/*
3 * Cadence Tensilica xtfpga system reset driver.
4 *
5 * (C) Copyright 2016 Cadence Design Systems Inc.
Chris Zankel05d0c5d2016-08-10 18:36:48 +03006 */
7
Tom Rinidec7ea02024-05-20 13:35:03 -06008#include <config.h>
Chris Zankel05d0c5d2016-08-10 18:36:48 +03009#include <dm.h>
10#include <errno.h>
11#include <sysreset.h>
12#include <asm/io.h>
13
14static int xtfpga_reset_request(struct udevice *dev, enum sysreset_t type)
15{
16 switch (type) {
17 case SYSRESET_COLD:
Tom Rini6a5dccc2022-11-16 13:10:41 -050018 writel(CFG_SYS_FPGAREG_RESET_CODE,
19 CFG_SYS_FPGAREG_RESET);
Chris Zankel05d0c5d2016-08-10 18:36:48 +030020 break;
21 default:
22 return -EPROTONOSUPPORT;
23 }
24
25 return -EINPROGRESS;
26}
27
28static struct sysreset_ops xtfpga_sysreset_ops = {
29 .request = xtfpga_reset_request,
30};
31
32U_BOOT_DRIVER(xtfpga_sysreset) = {
33 .name = "xtfpga_sysreset",
34 .id = UCLASS_SYSRESET,
35 .ops = &xtfpga_sysreset_ops,
36};