aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-10-04 18:16:42 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-10-05 16:21:40 -0400
commit28047eced817b3b7cd404fac4b26f29fcf04f1f7 (patch)
tree56e82489cab228bfb1e72c7f3d8847c04e648c1d /arch
parent804b3f9a16e446cb023417faec58b6506c834052 (diff)
[ARM] 4597/2: OSIRIS: ensure CPLD0 is preserved after suspend
Ensure that CPLD is restored to the original state on resume, and that before going into suspend we select the NAND bank we booted from for restarting. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 0ba7e9060c7b..be5377f128c4 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -276,7 +276,17 @@ static unsigned char pm_osiris_ctrl0;
276 276
277static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) 277static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state)
278{ 278{
279 unsigned int tmp;
280
279 pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0); 281 pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0);
282 tmp = pm_osiris_ctrl0 & ~OSIRIS_CTRL0_NANDSEL;
283
284 /* ensure correct NAND slot is selected on resume */
285 if ((pm_osiris_ctrl0 & OSIRIS_CTRL0_BOOT_INT) == 0)
286 tmp |= 2;
287
288 __raw_writeb(tmp, OSIRIS_VA_CTRL0);
289
280 return 0; 290 return 0;
281} 291}
282 292
@@ -285,6 +295,8 @@ static int osiris_pm_resume(struct sys_device *sd)
285 if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) 295 if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8)
286 __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); 296 __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1);
287 297
298 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0);
299
288 return 0; 300 return 0;
289} 301}
290 302