diff options
Diffstat (limited to 'packages/linux/linux-ezx-2.6.23/patches/ezx-pm.patch')
-rw-r--r-- | packages/linux/linux-ezx-2.6.23/patches/ezx-pm.patch | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/packages/linux/linux-ezx-2.6.23/patches/ezx-pm.patch b/packages/linux/linux-ezx-2.6.23/patches/ezx-pm.patch new file mode 100644 index 0000000000..aa2d83b24e --- /dev/null +++ b/packages/linux/linux-ezx-2.6.23/patches/ezx-pm.patch @@ -0,0 +1,108 @@ +Index: linux-2.6.23/arch/arm/mach-pxa/pxa27x.c +=================================================================== +--- linux-2.6.23.orig/arch/arm/mach-pxa/pxa27x.c 2007-10-09 22:31:38.000000000 +0200 ++++ linux-2.6.23/arch/arm/mach-pxa/pxa27x.c 2007-10-23 12:25:34.000000000 +0200 +@@ -25,6 +25,10 @@ + #include <asm/arch/pm.h> + #include <asm/arch/dma.h> + ++#ifdef CONFIG_PXA_EZX ++#include <asm/arch/ezx.h> ++#endif ++ + #include "generic.h" + #include "devices.h" + +@@ -192,7 +196,12 @@ + void pxa27x_cpu_pm_restore(unsigned long *sleep_save) + { + /* ensure not to come back here if it wasn't intended */ ++#ifdef CONFIG_PXA_EZX ++ *(unsigned long *)(phys_to_virt(RESUME_ADDR)) = 0; ++ *(unsigned long *)(phys_to_virt(FLAG_ADDR)) = OFF_FLAG; ++#else + PSPR = 0; ++#endif + + /* restore registers */ + RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); +@@ -242,7 +251,13 @@ + break; + case PM_SUSPEND_MEM: + /* set resume return address */ ++#ifdef CONFIG_PXA_EZX ++ /* set EZX flags for blob - WM */ ++ *(unsigned long *)(phys_to_virt(RESUME_ADDR)) = virt_to_phys(pxa_cpu_resume); ++ *(unsigned long *)(phys_to_virt(FLAG_ADDR)) = SLEEP_FLAG; ++#else + PSPR = virt_to_phys(pxa_cpu_resume); ++#endif + pxa27x_cpu_suspend(PWRMODE_SLEEP); + break; + } +Index: linux-2.6.23/arch/arm/mach-pxa/ezx.c +=================================================================== +--- linux-2.6.23.orig/arch/arm/mach-pxa/ezx.c 2007-10-23 12:23:34.000000000 +0200 ++++ linux-2.6.23/arch/arm/mach-pxa/ezx.c 2007-10-23 12:27:30.000000000 +0200 +@@ -19,6 +19,7 @@ + #include <asm/arch/pxa-regs.h> + #include <asm/arch/ohci.h> + #include <asm/arch/ezx.h> ++#include <asm/arch/system.h> + + #include "generic.h" + +@@ -122,8 +123,53 @@ + &ezxbp_device, + }; + ++/* PM */ ++extern int bp_handshake_passed(void); ++ ++static void ezx_reboot_poweroff(char mode) ++{ ++ *(unsigned long *)(phys_to_virt(BPSIG_ADDR)) = NO_FLAG; ++ cpu_proc_fin(); ++ ++#ifdef CONFIG_EZX_BP ++ if (pxa_gpio_get_value(GPIO_BB_WDI) == 0) { ++ *(unsigned long *)(phys_to_virt(BPSIG_ADDR)) = WDI_FLAG; ++ ++ /* reset BP */ ++ pxa_gpio_set_value(GPIO_BB_RESET, 0); ++ mdelay(1); ++ pxa_gpio_set_value(GPIO_BB_RESET, 1); ++ ++ if (mode == 'z') { ++ arch_reset('h'); ++ while(1); ++ } ++ } ++#endif ++ if (mode == 'z') ++ /* Panic! Ask PCAP to turn both processors off */ ++ pxa_gpio_set_value(GPIO_WDI_AP, 0); ++ else ++ arm_machine_restart(mode); ++ ++ while(1); ++} ++ ++static inline void ezx_poweroff(void) ++{ ++ ezx_reboot_poweroff('z'); ++} ++ ++static inline void ezx_restart(char mode) ++{ ++ ezx_reboot_poweroff(mode); ++} ++ + static int __init ezx_init(void) + { ++ pm_power_off = ezx_poweroff; ++ arm_pm_restart = ezx_restart; ++ + CKEN = (1 << CKEN_OSTIMER) | (1 << CKEN_MEMC); + + pxa_gpio_mode(GPIO_ICL_FFRXD_MD); |