diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index 43fcf2e..a76028d 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c @@ -93,11 +93,11 @@ static unsigned long palmte2_pin_config[] __initdata = { GPIO77_LCD_BIAS, /* GPIO KEYS */ - GPIO5_GPIO, /* notes */ - GPIO7_GPIO, /* tasks */ - GPIO11_GPIO, /* calendar */ - GPIO13_GPIO, /* contacts */ - GPIO14_GPIO, /* center */ + GPIO5_GPIO | WAKEUP_ON_LEVEL_HIGH, /* notes */ + GPIO7_GPIO | WAKEUP_ON_LEVEL_HIGH, /* tasks */ + GPIO11_GPIO | WAKEUP_ON_LEVEL_HIGH, /* calendar */ + GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* contacts */ + GPIO14_GPIO | WAKEUP_ON_LEVEL_HIGH, /* center */ GPIO19_GPIO, /* left */ GPIO20_GPIO, /* right */ GPIO21_GPIO, /* down */ @@ -421,6 +421,104 @@ static struct pxafb_mach_info palmte2_lcd_screen = { }; /****************************************************************************** + * Power management - standby + ******************************************************************************/ +#include +#include + +static u32 *addr; + +#define PALMTE2_WL_SIZE 40 +static u32 resume[PALMTE2_WL_SIZE] = { + 0xe3a00901, + 0xe2801b0a, + 0xe59f208c, + 0xe28f7028, + 0xe287720a, + 0xe5802000, + 0xe5812000, + 0xe3a00000, + 0xee070f17, + 0xee080f17, + 0xee12af10, + 0xe1a00000, + 0xe24ff004, + 0xe1a00000, + 0xe1a0f007, + 0xee110f10, + 0xe3c00c23, + 0xe3c00087, + 0xe3800a01, + 0xee010f10, + 0xee12af10, + 0xe1a00000, + 0xe24ff004, + 0xe3a00000, + 0xee080f17, + 0xee12af10, + 0xe1a00000, + 0xe24ff004, + 0xe3a0020a, + 0xe2801902, + 0xe2800901, + 0xe1a02001, + 0xe4913004, + 0xe4803004, + 0xe1520000, + 0x124ff014, + 0xe3a00101, + 0xe380060f, + 0xe590f008, + 0xa0000c1a +}; + +static int palmte2_pm_suspend(struct sys_device *dev, pm_message_t msg) +{ + int i; + PWER = 0xd; + PRER = 0xd; + PFER = 0xd; + + /* Save TTB to 0xa0008000 */ + for(i = 0; i < 0x1000; i++) + addr[i + 0x1000] = addr[i]; + + /* Set the marker for bootloader */ + addr[0x200] = 0x0a; + + return 0; +} + +static struct sysdev_class palmte2_pm_class = { + .name = "palmte2_pm", + .suspend = palmte2_pm_suspend, +}; + +static struct sys_device palmte2_pm_device = { + .cls = &palmte2_pm_class, +}; + +static int __init palmte2_pm_init(void) +{ + int i; + sysdev_class_register(&palmte2_pm_class); + sysdev_register(&palmte2_pm_device); + + /* Copy the bootloading code */ + addr = phys_to_virt(0xa0000010); + for(i = 0; i < PALMTE2_WL_SIZE; i++) + addr[i] = resume[i]; + + /* Point to TTB (for backup) */ + addr = phys_to_virt(0xa0004000); + + return 0; +} + +device_initcall(palmte2_pm_init); + + +/****************************************************************************** * Machine init ******************************************************************************/ static struct platform_device *devices[] __initdata = { diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 8df2b08..b869042 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -833,6 +833,14 @@ void __init reserve_node_zero(pg_data_t *pgdat) reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, BOOTMEM_EXCLUSIVE); + reserve_bootmem_node(pgdat, 0xa0000000, 0x1000, + BOOTMEM_EXCLUSIVE); + reserve_bootmem_node(pgdat, 0xa0008000, 0x4000, + BOOTMEM_EXCLUSIVE); + + + + #ifdef CONFIG_SA1111 /* * Because of the SA1111 DMA bug, we want to preserve our