aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-11-30 11:40:31 -0500
committerTony Lindgren <tony@atomide.com>2012-11-30 11:40:31 -0500
commit2589d056122f6dcb405d411eae872aac8cf9da1b (patch)
tree8b2fb3a9f8205c110842c59ed42987a6f2b17e1a /arch/arm/mach-omap1
parent42a1cc9c0ec2a00b53b4f02849dc4377b09b3b05 (diff)
parent8b9c1ac2e11a9fb3a5a8860fb7570ff7633aa7f7 (diff)
Merge tag 'tags/omap-for-v3.8/devel-prcm-signed' into omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3
omap prcm changes via Paul Walmsley <paul@pwsan.com>: Some miscellaneous OMAP hwmod changes for 3.8, along with a PRM change needed for one of the hwmod patches to function. Basic test logs for this branch on top of Tony's omap-for-v3.8/clock branch at commit 558a0780b0a04862a678f7823215424b4e5501f9 are here: http://www.pwsan.com/omap/testlogs/hwmod_devel_a_3.8/20121121161522/ However, omap-for-v3.8/clock at 558a0780 does not include some fixes that are needed for a successful test. With several reverts, fixes, and workarounds applied, the following test logs were obtained: http://www.pwsan.com/omap/testlogs/TEST_hwmod_devel_a_3.8/20121121162719/ which indicate that the series tests cleanly. Conflicts: arch/arm/mach-omap2/cm33xx.c arch/arm/mach-omap2/io.c arch/arm/mach-omap2/prm_common.c
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/common.h2
-rw-r--r--arch/arm/mach-omap1/devices.c21
-rw-r--r--arch/arm/mach-omap1/reset.c41
3 files changed, 59 insertions, 5 deletions
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index fc8c9449eba8..b53e0854422f 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -93,4 +93,6 @@ extern int ocpi_enable(void);
93static inline int ocpi_enable(void) { return 0; } 93static inline int ocpi_enable(void) { return 0; }
94#endif 94#endif
95 95
96extern u32 omap1_get_reset_sources(void);
97
96#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */ 98#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 7155ed8b97f8..0af635205e8a 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -17,6 +17,8 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19 19
20#include <linux/platform_data/omap-wd-timer.h>
21
20#include <asm/mach/map.h> 22#include <asm/mach/map.h>
21 23
22#include <mach/tc.h> 24#include <mach/tc.h>
@@ -447,18 +449,31 @@ static struct resource wdt_resources[] = {
447}; 449};
448 450
449static struct platform_device omap_wdt_device = { 451static struct platform_device omap_wdt_device = {
450 .name = "omap_wdt", 452 .name = "omap_wdt",
451 .id = -1, 453 .id = -1,
452 .num_resources = ARRAY_SIZE(wdt_resources), 454 .num_resources = ARRAY_SIZE(wdt_resources),
453 .resource = wdt_resources, 455 .resource = wdt_resources,
454}; 456};
455 457
456static int __init omap_init_wdt(void) 458static int __init omap_init_wdt(void)
457{ 459{
460 struct omap_wd_timer_platform_data pdata;
461 int ret;
462
458 if (!cpu_is_omap16xx()) 463 if (!cpu_is_omap16xx())
459 return -ENODEV; 464 return -ENODEV;
460 465
461 return platform_device_register(&omap_wdt_device); 466 pdata.read_reset_sources = omap1_get_reset_sources;
467
468 ret = platform_device_register(&omap_wdt_device);
469 if (!ret) {
470 ret = platform_device_add_data(&omap_wdt_device, &pdata,
471 sizeof(pdata));
472 if (ret)
473 platform_device_del(&omap_wdt_device);
474 }
475
476 return ret;
462} 477}
463subsys_initcall(omap_init_wdt); 478subsys_initcall(omap_init_wdt);
464#endif 479#endif
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index b17709103866..5eebd7e889d0 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -4,12 +4,24 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/io.h> 5#include <linux/io.h>
6 6
7#include <plat/prcm.h>
8
9#include <mach/hardware.h> 7#include <mach/hardware.h>
10 8
9#include "iomap.h"
11#include "common.h" 10#include "common.h"
12 11
12/* ARM_SYSST bit shifts related to SoC reset sources */
13#define ARM_SYSST_POR_SHIFT 5
14#define ARM_SYSST_EXT_RST_SHIFT 4
15#define ARM_SYSST_ARM_WDRST_SHIFT 2
16#define ARM_SYSST_GLOB_SWRST_SHIFT 1
17
18/* Standardized reset source bits (across all OMAP SoCs) */
19#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
20#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
21#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
22#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
23
24
13void omap1_restart(char mode, const char *cmd) 25void omap1_restart(char mode, const char *cmd)
14{ 26{
15 /* 27 /*
@@ -23,3 +35,28 @@ void omap1_restart(char mode, const char *cmd)
23 35
24 omap_writew(1, ARM_RSTCT1); 36 omap_writew(1, ARM_RSTCT1);
25} 37}
38
39/**
40 * omap1_get_reset_sources - return the source of the SoC's last reset
41 *
42 * Returns bits that represent the last reset source for the SoC. The
43 * format is standardized across OMAPs for use by the OMAP watchdog.
44 */
45u32 omap1_get_reset_sources(void)
46{
47 u32 ret = 0;
48 u16 rs;
49
50 rs = __raw_readw(OMAP1_IO_ADDRESS(ARM_SYSST));
51
52 if (rs & (1 << ARM_SYSST_POR_SHIFT))
53 ret |= 1 << OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT;
54 if (rs & (1 << ARM_SYSST_EXT_RST_SHIFT))
55 ret |= 1 << OMAP_EXTWARM_RST_SRC_ID_SHIFT;
56 if (rs & (1 << ARM_SYSST_ARM_WDRST_SHIFT))
57 ret |= 1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT;
58 if (rs & (1 << ARM_SYSST_GLOB_SWRST_SHIFT))
59 ret |= 1 << OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT;
60
61 return ret;
62}