aboutsummaryrefslogtreecommitdiff
path: root/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch
blob: fd24427c29735e79ce8673eba852babbc8080a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
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
--- linux-3.1.6/arch/arm/mach-s3c2410/include/mach/h1940.h.orig	2011-12-21 22:00:46.000000000 +0100
+++ linux-3.1.6/arch/arm/mach-s3c2410/include/mach/h1940.h	2011-12-31 17:01:21.985102436 +0100
@@ -17,6 +17,8 @@
 #define H1940_SUSPEND_CHECK		(0x30080000)
 
 extern void h1940_pm_return(void);
+extern void h1940_pm_return_end(void);
+
 extern int h1940_led_blink_set(unsigned gpio, int state,
 	unsigned long *delay_on, unsigned long *delay_off);

--- linux-3.1.6/arch/arm/mach-s3c2410/mach-n30.c.orig	2011-12-31 16:57:30.185718019 +0100
+++ linux-3.1.6/arch/arm/mach-s3c2410/mach-n30.c	2011-12-31 17:01:45.708299675 +0100
@@ -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)
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
@@ -796,12 +802,26 @@
 	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);
@@ -867,6 +887,7 @@
 	.init_machine	= n30_init,
 	.init_irq	= s3c24xx_init_irq,
 	.map_io		= n30_map_io,
+	.reserve	= n30_reserve,
 MACHINE_END
 
 MACHINE_START(N35, "Acer-N35")
@@ -877,4 +898,5 @@
 	.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