1 // SPDX-License-Identifier: GPL-2.0
3 * (C) Copyright 2017 Rockchip Electronics Co., Ltd
11 #include <asm/arch/clock.h>
12 #include <asm/arch/cru_rk3328.h>
13 #include <asm/arch/hardware.h>
14 #include <linux/err.h>
16 int rockchip_sysreset_request(struct udevice *dev, enum sysreset_t type)
18 struct sysreset_reg *offset = dev_get_priv(dev);
19 unsigned long cru_base = (unsigned long)rockchip_get_cru();
21 if (IS_ERR_VALUE(cru_base))
26 writel(0xeca8, cru_base + offset->glb_srst_snd_value);
29 writel(0xfdb9, cru_base + offset->glb_srst_fst_value);
32 return -EPROTONOSUPPORT;
38 static struct sysreset_ops rockchip_sysreset = {
39 .request = rockchip_sysreset_request,
42 U_BOOT_DRIVER(sysreset_rockchip) = {
43 .name = "rockchip_sysreset",
44 .id = UCLASS_SYSRESET,
45 .ops = &rockchip_sysreset,