Uwe Kleine-König | 5886269 | 2007-05-09 07:51:49 +0200 | [diff] [blame] | 1 | /* linux/arch/arm/plat-s3c24xx/sleep.S |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 2 | * |
| 3 | * Copyright (c) 2004 Simtec Electronics |
| 4 | * Ben Dooks <ben@simtec.co.uk> |
| 5 | * |
| 6 | * S3C2410 Power Manager (Suspend-To-RAM) support |
| 7 | * |
| 8 | * Based on PXA/SA1100 sleep code by: |
| 9 | * Nicolas Pitre, (c) 2002 Monta Vista Software Inc |
| 10 | * Cliff Brake, (c) 2001 |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation; either version 2 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program; if not, write to the Free Software |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 | */ |
| 26 | |
| 27 | #include <linux/linkage.h> |
Tushar Behera | 334a1c7 | 2014-02-14 10:32:45 +0900 | [diff] [blame] | 28 | #include <linux/serial_s3c.h> |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 29 | #include <asm/assembler.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | #include <mach/hardware.h> |
| 31 | #include <mach/map.h> |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 32 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 33 | #include <mach/regs-gpio.h> |
| 34 | #include <mach/regs-clock.h> |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 35 | |
| 36 | /* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not |
| 37 | * reset the UART configuration, only enable if you really need this! |
| 38 | */ |
| 39 | //#define CONFIG_DEBUG_RESUME |
| 40 | |
| 41 | .text |
| 42 | |
Ben Dooks | 6c729af | 2007-09-30 09:59:15 +0100 | [diff] [blame] | 43 | /* sleep magic, to allow the bootloader to check for an valid |
| 44 | * image to resume to. Must be the first word before the |
Ben Dooks | ef30e14 | 2008-12-12 00:24:19 +0000 | [diff] [blame] | 45 | * s3c_cpu_resume entry. |
Ben Dooks | 6c729af | 2007-09-30 09:59:15 +0100 | [diff] [blame] | 46 | */ |
| 47 | |
| 48 | .word 0x2bedf00d |
| 49 | |
Ben Dooks | ef30e14 | 2008-12-12 00:24:19 +0000 | [diff] [blame] | 50 | /* s3c_cpu_resume |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 51 | * |
| 52 | * resume code entry for bootloader to call |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 53 | */ |
| 54 | |
Ben Dooks | ef30e14 | 2008-12-12 00:24:19 +0000 | [diff] [blame] | 55 | ENTRY(s3c_cpu_resume) |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 56 | mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE |
| 57 | msr cpsr_c, r0 |
| 58 | |
| 59 | @@ load UART to allow us to print the two characters for |
| 60 | @@ resume debug |
| 61 | |
| 62 | mov r2, #S3C24XX_PA_UART & 0xff000000 |
| 63 | orr r2, r2, #S3C24XX_PA_UART & 0xff000 |
| 64 | |
| 65 | #if 0 |
| 66 | /* SMDK2440 LED set */ |
| 67 | mov r14, #S3C24XX_PA_GPIO |
| 68 | ldr r12, [ r14, #0x54 ] |
| 69 | bic r12, r12, #3<<4 |
| 70 | orr r12, r12, #1<<7 |
| 71 | str r12, [ r14, #0x54 ] |
| 72 | #endif |
| 73 | |
| 74 | #ifdef CONFIG_DEBUG_RESUME |
| 75 | mov r3, #'L' |
| 76 | strb r3, [ r2, #S3C2410_UTXH ] |
| 77 | 1001: |
| 78 | ldrb r14, [ r3, #S3C2410_UTRSTAT ] |
| 79 | tst r14, #S3C2410_UTRSTAT_TXE |
| 80 | beq 1001b |
| 81 | #endif /* CONFIG_DEBUG_RESUME */ |
| 82 | |
Russell King | 2e2f3d3 | 2011-02-06 17:39:31 +0000 | [diff] [blame] | 83 | b cpu_resume |