xref: /openbmc/linux/arch/arm/mach-omap2/sleep43xx.S (revision 03de3727b25059d9802d1baac319ba40c035eade)
141d37e61SDave Gerlach/* SPDX-License-Identifier: GPL-2.0 */
241d37e61SDave Gerlach/*
341d37e61SDave Gerlach * Low level suspend code for AM43XX SoCs
441d37e61SDave Gerlach *
541d37e61SDave Gerlach * Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
641d37e61SDave Gerlach *	Dave Gerlach, Vaibhav Bedia
741d37e61SDave Gerlach */
841d37e61SDave Gerlach
941d9d44dSDave Gerlach#include <generated/ti-emif-asm-offsets.h>
1041d9d44dSDave Gerlach#include <generated/ti-pm-asm-offsets.h>
1141d37e61SDave Gerlach#include <linux/linkage.h>
1241d37e61SDave Gerlach#include <linux/ti-emif-sram.h>
1341d37e61SDave Gerlach
1441d37e61SDave Gerlach#include <asm/assembler.h>
1541d37e61SDave Gerlach#include <asm/hardware/cache-l2x0.h>
1641d37e61SDave Gerlach#include <asm/memory.h>
1741d37e61SDave Gerlach
1841d37e61SDave Gerlach#include "cm33xx.h"
1941d37e61SDave Gerlach#include "common.h"
2041d37e61SDave Gerlach#include "iomap.h"
2141d37e61SDave Gerlach#include "omap-secure.h"
2241d37e61SDave Gerlach#include "omap44xx.h"
2341d37e61SDave Gerlach#include "prm33xx.h"
2441d37e61SDave Gerlach#include "prcm43xx.h"
2541d37e61SDave Gerlach
2641d37e61SDave Gerlach#define AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED		0x00030000
2741d37e61SDave Gerlach#define AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE		0x0003
2841d37e61SDave Gerlach#define AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE		0x0002
2941d37e61SDave Gerlach
3041d37e61SDave Gerlach#define AM43XX_EMIF_POWEROFF_ENABLE			0x1
3141d37e61SDave Gerlach#define AM43XX_EMIF_POWEROFF_DISABLE			0x0
3241d37e61SDave Gerlach
3341d37e61SDave Gerlach#define AM43XX_CM_CLKSTCTRL_CLKTRCTRL_SW_SLEEP		0x1
3441d37e61SDave Gerlach#define AM43XX_CM_CLKSTCTRL_CLKTRCTRL_HW_AUTO		0x3
3541d37e61SDave Gerlach
3641d37e61SDave Gerlach#define AM43XX_CM_BASE					0x44DF0000
3741d37e61SDave Gerlach
3841d37e61SDave Gerlach#define AM43XX_CM_REGADDR(inst, reg)                           \
3941d37e61SDave Gerlach       AM33XX_L4_WK_IO_ADDRESS(AM43XX_CM_BASE + (inst) + (reg))
4041d37e61SDave Gerlach
4141d37e61SDave Gerlach#define AM43XX_CM_MPU_CLKSTCTRL AM43XX_CM_REGADDR(AM43XX_CM_MPU_INST, \
4241d37e61SDave Gerlach					AM43XX_CM_MPU_MPU_CDOFFS)
4341d37e61SDave Gerlach#define AM43XX_CM_MPU_MPU_CLKCTRL AM43XX_CM_REGADDR(AM43XX_CM_MPU_INST, \
4441d37e61SDave Gerlach					AM43XX_CM_MPU_MPU_CLKCTRL_OFFSET)
4541d37e61SDave Gerlach#define AM43XX_CM_PER_EMIF_CLKCTRL  AM43XX_CM_REGADDR(AM43XX_CM_PER_INST, \
4641d37e61SDave Gerlach					AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET)
4741d37e61SDave Gerlach#define AM43XX_PRM_EMIF_CTRL_OFFSET			0x0030
4841d37e61SDave Gerlach
4941d37e61SDave Gerlach	.arm
5041d37e61SDave Gerlach	.align 3
5141d37e61SDave Gerlach
5241d37e61SDave GerlachENTRY(am43xx_do_wfi)
5341d37e61SDave Gerlach	stmfd	sp!, {r4 - r11, lr}	@ save registers on stack
5441d37e61SDave Gerlach
55*03de3727SArnd Bergmann#ifdef CONFIG_CACHE_L2X0
5641d37e61SDave Gerlach	/* Retrieve l2 cache virt address BEFORE we shut off EMIF */
5741d37e61SDave Gerlach	ldr	r1, get_l2cache_base
5841d37e61SDave Gerlach	blx	r1
5941d37e61SDave Gerlach	mov	r8, r0
60*03de3727SArnd Bergmann#endif
6141d37e61SDave Gerlach
6241d37e61SDave Gerlach	/*
6341d37e61SDave Gerlach	 * Flush all data from the L1 and L2 data cache before disabling
6441d37e61SDave Gerlach	 * SCTLR.C bit.
6541d37e61SDave Gerlach	 */
6641d37e61SDave Gerlach	ldr	r1, kernel_flush
6741d37e61SDave Gerlach	blx	r1
6841d37e61SDave Gerlach
6941d37e61SDave Gerlach	/*
7041d37e61SDave Gerlach	 * Clear the SCTLR.C bit to prevent further data cache
7141d37e61SDave Gerlach	 * allocation. Clearing SCTLR.C would make all the data accesses
7241d37e61SDave Gerlach	 * strongly ordered and would not hit the cache.
7341d37e61SDave Gerlach	 */
7441d37e61SDave Gerlach	mrc	p15, 0, r0, c1, c0, 0
7541d37e61SDave Gerlach	bic	r0, r0, #(1 << 2)	@ Disable the C bit
7641d37e61SDave Gerlach	mcr	p15, 0, r0, c1, c0, 0
7741d37e61SDave Gerlach	isb
7841d37e61SDave Gerlach	dsb
7941d37e61SDave Gerlach
8041d37e61SDave Gerlach	/*
8141d37e61SDave Gerlach	 * Invalidate L1 and L2 data cache.
8241d37e61SDave Gerlach	 */
8341d37e61SDave Gerlach	ldr	r1, kernel_flush
8441d37e61SDave Gerlach	blx	r1
8541d37e61SDave Gerlach
8641d37e61SDave Gerlach#ifdef CONFIG_CACHE_L2X0
8741d37e61SDave Gerlach	/*
8841d37e61SDave Gerlach	 * Clean and invalidate the L2 cache.
8941d37e61SDave Gerlach	 */
9041d37e61SDave Gerlach#ifdef CONFIG_PL310_ERRATA_727915
9141d37e61SDave Gerlach	mov	r0, #0x03
9241d37e61SDave Gerlach	mov	r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX
9341d37e61SDave Gerlach	dsb
9441d37e61SDave Gerlach	smc	#0
9541d37e61SDave Gerlach	dsb
9641d37e61SDave Gerlach#endif
9741d37e61SDave Gerlach	mov	r0, r8
9841d37e61SDave Gerlach	adr	r4, am43xx_pm_ro_sram_data
9941d37e61SDave Gerlach	ldr	r3, [r4, #AMX3_PM_RO_SRAM_DATA_VIRT_OFFSET]
10041d37e61SDave Gerlach
10141d37e61SDave Gerlach	mov	r2, r0
10241d37e61SDave Gerlach	ldr	r0, [r2, #L2X0_AUX_CTRL]
10341d37e61SDave Gerlach	str	r0, [r3, #AMX3_PM_L2_AUX_CTRL_VAL_OFFSET]
10441d37e61SDave Gerlach	ldr	r0, [r2, #L310_PREFETCH_CTRL]
10541d37e61SDave Gerlach	str	r0, [r3, #AMX3_PM_L2_PREFETCH_CTRL_VAL_OFFSET]
10641d37e61SDave Gerlach
10741d37e61SDave Gerlach	ldr	r0, l2_val
10841d37e61SDave Gerlach	str	r0, [r2, #L2X0_CLEAN_INV_WAY]
10941d37e61SDave Gerlachwait:
11041d37e61SDave Gerlach	ldr	r0, [r2, #L2X0_CLEAN_INV_WAY]
11141d37e61SDave Gerlach	ldr	r1, l2_val
11241d37e61SDave Gerlach	ands	r0, r0, r1
11341d37e61SDave Gerlach	bne	wait
11441d37e61SDave Gerlach#ifdef CONFIG_PL310_ERRATA_727915
11541d37e61SDave Gerlach	mov	r0, #0x00
11641d37e61SDave Gerlach	mov	r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX
11741d37e61SDave Gerlach	dsb
11841d37e61SDave Gerlach	smc	#0
11941d37e61SDave Gerlach	dsb
12041d37e61SDave Gerlach#endif
12141d37e61SDave Gerlachl2x_sync:
12241d37e61SDave Gerlach	mov	r0, r8
12341d37e61SDave Gerlach	mov	r2, r0
12441d37e61SDave Gerlach	mov	r0, #0x0
12541d37e61SDave Gerlach	str	r0, [r2, #L2X0_CACHE_SYNC]
12641d37e61SDave Gerlachsync:
12741d37e61SDave Gerlach	ldr	r0, [r2, #L2X0_CACHE_SYNC]
12841d37e61SDave Gerlach	ands	r0, r0, #0x1
12941d37e61SDave Gerlach	bne	sync
13041d37e61SDave Gerlach#endif
13141d37e61SDave Gerlach
13241d37e61SDave Gerlach	adr     r9, am43xx_emif_sram_table
13341d37e61SDave Gerlach
13441d37e61SDave Gerlach	ldr     r3, [r9, #EMIF_PM_ENTER_SR_OFFSET]
13541d37e61SDave Gerlach	blx     r3
13641d37e61SDave Gerlach
13741d37e61SDave Gerlach	ldr     r3, [r9, #EMIF_PM_SAVE_CONTEXT_OFFSET]
13841d37e61SDave Gerlach	blx     r3
13941d37e61SDave Gerlach
14041d37e61SDave Gerlach	/* Disable EMIF */
14141d37e61SDave Gerlach	ldr	r1, am43xx_virt_emif_clkctrl
14241d37e61SDave Gerlach	ldr	r2, [r1]
14341d37e61SDave Gerlach	bic	r2, r2, #AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE
14441d37e61SDave Gerlach	str	r2, [r1]
14541d37e61SDave Gerlach
14641d37e61SDave Gerlachwait_emif_disable:
14741d37e61SDave Gerlach	ldr	r2, [r1]
14841d37e61SDave Gerlach	mov	r3, #AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED
14941d37e61SDave Gerlach	cmp	r2, r3
15041d37e61SDave Gerlach	bne	wait_emif_disable
15141d37e61SDave Gerlach
15241d37e61SDave Gerlach	/*
15341d37e61SDave Gerlach	 * For the MPU WFI to be registered as an interrupt
15441d37e61SDave Gerlach	 * to WKUP_M3, MPU_CLKCTRL.MODULEMODE needs to be set
15541d37e61SDave Gerlach	 * to DISABLED
15641d37e61SDave Gerlach	 */
15741d37e61SDave Gerlach	ldr	r1, am43xx_virt_mpu_clkctrl
15841d37e61SDave Gerlach	ldr	r2, [r1]
15941d37e61SDave Gerlach	bic	r2, r2, #AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE
16041d37e61SDave Gerlach	str	r2, [r1]
16141d37e61SDave Gerlach
16241d37e61SDave Gerlach	/*
16341d37e61SDave Gerlach	 * Put MPU CLKDM to SW_SLEEP
16441d37e61SDave Gerlach	 */
16541d37e61SDave Gerlach	ldr	r1, am43xx_virt_mpu_clkstctrl
16641d37e61SDave Gerlach	mov	r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_SW_SLEEP
16741d37e61SDave Gerlach	str	r2, [r1]
16841d37e61SDave Gerlach
16941d37e61SDave Gerlach	/*
17041d37e61SDave Gerlach	 * Execute a barrier instruction to ensure that all cache,
17141d37e61SDave Gerlach	 * TLB and branch predictor maintenance operations issued
17241d37e61SDave Gerlach	 * have completed.
17341d37e61SDave Gerlach	 */
17441d37e61SDave Gerlach	dsb
17541d37e61SDave Gerlach	dmb
17641d37e61SDave Gerlach
17741d37e61SDave Gerlach	/*
17841d37e61SDave Gerlach	 * Execute a WFI instruction and wait until the
17941d37e61SDave Gerlach	 * STANDBYWFI output is asserted to indicate that the
18041d37e61SDave Gerlach	 * CPU is in idle and low power state. CPU can specualatively
18141d37e61SDave Gerlach	 * prefetch the instructions so add NOPs after WFI. Sixteen
18241d37e61SDave Gerlach	 * NOPs as per Cortex-A9 pipeline.
18341d37e61SDave Gerlach	 */
18441d37e61SDave Gerlach	wfi
18541d37e61SDave Gerlach
18641d37e61SDave Gerlach	nop
18741d37e61SDave Gerlach	nop
18841d37e61SDave Gerlach	nop
18941d37e61SDave Gerlach	nop
19041d37e61SDave Gerlach	nop
19141d37e61SDave Gerlach	nop
19241d37e61SDave Gerlach	nop
19341d37e61SDave Gerlach	nop
19441d37e61SDave Gerlach	nop
19541d37e61SDave Gerlach	nop
19641d37e61SDave Gerlach	nop
19741d37e61SDave Gerlach	nop
19841d37e61SDave Gerlach	nop
19941d37e61SDave Gerlach	nop
20041d37e61SDave Gerlach	nop
20141d37e61SDave Gerlach	nop
20241d37e61SDave Gerlach
20341d37e61SDave Gerlach	/* We come here in case of an abort due to a late interrupt */
20441d37e61SDave Gerlach	ldr	r1, am43xx_virt_mpu_clkstctrl
20541d37e61SDave Gerlach	mov	r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_HW_AUTO
20641d37e61SDave Gerlach	str	r2, [r1]
20741d37e61SDave Gerlach
20841d37e61SDave Gerlach	/* Set MPU_CLKCTRL.MODULEMODE back to ENABLE */
20941d37e61SDave Gerlach	ldr	r1, am43xx_virt_mpu_clkctrl
21041d37e61SDave Gerlach	mov	r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE
21141d37e61SDave Gerlach	str	r2, [r1]
21241d37e61SDave Gerlach
21341d37e61SDave Gerlach	/* Re-enable EMIF */
21441d37e61SDave Gerlach	ldr	r1, am43xx_virt_emif_clkctrl
21541d37e61SDave Gerlach	mov	r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE
21641d37e61SDave Gerlach	str	r2, [r1]
21741d37e61SDave Gerlachwait_emif_enable:
21841d37e61SDave Gerlach	ldr	r3, [r1]
21941d37e61SDave Gerlach	cmp	r2, r3
22041d37e61SDave Gerlach	bne	wait_emif_enable
22141d37e61SDave Gerlach
22241d37e61SDave Gerlach	/*
22341d37e61SDave Gerlach	 * Set SCTLR.C bit to allow data cache allocation
22441d37e61SDave Gerlach	 */
22541d37e61SDave Gerlach	mrc	p15, 0, r0, c1, c0, 0
22641d37e61SDave Gerlach	orr	r0, r0, #(1 << 2)	@ Enable the C bit
22741d37e61SDave Gerlach	mcr	p15, 0, r0, c1, c0, 0
22841d37e61SDave Gerlach	isb
22941d37e61SDave Gerlach
23041d37e61SDave Gerlach	ldr     r1, [r9, #EMIF_PM_ABORT_SR_OFFSET]
23141d37e61SDave Gerlach	blx     r1
23241d37e61SDave Gerlach
23341d37e61SDave Gerlach	/* Let the suspend code know about the abort */
23441d37e61SDave Gerlach	mov	r0, #1
23541d37e61SDave Gerlach	ldmfd	sp!, {r4 - r11, pc}	@ restore regs and return
23641d37e61SDave GerlachENDPROC(am43xx_do_wfi)
23741d37e61SDave Gerlach
23841d37e61SDave Gerlach	.align
23941d37e61SDave GerlachENTRY(am43xx_resume_offset)
24041d37e61SDave Gerlach	.word . - am43xx_do_wfi
24141d37e61SDave Gerlach
24241d37e61SDave GerlachENTRY(am43xx_resume_from_deep_sleep)
24341d37e61SDave Gerlach	/* Set MPU CLKSTCTRL to HW AUTO so that CPUidle works properly */
24441d37e61SDave Gerlach	ldr	r1, am43xx_virt_mpu_clkstctrl
24541d37e61SDave Gerlach	mov	r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_HW_AUTO
24641d37e61SDave Gerlach	str	r2, [r1]
24741d37e61SDave Gerlach
24841d37e61SDave Gerlach	/* For AM43xx, use EMIF power down until context is restored */
24941d37e61SDave Gerlach	ldr	r2, am43xx_phys_emif_poweroff
25041d37e61SDave Gerlach	mov	r1, #AM43XX_EMIF_POWEROFF_ENABLE
25141d37e61SDave Gerlach	str	r1, [r2, #0x0]
25241d37e61SDave Gerlach
25341d37e61SDave Gerlach	/* Re-enable EMIF */
25441d37e61SDave Gerlach	ldr	r1, am43xx_phys_emif_clkctrl
25541d37e61SDave Gerlach	mov	r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE
25641d37e61SDave Gerlach	str	r2, [r1]
25741d37e61SDave Gerlachwait_emif_enable1:
25841d37e61SDave Gerlach	ldr	r3, [r1]
25941d37e61SDave Gerlach	cmp	r2, r3
26041d37e61SDave Gerlach	bne	wait_emif_enable1
26141d37e61SDave Gerlach
26241d37e61SDave Gerlach	adr     r9, am43xx_emif_sram_table
26341d37e61SDave Gerlach
26441d37e61SDave Gerlach	ldr     r1, [r9, #EMIF_PM_RESTORE_CONTEXT_OFFSET]
26541d37e61SDave Gerlach	blx     r1
26641d37e61SDave Gerlach
26741d37e61SDave Gerlach	ldr     r1, [r9, #EMIF_PM_EXIT_SR_OFFSET]
26841d37e61SDave Gerlach	blx     r1
26941d37e61SDave Gerlach
27041d37e61SDave Gerlach	ldr     r2, am43xx_phys_emif_poweroff
27141d37e61SDave Gerlach	mov     r1, #AM43XX_EMIF_POWEROFF_DISABLE
27241d37e61SDave Gerlach	str     r1, [r2, #0x0]
27341d37e61SDave Gerlach
27441d37e61SDave Gerlach#ifdef CONFIG_CACHE_L2X0
27541d37e61SDave Gerlach	ldr	r2, l2_cache_base
27641d37e61SDave Gerlach	ldr	r0, [r2, #L2X0_CTRL]
27741d37e61SDave Gerlach	and	r0, #0x0f
27841d37e61SDave Gerlach	cmp	r0, #1
27941d37e61SDave Gerlach	beq	skip_l2en			@ Skip if already enabled
28041d37e61SDave Gerlach
28141d37e61SDave Gerlach	adr	r4, am43xx_pm_ro_sram_data
28241d37e61SDave Gerlach	ldr	r3, [r4, #AMX3_PM_RO_SRAM_DATA_PHYS_OFFSET]
28341d37e61SDave Gerlach	ldr     r0, [r3, #AMX3_PM_L2_PREFETCH_CTRL_VAL_OFFSET]
28441d37e61SDave Gerlach
28541d37e61SDave Gerlach	ldr	r12, l2_smc1
28641d37e61SDave Gerlach	dsb
28741d37e61SDave Gerlach	smc	#0
28841d37e61SDave Gerlach	dsb
28941d37e61SDave Gerlachset_aux_ctrl:
29041d37e61SDave Gerlach	ldr     r0, [r3, #AMX3_PM_L2_AUX_CTRL_VAL_OFFSET]
29141d37e61SDave Gerlach	ldr	r12, l2_smc2
29241d37e61SDave Gerlach	dsb
29341d37e61SDave Gerlach	smc	#0
29441d37e61SDave Gerlach	dsb
29541d37e61SDave Gerlach
29641d37e61SDave Gerlach	/* L2 invalidate on resume */
29741d37e61SDave Gerlach	ldr	r0, l2_val
29841d37e61SDave Gerlach	ldr	r2, l2_cache_base
29941d37e61SDave Gerlach	str	r0, [r2, #L2X0_INV_WAY]
30041d37e61SDave Gerlachwait2:
30141d37e61SDave Gerlach	ldr	r0, [r2, #L2X0_INV_WAY]
30241d37e61SDave Gerlach	ldr	r1, l2_val
30341d37e61SDave Gerlach	ands	r0, r0, r1
30441d37e61SDave Gerlach	bne	wait2
30541d37e61SDave Gerlach#ifdef CONFIG_PL310_ERRATA_727915
30641d37e61SDave Gerlach	mov	r0, #0x00
30741d37e61SDave Gerlach	mov	r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX
30841d37e61SDave Gerlach	dsb
30941d37e61SDave Gerlach	smc	#0
31041d37e61SDave Gerlach	dsb
31141d37e61SDave Gerlach#endif
31241d37e61SDave Gerlachl2x_sync2:
31341d37e61SDave Gerlach	ldr	r2, l2_cache_base
31441d37e61SDave Gerlach	mov	r0, #0x0
31541d37e61SDave Gerlach	str	r0, [r2, #L2X0_CACHE_SYNC]
31641d37e61SDave Gerlachsync2:
31741d37e61SDave Gerlach	ldr	r0, [r2, #L2X0_CACHE_SYNC]
31841d37e61SDave Gerlach	ands	r0, r0, #0x1
31941d37e61SDave Gerlach	bne	sync2
32041d37e61SDave Gerlach
32141d37e61SDave Gerlach	mov	r0, #0x1
32241d37e61SDave Gerlach	ldr	r12, l2_smc3
32341d37e61SDave Gerlach	dsb
32441d37e61SDave Gerlach	smc	#0
32541d37e61SDave Gerlach	dsb
32641d37e61SDave Gerlach#endif
32741d37e61SDave Gerlachskip_l2en:
32841d37e61SDave Gerlach	/* We are back. Branch to the common CPU resume routine */
32941d37e61SDave Gerlach	mov	r0, #0
33041d37e61SDave Gerlach	ldr	pc, resume_addr
33141d37e61SDave GerlachENDPROC(am43xx_resume_from_deep_sleep)
33241d37e61SDave Gerlach
33341d37e61SDave Gerlach/*
33441d37e61SDave Gerlach * Local variables
33541d37e61SDave Gerlach */
33641d37e61SDave Gerlach	.align
33741d37e61SDave Gerlachresume_addr:
33841d37e61SDave Gerlach	.word	cpu_resume - PAGE_OFFSET + 0x80000000
33941d37e61SDave Gerlachkernel_flush:
34041d37e61SDave Gerlach	.word   v7_flush_dcache_all
34141d37e61SDave Gerlachddr_start:
34241d37e61SDave Gerlach	.word	PAGE_OFFSET
34341d37e61SDave Gerlach
34441d37e61SDave Gerlacham43xx_phys_emif_poweroff:
34541d37e61SDave Gerlach	.word   (AM43XX_CM_BASE + AM43XX_PRM_DEVICE_INST + \
34641d37e61SDave Gerlach		 AM43XX_PRM_EMIF_CTRL_OFFSET)
34741d37e61SDave Gerlacham43xx_virt_mpu_clkstctrl:
34841d37e61SDave Gerlach	.word	(AM43XX_CM_MPU_CLKSTCTRL)
34941d37e61SDave Gerlacham43xx_virt_mpu_clkctrl:
35041d37e61SDave Gerlach	.word	(AM43XX_CM_MPU_MPU_CLKCTRL)
35141d37e61SDave Gerlacham43xx_virt_emif_clkctrl:
35241d37e61SDave Gerlach	.word	(AM43XX_CM_PER_EMIF_CLKCTRL)
35341d37e61SDave Gerlacham43xx_phys_emif_clkctrl:
35441d37e61SDave Gerlach	.word	(AM43XX_CM_BASE + AM43XX_CM_PER_INST + \
35541d37e61SDave Gerlach		 AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET)
35641d37e61SDave Gerlach
357*03de3727SArnd Bergmann#ifdef CONFIG_CACHE_L2X0
35841d37e61SDave Gerlach/* L2 cache related defines for AM437x */
359*03de3727SArnd Bergmannget_l2cache_base:
360*03de3727SArnd Bergmann	.word	omap4_get_l2cache_base
36141d37e61SDave Gerlachl2_cache_base:
36241d37e61SDave Gerlach	.word	OMAP44XX_L2CACHE_BASE
36341d37e61SDave Gerlachl2_smc1:
36441d37e61SDave Gerlach	.word	OMAP4_MON_L2X0_PREFETCH_INDEX
36541d37e61SDave Gerlachl2_smc2:
36641d37e61SDave Gerlach	.word	OMAP4_MON_L2X0_AUXCTRL_INDEX
36741d37e61SDave Gerlachl2_smc3:
36841d37e61SDave Gerlach	.word	OMAP4_MON_L2X0_CTRL_INDEX
36941d37e61SDave Gerlachl2_val:
37041d37e61SDave Gerlach	.word	0xffff
371*03de3727SArnd Bergmann#endif
37241d37e61SDave Gerlach
37341d37e61SDave Gerlach.align 3
37441d37e61SDave Gerlach/* DDR related defines */
37541d37e61SDave GerlachENTRY(am43xx_emif_sram_table)
37641d37e61SDave Gerlach	.space EMIF_PM_FUNCTIONS_SIZE
37741d37e61SDave Gerlach
37841d37e61SDave GerlachENTRY(am43xx_pm_sram)
37941d37e61SDave Gerlach	.word am43xx_do_wfi
38041d37e61SDave Gerlach	.word am43xx_do_wfi_sz
38141d37e61SDave Gerlach	.word am43xx_resume_offset
38241d37e61SDave Gerlach	.word am43xx_emif_sram_table
38341d37e61SDave Gerlach	.word am43xx_pm_ro_sram_data
38441d37e61SDave Gerlach
38541d37e61SDave Gerlach.align 3
38641d37e61SDave Gerlach
38741d37e61SDave GerlachENTRY(am43xx_pm_ro_sram_data)
38841d37e61SDave Gerlach	.space AMX3_PM_RO_SRAM_DATA_SIZE
38941d37e61SDave Gerlach
39041d37e61SDave GerlachENTRY(am43xx_do_wfi_sz)
39141d37e61SDave Gerlach	.word	. - am43xx_do_wfi
392