2017-12-25 22:54:32 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
/*
|
2007-02-11 20:31:01 +03:00
|
|
|
* Copyright (c) 2004 Simtec Electronics
|
|
|
|
* Ben Dooks <ben@simtec.co.uk>
|
|
|
|
*
|
|
|
|
* S3C2410 Power Manager (Suspend-To-RAM) support
|
|
|
|
*
|
|
|
|
* Based on PXA/SA1100 sleep code by:
|
|
|
|
* Nicolas Pitre, (c) 2002 Monta Vista Software Inc
|
|
|
|
* Cliff Brake, (c) 2001
|
2017-12-25 22:54:32 +03:00
|
|
|
*/
|
2007-02-11 20:31:01 +03:00
|
|
|
|
|
|
|
#include <linux/linkage.h>
|
2014-02-14 05:32:45 +04:00
|
|
|
#include <linux/serial_s3c.h>
|
2007-02-11 20:31:01 +03:00
|
|
|
#include <asm/assembler.h>
|
2019-09-02 19:37:30 +03:00
|
|
|
#include "map.h"
|
2007-02-11 20:31:01 +03:00
|
|
|
|
2019-09-02 19:37:30 +03:00
|
|
|
#include "regs-gpio.h"
|
|
|
|
#include "regs-clock.h"
|
2007-02-11 20:31:01 +03:00
|
|
|
|
2017-07-17 08:48:09 +03:00
|
|
|
/*
|
|
|
|
* S3C24XX_DEBUG_RESUME is dangerous if your bootloader does not
|
2007-02-11 20:31:01 +03:00
|
|
|
* reset the UART configuration, only enable if you really need this!
|
2017-07-17 08:48:09 +03:00
|
|
|
*/
|
|
|
|
//#define S3C24XX_DEBUG_RESUME
|
2007-02-11 20:31:01 +03:00
|
|
|
|
|
|
|
.text
|
|
|
|
|
2007-09-30 12:59:15 +04:00
|
|
|
/* sleep magic, to allow the bootloader to check for an valid
|
|
|
|
* image to resume to. Must be the first word before the
|
2008-12-12 03:24:19 +03:00
|
|
|
* s3c_cpu_resume entry.
|
2007-09-30 12:59:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
.word 0x2bedf00d
|
|
|
|
|
2008-12-12 03:24:19 +03:00
|
|
|
/* s3c_cpu_resume
|
2007-02-11 20:31:01 +03:00
|
|
|
*
|
|
|
|
* resume code entry for bootloader to call
|
|
|
|
*/
|
|
|
|
|
2008-12-12 03:24:19 +03:00
|
|
|
ENTRY(s3c_cpu_resume)
|
2007-02-11 20:31:01 +03:00
|
|
|
mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
|
|
|
|
msr cpsr_c, r0
|
|
|
|
|
|
|
|
@@ load UART to allow us to print the two characters for
|
|
|
|
@@ resume debug
|
|
|
|
|
|
|
|
mov r2, #S3C24XX_PA_UART & 0xff000000
|
|
|
|
orr r2, r2, #S3C24XX_PA_UART & 0xff000
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* SMDK2440 LED set */
|
|
|
|
mov r14, #S3C24XX_PA_GPIO
|
|
|
|
ldr r12, [ r14, #0x54 ]
|
|
|
|
bic r12, r12, #3<<4
|
|
|
|
orr r12, r12, #1<<7
|
|
|
|
str r12, [ r14, #0x54 ]
|
|
|
|
#endif
|
|
|
|
|
2017-07-17 08:48:09 +03:00
|
|
|
#ifdef S3C24XX_DEBUG_RESUME
|
2007-02-11 20:31:01 +03:00
|
|
|
mov r3, #'L'
|
|
|
|
strb r3, [ r2, #S3C2410_UTXH ]
|
|
|
|
1001:
|
|
|
|
ldrb r14, [ r3, #S3C2410_UTRSTAT ]
|
|
|
|
tst r14, #S3C2410_UTRSTAT_TXE
|
|
|
|
beq 1001b
|
2017-07-17 08:48:09 +03:00
|
|
|
#endif /* S3C24XX_DEBUG_RESUME */
|
2007-02-11 20:31:01 +03:00
|
|
|
|
2011-02-06 20:39:31 +03:00
|
|
|
b cpu_resume
|