All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] sysreset: add support for rockchip rk3328 soc
Date: Fri, 17 Feb 2017 16:07:56 +0800	[thread overview]
Message-ID: <1487318878-23597-6-git-send-email-kever.yang@rock-chips.com> (raw)
In-Reply-To: <1487318878-23597-1-git-send-email-kever.yang@rock-chips.com>

Add rk3328 sysreset driver.

Signed-off-by: William Zhang <william.zhang@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 drivers/sysreset/Makefile          |  1 +
 drivers/sysreset/sysreset_rk3328.c | 45 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 drivers/sysreset/sysreset_rk3328.c

diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index 37638a8..12cfa79 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -10,6 +10,7 @@ ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_ROCKCHIP_RK3036) += sysreset_rk3036.o
 endif
 obj-$(CONFIG_ROCKCHIP_RK3288) += sysreset_rk3288.o
+obj-$(CONFIG_ROCKCHIP_RK3328) += sysreset_rk3328.o
 obj-$(CONFIG_ROCKCHIP_RK3399) += sysreset_rk3399.o
 obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
 obj-$(CONFIG_ARCH_SNAPDRAGON) += sysreset_snapdragon.o
diff --git a/drivers/sysreset/sysreset_rk3328.c b/drivers/sysreset/sysreset_rk3328.c
new file mode 100644
index 0000000..7b22342
--- /dev/null
+++ b/drivers/sysreset/sysreset_rk3328.c
@@ -0,0 +1,45 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:	GPL-2.0
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cru_rk3328.h>
+#include <asm/arch/hardware.h>
+#include <asm/io.h>
+#include <dm.h>
+#include <errno.h>
+#include <linux/err.h>
+#include <sysreset.h>
+
+int rk3328_sysreset_request(struct udevice *dev, enum sysreset_t type)
+{
+	struct rk3328_cru *cru = rockchip_get_cru();
+
+	if (IS_ERR(cru))
+		return PTR_ERR(cru);
+	switch (type) {
+	case SYSRESET_WARM:
+		writel(0xeca8, &cru->glb_srst_snd_value);
+		break;
+	case SYSRESET_COLD:
+		writel(0xfdb9, &cru->glb_srst_fst_value);
+		break;
+	default:
+		return -EPROTONOSUPPORT;
+	}
+
+	return -EINPROGRESS;
+}
+
+static struct sysreset_ops rk3328_sysreset = {
+	.request	= rk3328_sysreset_request,
+};
+
+U_BOOT_DRIVER(sysreset_rk3328) = {
+	.name	= "rk3328_sysreset",
+	.id	= UCLASS_SYSRESET,
+	.ops	= &rk3328_sysreset,
+};
-- 
1.9.1

  parent reply	other threads:[~2017-02-17  8:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  8:07 [U-Boot] [PATCH 0/7] add support for rk3328 SoC Kever Yang
2017-02-17  8:07 ` [U-Boot] [PATCH 1/7] arm64: dts: add support for Rockchip rk3328 soc Kever Yang
2017-02-21 18:06   ` Simon Glass
2017-02-17  8:07 ` [U-Boot] [PATCH 2/7] ARM64: rockchip: add support for rk3328 SoC Kever Yang
2017-02-21 18:06   ` Simon Glass
2017-02-17  8:07 ` [U-Boot] [PATCH 3/7] clk: rockchip: add support for rk3328 Kever Yang
2017-02-21 18:06   ` Simon Glass
2017-02-22  9:45     ` Kever Yang
2017-02-23  2:23       ` Simon Glass
2017-02-17  8:07 ` [U-Boot] [PATCH 4/7] pinctrl: " Kever Yang
2017-02-21 18:06   ` Simon Glass
2017-02-17  8:07 ` Kever Yang [this message]
2017-02-21 18:06   ` [U-Boot] [PATCH 5/7] sysreset: add support for rockchip rk3328 soc Simon Glass
2017-02-17  8:07 ` [U-Boot] [PATCH 6/7] board: rockchip: add support for rk3328 evb Kever Yang
2017-02-21 18:07   ` Simon Glass
2017-02-17  8:07 ` [U-Boot] [PATCH 7/7] config: add support for evb-rk3328 Kever Yang
2017-02-21 18:07   ` Simon Glass
2017-02-21 18:07 ` [U-Boot] [PATCH 0/7] add support for rk3328 SoC Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487318878-23597-6-git-send-email-kever.yang@rock-chips.com \
    --to=kever.yang@rock-chips.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.