diff options
author | Ben Dooks <ben-linux@fluff.org> | 2007-06-06 05:36:09 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-06-11 04:09:31 -0400 |
commit | 5698bd28c67775c722dc1f4ab82e0041c1c740ea (patch) | |
tree | c9abe7032122bc466a0d056a7ae4d850d89c91fd | |
parent | 55ba86bc6c33ce8b690fdf20ab485ef94cccd423 (diff) |
[ARM] 4444/2: OSIRIS: CPLD suspend fix
Ensure the CPLD 8bit settings are preserved over a suspend/resume
cycle as the CPU sends a hard-reset at resume time.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-s3c2440/mach-osiris.c | 39 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/osiris-cpld.h | 5 |
2 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index 64da36a00644..15811601f03d 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/sysdev.h> | ||
19 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
20 | 21 | ||
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -245,6 +246,40 @@ static struct platform_device osiris_pcmcia = { | |||
245 | .resource = osiris_pcmcia_resource, | 246 | .resource = osiris_pcmcia_resource, |
246 | }; | 247 | }; |
247 | 248 | ||
249 | /* Osiris power management device */ | ||
250 | |||
251 | #ifdef CONFIG_PM | ||
252 | static unsigned char pm_osiris_ctrl0; | ||
253 | |||
254 | static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) | ||
255 | { | ||
256 | pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0); | ||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | static int osiris_pm_resume(struct sys_device *sd) | ||
261 | { | ||
262 | if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) | ||
263 | __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); | ||
264 | |||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | #else | ||
269 | #define osiris_pm_suspend NULL | ||
270 | #define osiris_pm_resume NULL | ||
271 | #endif | ||
272 | |||
273 | static struct sysdev_class osiris_pm_sysclass = { | ||
274 | set_kset_name("mach-osiris"), | ||
275 | .suspend = osiris_pm_suspend, | ||
276 | .resume = osiris_pm_resume, | ||
277 | }; | ||
278 | |||
279 | static struct sys_device osiris_pm_sysdev = { | ||
280 | .cls = &osiris_pm_sysclass, | ||
281 | }; | ||
282 | |||
248 | /* Standard Osiris devices */ | 283 | /* Standard Osiris devices */ |
249 | 284 | ||
250 | static struct platform_device *osiris_devices[] __initdata = { | 285 | static struct platform_device *osiris_devices[] __initdata = { |
@@ -299,6 +334,9 @@ static void __init osiris_map_io(void) | |||
299 | 334 | ||
300 | static void __init osiris_init(void) | 335 | static void __init osiris_init(void) |
301 | { | 336 | { |
337 | sysdev_class_register(&osiris_pm_sysclass); | ||
338 | sysdev_register(&osiris_pm_sysdev); | ||
339 | |||
302 | platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices)); | 340 | platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices)); |
303 | }; | 341 | }; |
304 | 342 | ||
@@ -310,5 +348,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") | |||
310 | .map_io = osiris_map_io, | 348 | .map_io = osiris_map_io, |
311 | .init_machine = osiris_init, | 349 | .init_machine = osiris_init, |
312 | .init_irq = s3c24xx_init_irq, | 350 | .init_irq = s3c24xx_init_irq, |
351 | .init_machine = osiris_init, | ||
313 | .timer = &s3c24xx_timer, | 352 | .timer = &s3c24xx_timer, |
314 | MACHINE_END | 353 | MACHINE_END |
diff --git a/include/asm-arm/arch-s3c2410/osiris-cpld.h b/include/asm-arm/arch-s3c2410/osiris-cpld.h index a3253e979efe..229ab2351db6 100644 --- a/include/asm-arm/arch-s3c2410/osiris-cpld.h +++ b/include/asm-arm/arch-s3c2410/osiris-cpld.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h | 1 | /* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h |
2 | * | 2 | * |
3 | * Copyright (c) 2005 Simtec Electronics | 3 | * Copyright 2005 Simtec Electronics |
4 | * http://www.simtec.co.uk/products/ | 4 | * http://www.simtec.co.uk/products/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * | 6 | * |
@@ -19,9 +19,12 @@ | |||
19 | #define OSIRIS_CTRL0_NANDSEL (0x3) | 19 | #define OSIRIS_CTRL0_NANDSEL (0x3) |
20 | #define OSIRIS_CTRL0_BOOT_INT (1<<3) | 20 | #define OSIRIS_CTRL0_BOOT_INT (1<<3) |
21 | #define OSIRIS_CTRL0_PCMCIA (1<<4) | 21 | #define OSIRIS_CTRL0_PCMCIA (1<<4) |
22 | #define OSIRIS_CTRL0_FIX8 (1<<5) | ||
22 | #define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6) | 23 | #define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6) |
23 | #define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7) | 24 | #define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7) |
24 | 25 | ||
26 | #define OSIRIS_CTRL1_FIX8 (1<<0) | ||
27 | |||
25 | #define OSIRIS_ID_REVMASK (0x7) | 28 | #define OSIRIS_ID_REVMASK (0x7) |
26 | 29 | ||
27 | #endif /* __ASM_ARCH_OSIRISCPLD_H */ | 30 | #endif /* __ASM_ARCH_OSIRISCPLD_H */ |