|
From: <hap...@us...> - 2007-07-27 23:38:29
|
Revision: 1210
http://hackndev.svn.sourceforge.net/hackndev/?rev=1210&view=rev
Author: happy-slapin
Date: 2007-07-27 16:38:07 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
palmz72: Cleanup, added comments.
Closes: 45
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-07-27 23:13:41 UTC (rev 1209)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-07-27 23:38:07 UTC (rev 1210)
@@ -93,6 +93,18 @@
#define palmz72_resume NULL
#endif
+/* We have some black magic here
+ * PalmOS ROM on recover expects special struct phys address
+ * to be transferred via PSPR. Using this struct PalmOS restores
+ * its state after sleep. As for Linux, we need to setup it the
+ * same way. More than that, PalmOS ROM changes some values in memory.
+ * For now only one location is found, which needs special treatment.
+ * Thanks to Alex Osborne, Andrzej Zaborowski, and lots of other people
+ * for reading backtraces for me :)
+ */
+
+#define PALMZ72_SAVE_DWORD ((unsigned long *)0xc0000050)
+
static struct {
u32 magic0; /* 0x0 */
u32 magic1; /* 0x4 */
@@ -127,14 +139,15 @@
/* setup the resume_info struct for the original bootloader */
palmz72_resume_info.resume_addr = resume_addr;
printk(KERN_INFO "PSPR=%lu\n", virt_to_phys(&palmz72_resume_info));
- store_ptr = *((unsigned long *)0xc0000050);
+ /* Storing memory touched by ROM */
+ store_ptr = *PALMZ72_SAVE_DWORD;
PSPR = virt_to_phys(&palmz72_resume_info);
}
static void palmz72_pxa_ll_pm_resume(void)
{
- *((unsigned long *)0xc0000050) = store_ptr;
- /* For future */
+ /* Restoring memory touched by ROM */
+ *PALMZ72_SAVE_DWORD = store_ptr;
}
struct pxa_ll_pm_ops palmz72_ll_pm_ops = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|