1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * S3C2410 Power Manager (Suspend-To-RAM) support
8 * Based on PXA/SA1100 sleep code by:
9 * Nicolas Pitre, (c) 2002 Monta Vista Software Inc
10 * Cliff Brake, (c) 2001
13 #include <linux/linkage.h>
14 #include <linux/serial_s3c.h>
15 #include <asm/assembler.h>
18 #include "regs-gpio.h"
19 #include "regs-clock.h"
22 * S3C24XX_DEBUG_RESUME is dangerous if your bootloader does not
23 * reset the UART configuration, only enable if you really need this!
25 //#define S3C24XX_DEBUG_RESUME
29 /* sleep magic, to allow the bootloader to check for an valid
30 * image to resume to. Must be the first word before the
31 * s3c_cpu_resume entry.
38 * resume code entry for bootloader to call
42 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
45 @@ load UART to allow us to print the two characters for
48 mov r2, #S3C24XX_PA_UART & 0xff000000
49 orr r2, r2, #S3C24XX_PA_UART & 0xff000
52 /* SMDK2440 LED set */
53 mov r14, #S3C24XX_PA_GPIO
54 ldr r12, [ r14, #0x54 ]
57 str r12, [ r14, #0x54 ]
60 #ifdef S3C24XX_DEBUG_RESUME
62 strb r3, [ r2, #S3C2410_UTXH ]
64 ldrb r14, [ r3, #S3C2410_UTRSTAT ]
65 tst r14, #S3C2410_UTRSTAT_TXE
67 #endif /* S3C24XX_DEBUG_RESUME */