diff options
author | Ben Dooks <ben-linux@fluff.org> | 2006-12-05 19:50:24 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-12-07 11:17:49 -0500 |
commit | 9073341c2ba5d5e77b3d05d84cf9e3a16e8a7902 (patch) | |
tree | 96e35ea42213836fa949df8f5d4b20f6834f855d | |
parent | f9a8ca1cabf09316d79cab7f04e1390261ff9035 (diff) |
[ARM] 3986/1: H1940: suspend to RAM support
Add support to suspend and resume, using the
H1940's bootloader
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-s3c2410/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-h1940.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/pm-h1940.S | 33 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/s3c2410-pm.c | 14 | ||||
-rw-r--r-- | arch/arm/mm/mmu.c | 5 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/h1940.h | 21 |
6 files changed, 81 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile index d66013365b6b..0cd71dfec447 100644 --- a/arch/arm/mach-s3c2410/Makefile +++ b/arch/arm/mach-s3c2410/Makefile | |||
@@ -77,7 +77,7 @@ obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o | |||
77 | obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o | 77 | obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o |
78 | obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o | 78 | obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o |
79 | obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o | 79 | obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o |
80 | obj-$(CONFIG_ARCH_H1940) += mach-h1940.o | 80 | obj-$(CONFIG_ARCH_H1940) += mach-h1940.o pm-h1940.o |
81 | obj-$(CONFIG_MACH_N30) += mach-n30.o | 81 | obj-$(CONFIG_MACH_N30) += mach-n30.o |
82 | obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o | 82 | obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o |
83 | obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o | 83 | obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o |
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 8c895c077d22..f5b98099a5d9 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/arch/regs-serial.h> | 33 | #include <asm/arch/regs-serial.h> |
34 | #include <asm/arch/regs-lcd.h> | 34 | #include <asm/arch/regs-lcd.h> |
35 | 35 | ||
36 | #include <asm/arch/h1940.h> | ||
36 | #include <asm/arch/h1940-latch.h> | 37 | #include <asm/arch/h1940-latch.h> |
37 | #include <asm/arch/fb.h> | 38 | #include <asm/arch/fb.h> |
38 | 39 | ||
@@ -41,6 +42,7 @@ | |||
41 | #include "clock.h" | 42 | #include "clock.h" |
42 | #include "devs.h" | 43 | #include "devs.h" |
43 | #include "cpu.h" | 44 | #include "cpu.h" |
45 | #include "pm.h" | ||
44 | 46 | ||
45 | static struct map_desc h1940_iodesc[] __initdata = { | 47 | static struct map_desc h1940_iodesc[] __initdata = { |
46 | [0] = { | 48 | [0] = { |
@@ -164,12 +166,16 @@ static void __init h1940_map_io(void) | |||
164 | s3c24xx_init_clocks(0); | 166 | s3c24xx_init_clocks(0); |
165 | s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs)); | 167 | s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs)); |
166 | s3c24xx_set_board(&h1940_board); | 168 | s3c24xx_set_board(&h1940_board); |
169 | |||
170 | /* setup PM */ | ||
171 | |||
172 | memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024); | ||
173 | s3c2410_pm_init(); | ||
167 | } | 174 | } |
168 | 175 | ||
169 | static void __init h1940_init_irq(void) | 176 | static void __init h1940_init_irq(void) |
170 | { | 177 | { |
171 | s3c24xx_init_irq(); | 178 | s3c24xx_init_irq(); |
172 | |||
173 | } | 179 | } |
174 | 180 | ||
175 | static void __init h1940_init(void) | 181 | static void __init h1940_init(void) |
diff --git a/arch/arm/mach-s3c2410/pm-h1940.S b/arch/arm/mach-s3c2410/pm-h1940.S new file mode 100644 index 000000000000..7d66de7ff7db --- /dev/null +++ b/arch/arm/mach-s3c2410/pm-h1940.S | |||
@@ -0,0 +1,33 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/pm-h1940.S | ||
2 | * | ||
3 | * Copyright (c) 2006 Ben Dooks <ben-linux@fluff.org> | ||
4 | * | ||
5 | * H1940 Suspend to RAM | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/linkage.h> | ||
22 | #include <asm/assembler.h> | ||
23 | #include <asm/hardware.h> | ||
24 | #include <asm/arch/map.h> | ||
25 | |||
26 | #include <asm/arch/regs-gpio.h> | ||
27 | |||
28 | .text | ||
29 | .global h1940_pm_return | ||
30 | |||
31 | h1940_pm_return: | ||
32 | mov r0, #S3C2410_PA_GPIO | ||
33 | ldr pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ] | ||
diff --git a/arch/arm/mach-s3c2410/s3c2410-pm.c b/arch/arm/mach-s3c2410/s3c2410-pm.c index e51d76669512..9cd0c104f1cb 100644 --- a/arch/arm/mach-s3c2410/s3c2410-pm.c +++ b/arch/arm/mach-s3c2410/s3c2410-pm.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
33 | 33 | ||
34 | #include <asm/arch/regs-gpio.h> | 34 | #include <asm/arch/regs-gpio.h> |
35 | #include <asm/arch/h1940.h> | ||
35 | 36 | ||
36 | #include "cpu.h" | 37 | #include "cpu.h" |
37 | #include "pm.h" | 38 | #include "pm.h" |
@@ -52,6 +53,19 @@ static void s3c2410_pm_prepare(void) | |||
52 | DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); | 53 | DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); |
53 | DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); | 54 | DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); |
54 | 55 | ||
56 | if (machine_is_h1940()) { | ||
57 | void *base = phys_to_virt(H1940_SUSPEND_CHECK); | ||
58 | unsigned long ptr; | ||
59 | unsigned long calc = 0; | ||
60 | |||
61 | /* generate check for the bootloader to check on resume */ | ||
62 | |||
63 | for (ptr = 0; ptr < 0x40000; ptr += 0x400) | ||
64 | calc += __raw_readl(base+ptr); | ||
65 | |||
66 | __raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM)); | ||
67 | } | ||
68 | |||
55 | if ( machine_is_aml_m5900() ) | 69 | if ( machine_is_aml_m5900() ) |
56 | s3c2410_gpio_setpin(S3C2410_GPF2, 1); | 70 | s3c2410_gpio_setpin(S3C2410_GPF2, 1); |
57 | 71 | ||
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 445bc3b951e6..f2d0d6f78973 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -619,6 +619,11 @@ void __init reserve_node_zero(pg_data_t *pgdat) | |||
619 | if (machine_is_p720t()) | 619 | if (machine_is_p720t()) |
620 | res_size = 0x00014000; | 620 | res_size = 0x00014000; |
621 | 621 | ||
622 | if (machine_is_h1940()) { | ||
623 | reserve_bootmem_node(pgdat, 0x30003000, 0x1000); | ||
624 | reserve_bootmem_node(pgdat, 0x30081000, 0x1000); | ||
625 | } | ||
626 | |||
622 | #ifdef CONFIG_SA1111 | 627 | #ifdef CONFIG_SA1111 |
623 | /* | 628 | /* |
624 | * Because of the SA1111 DMA bug, we want to preserve our | 629 | * Because of the SA1111 DMA bug, we want to preserve our |
diff --git a/include/asm-arm/arch-s3c2410/h1940.h b/include/asm-arm/arch-s3c2410/h1940.h new file mode 100644 index 000000000000..6135592e60f2 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/h1940.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/h1940.h | ||
2 | * | ||
3 | * Copyright 2006 Ben Dooks <ben-linux@fluff.org> | ||
4 | * | ||
5 | * H1940 definitions | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_ARCH_H1940_H | ||
13 | #define __ASM_ARCH_H1940_H | ||
14 | |||
15 | #define H1940_SUSPEND_CHECKSUM (0x30003ff8) | ||
16 | #define H1940_SUSPEND_RESUMEAT (0x30081000) | ||
17 | #define H1940_SUSPEND_CHECK (0x30080000) | ||
18 | |||
19 | extern void h1940_pm_return(void); | ||
20 | |||
21 | #endif /* __ASM_ARCH_H1940_H */ | ||