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>
16 #include <mach/hardware.h>
19 #include <mach/regs-gpio.h>
20 #include <mach/regs-clock.h>
23 * S3C24XX_DEBUG_RESUME is dangerous if your bootloader does not
24 * reset the UART configuration, only enable if you really need this!
26 //#define S3C24XX_DEBUG_RESUME
30 /* sleep magic, to allow the bootloader to check for an valid
31 * image to resume to. Must be the first word before the
32 * s3c_cpu_resume entry.
39 * resume code entry for bootloader to call
43 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
46 @@ load UART to allow us to print the two characters for
49 mov r2, #S3C24XX_PA_UART & 0xff000000
50 orr r2, r2, #S3C24XX_PA_UART & 0xff000
53 /* SMDK2440 LED set */
54 mov r14, #S3C24XX_PA_GPIO
55 ldr r12, [ r14, #0x54 ]
58 str r12, [ r14, #0x54 ]
61 #ifdef S3C24XX_DEBUG_RESUME
63 strb r3, [ r2, #S3C2410_UTXH ]
65 ldrb r14, [ r3, #S3C2410_UTRSTAT ]
66 tst r14, #S3C2410_UTRSTAT_TXE
68 #endif /* S3C24XX_DEBUG_RESUME */