aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-10-24 20:05:59 -0400
committerTony Lindgren <tony@atomide.com>2012-10-24 20:05:59 -0400
commit8634155ef41d3a035f2ea0b6c5bed2806f2788bc (patch)
tree6334a630abf196685803f17002fbf25d11babe17 /arch/arm/mach-omap1
parent6d02643d64b4440394ee462ea4b870c8506cd9e7 (diff)
parent2bb2a5d30abb0dc99d074877bfad2056142c730b (diff)
Merge tag 'omap-cleanup-a-for-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.8/cleanup-prcm
The first set of OMAP PRM/CM-related cleanup patches for 3.8. Prepares for the future move of the PRM/CM code to drivers/. Also includes some prcm.[ch] cleanup patches from the WDTIMER cleanup series that don't need external acks. Basic test logs for this branch on top of v3.7-rc2 are here: http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121021123719/ But due to the number of unrelated regressions present in v3.7-rc[12], it's not particularly usable as a testing base. With reverts, fixes, and workarounds applied as documented in: http://www.pwsan.com/omap/testlogs/test_v3.7-rc2/20121020134755/README.txt the following test logs were obtained: http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121020231757/ which indicate that the series tests cleanly. Conflicts: arch/arm/mach-omap2/Makefile arch/arm/mach-omap2/clockdomain2xxx_3xxx.c arch/arm/mach-omap2/pm24xx.c
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/common.h2
-rw-r--r--arch/arm/mach-omap1/reset.c38
2 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index 26e19d3b7924..d6ac18d04da7 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -94,4 +94,6 @@ extern int ocpi_enable(void);
94static inline int ocpi_enable(void) { return 0; } 94static inline int ocpi_enable(void) { return 0; }
95#endif 95#endif
96 96
97extern int omap1_get_reset_sources(void);
98
97#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */ 99#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index b17709103866..a0a9f97772ea 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -10,6 +10,19 @@
10 10
11#include "common.h" 11#include "common.h"
12 12
13/* ARM_SYSST bit shifts related to SoC reset sources */
14#define ARM_SYSST_POR_SHIFT 5
15#define ARM_SYSST_EXT_RST_SHIFT 4
16#define ARM_SYSST_ARM_WDRST_SHIFT 2
17#define ARM_SYSST_GLOB_SWRST_SHIFT 1
18
19/* Standardized reset source bits (across all OMAP SoCs) */
20#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
21#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
22#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
23#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
24
25
13void omap1_restart(char mode, const char *cmd) 26void omap1_restart(char mode, const char *cmd)
14{ 27{
15 /* 28 /*
@@ -23,3 +36,28 @@ void omap1_restart(char mode, const char *cmd)
23 36
24 omap_writew(1, ARM_RSTCT1); 37 omap_writew(1, ARM_RSTCT1);
25} 38}
39
40/**
41 * omap1_get_reset_sources - return the source of the SoC's last reset
42 *
43 * Returns bits that represent the last reset source for the SoC. The
44 * format is standardized across OMAPs for use by the OMAP watchdog.
45 */
46int omap1_get_reset_sources(void)
47{
48 int ret = 0;
49 u16 rs;
50
51 rs = __raw_readw(ARM_SYSST);
52
53 if (rs & (1 << ARM_SYSST_POR_SHIFT))
54 ret |= 1 << OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT;
55 if (rs & (1 << ARM_SYSST_EXT_RST_SHIFT))
56 ret |= 1 << OMAP_EXTWARM_RST_SRC_ID_SHIFT;
57 if (rs & (1 << ARM_SYSST_ARM_WDRST_SHIFT))
58 ret |= 1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT;
59 if (rs & (1 << ARM_SYSST_GLOB_SWRST_SHIFT))
60 ret |= 1 << OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT;
61
62 return ret;
63}