xref: /linux/arch/arm/mach-omap2/sleep34xx.S (revision 458e999eb14a301d4176783c8fcb277f5d009b4e)
18bd22949SKevin Hilman/*
28bd22949SKevin Hilman * linux/arch/arm/mach-omap2/sleep.S
38bd22949SKevin Hilman *
48bd22949SKevin Hilman * (C) Copyright 2007
58bd22949SKevin Hilman * Texas Instruments
68bd22949SKevin Hilman * Karthik Dasu <karthik-dp@ti.com>
78bd22949SKevin Hilman *
88bd22949SKevin Hilman * (C) Copyright 2004
98bd22949SKevin Hilman * Texas Instruments, <www.ti.com>
108bd22949SKevin Hilman * Richard Woodruff <r-woodruff2@ti.com>
118bd22949SKevin Hilman *
128bd22949SKevin Hilman * This program is free software; you can redistribute it and/or
138bd22949SKevin Hilman * modify it under the terms of the GNU General Public License as
148bd22949SKevin Hilman * published by the Free Software Foundation; either version 2 of
158bd22949SKevin Hilman * the License, or (at your option) any later version.
168bd22949SKevin Hilman *
178bd22949SKevin Hilman * This program is distributed in the hope that it will be useful,
188bd22949SKevin Hilman * but WITHOUT ANY WARRANTY; without even the implied warranty of
198bd22949SKevin Hilman * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE.  See the
208bd22949SKevin Hilman * GNU General Public License for more details.
218bd22949SKevin Hilman *
228bd22949SKevin Hilman * You should have received a copy of the GNU General Public License
238bd22949SKevin Hilman * along with this program; if not, write to the Free Software
248bd22949SKevin Hilman * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
258bd22949SKevin Hilman * MA 02111-1307 USA
268bd22949SKevin Hilman */
278bd22949SKevin Hilman#include <linux/linkage.h>
288bd22949SKevin Hilman#include <asm/assembler.h>
298bd22949SKevin Hilman#include <mach/io.h>
308bd22949SKevin Hilman
3189139dceSPeter 'p2' De Schrijver#include "cm.h"
328bd22949SKevin Hilman#include "prm.h"
338bd22949SKevin Hilman#include "sdrc.h"
344814ced5SPaul Walmsley#include "control.h"
358bd22949SKevin Hilman
36a89b6f00SRajendra Nayak#define SDRC_SCRATCHPAD_SEM_V	0xfa00291c
37a89b6f00SRajendra Nayak
388bd22949SKevin Hilman#define PM_PREPWSTST_CORE_V	OMAP34XX_PRM_REGADDR(CORE_MOD, \
398bd22949SKevin Hilman				OMAP3430_PM_PREPWSTST)
400795a75aSTero Kristo#define PM_PREPWSTST_CORE_P	0x48306AE8
418bd22949SKevin Hilman#define PM_PREPWSTST_MPU_V	OMAP34XX_PRM_REGADDR(MPU_MOD, \
428bd22949SKevin Hilman				OMAP3430_PM_PREPWSTST)
4337903009SAbhijit Pagare#define PM_PWSTCTRL_MPU_P	OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
4489139dceSPeter 'p2' De Schrijver#define CM_IDLEST1_CORE_V	OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
459d93b8a2SPeter 'p2' De Schrijver#define CM_IDLEST_CKGEN_V	OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
4627d59a4aSTero Kristo#define SRAM_BASE_P		0x40200000
4727d59a4aSTero Kristo#define CONTROL_STAT		0x480022F0
48*458e999eSNishanth Menon#define CONTROL_MEM_RTA_CTRL	(OMAP343X_CTRL_BASE\
49*458e999eSNishanth Menon					+ OMAP36XX_CONTROL_MEM_RTA_CTRL)
508bd22949SKevin Hilman#define SCRATCHPAD_MEM_OFFS	0x310 /* Move this as correct place is
518bd22949SKevin Hilman				       * available */
5261255ab9SRajendra Nayak#define SCRATCHPAD_BASE_P	(OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\
5361255ab9SRajendra Nayak						+ SCRATCHPAD_MEM_OFFS)
548bd22949SKevin Hilman#define SDRC_POWER_V		OMAP34XX_SDRC_REGADDR(SDRC_POWER)
550795a75aSTero Kristo#define SDRC_SYSCONFIG_P	(OMAP343X_SDRC_BASE + SDRC_SYSCONFIG)
560795a75aSTero Kristo#define SDRC_MR_0_P		(OMAP343X_SDRC_BASE + SDRC_MR_0)
570795a75aSTero Kristo#define SDRC_EMR2_0_P		(OMAP343X_SDRC_BASE + SDRC_EMR2_0)
580795a75aSTero Kristo#define SDRC_MANUAL_0_P		(OMAP343X_SDRC_BASE + SDRC_MANUAL_0)
590795a75aSTero Kristo#define SDRC_MR_1_P		(OMAP343X_SDRC_BASE + SDRC_MR_1)
600795a75aSTero Kristo#define SDRC_EMR2_1_P		(OMAP343X_SDRC_BASE + SDRC_EMR2_1)
610795a75aSTero Kristo#define SDRC_MANUAL_1_P		(OMAP343X_SDRC_BASE + SDRC_MANUAL_1)
6289139dceSPeter 'p2' De Schrijver#define SDRC_DLLA_STATUS_V	OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
6389139dceSPeter 'p2' De Schrijver#define SDRC_DLLA_CTRL_V	OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
648bd22949SKevin Hilman
658bd22949SKevin Hilman        .text
6646cd09a7SUwe Kleine-König/* Function to acquire the semaphore in scratchpad */
67a89b6f00SRajendra NayakENTRY(lock_scratchpad_sem)
68a89b6f00SRajendra Nayak	stmfd	sp!, {lr}	@ save registers on stack
69a89b6f00SRajendra Nayakwait_sem:
70a89b6f00SRajendra Nayak	mov	r0,#1
71a89b6f00SRajendra Nayak	ldr	r1, sdrc_scratchpad_sem
72a89b6f00SRajendra Nayakwait_loop:
73a89b6f00SRajendra Nayak	ldr	r2, [r1]	@ load the lock value
74a89b6f00SRajendra Nayak	cmp	r2, r0		@ is the lock free ?
75a89b6f00SRajendra Nayak	beq	wait_loop	@ not free...
76a89b6f00SRajendra Nayak	swp	r2, r0, [r1]	@ semaphore free so lock it and proceed
77a89b6f00SRajendra Nayak	cmp	r2, r0		@ did we succeed ?
78a89b6f00SRajendra Nayak	beq	wait_sem	@ no - try again
79a89b6f00SRajendra Nayak	ldmfd	sp!, {pc}	@ restore regs and return
80a89b6f00SRajendra Nayaksdrc_scratchpad_sem:
81a89b6f00SRajendra Nayak        .word SDRC_SCRATCHPAD_SEM_V
82a89b6f00SRajendra NayakENTRY(lock_scratchpad_sem_sz)
83a89b6f00SRajendra Nayak        .word   . - lock_scratchpad_sem
84a89b6f00SRajendra Nayak
85a89b6f00SRajendra Nayak        .text
86a89b6f00SRajendra Nayak/* Function to release the scratchpad semaphore */
87a89b6f00SRajendra NayakENTRY(unlock_scratchpad_sem)
88a89b6f00SRajendra Nayak	stmfd	sp!, {lr}	@ save registers on stack
89a89b6f00SRajendra Nayak	ldr	r3, sdrc_scratchpad_sem
90a89b6f00SRajendra Nayak	mov	r2,#0
91a89b6f00SRajendra Nayak	str	r2,[r3]
92a89b6f00SRajendra Nayak	ldmfd	sp!, {pc}	@ restore regs and return
93a89b6f00SRajendra NayakENTRY(unlock_scratchpad_sem_sz)
94a89b6f00SRajendra Nayak        .word   . - unlock_scratchpad_sem
95a89b6f00SRajendra Nayak
96a89b6f00SRajendra Nayak	.text
978bd22949SKevin Hilman/* Function call to get the restore pointer for resume from OFF */
988bd22949SKevin HilmanENTRY(get_restore_pointer)
998bd22949SKevin Hilman        stmfd   sp!, {lr}     @ save registers on stack
1008bd22949SKevin Hilman	adr	r0, restore
1018bd22949SKevin Hilman        ldmfd   sp!, {pc}     @ restore regs and return
1028bd22949SKevin HilmanENTRY(get_restore_pointer_sz)
1030795a75aSTero Kristo        .word   . - get_restore_pointer
104*458e999eSNishanth Menon	.text
105*458e999eSNishanth Menon/* Function call to get the restore pointer for 3630 resume from OFF */
106*458e999eSNishanth MenonENTRY(get_omap3630_restore_pointer)
107*458e999eSNishanth Menon        stmfd   sp!, {lr}     @ save registers on stack
108*458e999eSNishanth Menon	adr	r0, restore_3630
109*458e999eSNishanth Menon        ldmfd   sp!, {pc}     @ restore regs and return
110*458e999eSNishanth MenonENTRY(get_omap3630_restore_pointer_sz)
111*458e999eSNishanth Menon        .word   . - get_omap3630_restore_pointer
1120795a75aSTero Kristo
1130795a75aSTero Kristo	.text
1140795a75aSTero Kristo/* Function call to get the restore pointer for for ES3 to resume from OFF */
1150795a75aSTero KristoENTRY(get_es3_restore_pointer)
1160795a75aSTero Kristo	stmfd	sp!, {lr}	@ save registers on stack
1170795a75aSTero Kristo	adr	r0, restore_es3
1180795a75aSTero Kristo	ldmfd	sp!, {pc}	@ restore regs and return
1190795a75aSTero KristoENTRY(get_es3_restore_pointer_sz)
1200795a75aSTero Kristo	.word	. - get_es3_restore_pointer
1210795a75aSTero Kristo
1220795a75aSTero KristoENTRY(es3_sdrc_fix)
1230795a75aSTero Kristo	ldr	r4, sdrc_syscfg		@ get config addr
1240795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1250795a75aSTero Kristo	tst	r5, #0x100		@ is part access blocked
1260795a75aSTero Kristo	it	eq
1270795a75aSTero Kristo	biceq	r5, r5, #0x100		@ clear bit if set
1280795a75aSTero Kristo	str	r5, [r4]		@ write back change
1290795a75aSTero Kristo	ldr	r4, sdrc_mr_0		@ get config addr
1300795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1310795a75aSTero Kristo	str	r5, [r4]		@ write back change
1320795a75aSTero Kristo	ldr	r4, sdrc_emr2_0		@ get config addr
1330795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1340795a75aSTero Kristo	str	r5, [r4]		@ write back change
1350795a75aSTero Kristo	ldr	r4, sdrc_manual_0	@ get config addr
1360795a75aSTero Kristo	mov	r5, #0x2		@ autorefresh command
1370795a75aSTero Kristo	str	r5, [r4]		@ kick off refreshes
1380795a75aSTero Kristo	ldr	r4, sdrc_mr_1		@ get config addr
1390795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1400795a75aSTero Kristo	str	r5, [r4]		@ write back change
1410795a75aSTero Kristo	ldr	r4, sdrc_emr2_1		@ get config addr
1420795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1430795a75aSTero Kristo	str	r5, [r4]		@ write back change
1440795a75aSTero Kristo	ldr	r4, sdrc_manual_1	@ get config addr
1450795a75aSTero Kristo	mov	r5, #0x2		@ autorefresh command
1460795a75aSTero Kristo	str	r5, [r4]		@ kick off refreshes
1470795a75aSTero Kristo	bx	lr
1480795a75aSTero Kristosdrc_syscfg:
1490795a75aSTero Kristo	.word	SDRC_SYSCONFIG_P
1500795a75aSTero Kristosdrc_mr_0:
1510795a75aSTero Kristo	.word	SDRC_MR_0_P
1520795a75aSTero Kristosdrc_emr2_0:
1530795a75aSTero Kristo	.word	SDRC_EMR2_0_P
1540795a75aSTero Kristosdrc_manual_0:
1550795a75aSTero Kristo	.word	SDRC_MANUAL_0_P
1560795a75aSTero Kristosdrc_mr_1:
1570795a75aSTero Kristo	.word	SDRC_MR_1_P
1580795a75aSTero Kristosdrc_emr2_1:
1590795a75aSTero Kristo	.word	SDRC_EMR2_1_P
1600795a75aSTero Kristosdrc_manual_1:
1610795a75aSTero Kristo	.word	SDRC_MANUAL_1_P
1620795a75aSTero KristoENTRY(es3_sdrc_fix_sz)
1630795a75aSTero Kristo	.word	. - es3_sdrc_fix
16427d59a4aSTero Kristo
16527d59a4aSTero Kristo/* Function to call rom code to save secure ram context */
16627d59a4aSTero KristoENTRY(save_secure_ram_context)
16727d59a4aSTero Kristo	stmfd	sp!, {r1-r12, lr}	@ save registers on stack
16827d59a4aSTero Kristosave_secure_ram_debug:
16927d59a4aSTero Kristo	/* b save_secure_ram_debug */	@ enable to debug save code
17027d59a4aSTero Kristo	adr	r3, api_params		@ r3 points to parameters
17127d59a4aSTero Kristo	str	r0, [r3,#0x4]		@ r0 has sdram address
17227d59a4aSTero Kristo	ldr	r12, high_mask
17327d59a4aSTero Kristo	and	r3, r3, r12
17427d59a4aSTero Kristo	ldr	r12, sram_phy_addr_mask
17527d59a4aSTero Kristo	orr	r3, r3, r12
17627d59a4aSTero Kristo	mov	r0, #25			@ set service ID for PPA
17727d59a4aSTero Kristo	mov	r12, r0			@ copy secure service ID in r12
17827d59a4aSTero Kristo	mov	r1, #0			@ set task id for ROM code in r1
179ba50ea7eSKalle Jokiniemi	mov	r2, #4			@ set some flags in r2, r6
18027d59a4aSTero Kristo	mov	r6, #0xff
18127d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
18227d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
18327d59a4aSTero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
18427d59a4aSTero Kristo	nop
18527d59a4aSTero Kristo	nop
18627d59a4aSTero Kristo	nop
18727d59a4aSTero Kristo	nop
18827d59a4aSTero Kristo	ldmfd	sp!, {r1-r12, pc}
18927d59a4aSTero Kristosram_phy_addr_mask:
19027d59a4aSTero Kristo	.word	SRAM_BASE_P
19127d59a4aSTero Kristohigh_mask:
19227d59a4aSTero Kristo	.word	0xffff
19327d59a4aSTero Kristoapi_params:
19427d59a4aSTero Kristo	.word	0x4, 0x0, 0x0, 0x1, 0x1
19527d59a4aSTero KristoENTRY(save_secure_ram_context_sz)
19627d59a4aSTero Kristo	.word	. - save_secure_ram_context
19727d59a4aSTero Kristo
1988bd22949SKevin Hilman/*
1998bd22949SKevin Hilman * Forces OMAP into idle state
2008bd22949SKevin Hilman *
2018bd22949SKevin Hilman * omap34xx_suspend() - This bit of code just executes the WFI
2028bd22949SKevin Hilman * for normal idles.
2038bd22949SKevin Hilman *
2048bd22949SKevin Hilman * Note: This code get's copied to internal SRAM at boot. When the OMAP
2058bd22949SKevin Hilman *	 wakes up it continues execution at the point it went to sleep.
2068bd22949SKevin Hilman */
2078bd22949SKevin HilmanENTRY(omap34xx_cpu_suspend)
2088bd22949SKevin Hilman	stmfd	sp!, {r0-r12, lr}		@ save registers on stack
2098bd22949SKevin Hilmanloop:
2108bd22949SKevin Hilman	/*b	loop*/	@Enable to debug by stepping through code
2118bd22949SKevin Hilman	/* r0 contains restore pointer in sdram */
2128bd22949SKevin Hilman	/* r1 contains information about saving context */
2138bd22949SKevin Hilman	ldr     r4, sdrc_power          @ read the SDRC_POWER register
2148bd22949SKevin Hilman	ldr     r5, [r4]                @ read the contents of SDRC_POWER
2158bd22949SKevin Hilman	orr     r5, r5, #0x40           @ enable self refresh on idle req
2168bd22949SKevin Hilman	str     r5, [r4]                @ write back to SDRC_POWER register
2178bd22949SKevin Hilman
2188bd22949SKevin Hilman	cmp	r1, #0x0
2198bd22949SKevin Hilman	/* If context save is required, do that and execute wfi */
2208bd22949SKevin Hilman	bne	save_context_wfi
2218bd22949SKevin Hilman	/* Data memory barrier and Data sync barrier */
2228bd22949SKevin Hilman	mov	r1, #0
2238bd22949SKevin Hilman	mcr	p15, 0, r1, c7, c10, 4
2248bd22949SKevin Hilman	mcr	p15, 0, r1, c7, c10, 5
2258bd22949SKevin Hilman
2268bd22949SKevin Hilman	wfi				@ wait for interrupt
2278bd22949SKevin Hilman
2288bd22949SKevin Hilman	nop
2298bd22949SKevin Hilman	nop
2308bd22949SKevin Hilman	nop
2318bd22949SKevin Hilman	nop
2328bd22949SKevin Hilman	nop
2338bd22949SKevin Hilman	nop
2348bd22949SKevin Hilman	nop
2358bd22949SKevin Hilman	nop
2368bd22949SKevin Hilman	nop
2378bd22949SKevin Hilman	nop
23889139dceSPeter 'p2' De Schrijver	bl wait_sdrc_ok
2398bd22949SKevin Hilman
2408bd22949SKevin Hilman	ldmfd	sp!, {r0-r12, pc}		@ restore regs and return
2410795a75aSTero Kristorestore_es3:
2420795a75aSTero Kristo	/*b restore_es3*/		@ Enable to debug restore code
2430795a75aSTero Kristo	ldr	r5, pm_prepwstst_core_p
2440795a75aSTero Kristo	ldr	r4, [r5]
2450795a75aSTero Kristo	and	r4, r4, #0x3
2460795a75aSTero Kristo	cmp	r4, #0x0	@ Check if previous power state of CORE is OFF
2470795a75aSTero Kristo	bne	restore
2480795a75aSTero Kristo	adr	r0, es3_sdrc_fix
2490795a75aSTero Kristo	ldr	r1, sram_base
2500795a75aSTero Kristo	ldr	r2, es3_sdrc_fix_sz
2510795a75aSTero Kristo	mov	r2, r2, ror #2
2520795a75aSTero Kristocopy_to_sram:
2530795a75aSTero Kristo	ldmia	r0!, {r3}	@ val = *src
2540795a75aSTero Kristo	stmia	r1!, {r3}	@ *dst = val
2550795a75aSTero Kristo	subs	r2, r2, #0x1	@ num_words--
2560795a75aSTero Kristo	bne	copy_to_sram
2570795a75aSTero Kristo	ldr	r1, sram_base
2580795a75aSTero Kristo	blx	r1
259*458e999eSNishanth Menon	b	restore
260*458e999eSNishanth Menon
261*458e999eSNishanth Menonrestore_3630:
262*458e999eSNishanth Menon	/*b restore_es3630*/		@ Enable to debug restore code
263*458e999eSNishanth Menon	ldr	r1, pm_prepwstst_core_p
264*458e999eSNishanth Menon	ldr	r2, [r1]
265*458e999eSNishanth Menon	and	r2, r2, #0x3
266*458e999eSNishanth Menon	cmp	r2, #0x0	@ Check if previous power state of CORE is OFF
267*458e999eSNishanth Menon	bne	restore
268*458e999eSNishanth Menon	/* Disable RTA before giving control */
269*458e999eSNishanth Menon	ldr	r1, control_mem_rta
270*458e999eSNishanth Menon	mov	r2, #OMAP36XX_RTA_DISABLE
271*458e999eSNishanth Menon	str	r2, [r1]
272*458e999eSNishanth Menon	/* Fall thru for the remaining logic */
2738bd22949SKevin Hilmanrestore:
2748bd22949SKevin Hilman	/* b restore*/  @ Enable to debug restore code
2758bd22949SKevin Hilman        /* Check what was the reason for mpu reset and store the reason in r9*/
2768bd22949SKevin Hilman        /* 1 - Only L1 and logic lost */
2778bd22949SKevin Hilman        /* 2 - Only L2 lost - In this case, we wont be here */
2788bd22949SKevin Hilman        /* 3 - Both L1 and L2 lost */
2798bd22949SKevin Hilman	ldr     r1, pm_pwstctrl_mpu
2808bd22949SKevin Hilman	ldr	r2, [r1]
2818bd22949SKevin Hilman	and     r2, r2, #0x3
2828bd22949SKevin Hilman	cmp     r2, #0x0	@ Check if target power state was OFF or RET
2838bd22949SKevin Hilman        moveq   r9, #0x3        @ MPU OFF => L1 and L2 lost
2848bd22949SKevin Hilman	movne	r9, #0x1	@ Only L1 and L2 lost => avoid L2 invalidation
2858bd22949SKevin Hilman	bne	logic_l1_restore
28627d59a4aSTero Kristo	ldr	r0, control_stat
28727d59a4aSTero Kristo	ldr	r1, [r0]
28827d59a4aSTero Kristo	and	r1, #0x700
28927d59a4aSTero Kristo	cmp	r1, #0x300
29027d59a4aSTero Kristo	beq	l2_inv_gp
29127d59a4aSTero Kristo	mov	r0, #40		@ set service ID for PPA
29227d59a4aSTero Kristo	mov	r12, r0		@ copy secure Service ID in r12
29327d59a4aSTero Kristo	mov	r1, #0		@ set task id for ROM code in r1
29427d59a4aSTero Kristo	mov	r2, #4		@ set some flags in r2, r6
29527d59a4aSTero Kristo	mov	r6, #0xff
29627d59a4aSTero Kristo	adr	r3, l2_inv_api_params	@ r3 points to dummy parameters
29727d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
29827d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
29927d59a4aSTero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
30027d59a4aSTero Kristo	/* Write to Aux control register to set some bits */
30127d59a4aSTero Kristo	mov	r0, #42		@ set service ID for PPA
30227d59a4aSTero Kristo	mov	r12, r0		@ copy secure Service ID in r12
30327d59a4aSTero Kristo	mov	r1, #0		@ set task id for ROM code in r1
30427d59a4aSTero Kristo	mov	r2, #4		@ set some flags in r2, r6
30527d59a4aSTero Kristo	mov	r6, #0xff
306a087cad9STero Kristo	ldr	r4, scratchpad_base
307a087cad9STero Kristo	ldr	r3, [r4, #0xBC]	@ r3 points to parameters
30827d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
30927d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
31027d59a4aSTero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
31127d59a4aSTero Kristo
31279dcfdd4STero Kristo#ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE
31379dcfdd4STero Kristo	/* Restore L2 aux control register */
31479dcfdd4STero Kristo	@ set service ID for PPA
31579dcfdd4STero Kristo	mov	r0, #CONFIG_OMAP3_L2_AUX_SECURE_SERVICE_SET_ID
31679dcfdd4STero Kristo	mov	r12, r0		@ copy service ID in r12
31779dcfdd4STero Kristo	mov	r1, #0		@ set task ID for ROM code in r1
31879dcfdd4STero Kristo	mov	r2, #4		@ set some flags in r2, r6
31979dcfdd4STero Kristo	mov	r6, #0xff
32079dcfdd4STero Kristo	ldr	r4, scratchpad_base
32179dcfdd4STero Kristo	ldr	r3, [r4, #0xBC]
32279dcfdd4STero Kristo	adds	r3, r3, #8	@ r3 points to parameters
32379dcfdd4STero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
32479dcfdd4STero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
32579dcfdd4STero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
32679dcfdd4STero Kristo#endif
32727d59a4aSTero Kristo	b	logic_l1_restore
32827d59a4aSTero Kristol2_inv_api_params:
32927d59a4aSTero Kristo	.word   0x1, 0x00
33027d59a4aSTero Kristol2_inv_gp:
3318bd22949SKevin Hilman	/* Execute smi to invalidate L2 cache */
3328bd22949SKevin Hilman	mov r12, #0x1                         @ set up to invalide L2
3338bd22949SKevin Hilmansmi:    .word 0xE1600070		@ Call SMI monitor (smieq)
33427d59a4aSTero Kristo	/* Write to Aux control register to set some bits */
335a087cad9STero Kristo	ldr	r4, scratchpad_base
336a087cad9STero Kristo	ldr	r3, [r4,#0xBC]
337a087cad9STero Kristo	ldr	r0, [r3,#4]
33827d59a4aSTero Kristo	mov	r12, #0x3
33927d59a4aSTero Kristo	.word 0xE1600070	@ Call SMI monitor (smieq)
34079dcfdd4STero Kristo	ldr	r4, scratchpad_base
34179dcfdd4STero Kristo	ldr	r3, [r4,#0xBC]
34279dcfdd4STero Kristo	ldr	r0, [r3,#12]
34379dcfdd4STero Kristo	mov	r12, #0x2
34479dcfdd4STero Kristo	.word 0xE1600070	@ Call SMI monitor (smieq)
3458bd22949SKevin Hilmanlogic_l1_restore:
3468bd22949SKevin Hilman	mov	r1, #0
3478bd22949SKevin Hilman	/* Invalidate all instruction caches to PoU
3488bd22949SKevin Hilman	 * and flush branch target cache */
3498bd22949SKevin Hilman	mcr	p15, 0, r1, c7, c5, 0
3508bd22949SKevin Hilman
3518bd22949SKevin Hilman	ldr	r4, scratchpad_base
3528bd22949SKevin Hilman	ldr	r3, [r4,#0xBC]
35379dcfdd4STero Kristo	adds	r3, r3, #16
3548bd22949SKevin Hilman	ldmia	r3!, {r4-r6}
3558bd22949SKevin Hilman	mov	sp, r4
3568bd22949SKevin Hilman	msr	spsr_cxsf, r5
3578bd22949SKevin Hilman	mov	lr, r6
3588bd22949SKevin Hilman
3598bd22949SKevin Hilman	ldmia	r3!, {r4-r9}
3608bd22949SKevin Hilman	/* Coprocessor access Control Register */
3618bd22949SKevin Hilman	mcr p15, 0, r4, c1, c0, 2
3628bd22949SKevin Hilman
3638bd22949SKevin Hilman	/* TTBR0 */
3648bd22949SKevin Hilman	MCR p15, 0, r5, c2, c0, 0
3658bd22949SKevin Hilman	/* TTBR1 */
3668bd22949SKevin Hilman	MCR p15, 0, r6, c2, c0, 1
3678bd22949SKevin Hilman	/* Translation table base control register */
3688bd22949SKevin Hilman	MCR p15, 0, r7, c2, c0, 2
3698bd22949SKevin Hilman	/*domain access Control Register */
3708bd22949SKevin Hilman	MCR p15, 0, r8, c3, c0, 0
3718bd22949SKevin Hilman	/* data fault status Register */
3728bd22949SKevin Hilman	MCR p15, 0, r9, c5, c0, 0
3738bd22949SKevin Hilman
3748bd22949SKevin Hilman	ldmia  r3!,{r4-r8}
3758bd22949SKevin Hilman	/* instruction fault status Register */
3768bd22949SKevin Hilman	MCR p15, 0, r4, c5, c0, 1
3778bd22949SKevin Hilman	/*Data Auxiliary Fault Status Register */
3788bd22949SKevin Hilman	MCR p15, 0, r5, c5, c1, 0
3798bd22949SKevin Hilman	/*Instruction Auxiliary Fault Status Register*/
3808bd22949SKevin Hilman	MCR p15, 0, r6, c5, c1, 1
3818bd22949SKevin Hilman	/*Data Fault Address Register */
3828bd22949SKevin Hilman	MCR p15, 0, r7, c6, c0, 0
3838bd22949SKevin Hilman	/*Instruction Fault Address Register*/
3848bd22949SKevin Hilman	MCR p15, 0, r8, c6, c0, 2
3858bd22949SKevin Hilman	ldmia  r3!,{r4-r7}
3868bd22949SKevin Hilman
3878bd22949SKevin Hilman	/* user r/w thread and process ID */
3888bd22949SKevin Hilman	MCR p15, 0, r4, c13, c0, 2
3898bd22949SKevin Hilman	/* user ro thread and process ID */
3908bd22949SKevin Hilman	MCR p15, 0, r5, c13, c0, 3
3918bd22949SKevin Hilman	/*Privileged only thread and process ID */
3928bd22949SKevin Hilman	MCR p15, 0, r6, c13, c0, 4
3938bd22949SKevin Hilman	/* cache size selection */
3948bd22949SKevin Hilman	MCR p15, 2, r7, c0, c0, 0
3958bd22949SKevin Hilman	ldmia  r3!,{r4-r8}
3968bd22949SKevin Hilman	/* Data TLB lockdown registers */
3978bd22949SKevin Hilman	MCR p15, 0, r4, c10, c0, 0
3988bd22949SKevin Hilman	/* Instruction TLB lockdown registers */
3998bd22949SKevin Hilman	MCR p15, 0, r5, c10, c0, 1
4008bd22949SKevin Hilman	/* Secure or Nonsecure Vector Base Address */
4018bd22949SKevin Hilman	MCR p15, 0, r6, c12, c0, 0
4028bd22949SKevin Hilman	/* FCSE PID */
4038bd22949SKevin Hilman	MCR p15, 0, r7, c13, c0, 0
4048bd22949SKevin Hilman	/* Context PID */
4058bd22949SKevin Hilman	MCR p15, 0, r8, c13, c0, 1
4068bd22949SKevin Hilman
4078bd22949SKevin Hilman	ldmia  r3!,{r4-r5}
4088bd22949SKevin Hilman	/* primary memory remap register */
4098bd22949SKevin Hilman	MCR p15, 0, r4, c10, c2, 0
4108bd22949SKevin Hilman	/*normal memory remap register */
4118bd22949SKevin Hilman	MCR p15, 0, r5, c10, c2, 1
4128bd22949SKevin Hilman
4138bd22949SKevin Hilman	/* Restore cpsr */
4148bd22949SKevin Hilman	ldmia	r3!,{r4}	/*load CPSR from SDRAM*/
4158bd22949SKevin Hilman	msr	cpsr, r4	/*store cpsr */
4168bd22949SKevin Hilman
4178bd22949SKevin Hilman	/* Enabling MMU here */
4188bd22949SKevin Hilman	mrc	p15, 0, r7, c2, c0, 2 /* Read TTBRControl */
4198bd22949SKevin Hilman	/* Extract N (0:2) bits and decide whether to use TTBR0 or TTBR1*/
4208bd22949SKevin Hilman	and	r7, #0x7
4218bd22949SKevin Hilman	cmp	r7, #0x0
4228bd22949SKevin Hilman	beq	usettbr0
4238bd22949SKevin Hilmanttbr_error:
4248bd22949SKevin Hilman	/* More work needs to be done to support N[0:2] value other than 0
4258bd22949SKevin Hilman	* So looping here so that the error can be detected
4268bd22949SKevin Hilman	*/
4278bd22949SKevin Hilman	b	ttbr_error
4288bd22949SKevin Hilmanusettbr0:
4298bd22949SKevin Hilman	mrc	p15, 0, r2, c2, c0, 0
4308bd22949SKevin Hilman	ldr	r5, ttbrbit_mask
4318bd22949SKevin Hilman	and	r2, r5
4328bd22949SKevin Hilman	mov	r4, pc
4338bd22949SKevin Hilman	ldr	r5, table_index_mask
4348bd22949SKevin Hilman	and	r4, r5 /* r4 = 31 to 20 bits of pc */
4358bd22949SKevin Hilman	/* Extract the value to be written to table entry */
4368bd22949SKevin Hilman	ldr	r1, table_entry
4378bd22949SKevin Hilman	add	r1, r1, r4 /* r1 has value to be written to table entry*/
4388bd22949SKevin Hilman	/* Getting the address of table entry to modify */
4398bd22949SKevin Hilman	lsr	r4, #18
4408bd22949SKevin Hilman	add	r2, r4 /* r2 has the location which needs to be modified */
4418bd22949SKevin Hilman	/* Storing previous entry of location being modified */
4428bd22949SKevin Hilman	ldr	r5, scratchpad_base
4438bd22949SKevin Hilman	ldr	r4, [r2]
4448bd22949SKevin Hilman	str	r4, [r5, #0xC0]
4458bd22949SKevin Hilman	/* Modify the table entry */
4468bd22949SKevin Hilman	str	r1, [r2]
4478bd22949SKevin Hilman	/* Storing address of entry being modified
4488bd22949SKevin Hilman	 * - will be restored after enabling MMU */
4498bd22949SKevin Hilman	ldr	r5, scratchpad_base
4508bd22949SKevin Hilman	str	r2, [r5, #0xC4]
4518bd22949SKevin Hilman
4528bd22949SKevin Hilman	mov	r0, #0
4538bd22949SKevin Hilman	mcr	p15, 0, r0, c7, c5, 4	@ Flush prefetch buffer
4548bd22949SKevin Hilman	mcr	p15, 0, r0, c7, c5, 6	@ Invalidate branch predictor array
4558bd22949SKevin Hilman	mcr	p15, 0, r0, c8, c5, 0	@ Invalidate instruction TLB
4568bd22949SKevin Hilman	mcr	p15, 0, r0, c8, c6, 0	@ Invalidate data TLB
4578bd22949SKevin Hilman	/* Restore control register  but dont enable caches here*/
4588bd22949SKevin Hilman	/* Caches will be enabled after restoring MMU table entry */
4598bd22949SKevin Hilman	ldmia	r3!, {r4}
4608bd22949SKevin Hilman	/* Store previous value of control register in scratchpad */
4618bd22949SKevin Hilman	str	r4, [r5, #0xC8]
4628bd22949SKevin Hilman	ldr	r2, cache_pred_disable_mask
4638bd22949SKevin Hilman	and	r4, r2
4648bd22949SKevin Hilman	mcr	p15, 0, r4, c1, c0, 0
4658bd22949SKevin Hilman
4668bd22949SKevin Hilman	ldmfd	sp!, {r0-r12, pc}		@ restore regs and return
4678bd22949SKevin Hilmansave_context_wfi:
4688bd22949SKevin Hilman	/*b	save_context_wfi*/	@ enable to debug save code
4698bd22949SKevin Hilman	mov	r8, r0 /* Store SDRAM address in r8 */
470a087cad9STero Kristo	mrc	p15, 0, r5, c1, c0, 1	@ Read Auxiliary Control Register
471a087cad9STero Kristo	mov	r4, #0x1		@ Number of parameters for restore call
47279dcfdd4STero Kristo	stmia	r8!, {r4-r5}		@ Push parameters for restore call
47379dcfdd4STero Kristo	mrc	p15, 1, r5, c9, c0, 2	@ Read L2 AUX ctrl register
47479dcfdd4STero Kristo	stmia	r8!, {r4-r5}		@ Push parameters for restore call
4758bd22949SKevin Hilman        /* Check what that target sleep state is:stored in r1*/
4768bd22949SKevin Hilman        /* 1 - Only L1 and logic lost */
4778bd22949SKevin Hilman        /* 2 - Only L2 lost */
4788bd22949SKevin Hilman        /* 3 - Both L1 and L2 lost */
4798bd22949SKevin Hilman	cmp	r1, #0x2 /* Only L2 lost */
4808bd22949SKevin Hilman	beq	clean_l2
4818bd22949SKevin Hilman	cmp	r1, #0x1 /* L2 retained */
4828bd22949SKevin Hilman	/* r9 stores whether to clean L2 or not*/
4838bd22949SKevin Hilman	moveq	r9, #0x0 /* Dont Clean L2 */
4848bd22949SKevin Hilman	movne	r9, #0x1 /* Clean L2 */
4858bd22949SKevin Hilmanl1_logic_lost:
4868bd22949SKevin Hilman	/* Store sp and spsr to SDRAM */
4878bd22949SKevin Hilman	mov	r4, sp
4888bd22949SKevin Hilman	mrs	r5, spsr
4898bd22949SKevin Hilman	mov	r6, lr
4908bd22949SKevin Hilman	stmia	r8!, {r4-r6}
4918bd22949SKevin Hilman	/* Save all ARM registers */
4928bd22949SKevin Hilman	/* Coprocessor access control register */
4938bd22949SKevin Hilman	mrc	p15, 0, r6, c1, c0, 2
4948bd22949SKevin Hilman	stmia	r8!, {r6}
4958bd22949SKevin Hilman	/* TTBR0, TTBR1 and Translation table base control */
4968bd22949SKevin Hilman	mrc	p15, 0, r4, c2, c0, 0
4978bd22949SKevin Hilman	mrc	p15, 0, r5, c2, c0, 1
4988bd22949SKevin Hilman	mrc	p15, 0, r6, c2, c0, 2
4998bd22949SKevin Hilman	stmia	r8!, {r4-r6}
5008bd22949SKevin Hilman	/* Domain access control register, data fault status register,
5018bd22949SKevin Hilman	and instruction fault status register */
5028bd22949SKevin Hilman	mrc	p15, 0, r4, c3, c0, 0
5038bd22949SKevin Hilman	mrc	p15, 0, r5, c5, c0, 0
5048bd22949SKevin Hilman	mrc	p15, 0, r6, c5, c0, 1
5058bd22949SKevin Hilman	stmia	r8!, {r4-r6}
5068bd22949SKevin Hilman	/* Data aux fault status register, instruction aux fault status,
5078bd22949SKevin Hilman	datat fault address register and instruction fault address register*/
5088bd22949SKevin Hilman	mrc	p15, 0, r4, c5, c1, 0
5098bd22949SKevin Hilman	mrc	p15, 0, r5, c5, c1, 1
5108bd22949SKevin Hilman	mrc	p15, 0, r6, c6, c0, 0
5118bd22949SKevin Hilman	mrc	p15, 0, r7, c6, c0, 2
5128bd22949SKevin Hilman	stmia	r8!, {r4-r7}
5138bd22949SKevin Hilman	/* user r/w thread and process ID, user r/o thread and process ID,
5148bd22949SKevin Hilman	priv only thread and process ID, cache size selection */
5158bd22949SKevin Hilman	mrc	p15, 0, r4, c13, c0, 2
5168bd22949SKevin Hilman	mrc	p15, 0, r5, c13, c0, 3
5178bd22949SKevin Hilman	mrc	p15, 0, r6, c13, c0, 4
5188bd22949SKevin Hilman	mrc	p15, 2, r7, c0, c0, 0
5198bd22949SKevin Hilman	stmia	r8!, {r4-r7}
5208bd22949SKevin Hilman	/* Data TLB lockdown, instruction TLB lockdown registers */
5218bd22949SKevin Hilman	mrc	p15, 0, r5, c10, c0, 0
5228bd22949SKevin Hilman	mrc	p15, 0, r6, c10, c0, 1
5238bd22949SKevin Hilman	stmia	r8!, {r5-r6}
5248bd22949SKevin Hilman	/* Secure or non secure vector base address, FCSE PID, Context PID*/
5258bd22949SKevin Hilman	mrc	p15, 0, r4, c12, c0, 0
5268bd22949SKevin Hilman	mrc	p15, 0, r5, c13, c0, 0
5278bd22949SKevin Hilman	mrc	p15, 0, r6, c13, c0, 1
5288bd22949SKevin Hilman	stmia	r8!, {r4-r6}
5298bd22949SKevin Hilman	/* Primary remap, normal remap registers */
5308bd22949SKevin Hilman	mrc	p15, 0, r4, c10, c2, 0
5318bd22949SKevin Hilman	mrc	p15, 0, r5, c10, c2, 1
5328bd22949SKevin Hilman	stmia	r8!,{r4-r5}
5338bd22949SKevin Hilman
5348bd22949SKevin Hilman	/* Store current cpsr*/
5358bd22949SKevin Hilman	mrs	r2, cpsr
5368bd22949SKevin Hilman	stmia	r8!, {r2}
5378bd22949SKevin Hilman
5388bd22949SKevin Hilman	mrc	p15, 0, r4, c1, c0, 0
5398bd22949SKevin Hilman	/* save control register */
5408bd22949SKevin Hilman	stmia	r8!, {r4}
5418bd22949SKevin Hilmanclean_caches:
5428bd22949SKevin Hilman	/* Clean Data or unified cache to POU*/
5438bd22949SKevin Hilman	/* How to invalidate only L1 cache???? - #FIX_ME# */
5448bd22949SKevin Hilman	/* mcr	p15, 0, r11, c7, c11, 1 */
5458bd22949SKevin Hilman	cmp	r9, #1 /* Check whether L2 inval is required or not*/
5468bd22949SKevin Hilman	bne	skip_l2_inval
5478bd22949SKevin Hilmanclean_l2:
5480bd40535SRichard Woodruff	/*
5490bd40535SRichard Woodruff	 * Jump out to kernel flush routine
5500bd40535SRichard Woodruff	 *  - reuse that code is better
5510bd40535SRichard Woodruff	 *  - it executes in a cached space so is faster than refetch per-block
5520bd40535SRichard Woodruff	 *  - should be faster and will change with kernel
5530bd40535SRichard Woodruff	 *  - 'might' have to copy address, load and jump to it
5540bd40535SRichard Woodruff	 *  - lr is used since we are running in SRAM currently.
5550bd40535SRichard Woodruff	 */
5560bd40535SRichard Woodruff	ldr r1, kernel_flush
5570bd40535SRichard Woodruff	mov lr, pc
5580bd40535SRichard Woodruff	bx  r1
5590bd40535SRichard Woodruff
5608bd22949SKevin Hilmanskip_l2_inval:
5618bd22949SKevin Hilman	/* Data memory barrier and Data sync barrier */
5628bd22949SKevin Hilman	mov     r1, #0
5638bd22949SKevin Hilman	mcr     p15, 0, r1, c7, c10, 4
5648bd22949SKevin Hilman	mcr     p15, 0, r1, c7, c10, 5
5658bd22949SKevin Hilman
5668bd22949SKevin Hilman	wfi                             @ wait for interrupt
5678bd22949SKevin Hilman	nop
5688bd22949SKevin Hilman	nop
5698bd22949SKevin Hilman	nop
5708bd22949SKevin Hilman	nop
5718bd22949SKevin Hilman	nop
5728bd22949SKevin Hilman	nop
5738bd22949SKevin Hilman	nop
5748bd22949SKevin Hilman	nop
5758bd22949SKevin Hilman	nop
5768bd22949SKevin Hilman	nop
57789139dceSPeter 'p2' De Schrijver	bl wait_sdrc_ok
5788bd22949SKevin Hilman	/* restore regs and return */
5798bd22949SKevin Hilman	ldmfd   sp!, {r0-r12, pc}
5808bd22949SKevin Hilman
58189139dceSPeter 'p2' De Schrijver/* Make sure SDRC accesses are ok */
58289139dceSPeter 'p2' De Schrijverwait_sdrc_ok:
5839d93b8a2SPeter 'p2' De Schrijver
5849d93b8a2SPeter 'p2' De Schrijver/* DPLL3 must be locked before accessing the SDRC. Maybe the HW ensures this. */
5859d93b8a2SPeter 'p2' De Schrijver	ldr	r4, cm_idlest_ckgen
5869d93b8a2SPeter 'p2' De Schrijverwait_dpll3_lock:
58789139dceSPeter 'p2' De Schrijver	ldr	r5, [r4]
5889d93b8a2SPeter 'p2' De Schrijver	tst	r5, #1
5899d93b8a2SPeter 'p2' De Schrijver	beq	wait_dpll3_lock
5909d93b8a2SPeter 'p2' De Schrijver
5919d93b8a2SPeter 'p2' De Schrijver        ldr     r4, cm_idlest1_core
5929d93b8a2SPeter 'p2' De Schrijverwait_sdrc_ready:
5939d93b8a2SPeter 'p2' De Schrijver        ldr     r5, [r4]
5949d93b8a2SPeter 'p2' De Schrijver        tst     r5, #0x2
5959d93b8a2SPeter 'p2' De Schrijver        bne     wait_sdrc_ready
5969d93b8a2SPeter 'p2' De Schrijver	/* allow DLL powerdown upon hw idle req */
5978bd22949SKevin Hilman        ldr     r4, sdrc_power
5988bd22949SKevin Hilman        ldr     r5, [r4]
5998bd22949SKevin Hilman        bic     r5, r5, #0x40
6008bd22949SKevin Hilman        str     r5, [r4]
6019d93b8a2SPeter 'p2' De Schrijveris_dll_in_lock_mode:
6029d93b8a2SPeter 'p2' De Schrijver
60389139dceSPeter 'p2' De Schrijver        /* Is dll in lock mode? */
60489139dceSPeter 'p2' De Schrijver        ldr     r4, sdrc_dlla_ctrl
60589139dceSPeter 'p2' De Schrijver        ldr     r5, [r4]
60689139dceSPeter 'p2' De Schrijver        tst     r5, #0x4
60789139dceSPeter 'p2' De Schrijver        bxne    lr
60889139dceSPeter 'p2' De Schrijver        /* wait till dll locks */
6099d93b8a2SPeter 'p2' De Schrijverwait_dll_lock_timed:
6109d93b8a2SPeter 'p2' De Schrijver	ldr	r4, wait_dll_lock_counter
6119d93b8a2SPeter 'p2' De Schrijver	add	r4, r4, #1
6129d93b8a2SPeter 'p2' De Schrijver	str	r4, wait_dll_lock_counter
61389139dceSPeter 'p2' De Schrijver	ldr	r4, sdrc_dlla_status
6149d93b8a2SPeter 'p2' De Schrijver        mov	r6, #8		/* Wait 20uS for lock */
6159d93b8a2SPeter 'p2' De Schrijverwait_dll_lock:
6169d93b8a2SPeter 'p2' De Schrijver	subs	r6, r6, #0x1
6179d93b8a2SPeter 'p2' De Schrijver	beq	kick_dll
61889139dceSPeter 'p2' De Schrijver        ldr     r5, [r4]
61989139dceSPeter 'p2' De Schrijver        and     r5, r5, #0x4
62089139dceSPeter 'p2' De Schrijver        cmp     r5, #0x4
62189139dceSPeter 'p2' De Schrijver        bne     wait_dll_lock
6228bd22949SKevin Hilman        bx      lr
62389139dceSPeter 'p2' De Schrijver
6249d93b8a2SPeter 'p2' De Schrijver	/* disable/reenable DLL if not locked */
6259d93b8a2SPeter 'p2' De Schrijverkick_dll:
6269d93b8a2SPeter 'p2' De Schrijver	ldr	r4, sdrc_dlla_ctrl
6279d93b8a2SPeter 'p2' De Schrijver	ldr	r5, [r4]
6289d93b8a2SPeter 'p2' De Schrijver	mov	r6, r5
6299d93b8a2SPeter 'p2' De Schrijver	bic	r6, #(1<<3)	/* disable dll */
6309d93b8a2SPeter 'p2' De Schrijver	str	r6, [r4]
6319d93b8a2SPeter 'p2' De Schrijver	dsb
6329d93b8a2SPeter 'p2' De Schrijver	orr	r6, r6, #(1<<3)	/* enable dll */
6339d93b8a2SPeter 'p2' De Schrijver	str	r6, [r4]
6349d93b8a2SPeter 'p2' De Schrijver	dsb
6359d93b8a2SPeter 'p2' De Schrijver	ldr	r4, kick_counter
6369d93b8a2SPeter 'p2' De Schrijver	add	r4, r4, #1
6379d93b8a2SPeter 'p2' De Schrijver	str	r4, kick_counter
6389d93b8a2SPeter 'p2' De Schrijver	b	wait_dll_lock_timed
6399d93b8a2SPeter 'p2' De Schrijver
64089139dceSPeter 'p2' De Schrijvercm_idlest1_core:
64189139dceSPeter 'p2' De Schrijver	.word	CM_IDLEST1_CORE_V
6429d93b8a2SPeter 'p2' De Schrijvercm_idlest_ckgen:
6439d93b8a2SPeter 'p2' De Schrijver	.word	CM_IDLEST_CKGEN_V
64489139dceSPeter 'p2' De Schrijversdrc_dlla_status:
64589139dceSPeter 'p2' De Schrijver	.word	SDRC_DLLA_STATUS_V
64689139dceSPeter 'p2' De Schrijversdrc_dlla_ctrl:
64789139dceSPeter 'p2' De Schrijver	.word	SDRC_DLLA_CTRL_V
6488bd22949SKevin Hilmanpm_prepwstst_core:
6498bd22949SKevin Hilman	.word	PM_PREPWSTST_CORE_V
6500795a75aSTero Kristopm_prepwstst_core_p:
6510795a75aSTero Kristo	.word	PM_PREPWSTST_CORE_P
6528bd22949SKevin Hilmanpm_prepwstst_mpu:
6538bd22949SKevin Hilman	.word	PM_PREPWSTST_MPU_V
6548bd22949SKevin Hilmanpm_pwstctrl_mpu:
6558bd22949SKevin Hilman	.word	PM_PWSTCTRL_MPU_P
6568bd22949SKevin Hilmanscratchpad_base:
6578bd22949SKevin Hilman	.word	SCRATCHPAD_BASE_P
6580795a75aSTero Kristosram_base:
6590795a75aSTero Kristo	.word	SRAM_BASE_P + 0x8000
6608bd22949SKevin Hilmansdrc_power:
6618bd22949SKevin Hilman	.word SDRC_POWER_V
6628bd22949SKevin Hilmanclk_stabilize_delay:
6638bd22949SKevin Hilman	.word 0x000001FF
6648bd22949SKevin Hilmanassoc_mask:
6658bd22949SKevin Hilman	.word	0x3ff
6668bd22949SKevin Hilmannumset_mask:
6678bd22949SKevin Hilman	.word	0x7fff
6688bd22949SKevin Hilmanttbrbit_mask:
6698bd22949SKevin Hilman	.word	0xFFFFC000
6708bd22949SKevin Hilmantable_index_mask:
6718bd22949SKevin Hilman	.word	0xFFF00000
6728bd22949SKevin Hilmantable_entry:
6738bd22949SKevin Hilman	.word	0x00000C02
6748bd22949SKevin Hilmancache_pred_disable_mask:
6758bd22949SKevin Hilman	.word	0xFFFFE7FB
67627d59a4aSTero Kristocontrol_stat:
67727d59a4aSTero Kristo	.word	CONTROL_STAT
678*458e999eSNishanth Menoncontrol_mem_rta:
679*458e999eSNishanth Menon	.word	CONTROL_MEM_RTA_CTRL
6800bd40535SRichard Woodruffkernel_flush:
6810bd40535SRichard Woodruff	.word v7_flush_dcache_all
6829d93b8a2SPeter 'p2' De Schrijver	/*
6839d93b8a2SPeter 'p2' De Schrijver	 * When exporting to userspace while the counters are in SRAM,
6849d93b8a2SPeter 'p2' De Schrijver	 * these 2 words need to be at the end to facilitate retrival!
6859d93b8a2SPeter 'p2' De Schrijver	 */
6869d93b8a2SPeter 'p2' De Schrijverkick_counter:
6879d93b8a2SPeter 'p2' De Schrijver	.word	0
6889d93b8a2SPeter 'p2' De Schrijverwait_dll_lock_counter:
6899d93b8a2SPeter 'p2' De Schrijver	.word	0
6908bd22949SKevin HilmanENTRY(omap34xx_cpu_suspend_sz)
6918bd22949SKevin Hilman	.word	. - omap34xx_cpu_suspend
692