From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] ARM/MXS: add new way to reset the whole SoC
Date: Thu, 21 Jun 2012 11:12:21 +0200 [thread overview]
Message-ID: <1340269942-25253-2-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1340269942-25253-1-git-send-email-jbe@pengutronix.de>
Currently the watchdog is occupied for system reset. This usage collides with
the dedicated usage of a watchdog. This patch change the behaviour of at least
i.MX23/i.MX28 where the chipset supports a simple and powerful alternative
to reset the whole SoC (including the PMIC).
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
arch/arm/mach-mxs/soc-imx23.c | 37 +++++++++++++++++++++++++++++++++++++
arch/arm/mach-mxs/soc-imx28.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100644 arch/arm/mach-mxs/soc-imx23.c
create mode 100644 arch/arm/mach-mxs/soc-imx28.c
diff --git a/arch/arm/mach-mxs/soc-imx23.c b/arch/arm/mach-mxs/soc-imx23.c
new file mode 100644
index 0000000..6819b3c
--- /dev/null
+++ b/arch/arm/mach-mxs/soc-imx23.c
@@ -0,0 +1,37 @@
+/*
+ * (c) 2012 Juergen Beisert <kernel@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Collection of some SoC specific functions
+ */
+
+#include <common.h>
+#include <init.h>
+#include <mach/imx-regs.h>
+#include <io.h>
+
+#define HW_CLKCTRL_RESET 0x120
+# define HW_CLKCTRL_RESET_CHIP (1 << 1)
+
+/* Reset the full i.MX23 SoC via a chipset feature */
+void __noreturn reset_cpu(unsigned long addr)
+{
+ u32 reg;
+
+ reg = readl(IMX_CCM_BASE + HW_CLKCTRL_RESET);
+ writel(reg | HW_CLKCTRL_RESET_CHIP, IMX_CCM_BASE + HW_CLKCTRL_RESET);
+
+ while (1)
+ ;
+ /*NOTREACHED*/
+}
+EXPORT_SYMBOL(reset_cpu);
diff --git a/arch/arm/mach-mxs/soc-imx28.c b/arch/arm/mach-mxs/soc-imx28.c
new file mode 100644
index 0000000..a181b75
--- /dev/null
+++ b/arch/arm/mach-mxs/soc-imx28.c
@@ -0,0 +1,37 @@
+/*
+ * (c) 2012 Juergen Beisert <kernel@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Collection of some SoC specific functions
+ */
+
+#include <common.h>
+#include <init.h>
+#include <mach/imx-regs.h>
+#include <io.h>
+
+#define HW_CLKCTRL_RESET 0x1e0
+# define HW_CLKCTRL_RESET_CHIP (1 << 1)
+
+/* Reset the full i.MX28 SoC via a chipset feature */
+void __noreturn reset_cpu(unsigned long addr)
+{
+ u32 reg;
+
+ reg = readl(IMX_CCM_BASE + HW_CLKCTRL_RESET);
+ writel(reg | HW_CLKCTRL_RESET_CHIP, IMX_CCM_BASE + HW_CLKCTRL_RESET);
+
+ while (1)
+ ;
+ /*NOTREACHED*/
+}
+EXPORT_SYMBOL(reset_cpu);
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-06-21 9:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-21 9:12 [PATCHv2] ARM/MXS: free the watchdog from acting as a system reset source on demand Juergen Beisert
2012-06-21 9:12 ` Juergen Beisert [this message]
2012-06-21 9:12 ` [PATCH 2/2] ARM/MXS: remove the now obsolete mxs reset routine Juergen Beisert
2012-06-21 17:30 ` [PATCHv2] ARM/MXS: free the watchdog from acting as a system reset source on demand Sascha Hauer
-- strict thread matches above, loose matches on Subject: below --
2012-06-20 13:49 [PATCH] " Juergen Beisert
2012-06-20 13:49 ` [PATCH 1/2] ARM/MXS: add new way to reset the whole SoC Juergen Beisert
2012-06-20 18:46 ` Uwe Kleine-König
2012-06-20 19:04 ` Juergen Beisert
2012-06-20 20:05 ` Uwe Kleine-König
2012-06-21 8:33 ` Juergen Beisert
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=1340269942-25253-2-git-send-email-jbe@pengutronix.de \
--to=jbe@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox