aboutsummaryrefslogtreecommitdiff
path: root/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch
diff options
context:
space:
mode:
Diffstat (limited to 'linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch')
-rw-r--r--linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch187
1 files changed, 187 insertions, 0 deletions
diff --git a/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch b/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch
new file mode 100644
index 0000000..b00ddcd
--- /dev/null
+++ b/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch
@@ -0,0 +1,187 @@
+From e73ac678d32e5748c73902591922b0e9b5b6c182 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Thu, 27 May 2010 15:53:03 +0200
+Subject: [PATCH 12/14] n30: Basic suspend to ram for Acer n30 / n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/Makefile | 1 +
+ arch/arm/mach-s3c2410/Kconfig | 1 +
+ arch/arm/mach-s3c2410/Makefile.boot | 11 +++++++----
+ arch/arm/mach-s3c2410/include/mach/h1940.h | 1 +
+ arch/arm/mach-s3c2410/mach-n30.c | 22 ++++++++++++++++++++++
+ arch/arm/mach-s3c2410/pm-h1940.S | 2 ++
+ arch/arm/mach-s3c2410/sleep.S | 3 +++
+ 7 files changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/Makefile b/arch/arm/Makefile
+index 59c1ce8..40ec8d4 100644
+--- a/arch/arm/Makefile
++++ b/arch/arm/Makefile
+@@ -119,6 +119,7 @@ textofs-y := 0x00008000
+ textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000
+ # We don't want the htc bootloader to corrupt kernel during resume
+ textofs-$(CONFIG_PM_H1940) := 0x00108000
++textofs-$(CONFIG_MACH_N35) := 0x00208000
+ # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
+ ifeq ($(CONFIG_ARCH_SA1100),y)
+ textofs-$(CONFIG_SA1111) := 0x00208000
+diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
+index 1d55349..bcb7061 100644
+--- a/arch/arm/mach-s3c2410/Kconfig
++++ b/arch/arm/mach-s3c2410/Kconfig
+@@ -98,6 +98,7 @@ config MACH_N30
+ bool "Acer N30 family"
+ select CPU_S3C2410
+ select MACH_N35
++ select PM_H1940 if PM
+ select S3C_DEV_USB_HOST
+ select S3C_DEV_NAND
+ select S3C2410_SETUP_TS
+diff --git a/arch/arm/mach-s3c2410/Makefile.boot b/arch/arm/mach-s3c2410/Makefile.boot
+index 58c1dd7..aaf5bdc 100644
+--- a/arch/arm/mach-s3c2410/Makefile.boot
++++ b/arch/arm/mach-s3c2410/Makefile.boot
+@@ -1,7 +1,10 @@
++zreladdr-y := 0x30008000
++params_phys-y := 0x30000100
+ ifeq ($(CONFIG_PM_H1940),y)
+- zreladdr-y := 0x30108000
++ zreladdr-y := 0x30108000
+ params_phys-y := 0x30100100
+-else
+- zreladdr-y := 0x30008000
+- params_phys-y := 0x30000100
++endif
++ifeq ($(CONFIG_MACH_N35),y)
++ zreladdr-y := 0x30208000
++ params_phys-y := 0x30200100
+ endif
+diff --git a/arch/arm/mach-s3c2410/include/mach/h1940.h b/arch/arm/mach-s3c2410/include/mach/h1940.h
+index 4559784..be48128 100644
+--- a/arch/arm/mach-s3c2410/include/mach/h1940.h
++++ b/arch/arm/mach-s3c2410/include/mach/h1940.h
+@@ -17,5 +17,6 @@
+ #define H1940_SUSPEND_CHECK (0x30080000)
+
+ extern void h1940_pm_return(void);
++extern void h1940_pm_return_end(void);
+
+ #endif /* __ASM_ARCH_H1940_H */
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 3c784e4..34a7e9e 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -19,6 +19,7 @@
+
+ #include <linux/delay.h>
+ #include <linux/gpio_keys.h>
++#include <linux/memblock.h>
+ #include <linux/init.h>
+ #include <linux/gpio.h>
+ #include <linux/input.h>
+@@ -27,6 +28,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/pwm_backlight.h>
+ #include <linux/serial_core.h>
++#include <linux/sysdev.h>
+ #include <linux/timer.h>
+ #include <linux/io.h>
+ #include <linux/mmc/host.h>
+@@ -36,6 +38,7 @@
+ #include <asm/mach-types.h>
+
+ #include <mach/fb.h>
++#include <mach/h1940.h>
+ #include <mach/leds-gpio.h>
+ #include <mach/regs-gpio.h>
+ #include <mach/regs-lcd.h>
+@@ -49,6 +52,7 @@
+
+ #include <plat/clock.h>
+ #include <plat/cpu.h>
++#include <plat/pm.h>
+ #include <plat/devs.h>
+ #include <plat/mci.h>
+ #include <plat/nand.h>
+@@ -58,6 +62,8 @@
+
+ #include <video/platform_lcd.h>
+
++#define N35_SUSPEND_RESUMEAT (S3C2410_SDRAM_PA + 0x201000)
++
+ #ifdef CONFIG_MTD_PARTITIONS
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/nand.h>
+@@ -816,12 +822,26 @@ static void __init n30_map_io(void)
+ s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
+ }
+
++/* Acer N30/N35 need to reserve this memory to suspend */
++static void __init n30_reserve(void)
++{
++ memblock_reserve(0x30201000, 0x1000);
++}
++
+ /* GPB3 is the line that controls the pull-up for the USB D+ line */
+
+ static void __init n30_init(void)
+ {
+ WARN_ON(gpio_request(S3C2410_GPG(4), "mmc power"));
+
++ /* setup PM */
++
++#ifdef CONFIG_PM_H1940
++ memcpy(phys_to_virt(N35_SUSPEND_RESUMEAT), h1940_pm_return,
++ h1940_pm_return_end - h1940_pm_return);
++#endif
++ s3c_pm_init();
++
+ s3c24xx_fb_set_platdata(&n30_fb_info);
+ s3c24xx_ts_set_platdata(&n30_ts_cfg);
+ s3c24xx_udc_set_platdata(&n30_udc_cfg);
+@@ -892,6 +912,7 @@ MACHINE_START(N30, "Acer-N30")
+ .init_machine = n30_init,
+ .init_irq = s3c24xx_init_irq,
+ .map_io = n30_map_io,
++ .reserve = n30_reserve,
+ MACHINE_END
+
+ MACHINE_START(N35, "Acer-N35")
+@@ -904,4 +925,5 @@ MACHINE_START(N35, "Acer-N35")
+ .init_machine = n30_init,
+ .init_irq = s3c24xx_init_irq,
+ .map_io = n30_map_io,
++ .reserve = n30_reserve,
+ MACHINE_END
+diff --git a/arch/arm/mach-s3c2410/pm-h1940.S b/arch/arm/mach-s3c2410/pm-h1940.S
+index c93bf2d..020ed0c 100644
+--- a/arch/arm/mach-s3c2410/pm-h1940.S
++++ b/arch/arm/mach-s3c2410/pm-h1940.S
+@@ -27,7 +27,9 @@
+
+ .text
+ .global h1940_pm_return
++ .global h1940_pm_return_end
+
+ h1940_pm_return:
+ mov r0, #S3C2410_PA_GPIO
+ ldr pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ]
++h1940_pm_return_end:
+diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S
+index dd5b638..84ecef3 100644
+--- a/arch/arm/mach-s3c2410/sleep.S
++++ b/arch/arm/mach-s3c2410/sleep.S
+@@ -51,6 +51,9 @@ ENTRY(s3c2410_cpu_suspend)
+
+ orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command
+ orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
++ @ turn off data port pull ups
++ orr r8, r8, #S3C2410_MISCCR_SPUCR_HDIS
++ orr r8, r8, #S3C2410_MISCCR_SPUCR_LDIS
+ orr r9, r9, #S3C2410_CLKCON_POWER @ power down command
+
+ teq pc, #0 @ first as a trial-run to load cache
+--
+1.7.3.1
+