xref: /linux/arch/arm/mach-omap2/sleep34xx.S (revision b4b36fd94e4ca99b3258ff24c2c58cdde67085e0)
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>
29*b4b36fd9SJean Pihet#include <plat/sram.h>
308bd22949SKevin Hilman#include <mach/io.h>
318bd22949SKevin Hilman
3289139dceSPeter 'p2' De Schrijver#include "cm.h"
338bd22949SKevin Hilman#include "prm.h"
348bd22949SKevin Hilman#include "sdrc.h"
354814ced5SPaul Walmsley#include "control.h"
368bd22949SKevin Hilman
37a89b6f00SRajendra Nayak#define SDRC_SCRATCHPAD_SEM_V	0xfa00291c
38a89b6f00SRajendra Nayak
390795a75aSTero Kristo#define PM_PREPWSTST_CORE_P	0x48306AE8
4037903009SAbhijit Pagare#define PM_PWSTCTRL_MPU_P	OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
4189139dceSPeter 'p2' De Schrijver#define CM_IDLEST1_CORE_V	OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
429d93b8a2SPeter 'p2' De Schrijver#define CM_IDLEST_CKGEN_V	OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
4327d59a4aSTero Kristo#define SRAM_BASE_P		0x40200000
4427d59a4aSTero Kristo#define CONTROL_STAT		0x480022F0
45458e999eSNishanth Menon#define CONTROL_MEM_RTA_CTRL	(OMAP343X_CTRL_BASE\
46458e999eSNishanth Menon					+ OMAP36XX_CONTROL_MEM_RTA_CTRL)
478bd22949SKevin Hilman#define SCRATCHPAD_MEM_OFFS	0x310 /* Move this as correct place is
488bd22949SKevin Hilman				       * available */
4961255ab9SRajendra Nayak#define SCRATCHPAD_BASE_P	(OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\
5061255ab9SRajendra Nayak						+ SCRATCHPAD_MEM_OFFS)
518bd22949SKevin Hilman#define SDRC_POWER_V		OMAP34XX_SDRC_REGADDR(SDRC_POWER)
520795a75aSTero Kristo#define SDRC_SYSCONFIG_P	(OMAP343X_SDRC_BASE + SDRC_SYSCONFIG)
530795a75aSTero Kristo#define SDRC_MR_0_P		(OMAP343X_SDRC_BASE + SDRC_MR_0)
540795a75aSTero Kristo#define SDRC_EMR2_0_P		(OMAP343X_SDRC_BASE + SDRC_EMR2_0)
550795a75aSTero Kristo#define SDRC_MANUAL_0_P		(OMAP343X_SDRC_BASE + SDRC_MANUAL_0)
560795a75aSTero Kristo#define SDRC_MR_1_P		(OMAP343X_SDRC_BASE + SDRC_MR_1)
570795a75aSTero Kristo#define SDRC_EMR2_1_P		(OMAP343X_SDRC_BASE + SDRC_EMR2_1)
580795a75aSTero Kristo#define SDRC_MANUAL_1_P		(OMAP343X_SDRC_BASE + SDRC_MANUAL_1)
5989139dceSPeter 'p2' De Schrijver#define SDRC_DLLA_STATUS_V	OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
6089139dceSPeter 'p2' De Schrijver#define SDRC_DLLA_CTRL_V	OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
618bd22949SKevin Hilman
62a89b6f00SRajendra Nayak
63d3cdfd2aSJean Pihet/*
64d3cdfd2aSJean Pihet * API functions
65d3cdfd2aSJean Pihet */
66a89b6f00SRajendra Nayak
67a89b6f00SRajendra Nayak	.text
688bd22949SKevin Hilman/* Function call to get the restore pointer for resume from OFF */
698bd22949SKevin HilmanENTRY(get_restore_pointer)
708bd22949SKevin Hilman        stmfd   sp!, {lr}     @ save registers on stack
718bd22949SKevin Hilman	adr	r0, restore
728bd22949SKevin Hilman        ldmfd   sp!, {pc}     @ restore regs and return
738bd22949SKevin HilmanENTRY(get_restore_pointer_sz)
740795a75aSTero Kristo        .word   . - get_restore_pointer
75458e999eSNishanth Menon	.text
76458e999eSNishanth Menon/* Function call to get the restore pointer for 3630 resume from OFF */
77458e999eSNishanth MenonENTRY(get_omap3630_restore_pointer)
78458e999eSNishanth Menon        stmfd   sp!, {lr}     @ save registers on stack
79458e999eSNishanth Menon	adr	r0, restore_3630
80458e999eSNishanth Menon        ldmfd   sp!, {pc}     @ restore regs and return
81458e999eSNishanth MenonENTRY(get_omap3630_restore_pointer_sz)
82458e999eSNishanth Menon        .word   . - get_omap3630_restore_pointer
830795a75aSTero Kristo
840795a75aSTero Kristo	.text
85c4236d2eSPeter 'p2' De Schrijver/*
86c4236d2eSPeter 'p2' De Schrijver * L2 cache needs to be toggled for stable OFF mode functionality on 3630.
87c4236d2eSPeter 'p2' De Schrijver * This function sets up a fflag that will allow for this toggling to take
88c4236d2eSPeter 'p2' De Schrijver * place on 3630. Hopefully some version in the future maynot need this
89c4236d2eSPeter 'p2' De Schrijver */
90c4236d2eSPeter 'p2' De SchrijverENTRY(enable_omap3630_toggle_l2_on_restore)
91c4236d2eSPeter 'p2' De Schrijver        stmfd   sp!, {lr}     @ save registers on stack
92c4236d2eSPeter 'p2' De Schrijver	/* Setup so that we will disable and enable l2 */
93c4236d2eSPeter 'p2' De Schrijver	mov	r1, #0x1
94c4236d2eSPeter 'p2' De Schrijver	str	r1, l2dis_3630
95c4236d2eSPeter 'p2' De Schrijver        ldmfd   sp!, {pc}     @ restore regs and return
96c4236d2eSPeter 'p2' De Schrijver
97c4236d2eSPeter 'p2' De Schrijver	.text
980795a75aSTero Kristo/* Function call to get the restore pointer for for ES3 to resume from OFF */
990795a75aSTero KristoENTRY(get_es3_restore_pointer)
1000795a75aSTero Kristo	stmfd	sp!, {lr}	@ save registers on stack
1010795a75aSTero Kristo	adr	r0, restore_es3
1020795a75aSTero Kristo	ldmfd	sp!, {pc}	@ restore regs and return
1030795a75aSTero KristoENTRY(get_es3_restore_pointer_sz)
1040795a75aSTero Kristo	.word	. - get_es3_restore_pointer
1050795a75aSTero Kristo
1060795a75aSTero KristoENTRY(es3_sdrc_fix)
1070795a75aSTero Kristo	ldr	r4, sdrc_syscfg		@ get config addr
1080795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1090795a75aSTero Kristo	tst	r5, #0x100		@ is part access blocked
1100795a75aSTero Kristo	it	eq
1110795a75aSTero Kristo	biceq	r5, r5, #0x100		@ clear bit if set
1120795a75aSTero Kristo	str	r5, [r4]		@ write back change
1130795a75aSTero Kristo	ldr	r4, sdrc_mr_0		@ get config addr
1140795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1150795a75aSTero Kristo	str	r5, [r4]		@ write back change
1160795a75aSTero Kristo	ldr	r4, sdrc_emr2_0		@ get config addr
1170795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1180795a75aSTero Kristo	str	r5, [r4]		@ write back change
1190795a75aSTero Kristo	ldr	r4, sdrc_manual_0	@ get config addr
1200795a75aSTero Kristo	mov	r5, #0x2		@ autorefresh command
1210795a75aSTero Kristo	str	r5, [r4]		@ kick off refreshes
1220795a75aSTero Kristo	ldr	r4, sdrc_mr_1		@ get config addr
1230795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1240795a75aSTero Kristo	str	r5, [r4]		@ write back change
1250795a75aSTero Kristo	ldr	r4, sdrc_emr2_1		@ get config addr
1260795a75aSTero Kristo	ldr	r5, [r4]		@ get value
1270795a75aSTero Kristo	str	r5, [r4]		@ write back change
1280795a75aSTero Kristo	ldr	r4, sdrc_manual_1	@ get config addr
1290795a75aSTero Kristo	mov	r5, #0x2		@ autorefresh command
1300795a75aSTero Kristo	str	r5, [r4]		@ kick off refreshes
1310795a75aSTero Kristo	bx	lr
1320795a75aSTero Kristosdrc_syscfg:
1330795a75aSTero Kristo	.word	SDRC_SYSCONFIG_P
1340795a75aSTero Kristosdrc_mr_0:
1350795a75aSTero Kristo	.word	SDRC_MR_0_P
1360795a75aSTero Kristosdrc_emr2_0:
1370795a75aSTero Kristo	.word	SDRC_EMR2_0_P
1380795a75aSTero Kristosdrc_manual_0:
1390795a75aSTero Kristo	.word	SDRC_MANUAL_0_P
1400795a75aSTero Kristosdrc_mr_1:
1410795a75aSTero Kristo	.word	SDRC_MR_1_P
1420795a75aSTero Kristosdrc_emr2_1:
1430795a75aSTero Kristo	.word	SDRC_EMR2_1_P
1440795a75aSTero Kristosdrc_manual_1:
1450795a75aSTero Kristo	.word	SDRC_MANUAL_1_P
1460795a75aSTero KristoENTRY(es3_sdrc_fix_sz)
1470795a75aSTero Kristo	.word	. - es3_sdrc_fix
14827d59a4aSTero Kristo
14927d59a4aSTero Kristo/* Function to call rom code to save secure ram context */
15027d59a4aSTero KristoENTRY(save_secure_ram_context)
15127d59a4aSTero Kristo	stmfd	sp!, {r1-r12, lr}	@ save registers on stack
152d3cdfd2aSJean Pihet
15327d59a4aSTero Kristo	adr	r3, api_params		@ r3 points to parameters
15427d59a4aSTero Kristo	str	r0, [r3,#0x4]		@ r0 has sdram address
15527d59a4aSTero Kristo	ldr	r12, high_mask
15627d59a4aSTero Kristo	and	r3, r3, r12
15727d59a4aSTero Kristo	ldr	r12, sram_phy_addr_mask
15827d59a4aSTero Kristo	orr	r3, r3, r12
15927d59a4aSTero Kristo	mov	r0, #25			@ set service ID for PPA
16027d59a4aSTero Kristo	mov	r12, r0			@ copy secure service ID in r12
16127d59a4aSTero Kristo	mov	r1, #0			@ set task id for ROM code in r1
162ba50ea7eSKalle Jokiniemi	mov	r2, #4			@ set some flags in r2, r6
16327d59a4aSTero Kristo	mov	r6, #0xff
16427d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
16527d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
16627d59a4aSTero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
16727d59a4aSTero Kristo	nop
16827d59a4aSTero Kristo	nop
16927d59a4aSTero Kristo	nop
17027d59a4aSTero Kristo	nop
17127d59a4aSTero Kristo	ldmfd	sp!, {r1-r12, pc}
17227d59a4aSTero Kristosram_phy_addr_mask:
17327d59a4aSTero Kristo	.word	SRAM_BASE_P
17427d59a4aSTero Kristohigh_mask:
17527d59a4aSTero Kristo	.word	0xffff
17627d59a4aSTero Kristoapi_params:
17727d59a4aSTero Kristo	.word	0x4, 0x0, 0x0, 0x1, 0x1
17827d59a4aSTero KristoENTRY(save_secure_ram_context_sz)
17927d59a4aSTero Kristo	.word	. - save_secure_ram_context
18027d59a4aSTero Kristo
1818bd22949SKevin Hilman/*
1828bd22949SKevin Hilman * Forces OMAP into idle state
1838bd22949SKevin Hilman *
1848bd22949SKevin Hilman * omap34xx_suspend() - This bit of code just executes the WFI
1858bd22949SKevin Hilman * for normal idles.
1868bd22949SKevin Hilman *
1878bd22949SKevin Hilman * Note: This code get's copied to internal SRAM at boot. When the OMAP
1888bd22949SKevin Hilman *	 wakes up it continues execution at the point it went to sleep.
1898bd22949SKevin Hilman */
1908bd22949SKevin HilmanENTRY(omap34xx_cpu_suspend)
1918bd22949SKevin Hilman	stmfd	sp!, {r0-r12, lr}		@ save registers on stack
192d3cdfd2aSJean Pihet
1938bd22949SKevin Hilman	/* r0 contains restore pointer in sdram */
1948bd22949SKevin Hilman	/* r1 contains information about saving context */
1958bd22949SKevin Hilman	ldr     r4, sdrc_power          @ read the SDRC_POWER register
1968bd22949SKevin Hilman	ldr     r5, [r4]                @ read the contents of SDRC_POWER
1978bd22949SKevin Hilman	orr     r5, r5, #0x40           @ enable self refresh on idle req
1988bd22949SKevin Hilman	str     r5, [r4]                @ write back to SDRC_POWER register
1998bd22949SKevin Hilman
2008bd22949SKevin Hilman	cmp	r1, #0x0
2018bd22949SKevin Hilman	/* If context save is required, do that and execute wfi */
2028bd22949SKevin Hilman	bne	save_context_wfi
2038bd22949SKevin Hilman	/* Data memory barrier and Data sync barrier */
2048bd22949SKevin Hilman	mov	r1, #0
2058bd22949SKevin Hilman	mcr	p15, 0, r1, c7, c10, 4
2068bd22949SKevin Hilman	mcr	p15, 0, r1, c7, c10, 5
2078bd22949SKevin Hilman
2088bd22949SKevin Hilman	wfi				@ wait for interrupt
2098bd22949SKevin Hilman
2108bd22949SKevin Hilman	nop
2118bd22949SKevin Hilman	nop
2128bd22949SKevin Hilman	nop
2138bd22949SKevin Hilman	nop
2148bd22949SKevin Hilman	nop
2158bd22949SKevin Hilman	nop
2168bd22949SKevin Hilman	nop
2178bd22949SKevin Hilman	nop
2188bd22949SKevin Hilman	nop
2198bd22949SKevin Hilman	nop
22089139dceSPeter 'p2' De Schrijver	bl wait_sdrc_ok
2218bd22949SKevin Hilman
2228bd22949SKevin Hilman	ldmfd	sp!, {r0-r12, pc}		@ restore regs and return
2230795a75aSTero Kristorestore_es3:
2240795a75aSTero Kristo	ldr	r5, pm_prepwstst_core_p
2250795a75aSTero Kristo	ldr	r4, [r5]
2260795a75aSTero Kristo	and	r4, r4, #0x3
2270795a75aSTero Kristo	cmp	r4, #0x0	@ Check if previous power state of CORE is OFF
2280795a75aSTero Kristo	bne	restore
2290795a75aSTero Kristo	adr	r0, es3_sdrc_fix
2300795a75aSTero Kristo	ldr	r1, sram_base
2310795a75aSTero Kristo	ldr	r2, es3_sdrc_fix_sz
2320795a75aSTero Kristo	mov	r2, r2, ror #2
2330795a75aSTero Kristocopy_to_sram:
2340795a75aSTero Kristo	ldmia	r0!, {r3}	@ val = *src
2350795a75aSTero Kristo	stmia	r1!, {r3}	@ *dst = val
2360795a75aSTero Kristo	subs	r2, r2, #0x1	@ num_words--
2370795a75aSTero Kristo	bne	copy_to_sram
2380795a75aSTero Kristo	ldr	r1, sram_base
2390795a75aSTero Kristo	blx	r1
240458e999eSNishanth Menon	b	restore
241458e999eSNishanth Menon
242458e999eSNishanth Menonrestore_3630:
243458e999eSNishanth Menon	ldr	r1, pm_prepwstst_core_p
244458e999eSNishanth Menon	ldr	r2, [r1]
245458e999eSNishanth Menon	and	r2, r2, #0x3
246458e999eSNishanth Menon	cmp	r2, #0x0	@ Check if previous power state of CORE is OFF
247458e999eSNishanth Menon	bne	restore
248458e999eSNishanth Menon	/* Disable RTA before giving control */
249458e999eSNishanth Menon	ldr	r1, control_mem_rta
250458e999eSNishanth Menon	mov	r2, #OMAP36XX_RTA_DISABLE
251458e999eSNishanth Menon	str	r2, [r1]
252458e999eSNishanth Menon	/* Fall thru for the remaining logic */
2538bd22949SKevin Hilmanrestore:
2548bd22949SKevin Hilman        /* Check what was the reason for mpu reset and store the reason in r9*/
2558bd22949SKevin Hilman        /* 1 - Only L1 and logic lost */
2568bd22949SKevin Hilman        /* 2 - Only L2 lost - In this case, we wont be here */
2578bd22949SKevin Hilman        /* 3 - Both L1 and L2 lost */
2588bd22949SKevin Hilman	ldr     r1, pm_pwstctrl_mpu
2598bd22949SKevin Hilman	ldr	r2, [r1]
2608bd22949SKevin Hilman	and     r2, r2, #0x3
2618bd22949SKevin Hilman	cmp     r2, #0x0	@ Check if target power state was OFF or RET
2628bd22949SKevin Hilman        moveq   r9, #0x3        @ MPU OFF => L1 and L2 lost
2638bd22949SKevin Hilman	movne	r9, #0x1	@ Only L1 and L2 lost => avoid L2 invalidation
2648bd22949SKevin Hilman	bne	logic_l1_restore
265c4236d2eSPeter 'p2' De Schrijver
266c4236d2eSPeter 'p2' De Schrijver	ldr	r0, l2dis_3630
267c4236d2eSPeter 'p2' De Schrijver	cmp	r0, #0x1	@ should we disable L2 on 3630?
268c4236d2eSPeter 'p2' De Schrijver	bne	skipl2dis
269c4236d2eSPeter 'p2' De Schrijver	mrc	p15, 0, r0, c1, c0, 1
270c4236d2eSPeter 'p2' De Schrijver	bic	r0, r0, #2	@ disable L2 cache
271c4236d2eSPeter 'p2' De Schrijver	mcr	p15, 0, r0, c1, c0, 1
272c4236d2eSPeter 'p2' De Schrijverskipl2dis:
27327d59a4aSTero Kristo	ldr	r0, control_stat
27427d59a4aSTero Kristo	ldr	r1, [r0]
27527d59a4aSTero Kristo	and	r1, #0x700
27627d59a4aSTero Kristo	cmp	r1, #0x300
27727d59a4aSTero Kristo	beq	l2_inv_gp
27827d59a4aSTero Kristo	mov	r0, #40		@ set service ID for PPA
27927d59a4aSTero Kristo	mov	r12, r0		@ copy secure Service ID in r12
28027d59a4aSTero Kristo	mov	r1, #0		@ set task id for ROM code in r1
28127d59a4aSTero Kristo	mov	r2, #4		@ set some flags in r2, r6
28227d59a4aSTero Kristo	mov	r6, #0xff
28327d59a4aSTero Kristo	adr	r3, l2_inv_api_params	@ r3 points to dummy parameters
28427d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
28527d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
28627d59a4aSTero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
28727d59a4aSTero Kristo	/* Write to Aux control register to set some bits */
28827d59a4aSTero Kristo	mov	r0, #42		@ set service ID for PPA
28927d59a4aSTero Kristo	mov	r12, r0		@ copy secure Service ID in r12
29027d59a4aSTero Kristo	mov	r1, #0		@ set task id for ROM code in r1
29127d59a4aSTero Kristo	mov	r2, #4		@ set some flags in r2, r6
29227d59a4aSTero Kristo	mov	r6, #0xff
293a087cad9STero Kristo	ldr	r4, scratchpad_base
294a087cad9STero Kristo	ldr	r3, [r4, #0xBC]	@ r3 points to parameters
29527d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
29627d59a4aSTero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
29727d59a4aSTero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
29827d59a4aSTero Kristo
29979dcfdd4STero Kristo#ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE
30079dcfdd4STero Kristo	/* Restore L2 aux control register */
30179dcfdd4STero Kristo	@ set service ID for PPA
30279dcfdd4STero Kristo	mov	r0, #CONFIG_OMAP3_L2_AUX_SECURE_SERVICE_SET_ID
30379dcfdd4STero Kristo	mov	r12, r0		@ copy service ID in r12
30479dcfdd4STero Kristo	mov	r1, #0		@ set task ID for ROM code in r1
30579dcfdd4STero Kristo	mov	r2, #4		@ set some flags in r2, r6
30679dcfdd4STero Kristo	mov	r6, #0xff
30779dcfdd4STero Kristo	ldr	r4, scratchpad_base
30879dcfdd4STero Kristo	ldr	r3, [r4, #0xBC]
30979dcfdd4STero Kristo	adds	r3, r3, #8	@ r3 points to parameters
31079dcfdd4STero Kristo	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
31179dcfdd4STero Kristo	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
31279dcfdd4STero Kristo	.word	0xE1600071		@ call SMI monitor (smi #1)
31379dcfdd4STero Kristo#endif
31427d59a4aSTero Kristo	b	logic_l1_restore
31527d59a4aSTero Kristol2_inv_api_params:
31627d59a4aSTero Kristo	.word   0x1, 0x00
31727d59a4aSTero Kristol2_inv_gp:
3188bd22949SKevin Hilman	/* Execute smi to invalidate L2 cache */
3198bd22949SKevin Hilman	mov r12, #0x1                         @ set up to invalide L2
3208bd22949SKevin Hilmansmi:    .word 0xE1600070		@ Call SMI monitor (smieq)
32127d59a4aSTero Kristo	/* Write to Aux control register to set some bits */
322a087cad9STero Kristo	ldr	r4, scratchpad_base
323a087cad9STero Kristo	ldr	r3, [r4,#0xBC]
324a087cad9STero Kristo	ldr	r0, [r3,#4]
32527d59a4aSTero Kristo	mov	r12, #0x3
32627d59a4aSTero Kristo	.word 0xE1600070	@ Call SMI monitor (smieq)
32779dcfdd4STero Kristo	ldr	r4, scratchpad_base
32879dcfdd4STero Kristo	ldr	r3, [r4,#0xBC]
32979dcfdd4STero Kristo	ldr	r0, [r3,#12]
33079dcfdd4STero Kristo	mov	r12, #0x2
33179dcfdd4STero Kristo	.word 0xE1600070	@ Call SMI monitor (smieq)
3328bd22949SKevin Hilmanlogic_l1_restore:
333c4236d2eSPeter 'p2' De Schrijver	ldr	r1, l2dis_3630
334c4236d2eSPeter 'p2' De Schrijver	cmp	r1, #0x1	@ Do we need to re-enable L2 on 3630?
335c4236d2eSPeter 'p2' De Schrijver	bne	skipl2reen
336c4236d2eSPeter 'p2' De Schrijver	mrc	p15, 0, r1, c1, c0, 1
337c4236d2eSPeter 'p2' De Schrijver	orr	r1, r1, #2	@ re-enable L2 cache
338c4236d2eSPeter 'p2' De Schrijver	mcr	p15, 0, r1, c1, c0, 1
339c4236d2eSPeter 'p2' De Schrijverskipl2reen:
3408bd22949SKevin Hilman	mov	r1, #0
3418bd22949SKevin Hilman	/* Invalidate all instruction caches to PoU
3428bd22949SKevin Hilman	 * and flush branch target cache */
3438bd22949SKevin Hilman	mcr	p15, 0, r1, c7, c5, 0
3448bd22949SKevin Hilman
3458bd22949SKevin Hilman	ldr	r4, scratchpad_base
3468bd22949SKevin Hilman	ldr	r3, [r4,#0xBC]
34779dcfdd4STero Kristo	adds	r3, r3, #16
3488bd22949SKevin Hilman	ldmia	r3!, {r4-r6}
3498bd22949SKevin Hilman	mov	sp, r4
3508bd22949SKevin Hilman	msr	spsr_cxsf, r5
3518bd22949SKevin Hilman	mov	lr, r6
3528bd22949SKevin Hilman
3538bd22949SKevin Hilman	ldmia	r3!, {r4-r9}
3548bd22949SKevin Hilman	/* Coprocessor access Control Register */
3558bd22949SKevin Hilman	mcr p15, 0, r4, c1, c0, 2
3568bd22949SKevin Hilman
3578bd22949SKevin Hilman	/* TTBR0 */
3588bd22949SKevin Hilman	MCR p15, 0, r5, c2, c0, 0
3598bd22949SKevin Hilman	/* TTBR1 */
3608bd22949SKevin Hilman	MCR p15, 0, r6, c2, c0, 1
3618bd22949SKevin Hilman	/* Translation table base control register */
3628bd22949SKevin Hilman	MCR p15, 0, r7, c2, c0, 2
3638bd22949SKevin Hilman	/*domain access Control Register */
3648bd22949SKevin Hilman	MCR p15, 0, r8, c3, c0, 0
3658bd22949SKevin Hilman	/* data fault status Register */
3668bd22949SKevin Hilman	MCR p15, 0, r9, c5, c0, 0
3678bd22949SKevin Hilman
3688bd22949SKevin Hilman	ldmia  r3!,{r4-r8}
3698bd22949SKevin Hilman	/* instruction fault status Register */
3708bd22949SKevin Hilman	MCR p15, 0, r4, c5, c0, 1
3718bd22949SKevin Hilman	/*Data Auxiliary Fault Status Register */
3728bd22949SKevin Hilman	MCR p15, 0, r5, c5, c1, 0
3738bd22949SKevin Hilman	/*Instruction Auxiliary Fault Status Register*/
3748bd22949SKevin Hilman	MCR p15, 0, r6, c5, c1, 1
3758bd22949SKevin Hilman	/*Data Fault Address Register */
3768bd22949SKevin Hilman	MCR p15, 0, r7, c6, c0, 0
3778bd22949SKevin Hilman	/*Instruction Fault Address Register*/
3788bd22949SKevin Hilman	MCR p15, 0, r8, c6, c0, 2
3798bd22949SKevin Hilman	ldmia  r3!,{r4-r7}
3808bd22949SKevin Hilman
3818bd22949SKevin Hilman	/* user r/w thread and process ID */
3828bd22949SKevin Hilman	MCR p15, 0, r4, c13, c0, 2
3838bd22949SKevin Hilman	/* user ro thread and process ID */
3848bd22949SKevin Hilman	MCR p15, 0, r5, c13, c0, 3
3858bd22949SKevin Hilman	/*Privileged only thread and process ID */
3868bd22949SKevin Hilman	MCR p15, 0, r6, c13, c0, 4
3878bd22949SKevin Hilman	/* cache size selection */
3888bd22949SKevin Hilman	MCR p15, 2, r7, c0, c0, 0
3898bd22949SKevin Hilman	ldmia  r3!,{r4-r8}
3908bd22949SKevin Hilman	/* Data TLB lockdown registers */
3918bd22949SKevin Hilman	MCR p15, 0, r4, c10, c0, 0
3928bd22949SKevin Hilman	/* Instruction TLB lockdown registers */
3938bd22949SKevin Hilman	MCR p15, 0, r5, c10, c0, 1
3948bd22949SKevin Hilman	/* Secure or Nonsecure Vector Base Address */
3958bd22949SKevin Hilman	MCR p15, 0, r6, c12, c0, 0
3968bd22949SKevin Hilman	/* FCSE PID */
3978bd22949SKevin Hilman	MCR p15, 0, r7, c13, c0, 0
3988bd22949SKevin Hilman	/* Context PID */
3998bd22949SKevin Hilman	MCR p15, 0, r8, c13, c0, 1
4008bd22949SKevin Hilman
4018bd22949SKevin Hilman	ldmia  r3!,{r4-r5}
4028bd22949SKevin Hilman	/* primary memory remap register */
4038bd22949SKevin Hilman	MCR p15, 0, r4, c10, c2, 0
4048bd22949SKevin Hilman	/*normal memory remap register */
4058bd22949SKevin Hilman	MCR p15, 0, r5, c10, c2, 1
4068bd22949SKevin Hilman
4078bd22949SKevin Hilman	/* Restore cpsr */
4088bd22949SKevin Hilman	ldmia	r3!,{r4}	/*load CPSR from SDRAM*/
4098bd22949SKevin Hilman	msr	cpsr, r4	/*store cpsr */
4108bd22949SKevin Hilman
4118bd22949SKevin Hilman	/* Enabling MMU here */
4128bd22949SKevin Hilman	mrc	p15, 0, r7, c2, c0, 2 /* Read TTBRControl */
4138bd22949SKevin Hilman	/* Extract N (0:2) bits and decide whether to use TTBR0 or TTBR1*/
4148bd22949SKevin Hilman	and	r7, #0x7
4158bd22949SKevin Hilman	cmp	r7, #0x0
4168bd22949SKevin Hilman	beq	usettbr0
4178bd22949SKevin Hilmanttbr_error:
4188bd22949SKevin Hilman	/* More work needs to be done to support N[0:2] value other than 0
4198bd22949SKevin Hilman	* So looping here so that the error can be detected
4208bd22949SKevin Hilman	*/
4218bd22949SKevin Hilman	b	ttbr_error
4228bd22949SKevin Hilmanusettbr0:
4238bd22949SKevin Hilman	mrc	p15, 0, r2, c2, c0, 0
4248bd22949SKevin Hilman	ldr	r5, ttbrbit_mask
4258bd22949SKevin Hilman	and	r2, r5
4268bd22949SKevin Hilman	mov	r4, pc
4278bd22949SKevin Hilman	ldr	r5, table_index_mask
4288bd22949SKevin Hilman	and	r4, r5 /* r4 = 31 to 20 bits of pc */
4298bd22949SKevin Hilman	/* Extract the value to be written to table entry */
4308bd22949SKevin Hilman	ldr	r1, table_entry
4318bd22949SKevin Hilman	add	r1, r1, r4 /* r1 has value to be written to table entry*/
4328bd22949SKevin Hilman	/* Getting the address of table entry to modify */
4338bd22949SKevin Hilman	lsr	r4, #18
4348bd22949SKevin Hilman	add	r2, r4 /* r2 has the location which needs to be modified */
4358bd22949SKevin Hilman	/* Storing previous entry of location being modified */
4368bd22949SKevin Hilman	ldr	r5, scratchpad_base
4378bd22949SKevin Hilman	ldr	r4, [r2]
4388bd22949SKevin Hilman	str	r4, [r5, #0xC0]
4398bd22949SKevin Hilman	/* Modify the table entry */
4408bd22949SKevin Hilman	str	r1, [r2]
4418bd22949SKevin Hilman	/* Storing address of entry being modified
4428bd22949SKevin Hilman	 * - will be restored after enabling MMU */
4438bd22949SKevin Hilman	ldr	r5, scratchpad_base
4448bd22949SKevin Hilman	str	r2, [r5, #0xC4]
4458bd22949SKevin Hilman
4468bd22949SKevin Hilman	mov	r0, #0
4478bd22949SKevin Hilman	mcr	p15, 0, r0, c7, c5, 4	@ Flush prefetch buffer
4488bd22949SKevin Hilman	mcr	p15, 0, r0, c7, c5, 6	@ Invalidate branch predictor array
4498bd22949SKevin Hilman	mcr	p15, 0, r0, c8, c5, 0	@ Invalidate instruction TLB
4508bd22949SKevin Hilman	mcr	p15, 0, r0, c8, c6, 0	@ Invalidate data TLB
4518bd22949SKevin Hilman	/* Restore control register  but dont enable caches here*/
4528bd22949SKevin Hilman	/* Caches will be enabled after restoring MMU table entry */
4538bd22949SKevin Hilman	ldmia	r3!, {r4}
4548bd22949SKevin Hilman	/* Store previous value of control register in scratchpad */
4558bd22949SKevin Hilman	str	r4, [r5, #0xC8]
4568bd22949SKevin Hilman	ldr	r2, cache_pred_disable_mask
4578bd22949SKevin Hilman	and	r4, r2
4588bd22949SKevin Hilman	mcr	p15, 0, r4, c1, c0, 0
4598bd22949SKevin Hilman
4608bd22949SKevin Hilman	ldmfd	sp!, {r0-r12, pc}		@ restore regs and return
4618bd22949SKevin Hilmansave_context_wfi:
4628bd22949SKevin Hilman	mov	r8, r0 /* Store SDRAM address in r8 */
463a087cad9STero Kristo	mrc	p15, 0, r5, c1, c0, 1	@ Read Auxiliary Control Register
464a087cad9STero Kristo	mov	r4, #0x1		@ Number of parameters for restore call
46579dcfdd4STero Kristo	stmia	r8!, {r4-r5}		@ Push parameters for restore call
46679dcfdd4STero Kristo	mrc	p15, 1, r5, c9, c0, 2	@ Read L2 AUX ctrl register
46779dcfdd4STero Kristo	stmia	r8!, {r4-r5}		@ Push parameters for restore call
4688bd22949SKevin Hilman        /* Check what that target sleep state is:stored in r1*/
4698bd22949SKevin Hilman        /* 1 - Only L1 and logic lost */
4708bd22949SKevin Hilman        /* 2 - Only L2 lost */
4718bd22949SKevin Hilman        /* 3 - Both L1 and L2 lost */
4728bd22949SKevin Hilman	cmp	r1, #0x2 /* Only L2 lost */
4738bd22949SKevin Hilman	beq	clean_l2
4748bd22949SKevin Hilman	cmp	r1, #0x1 /* L2 retained */
4758bd22949SKevin Hilman	/* r9 stores whether to clean L2 or not*/
4768bd22949SKevin Hilman	moveq	r9, #0x0 /* Dont Clean L2 */
4778bd22949SKevin Hilman	movne	r9, #0x1 /* Clean L2 */
4788bd22949SKevin Hilmanl1_logic_lost:
4798bd22949SKevin Hilman	/* Store sp and spsr to SDRAM */
4808bd22949SKevin Hilman	mov	r4, sp
4818bd22949SKevin Hilman	mrs	r5, spsr
4828bd22949SKevin Hilman	mov	r6, lr
4838bd22949SKevin Hilman	stmia	r8!, {r4-r6}
4848bd22949SKevin Hilman	/* Save all ARM registers */
4858bd22949SKevin Hilman	/* Coprocessor access control register */
4868bd22949SKevin Hilman	mrc	p15, 0, r6, c1, c0, 2
4878bd22949SKevin Hilman	stmia	r8!, {r6}
4888bd22949SKevin Hilman	/* TTBR0, TTBR1 and Translation table base control */
4898bd22949SKevin Hilman	mrc	p15, 0, r4, c2, c0, 0
4908bd22949SKevin Hilman	mrc	p15, 0, r5, c2, c0, 1
4918bd22949SKevin Hilman	mrc	p15, 0, r6, c2, c0, 2
4928bd22949SKevin Hilman	stmia	r8!, {r4-r6}
4938bd22949SKevin Hilman	/* Domain access control register, data fault status register,
4948bd22949SKevin Hilman	and instruction fault status register */
4958bd22949SKevin Hilman	mrc	p15, 0, r4, c3, c0, 0
4968bd22949SKevin Hilman	mrc	p15, 0, r5, c5, c0, 0
4978bd22949SKevin Hilman	mrc	p15, 0, r6, c5, c0, 1
4988bd22949SKevin Hilman	stmia	r8!, {r4-r6}
4998bd22949SKevin Hilman	/* Data aux fault status register, instruction aux fault status,
5008bd22949SKevin Hilman	datat fault address register and instruction fault address register*/
5018bd22949SKevin Hilman	mrc	p15, 0, r4, c5, c1, 0
5028bd22949SKevin Hilman	mrc	p15, 0, r5, c5, c1, 1
5038bd22949SKevin Hilman	mrc	p15, 0, r6, c6, c0, 0
5048bd22949SKevin Hilman	mrc	p15, 0, r7, c6, c0, 2
5058bd22949SKevin Hilman	stmia	r8!, {r4-r7}
5068bd22949SKevin Hilman	/* user r/w thread and process ID, user r/o thread and process ID,
5078bd22949SKevin Hilman	priv only thread and process ID, cache size selection */
5088bd22949SKevin Hilman	mrc	p15, 0, r4, c13, c0, 2
5098bd22949SKevin Hilman	mrc	p15, 0, r5, c13, c0, 3
5108bd22949SKevin Hilman	mrc	p15, 0, r6, c13, c0, 4
5118bd22949SKevin Hilman	mrc	p15, 2, r7, c0, c0, 0
5128bd22949SKevin Hilman	stmia	r8!, {r4-r7}
5138bd22949SKevin Hilman	/* Data TLB lockdown, instruction TLB lockdown registers */
5148bd22949SKevin Hilman	mrc	p15, 0, r5, c10, c0, 0
5158bd22949SKevin Hilman	mrc	p15, 0, r6, c10, c0, 1
5168bd22949SKevin Hilman	stmia	r8!, {r5-r6}
5178bd22949SKevin Hilman	/* Secure or non secure vector base address, FCSE PID, Context PID*/
5188bd22949SKevin Hilman	mrc	p15, 0, r4, c12, c0, 0
5198bd22949SKevin Hilman	mrc	p15, 0, r5, c13, c0, 0
5208bd22949SKevin Hilman	mrc	p15, 0, r6, c13, c0, 1
5218bd22949SKevin Hilman	stmia	r8!, {r4-r6}
5228bd22949SKevin Hilman	/* Primary remap, normal remap registers */
5238bd22949SKevin Hilman	mrc	p15, 0, r4, c10, c2, 0
5248bd22949SKevin Hilman	mrc	p15, 0, r5, c10, c2, 1
5258bd22949SKevin Hilman	stmia	r8!,{r4-r5}
5268bd22949SKevin Hilman
5278bd22949SKevin Hilman	/* Store current cpsr*/
5288bd22949SKevin Hilman	mrs	r2, cpsr
5298bd22949SKevin Hilman	stmia	r8!, {r2}
5308bd22949SKevin Hilman
5318bd22949SKevin Hilman	mrc	p15, 0, r4, c1, c0, 0
5328bd22949SKevin Hilman	/* save control register */
5338bd22949SKevin Hilman	stmia	r8!, {r4}
5348bd22949SKevin Hilmanclean_caches:
5358bd22949SKevin Hilman	/* Clean Data or unified cache to POU*/
5368bd22949SKevin Hilman	/* How to invalidate only L1 cache???? - #FIX_ME# */
5378bd22949SKevin Hilman	/* mcr	p15, 0, r11, c7, c11, 1 */
5388bd22949SKevin Hilman	cmp	r9, #1 /* Check whether L2 inval is required or not*/
5398bd22949SKevin Hilman	bne	skip_l2_inval
5408bd22949SKevin Hilmanclean_l2:
5410bd40535SRichard Woodruff	/*
5420bd40535SRichard Woodruff	 * Jump out to kernel flush routine
5430bd40535SRichard Woodruff	 *  - reuse that code is better
5440bd40535SRichard Woodruff	 *  - it executes in a cached space so is faster than refetch per-block
5450bd40535SRichard Woodruff	 *  - should be faster and will change with kernel
5460bd40535SRichard Woodruff	 *  - 'might' have to copy address, load and jump to it
5470bd40535SRichard Woodruff	 *  - lr is used since we are running in SRAM currently.
5480bd40535SRichard Woodruff	 */
5490bd40535SRichard Woodruff	ldr r1, kernel_flush
5500bd40535SRichard Woodruff	mov lr, pc
5510bd40535SRichard Woodruff	bx  r1
5520bd40535SRichard Woodruff
5538bd22949SKevin Hilmanskip_l2_inval:
5548bd22949SKevin Hilman	/* Data memory barrier and Data sync barrier */
5558bd22949SKevin Hilman	mov     r1, #0
5568bd22949SKevin Hilman	mcr     p15, 0, r1, c7, c10, 4
5578bd22949SKevin Hilman	mcr     p15, 0, r1, c7, c10, 5
5588bd22949SKevin Hilman
5598bd22949SKevin Hilman	wfi                             @ wait for interrupt
5608bd22949SKevin Hilman	nop
5618bd22949SKevin Hilman	nop
5628bd22949SKevin Hilman	nop
5638bd22949SKevin Hilman	nop
5648bd22949SKevin Hilman	nop
5658bd22949SKevin Hilman	nop
5668bd22949SKevin Hilman	nop
5678bd22949SKevin Hilman	nop
5688bd22949SKevin Hilman	nop
5698bd22949SKevin Hilman	nop
57089139dceSPeter 'p2' De Schrijver	bl wait_sdrc_ok
5718bd22949SKevin Hilman	/* restore regs and return */
5728bd22949SKevin Hilman	ldmfd   sp!, {r0-r12, pc}
5738bd22949SKevin Hilman
57489139dceSPeter 'p2' De Schrijver/* Make sure SDRC accesses are ok */
57589139dceSPeter 'p2' De Schrijverwait_sdrc_ok:
5769d93b8a2SPeter 'p2' De Schrijver
5779d93b8a2SPeter 'p2' De Schrijver/* DPLL3 must be locked before accessing the SDRC. Maybe the HW ensures this. */
5789d93b8a2SPeter 'p2' De Schrijver	ldr	r4, cm_idlest_ckgen
5799d93b8a2SPeter 'p2' De Schrijverwait_dpll3_lock:
58089139dceSPeter 'p2' De Schrijver	ldr	r5, [r4]
5819d93b8a2SPeter 'p2' De Schrijver	tst	r5, #1
5829d93b8a2SPeter 'p2' De Schrijver	beq	wait_dpll3_lock
5839d93b8a2SPeter 'p2' De Schrijver
5849d93b8a2SPeter 'p2' De Schrijver        ldr     r4, cm_idlest1_core
5859d93b8a2SPeter 'p2' De Schrijverwait_sdrc_ready:
5869d93b8a2SPeter 'p2' De Schrijver        ldr     r5, [r4]
5879d93b8a2SPeter 'p2' De Schrijver        tst     r5, #0x2
5889d93b8a2SPeter 'p2' De Schrijver        bne     wait_sdrc_ready
5899d93b8a2SPeter 'p2' De Schrijver	/* allow DLL powerdown upon hw idle req */
5908bd22949SKevin Hilman        ldr     r4, sdrc_power
5918bd22949SKevin Hilman        ldr     r5, [r4]
5928bd22949SKevin Hilman        bic     r5, r5, #0x40
5938bd22949SKevin Hilman        str     r5, [r4]
5949d93b8a2SPeter 'p2' De Schrijveris_dll_in_lock_mode:
5959d93b8a2SPeter 'p2' De Schrijver
59689139dceSPeter 'p2' De Schrijver        /* Is dll in lock mode? */
59789139dceSPeter 'p2' De Schrijver        ldr     r4, sdrc_dlla_ctrl
59889139dceSPeter 'p2' De Schrijver        ldr     r5, [r4]
59989139dceSPeter 'p2' De Schrijver        tst     r5, #0x4
60089139dceSPeter 'p2' De Schrijver        bxne    lr
60189139dceSPeter 'p2' De Schrijver        /* wait till dll locks */
6029d93b8a2SPeter 'p2' De Schrijverwait_dll_lock_timed:
6039d93b8a2SPeter 'p2' De Schrijver	ldr	r4, wait_dll_lock_counter
6049d93b8a2SPeter 'p2' De Schrijver	add	r4, r4, #1
6059d93b8a2SPeter 'p2' De Schrijver	str	r4, wait_dll_lock_counter
60689139dceSPeter 'p2' De Schrijver	ldr	r4, sdrc_dlla_status
6079d93b8a2SPeter 'p2' De Schrijver        mov	r6, #8		/* Wait 20uS for lock */
6089d93b8a2SPeter 'p2' De Schrijverwait_dll_lock:
6099d93b8a2SPeter 'p2' De Schrijver	subs	r6, r6, #0x1
6109d93b8a2SPeter 'p2' De Schrijver	beq	kick_dll
61189139dceSPeter 'p2' De Schrijver        ldr     r5, [r4]
61289139dceSPeter 'p2' De Schrijver        and     r5, r5, #0x4
61389139dceSPeter 'p2' De Schrijver        cmp     r5, #0x4
61489139dceSPeter 'p2' De Schrijver        bne     wait_dll_lock
6158bd22949SKevin Hilman        bx      lr
61689139dceSPeter 'p2' De Schrijver
6179d93b8a2SPeter 'p2' De Schrijver	/* disable/reenable DLL if not locked */
6189d93b8a2SPeter 'p2' De Schrijverkick_dll:
6199d93b8a2SPeter 'p2' De Schrijver	ldr	r4, sdrc_dlla_ctrl
6209d93b8a2SPeter 'p2' De Schrijver	ldr	r5, [r4]
6219d93b8a2SPeter 'p2' De Schrijver	mov	r6, r5
6229d93b8a2SPeter 'p2' De Schrijver	bic	r6, #(1<<3)	/* disable dll */
6239d93b8a2SPeter 'p2' De Schrijver	str	r6, [r4]
6249d93b8a2SPeter 'p2' De Schrijver	dsb
6259d93b8a2SPeter 'p2' De Schrijver	orr	r6, r6, #(1<<3)	/* enable dll */
6269d93b8a2SPeter 'p2' De Schrijver	str	r6, [r4]
6279d93b8a2SPeter 'p2' De Schrijver	dsb
6289d93b8a2SPeter 'p2' De Schrijver	ldr	r4, kick_counter
6299d93b8a2SPeter 'p2' De Schrijver	add	r4, r4, #1
6309d93b8a2SPeter 'p2' De Schrijver	str	r4, kick_counter
6319d93b8a2SPeter 'p2' De Schrijver	b	wait_dll_lock_timed
6329d93b8a2SPeter 'p2' De Schrijver
63389139dceSPeter 'p2' De Schrijvercm_idlest1_core:
63489139dceSPeter 'p2' De Schrijver	.word	CM_IDLEST1_CORE_V
6359d93b8a2SPeter 'p2' De Schrijvercm_idlest_ckgen:
6369d93b8a2SPeter 'p2' De Schrijver	.word	CM_IDLEST_CKGEN_V
63789139dceSPeter 'p2' De Schrijversdrc_dlla_status:
63889139dceSPeter 'p2' De Schrijver	.word	SDRC_DLLA_STATUS_V
63989139dceSPeter 'p2' De Schrijversdrc_dlla_ctrl:
64089139dceSPeter 'p2' De Schrijver	.word	SDRC_DLLA_CTRL_V
6410795a75aSTero Kristopm_prepwstst_core_p:
6420795a75aSTero Kristo	.word	PM_PREPWSTST_CORE_P
6438bd22949SKevin Hilmanpm_pwstctrl_mpu:
6448bd22949SKevin Hilman	.word	PM_PWSTCTRL_MPU_P
6458bd22949SKevin Hilmanscratchpad_base:
6468bd22949SKevin Hilman	.word	SCRATCHPAD_BASE_P
6470795a75aSTero Kristosram_base:
6480795a75aSTero Kristo	.word	SRAM_BASE_P + 0x8000
6498bd22949SKevin Hilmansdrc_power:
6508bd22949SKevin Hilman	.word SDRC_POWER_V
6518bd22949SKevin Hilmanttbrbit_mask:
6528bd22949SKevin Hilman	.word	0xFFFFC000
6538bd22949SKevin Hilmantable_index_mask:
6548bd22949SKevin Hilman	.word	0xFFF00000
6558bd22949SKevin Hilmantable_entry:
6568bd22949SKevin Hilman	.word	0x00000C02
6578bd22949SKevin Hilmancache_pred_disable_mask:
6588bd22949SKevin Hilman	.word	0xFFFFE7FB
65927d59a4aSTero Kristocontrol_stat:
66027d59a4aSTero Kristo	.word	CONTROL_STAT
661458e999eSNishanth Menoncontrol_mem_rta:
662458e999eSNishanth Menon	.word	CONTROL_MEM_RTA_CTRL
6630bd40535SRichard Woodruffkernel_flush:
6640bd40535SRichard Woodruff	.word v7_flush_dcache_all
665c4236d2eSPeter 'p2' De Schrijverl2dis_3630:
666c4236d2eSPeter 'p2' De Schrijver	.word 0
6679d93b8a2SPeter 'p2' De Schrijver	/*
6689d93b8a2SPeter 'p2' De Schrijver	 * When exporting to userspace while the counters are in SRAM,
6699d93b8a2SPeter 'p2' De Schrijver	 * these 2 words need to be at the end to facilitate retrival!
6709d93b8a2SPeter 'p2' De Schrijver	 */
6719d93b8a2SPeter 'p2' De Schrijverkick_counter:
6729d93b8a2SPeter 'p2' De Schrijver	.word	0
6739d93b8a2SPeter 'p2' De Schrijverwait_dll_lock_counter:
6749d93b8a2SPeter 'p2' De Schrijver	.word	0
6758bd22949SKevin HilmanENTRY(omap34xx_cpu_suspend_sz)
6768bd22949SKevin Hilman	.word	. - omap34xx_cpu_suspend
677