diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-12-21 17:39:15 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-12-21 21:57:40 -0500 |
commit | ff2516fbef20ed9edd9cc2fc8b8b48d5cb5a932f (patch) | |
tree | 29cc55d6a7c6e7b255a6d32e4590377ce9983123 /arch/arm/mach-omap2/devices.c | |
parent | 81fbc5ef9b22df2e2198dd0c530719a263a8d1c5 (diff) |
OMAP2+: wd_timer: disable on boot via hwmod postsetup mechanism
The OMAP watchdog timer IP blocks require a specific set of register
writes to occur before they will be disabled[1], even if the device
clocks appear to be disabled in the CM_*CLKEN registers. In the MPU
watchdog case, failure to execute this reset sequence will eventually
cause the watchdog to reset the OMAP unexpectedly.
Previously, the code to disable this watchdog was manually called from
mach-omap2/devices.c during device initialization. This causes the
watchdog to be unconditionally disabled for a portion of kernel
initialization. This should be controllable by the board-*.c files,
since some system integrators will want full watchdog coverage of
kernel initialization. Also, the watchdog disable code was not
connected to the hwmod shutdown code. This means that calling
omap_hwmod_shutdown() will not, in fact, disable the watchdog, and the
goal of omap_hwmod_shutdown() is to be able to shutdown any on-chip
OMAP device.
To resolve the latter problem, populate the pre_shutdown pointer in
the watchdog timer hwmod classes with a function that executes the
watchdog shutdown sequence. This allows the hwmod code to fully
disable the watchdog.
Then, to allow some board files to support watchdog coverage
throughout kernel initialization, add common code to mach-omap2/io.c
to cause the MPU watchdog to be disabled on boot unless a board file
specifically requests it to remain enabled. Board files can do this
by changing the watchdog timer hwmod's postsetup state between the
omap2_init_common_infrastructure() and omap2_init_common_devices()
function calls.
1. OMAP34xx Multimedia Device Silicon Revision 3.1.x Rev. ZH
[SWPU222H], Section 16.4.3.6, "Start/Stop Sequence for WDTs (Using
WDTi.WSPR Register)"
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Charulatha Varadarajan <charu@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 9221a486b51f..381f4eb92352 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include "mux.h" | 34 | #include "mux.h" |
35 | #include "control.h" | 35 | #include "control.h" |
36 | #include "wd_timer.h" | ||
37 | 36 | ||
38 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) | 37 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
39 | 38 | ||
@@ -956,26 +955,12 @@ static inline void omap_init_vout(void) {} | |||
956 | 955 | ||
957 | /*-------------------------------------------------------------------------*/ | 956 | /*-------------------------------------------------------------------------*/ |
958 | 957 | ||
959 | static int omap2_disable_wdt(struct omap_hwmod *oh, void *unused) | ||
960 | { | ||
961 | return omap2_wd_timer_disable(oh); | ||
962 | } | ||
963 | |||
964 | static void __init omap_disable_wdt(void) | ||
965 | { | ||
966 | if (cpu_class_is_omap2()) | ||
967 | omap_hwmod_for_each_by_class("wd_timer", | ||
968 | omap2_disable_wdt, NULL); | ||
969 | return; | ||
970 | } | ||
971 | |||
972 | static int __init omap2_init_devices(void) | 958 | static int __init omap2_init_devices(void) |
973 | { | 959 | { |
974 | /* | 960 | /* |
975 | * please keep these calls, and their implementations above, | 961 | * please keep these calls, and their implementations above, |
976 | * in alphabetical order so they're easier to sort through. | 962 | * in alphabetical order so they're easier to sort through. |
977 | */ | 963 | */ |
978 | omap_disable_wdt(); | ||
979 | omap_hsmmc_reset(); | 964 | omap_hsmmc_reset(); |
980 | omap_init_audio(); | 965 | omap_init_audio(); |
981 | omap_init_camera(); | 966 | omap_init_camera(); |