ARM ARM1176JZF-S Technical Reference Manual page 285

Table of Contents

Advertisement

ARM DDI 0301H
ID012310
To use the TLB lockdown access registers read or write CP15 with:
Opcode_1 set to 5
CRn set to c15
CRm set to:
c4, TLB Lockdown Index Register
c5, TLB Lockdown VA Register
c6, TLB Lockdown PA Register
c7, TLB Lockdown Attributes Register.
Opcode_2 set to 2.
For example:
MRC p15, 5, <Rd>, c15, c4, 2
MCR p15, 5, <Rd>, c15, c4, 2
MRC p15, 5, <Rd>, c15, c5, 2
MCR p15, 5, <Rd>, c15, c5, 2
MRC p15, 5, <Rd>, c15, c6, 2
MCR p15, 5, <Rd>, c15, c6, 2
MRC p15, 5, <Rd>, c15, c7, 2
MCR p15, 5, <Rd>, c15, c7, 2
Example 3-3 is a code sequence that stores all 8 TLB Lockdown entries to memory, and later
restores them to the TLB Lockdown region. You might use sequences similar to this for entry
into Dormant mode.
ADR
MOV
CPSID
TLBLockSave
MCR
MRC
MRC
MRC
STMIA
ADD
CMP
BNE
CPSIE
; insert other code here
ADR
MOV
CPSID
TLBLockLoad
LDMIA
MCR
MCR
MCR
MCR
ADD
CMP
BNE
CPSIE
Copyright © 2004-2009 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
; Read TLB Lockdown Index Register
; Write TLB Lockdown Index Register
; Read TLB Lockdown VA Register
; Write TLB Lockdown VA Register
; Read TLB Lockdown PA Register
; Write TLB Lockdown PA Register
; Read TLB Lockdown Attributes Register
; Write TLB Lockdown Attributes Register
Example 3-3 Save and restore all TLB Lockdown entries
r1,TLBLockAddr
; Set r1 to save address
R0,#0
; Initialize counter
aif
; Disable interrupts
p15,5,R0,c15,c4,2
; Set TLB Lockdown Index
p15,5,R2,c15,c5,2
; Read TLB Lockdown VA
p15,5,R3,c15,c7,2
; Read TLB Lockdown Attrs
p15,5,R4,c15,c6,2
; Read TLB Lockdown PA
r1!,{R2-R4}
; Save TLB Lockdown entry
R0,R0,#1
; Increment counter
R0,#8
; Saved all 8 entries?
TLBLockSave
; Loop until all saved
aif
; Re-enable interrupts
r1,TLBLockAddr
; Set r1 to save address
R0,#0
; Initialize counter
aif
; Disable interrupts
r1!,{R2-R4}
; Load TLB Lockdown entry
p15,5,R0,c15,c4,2
; Set TLB Lockdown Index
p15,5,R2,c15,c5,2
; Write TLB Lockdown VA
p15,5,R3,c15,c7,2
; Write TLB Lockdown Attrs
p15,5,R4,c15,c6,2
; Write TLB Lockdown PA
R0,R0,#1
; Increment counter
R0,#8
; Restored all 8 entries?
TLBLockLoad
; Loop until all restored
aif
; Re-enable interrupts
System Control Coprocessor
3-153

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents