mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] reset_source: make enum and string human readable
@ 2012-10-13  7:51 Jean-Christophe PLAGNIOL-VILLARD
  2012-10-13  7:51 ` [PATCH 2/4] reset_source: add software reset as possible source Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-13  7:51 UTC (permalink / raw)
  To: barebox

Today we need to read the code to understand it

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/mach-imx/reset_source.c     |    6 +++---
 arch/arm/mach-samsung/reset_source.c |    6 +++---
 common/reset_source.c                |   14 +++++++-------
 drivers/watchdog/im28wd.c            |    6 +++---
 include/reset_source.h               |   10 +++++-----
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-imx/reset_source.c b/arch/arm/mach-imx/reset_source.c
index e7b2a90..e97bf15 100644
--- a/arch/arm/mach-imx/reset_source.c
+++ b/arch/arm/mach-imx/reset_source.c
@@ -51,17 +51,17 @@ static int imx_detect_reset_source(void)
 	unsigned reg = read_detection_register();
 
 	if (reg & IMX_RESET_SRC_COLDSTART) {
-		set_reset_source(RESET_POR);
+		set_reset_source(RESET_POWER);
 		return 0;
 	}
 
 	if (reg & (IMX_RESET_SRC_HRDRESET | IMX_RESET_SRC_WARMSTART)) {
-		set_reset_source(RESET_RST);
+		set_reset_source(RESET_RESET);
 		return 0;
 	}
 
 	if (reg & IMX_RESET_SRC_WDOG) {
-		set_reset_source(RESET_WDG);
+		set_reset_source(RESET_WATCHDOG);
 		return 0;
 	}
 
diff --git a/arch/arm/mach-samsung/reset_source.c b/arch/arm/mach-samsung/reset_source.c
index 2456e3f..e2b8808 100644
--- a/arch/arm/mach-samsung/reset_source.c
+++ b/arch/arm/mach-samsung/reset_source.c
@@ -29,21 +29,21 @@ static int s3c_detect_reset_source(void)
 	u32 reg = readl(S3C_GPIO_BASE + S3C2440_GSTATUS2);
 
 	if (reg & S3C2440_GSTATUS2_PWRST) {
-		set_reset_source(RESET_POR);
+		set_reset_source(RESET_POWER);
 		writel(S3C2440_GSTATUS2_PWRST,
 					S3C_GPIO_BASE + S3C2440_GSTATUS2);
 		return 0;
 	}
 
 	if (reg & S3C2440_GSTATUS2_SLEEPRST) {
-		set_reset_source(RESET_WKE);
+		set_reset_source(RESET_WAKEUP);
 		writel(S3C2440_GSTATUS2_SLEEPRST,
 					S3C_GPIO_BASE + S3C2440_GSTATUS2);
 		return 0;
 	}
 
 	if (reg & S3C2440_GSTATUS2_WDRST) {
-		set_reset_source(RESET_WDG);
+		set_reset_source(RESET_WATCHDOG);
 		writel(S3C2440_GSTATUS2_WDRST,
 					S3C_GPIO_BASE + S3C2440_GSTATUS2);
 		return 0;
diff --git a/common/reset_source.c b/common/reset_source.c
index 2a7f9ff..ff76857 100644
--- a/common/reset_source.c
+++ b/common/reset_source.c
@@ -19,12 +19,12 @@
 #include <reset_source.h>
 
 static const char * const reset_src_names[] = {
-	[RESET_UKWN] = "unknown",
-	[RESET_POR] = "POR",
-	[RESET_RST] = "RST",
-	[RESET_WDG] = "WDG",
-	[RESET_WKE] = "WKE",
-	[RESET_JTAG] = "JTAG",
+	[RESET_UKWNOWN] = "unknown",
+	[RESET_POWER] = "power",
+	[RESET_RESET] = "reset",
+	[RESET_WATCHDOG] = "watchdog",
+	[RESET_WAKEUP] = "wakeup",
+	[RESET_JTAG] = "jtag",
 };
 
 void set_reset_source(enum reset_src_type st)
@@ -37,7 +37,7 @@ EXPORT_SYMBOL(set_reset_source);
 static int init_reset_source(void)
 {
 	globalvar_add_simple("system.reset");
-	set_reset_source(RESET_UKWN);
+	set_reset_source(RESET_UKWNOWN);
 	return 0;
 }
 
diff --git a/drivers/watchdog/im28wd.c b/drivers/watchdog/im28wd.c
index ca32a72..999f5b4 100644
--- a/drivers/watchdog/im28wd.c
+++ b/drivers/watchdog/im28wd.c
@@ -82,17 +82,17 @@ static void __maybe_unused imx28_detect_reset_source(const struct imx28_wd *p)
 	if (reg & MXS_RTC_PERSISTENT0_EXT_RST) {
 		writel(MXS_RTC_PERSISTENT0_EXT_RST,
 			p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
-		set_reset_source(RESET_POR);
+		set_reset_source(RESET_POWER);
 		return;
 	}
 	if (reg & MXS_RTC_PERSISTENT0_THM_RST) {
 		writel(MXS_RTC_PERSISTENT0_THM_RST,
 			p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
-		set_reset_source(RESET_RST);
+		set_reset_source(RESET_RESET);
 		return;
 	}
 
-	set_reset_source(RESET_RST);
+	set_reset_source(RESET_RESET);
 }
 
 static int imx28_wd_probe(struct device_d *dev)
diff --git a/include/reset_source.h b/include/reset_source.h
index 6734fbde..198abd0 100644
--- a/include/reset_source.h
+++ b/include/reset_source.h
@@ -14,11 +14,11 @@
 # define __INCLUDE_RESET_SOURCE_H
 
 enum reset_src_type {
-	RESET_UKWN,	/* maybe the SoC cannot detect the reset source */
-	RESET_POR,	/* Power On Reset (cold start) */
-	RESET_RST,	/* generic ReSeT (warm start) */
-	RESET_WDG,	/* watchdog */
-	RESET_WKE,	/* wake-up (some SoCs can handle this) */
+	RESET_UKWNOWN,	/* maybe the SoC cannot detect the reset source */
+	RESET_POWER,	/* Power On Reset (cold start) */
+	RESET_RESET,	/* generic ReSeT (warm start) */
+	RESET_WATCHDOG,	/* watchdog */
+	RESET_WAKEUP,	/* wake-up (some SoCs can handle this) */
 	RESET_JTAG,	/* JTAG reset */
 };
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 0/4 v2] add wakup source
@ 2012-10-13 13:46 Jean-Christophe PLAGNIOL-VILLARD
  2012-10-13 13:49 ` [PATCH 1/4] reset_source: make enum and string human readable Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-13 13:46 UTC (permalink / raw)
  To: barebox

HI,

	v2:
	  update against next

	add wakeup source and amek power source human readable

The following changes since commit f0c7ee4201d56ec87c8b0deff3a481644a34bb9d:

  Merge branch 'for-next-1/karo-tx53' into next (2012-10-13 14:24:49 +0200)

are available in the git repository at:


  git://git.jcrosoft.org/barebox.git delivery/reset_source

for you to fetch changes up to f4d6ae60c34f1e01bf913e3b8166b478e1b55fb2:

  at91: add reset and wakeup source detection support (2012-10-13 13:45:02 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (4):
      reset_source: make enum and string human readable
      reset_source: add software reset as possible source
      reset_resource: add wakeup source
      at91: add reset and wakeup source detection support

 arch/arm/mach-at91/Makefile                  |    1 +
 arch/arm/mach-at91/include/mach/at91_shdwc.h |   40 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-at91/reset_source.c            |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/imx1.c                     |    6 +++---
 arch/arm/mach-samsung/reset_source.c         |    6 +++---
 common/reset_source.c                        |   32 +++++++++++++++++++++++++-------
 drivers/watchdog/im28wd.c                    |    6 +++---
 drivers/watchdog/imxwd.c                     |    6 +++---
 include/reset_source.h                       |   22 +++++++++++++++++-----
 9 files changed, 154 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm/mach-at91/include/mach/at91_shdwc.h
 create mode 100644 arch/arm/mach-at91/reset_source.c

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-13 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-13  7:51 [PATCH 1/4] reset_source: make enum and string human readable Jean-Christophe PLAGNIOL-VILLARD
2012-10-13  7:51 ` [PATCH 2/4] reset_source: add software reset as possible source Jean-Christophe PLAGNIOL-VILLARD
2012-10-13  7:51 ` [PATCH 3/4] reset_resource: add wakeup source Jean-Christophe PLAGNIOL-VILLARD
2012-10-13  7:51 ` [PATCH 4/4] at91: add reset and wakeup source detection support Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 13:46 [PATCH 0/4 v2] add wakup source Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 13:49 ` [PATCH 1/4] reset_source: make enum and string human readable Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 13:49   ` [PATCH 4/4] at91: add reset and wakeup source detection support Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox