diff options
author | Magnus Damm <damm@opensource.se> | 2009-11-02 04:31:03 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-11-03 21:48:05 -0500 |
commit | c4b973f532206e1a67b1beae654b44c8be26fc44 (patch) | |
tree | e806f8dddc943bc22b5e6d52f8403ed58e902d34 /arch/sh | |
parent | a37c6c7aec38a693f87ee5ccc6e60a5b3ee700f2 (diff) |
sh: Add RWDT save/restore code for sh7724 R-standby
Add sh7724 code to save and restore RWDT state during
R-standby. Without this patch the watchdog will generate
a reset shortly after resuming from R-standby.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 6dc4469434ea..ac1505a8fd80 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |||
@@ -870,6 +870,9 @@ static struct { | |||
870 | unsigned char imr10; | 870 | unsigned char imr10; |
871 | unsigned char imr11; | 871 | unsigned char imr11; |
872 | unsigned char imr12; | 872 | unsigned char imr12; |
873 | /* RWDT */ | ||
874 | unsigned short rwtcnt; | ||
875 | unsigned short rwtcsr; | ||
873 | } sh7724_rstandby_state; | 876 | } sh7724_rstandby_state; |
874 | 877 | ||
875 | static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb, | 878 | static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb, |
@@ -920,6 +923,13 @@ static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb, | |||
920 | sh7724_rstandby_state.imr11 = __raw_readb(0xa40800ac); /* IMR11 */ | 923 | sh7724_rstandby_state.imr11 = __raw_readb(0xa40800ac); /* IMR11 */ |
921 | sh7724_rstandby_state.imr12 = __raw_readb(0xa40800b0); /* IMR12 */ | 924 | sh7724_rstandby_state.imr12 = __raw_readb(0xa40800b0); /* IMR12 */ |
922 | 925 | ||
926 | /* RWDT */ | ||
927 | sh7724_rstandby_state.rwtcnt = __raw_readb(0xa4520000); /* RWTCNT */ | ||
928 | sh7724_rstandby_state.rwtcnt |= 0x5a00; | ||
929 | sh7724_rstandby_state.rwtcsr = __raw_readb(0xa4520004); /* RWTCSR */ | ||
930 | sh7724_rstandby_state.rwtcsr |= 0xa500; | ||
931 | __raw_writew(sh7724_rstandby_state.rwtcsr & 0x07, 0xa4520004); | ||
932 | |||
923 | return NOTIFY_DONE; | 933 | return NOTIFY_DONE; |
924 | } | 934 | } |
925 | 935 | ||
@@ -970,6 +980,10 @@ static int sh7724_post_sleep_notifier_call(struct notifier_block *nb, | |||
970 | __raw_writeb(sh7724_rstandby_state.imr11, 0xa40800ac); /* IMR11 */ | 980 | __raw_writeb(sh7724_rstandby_state.imr11, 0xa40800ac); /* IMR11 */ |
971 | __raw_writeb(sh7724_rstandby_state.imr12, 0xa40800b0); /* IMR12 */ | 981 | __raw_writeb(sh7724_rstandby_state.imr12, 0xa40800b0); /* IMR12 */ |
972 | 982 | ||
983 | /* RWDT */ | ||
984 | __raw_writew(sh7724_rstandby_state.rwtcnt, 0xa4520000); /* RWTCNT */ | ||
985 | __raw_writew(sh7724_rstandby_state.rwtcsr, 0xa4520004); /* RWTCSR */ | ||
986 | |||
973 | return NOTIFY_DONE; | 987 | return NOTIFY_DONE; |
974 | } | 988 | } |
975 | 989 | ||