2017-12-26 03:54:33 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2010-01-26 09:45:40 +08:00
|
|
|
/* linux/arch/arm/plat-s3c64xx/sleep.S
|
2009-03-11 02:19:35 +08:00
|
|
|
*
|
|
|
|
* Copyright 2008 Openmoko, Inc.
|
|
|
|
* Copyright 2008 Simtec Electronics
|
|
|
|
* Ben Dooks <ben@simtec.co.uk>
|
|
|
|
* http://armlinux.simtec.co.uk/
|
|
|
|
*
|
|
|
|
* S3C64XX CPU sleep code
|
2017-12-26 03:54:33 +08:00
|
|
|
*/
|
2009-03-11 02:19:35 +08:00
|
|
|
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
#include <asm/assembler.h>
|
2019-09-03 00:37:30 +08:00
|
|
|
#include "map.h"
|
2009-03-11 02:19:35 +08:00
|
|
|
|
|
|
|
#undef S3C64XX_VA_GPIO
|
|
|
|
#define S3C64XX_VA_GPIO (0x0)
|
|
|
|
|
2019-09-03 00:37:30 +08:00
|
|
|
#include "regs-gpio.h"
|
2009-03-11 02:19:35 +08:00
|
|
|
|
|
|
|
#define LL_UART (S3C_PA_UART + (0x400 * CONFIG_S3C_LOWLEVEL_UART_PORT))
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
/* Sleep magic, the word before the resume entry point so that the
|
|
|
|
* bootloader can check for a resumeable image. */
|
|
|
|
|
|
|
|
.word 0x2bedf00d
|
|
|
|
|
|
|
|
/* s3c_cpu_reusme
|
|
|
|
*
|
|
|
|
* This is the entry point, stored by whatever method the bootloader
|
|
|
|
* requires to get the kernel runnign again. This code expects to be
|
|
|
|
* entered with no caches live and the MMU disabled. It will then
|
|
|
|
* restore the MMU and other basic CP registers saved and restart
|
|
|
|
* the kernel C code to finish the resume code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ENTRY(s3c_cpu_resume)
|
|
|
|
msr cpsr_c, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
|
|
|
|
ldr r2, =LL_UART /* for debug */
|
|
|
|
|
|
|
|
#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
|
2011-05-06 08:37:17 +08:00
|
|
|
|
|
|
|
#define S3C64XX_GPNCON (S3C64XX_GPN_BASE + 0x00)
|
|
|
|
#define S3C64XX_GPNDAT (S3C64XX_GPN_BASE + 0x04)
|
|
|
|
|
|
|
|
#define S3C64XX_GPN_CONMASK(__gpio) (0x3 << ((__gpio) * 2))
|
|
|
|
#define S3C64XX_GPN_OUTPUT(__gpio) (0x1 << ((__gpio) * 2))
|
|
|
|
|
2009-03-11 02:19:35 +08:00
|
|
|
/* Initialise the GPIO state if we are debugging via the SMDK LEDs,
|
|
|
|
* as the uboot version supplied resets these to inputs during the
|
|
|
|
* resume checks.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ldr r3, =S3C64XX_PA_GPIO
|
|
|
|
ldr r0, [ r3, #S3C64XX_GPNCON ]
|
|
|
|
bic r0, r0, #(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) | \
|
|
|
|
S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15))
|
|
|
|
orr r0, r0, #(S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) | \
|
|
|
|
S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15))
|
|
|
|
str r0, [ r3, #S3C64XX_GPNCON ]
|
|
|
|
|
|
|
|
ldr r0, [ r3, #S3C64XX_GPNDAT ]
|
|
|
|
bic r0, r0, #0xf << 12 @ GPN12..15
|
|
|
|
orr r0, r0, #1 << 15 @ GPN15
|
|
|
|
str r0, [ r3, #S3C64XX_GPNDAT ]
|
|
|
|
#endif
|
2011-02-07 01:39:31 +08:00
|
|
|
b cpu_resume
|