From: <z7...@us...> - 2007-01-18 08:26:49
|
Revision: 762 http://svn.sourceforge.net/hackndev/?rev=762&view=rev Author: z72ka Date: 2007-01-18 00:25:56 -0800 (Thu, 18 Jan 2007) Log Message: ----------- Palmz72: Added suspend/resume support Added Paths: ----------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c (rev 0) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-18 08:25:56 UTC (rev 762) @@ -0,0 +1,71 @@ +/* + * PalmOne Zire72 suspend/resume support + * + * Author: Jan Herman <2h...@se...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include <linux/kernel.h> +#include <linux/device.h> +#include <linux/pm.h> + +#include <asm/arch/pxa-pm_ll.h> +#include <asm/arch/hardware.h> +#include <asm/arch/pxa-regs.h> + +#include <asm/arch/palmz72-gpio.h> + + +static void palmz72_pxa_ll_pm_suspend(unsigned long resume_addr) +{ + + /* Wake up on Voice Memo button*/ + PWER |= PWER_GPIO13; + /* Wake up on RTC alaram is possibile */ + //PWER |= PWER_RTC; + PRER |= PWER_GPIO13; + + /* USB, in theory this can even wake us from deep sleep */ + PWER |= PWER_GPIO15; + PFER |= PWER_GPIO15; + PRER |= PWER_GPIO15; + + /* Turn off LCD power */ + SET_PALMZ72_GPIO(LCD_POWER,0); + /* Turn off USB power */ + SET_PALMZ72_GPIO(USB_POWER,0); + + + /* disable GPIO reset, palm bootloader will hang us */ + //PCFR |= PCFR_GPR_EN | PCFR_OPDE; + PCFR &= PCFR_GPR_EN; + + return; +} + +static void palmz72_pxa_ll_pm_resume(void) +{ + + /* re-enable GPIO reset */ + PCFR |= PCFR_GPR_EN; + + /* Turn on LCD power */ + SET_PALMZ72_GPIO(LCD_POWER,1); + + /* Turn on USB power */ + SET_PALMZ72_GPIO(USB_POWER,1); +} + +struct pxa_ll_pm_ops palmz72_ll_pm_ops = { + .suspend = palmz72_pxa_ll_pm_suspend, + .resume = palmz72_pxa_ll_pm_resume, +}; + +MODULE_AUTHOR("Jan Herman <2h...@se...>"); +MODULE_DESCRIPTION("PalmOne Zire72 suspend/resume support driver"); +MODULE_LICENSE("GPL"); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-01-23 19:11:20
|
Revision: 780 http://svn.sourceforge.net/hackndev/?rev=780&view=rev Author: happy-slapin Date: 2007-01-23 11:11:18 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Fixed function parameter list 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-01-23 18:34:39 UTC (rev 779) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-23 19:11:18 UTC (rev 780) @@ -53,7 +53,7 @@ return 0; } -static int palmz72_resume(struct device *dev, pm_message_t state) +static int palmz72_resume(struct device *dev) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-01-29 18:51:28
|
Revision: 782 http://svn.sourceforge.net/hackndev/?rev=782&view=rev Author: happy-slapin Date: 2007-01-29 10:51:17 -0800 (Mon, 29 Jan 2007) Log Message: ----------- z72: Keyboard wakeup 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-01-25 08:26:06 UTC (rev 781) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-29 18:51:17 UTC (rev 782) @@ -34,6 +34,9 @@ { /* Wake-Up on Voice memo button - GPIO 13 */ PWER |= PWER_GPIO13 | PWER_RTC | PWER_WEP1; + + /* Wakeup by keyboard :) */ + PKWR |= 0xfffff; PRER |= PWER_GPIO13; /* Enabled Deep-Sleep mode ?? */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-01-29 19:17:33
|
Revision: 783 http://svn.sourceforge.net/hackndev/?rev=783&view=rev Author: happy-slapin Date: 2007-01-29 11:17:25 -0800 (Mon, 29 Jan 2007) Log Message: ----------- z72: Limit wakeup to actual keys an not whole bunch of stuff 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-01-29 18:51:17 UTC (rev 782) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-29 19:17:25 UTC (rev 783) @@ -36,7 +36,7 @@ PWER |= PWER_GPIO13 | PWER_RTC | PWER_WEP1; /* Wakeup by keyboard :) */ - PKWR |= 0xfffff; + PKWR |= 0xe0000; PRER |= PWER_GPIO13; /* Enabled Deep-Sleep mode ?? */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-01-29 19:57:13
|
Revision: 784 http://svn.sourceforge.net/hackndev/?rev=784&view=rev Author: happy-slapin Date: 2007-01-29 11:42:21 -0800 (Mon, 29 Jan 2007) Log Message: ----------- z72: Fixed header 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-01-29 19:17:25 UTC (rev 783) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-29 19:42:21 UTC (rev 784) @@ -1,9 +1,9 @@ /************************************************************************ * PalmOne Zire72 suspend/resume support * * * - * Author: Jan Herman <2h...@se...> * + * Authos: Jan Herman <2h...@se...> * + * Sergey Lapin <sla...@gm...> * * * - * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License version 2 as * * published by the Free Software Foundation. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-01-31 18:52:39
|
Revision: 786 http://svn.sourceforge.net/hackndev/?rev=786&view=rev Author: happy-slapin Date: 2007-01-31 10:52:36 -0800 (Wed, 31 Jan 2007) Log Message: ----------- z72: Preparations for delayed resume 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-01-30 12:54:28 UTC (rev 785) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-31 18:52:36 UTC (rev 786) @@ -24,11 +24,15 @@ #include <asm/arch/pxa-regs.h> #include <asm/arch/palmz72-gpio.h> +#include <asm/arch/pxa27x_keyboard.h> +#define KPASMKP(col) (col/2==0 ? KPASMKP0 : col/2==1 ? KPASMKP1 : col/2==2 ? KPASMKP2 : KPASMKP3) +#define KPASMKPx_MKC(row, col) (1 << (row + 16*(col%2))) + struct pm_save_data { int brightness; - u32 jiffies; + u32 rcnr; }; static struct pm_save_data pm_save_data; @@ -36,24 +40,25 @@ #ifdef CONFIG_PM static int palmz72_suspend(struct device *dev, pm_message_t state) { - /* Wake-Up on Voice memo button - GPIO 13 */ - PWER |= PWER_GPIO13 | PWER_RTC | PWER_WEP1; + /* Wake-Up on RTC event, etc. */ + PWER |= PWER_RTC | PWER_WEP1; /* Wakeup by keyboard :) */ - PKWR |= 0xe0000; + PKWR = 0xe0001; - PRER |= PWER_GPIO13; /* Enabled Deep-Sleep mode ?? */ PCFR |= PCFR_DS; /* Low power mode */ PCFR |= PCFR_OPDE; + + /* 3.6.8.1 */ + while(!(OSCC & OSCC_OOK)) + {} /* Here are all of special for suspend PalmOne Zire 72 */ //printk("Palmz72_suspend: suspending..."); - SET_PALMZ72_GPIO(LED, 0); - /* Turn off LCD power */ SET_PALMZ72_GPIO(LCD_POWER,0); /* Turn off USB power */ @@ -83,8 +88,6 @@ /* Turn on USB power */ SET_PALMZ72_GPIO(USB_POWER,1); - SET_PALMZ72_GPIO(LED, 1); - return 0; } #else @@ -108,41 +111,83 @@ .resume = palmz72_pxa_ll_pm_resume, }; -static int (*pxa_pm_enter)(suspend_state_t state); +static int (*pxa_pm_enter_orig)(suspend_state_t state); +#define KBD_ROWS 4 +#define KBD_COLS 3 +#if 0 +static int check_buttons(void) +{ + int data = 0, row, col; + u32 storekpc = KPC; + + data = GET_GPIO(GPIO_NR_PALMZ72_KP_DKIN7) && 1; + + pxa_set_cken(CKEN19_KEYPAD, 1); -static void zire72_goto_sleep(suspend_state_t state) -{ - pxa_pm_enter(state); + KPC |= KBD_ROWS << 26; + KPC |= KBD_COLS << 23; + + KPC &= ~(KPC_ASACT|KPC_AS|KPC_IMKP|KPC_DE|KPC_DIE|KPC_MIE); + + /* Processing automatic scan once */ + KPC |= KPC_ME | KPC_AS; + + for (row=0; row < KBD_ROWS; row++) { + for (col=0; col < KBD_COLS; col++) { + data |= (KPASMKP(col) & KPASMKPx_MKC(row, col) && 1) << 2; + } + } + + +// pxa_set_cken(CKEN19_KEYPAD, 0); + KPC = storekpc; + return data; } - +#endif static int zire72_enter_suspend(suspend_state_t state) { /* Here we should implement wakeup conditions If we have none, just return 1 to continue sleeping */ - if(PKSR & 0x00001) { - printk(KERN_NOTICE "Returning from sleep due to GPIO13\n"); - return 0; - } - if(jiffies < ( pm_save_data.jiffies + msecs_to_jiffies(5000))) { - if(!(PKSR & 0xe0001)) - pm_save_data.jiffies = jiffies; - zire72_goto_sleep(state); + int data = 0; + + /* Do not suspend on active keypress */ +#if 0 + if(check_buttons()) return 1; +#endif + pxa_pm_enter_orig(state); + +#if 0 + if(!pm_save_data.rcnr) pm_save_data.rcnr = RCNR; + while(RCNR < ( pm_save_data.rcnr + 3)) { + + /* If we release button, sleep back */ + if(!(data = check_buttons())) { + pm_save_data.rcnr = 0; + return 1; + } } - if(PKSR & 0xe0001) { - printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n"); - return 0; - } - return 1; +#endif + printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n"); + printk(KERN_NOTICE "RCNR = %u pm_save_data.rcnr = %u\n", RCNR, pm_save_data.rcnr); + printk(KERN_NOTICE "Keys pressed: %d\n", data); + pm_save_data.rcnr = 0; + return 0; } static int zire72_pxa_pm_enter(suspend_state_t state) { - pm_save_data.jiffies = jiffies; - zire72_goto_sleep(state); + pm_save_data.rcnr = 0; +#if 0 + /* Do not suspend on active keypress */ + if(check_buttons()) + return 0; +#endif + pxa_pm_enter_orig(state); + while (zire72_enter_suspend(state)) {} return 0; @@ -160,9 +205,6 @@ static int palmz72_pm_probe(struct device *dev) { - pm_save_data.jiffies = jiffies; - pxa_pm_enter = pxa_pm_ops.enter; - pm_set_ops(&zire72_pm_ops); printk(KERN_NOTICE "PalmOne Zire72 power management driver registered\n"); return 0; } @@ -177,18 +219,20 @@ static int __init palmz72_pm_init(void) { + pxa_pm_enter_orig = pxa_pm_ops.enter; + pxa_pm_ops.enter = zire72_pxa_pm_enter; return driver_register(&palmz72_pm_driver); } static void __exit palmz72_pm_exit(void) { - pxa_pm_ops.enter = pxa_pm_enter; + pxa_pm_ops.enter = pxa_pm_enter_orig; driver_unregister(&palmz72_pm_driver); } module_init(palmz72_pm_init); module_exit(palmz72_pm_exit); -MODULE_AUTHOR("Jan Herman <2h...@se...>"); +MODULE_AUTHOR("Jan Herman <2h...@se...>, Sergey Lapin <sla...@gm...>"); MODULE_DESCRIPTION("PalmOne Zire 72 power management driver"); MODULE_LICENSE("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-03-20 16:40:25
|
Revision: 929 http://svn.sourceforge.net/hackndev/?rev=929&view=rev Author: happy-slapin Date: 2007-03-20 09:40:22 -0700 (Tue, 20 Mar 2007) Log Message: ----------- z72: PM cleanup 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-03-20 16:05:19 UTC (rev 928) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-03-20 16:40:22 UTC (rev 929) @@ -26,17 +26,6 @@ #include <asm/arch/palmz72-gpio.h> #include <asm/arch/pxa27x_keyboard.h> -#define KPASMKP(col) (col/2==0 ? KPASMKP0 : col/2==1 ? KPASMKP1 : col/2==2 ? KPASMKP2 : KPASMKP3) -#define KPASMKPx_MKC(row, col) (1 << (row + 16*(col%2))) - -struct pm_save_data -{ - int brightness; - u32 rcnr; -}; - -static struct pm_save_data pm_save_data; - #ifdef CONFIG_PM static int palmz72_suspend(struct device *dev, pm_message_t state) { @@ -56,9 +45,6 @@ while(!(OSCC & OSCC_OOK)) {} - /* Here are all of special for suspend PalmOne Zire 72 */ - //printk("Palmz72_suspend: suspending..."); - /* Turn off LCD power */ SET_PALMZ72_GPIO(LCD_POWER,0); /* Turn screen off */ @@ -115,98 +101,6 @@ .resume = palmz72_pxa_ll_pm_resume, }; -static int (*pxa_pm_enter_orig)(suspend_state_t state); -#define KBD_ROWS 4 -#define KBD_COLS 3 -#if 0 -static int check_buttons(void) -{ - int data = 0, row, col; - u32 storekpc = KPC; - - data = GET_GPIO(GPIO_NR_PALMZ72_KP_DKIN7) && 1; - - pxa_set_cken(CKEN19_KEYPAD, 1); - - KPC |= KBD_ROWS << 26; - KPC |= KBD_COLS << 23; - - KPC &= ~(KPC_ASACT|KPC_AS|KPC_IMKP|KPC_DE|KPC_DIE|KPC_MIE); - - /* Processing automatic scan once */ - KPC |= KPC_ME | KPC_AS; - - for (row=0; row < KBD_ROWS; row++) { - for (col=0; col < KBD_COLS; col++) { - data |= (KPASMKP(col) & KPASMKPx_MKC(row, col) && 1) << 2; - } - } - - -// pxa_set_cken(CKEN19_KEYPAD, 0); - KPC = storekpc; - return data; -} -#endif -static int zire72_enter_suspend(suspend_state_t state) -{ - /* Here we should implement wakeup conditions - If we have none, just return 1 to continue - sleeping */ - int data = 0; - - /* Do not suspend on active keypress */ -#if 0 - if(check_buttons()) - return 1; -#endif - pxa_pm_enter_orig(state); - -#if 0 - if(!pm_save_data.rcnr) pm_save_data.rcnr = RCNR; - while(RCNR < ( pm_save_data.rcnr + 3)) { - - /* If we release button, sleep back */ - if(!(data = check_buttons())) { - pm_save_data.rcnr = 0; - return 1; - } - } -#endif - printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n"); - printk(KERN_NOTICE "RCNR = %u pm_save_data.rcnr = %u\n", RCNR, pm_save_data.rcnr); - printk(KERN_NOTICE "Keys pressed: %d\n", data); - pm_save_data.rcnr = 0; - return 0; -} - - -static int zire72_pxa_pm_enter(suspend_state_t state) -{ - pm_save_data.rcnr = 0; - -#if 0 - /* Do not suspend on active keypress */ - if(check_buttons()) - return 0; -#endif - pxa_pm_enter_orig(state); - - while (zire72_enter_suspend(state)) - {} - return 0; -} - - -static struct pm_ops zire72_pm_ops = { - .pm_disk_mode = PM_DISK_FIRMWARE, - .prepare = pxa_pm_prepare, - .enter = zire72_pxa_pm_enter, - .finish = pxa_pm_finish, -}; - -extern struct pm_ops pxa_pm_ops; - static int palmz72_pm_probe(struct device *dev) { printk(KERN_NOTICE "PalmOne Zire72 power management driver registered\n"); @@ -223,14 +117,11 @@ static int __init palmz72_pm_init(void) { - pxa_pm_enter_orig = pxa_pm_ops.enter; - pxa_pm_ops.enter = zire72_pxa_pm_enter; return driver_register(&palmz72_pm_driver); } static void __exit palmz72_pm_exit(void) { - pxa_pm_ops.enter = pxa_pm_enter_orig; driver_unregister(&palmz72_pm_driver); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-03-29 11:02:16
|
Revision: 945 http://svn.sourceforge.net/hackndev/?rev=945&view=rev Author: z72ka Date: 2007-03-29 04:02:13 -0700 (Thu, 29 Mar 2007) Log Message: ----------- palmz72: fixed safety acquisition for suspend - now disabling GPIO reset works 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-03-29 07:33:00 UTC (rev 944) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-03-29 11:02:13 UTC (rev 945) @@ -54,7 +54,7 @@ /* disable GPIO reset - DO NOT REMOVE! */ - PCFR &= PCFR_GPR_EN; + PCFR = PCFR_GPROD; return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-03-29 18:55:04
|
Revision: 947 http://svn.sourceforge.net/hackndev/?rev=947&view=rev Author: z72ka Date: 2007-03-29 11:54:56 -0700 (Thu, 29 Mar 2007) Log Message: ----------- palmz72: enable gpio reset is safety on Z72 ...soory for my latest commit 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-03-29 13:53:13 UTC (rev 946) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-03-29 18:54:56 UTC (rev 947) @@ -54,7 +54,7 @@ /* disable GPIO reset - DO NOT REMOVE! */ - PCFR = PCFR_GPROD; + PCFR &= PCFR_GPR_EN; return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-07-21 07:50:07
|
Revision: 1189 http://svn.sourceforge.net/hackndev/?rev=1189&view=rev Author: bobofdoom Date: 2007-07-21 00:50:05 -0700 (Sat, 21 Jul 2007) Log Message: ----------- PalmZ72: Added logic that (should) enable waking from sleep to RAM via original bootloader. 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-20 15:51:04 UTC (rev 1188) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-07-21 07:50:05 UTC (rev 1189) @@ -52,7 +52,7 @@ /* Turn off USB power */ SET_PALMZ72_GPIO(USB_POWER,0); - + /* disable GPIO reset - DO NOT REMOVE! */ PCFR &= PCFR_GPR_EN; @@ -85,10 +85,40 @@ #define palmz72_resume NULL #endif +static struct { + u32 magic0; /* 0x0 */ + u32 magic1; /* 0x4 */ + u32 resume_addr; /* 0x8 */ + u32 pad[11]; /* 0xc..0x37 */ + + u32 arm_control; /* 0x38 */ + u32 aux_control; /* 0x3c */ + u32 ttb; /* 0x40 */ + u32 domain_access; /* 0x44 */ + u32 process_id; /* 0x48 */ +} palmz72_resume_info = { + .magic0 = 0xb4e6, + .magic1 = 1, + + /* reset state, MMU off etc */ + .arm_control = 0, + .aux_control = 0, + .ttb = 0, + .domain_access = 0, + .process_id = 0, +}; + static void palmz72_pxa_ll_pm_suspend(unsigned long resume_addr) { - /* For future */ - return; + /* hold current GPIO levels on outputs */ + PGSR0 = GPLR0; + PGSR1 = GPLR1; + PGSR2 = GPLR2; + PGSR3 = GPLR3; + + /* setup the resume_info struct for the original bootloader */ + palmz72_resume_info.resume_addr = resume_addr; + PSPR = virt_to_phys(&palmz72_resume_info); } static void palmz72_pxa_ll_pm_resume(void) @@ -104,6 +134,9 @@ static int palmz72_pm_probe(struct device *dev) { printk(KERN_NOTICE "PalmOne Zire72 power management driver registered\n"); +#ifdef CONFIG_PM + pxa_pm_set_ll_ops(&palmz72_ll_pm_ops); +#endif return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |