09.12.2012 Views

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MOV r0, r4<br />

POP {r4, pc}<br />

Example 12-31 shows the sequence on power up of an operating system.<br />

Debug<br />

Example 12-31 OS debug register restore sequence<br />

; On entry, r0 points to a block of saved debug registers.<br />

RestoreDebugRegisters<br />

PUSH {r4, lr}<br />

MOV r4, r0 ; save pointer<br />

; Step 1. Get the number of words saved.<br />

BL GetDebugRegisterBase ; returns base in R0<br />

LDR r1, [r0, 0x308] ; OSSRR returns size on first read<br />

; Step 2. Loop writing words from the OSSRR.<br />

1 LDR r2, [r4], 4 ; load a word from the save stack<br />

STR r2, [r0, 0x308] ; store a word of data<br />

SUBS r1, r1, 1<br />

BNE%B1 ; loop<br />

; Step 3. Clear the OS Lock Access Register (OSLAR).<br />

LDR r1, =0xC5ACCE55<br />

STR r1, [r0, 0x300] ; write OSLAR<br />

; Step 4. Return the pointer to the first word not written.<br />

MOV r0, r4<br />

POP {r4, pc}<br />

Note<br />

When the OSLAR is cleared, a debug event is triggered if the OS unlock catch bit is set to 1.<br />

This can be useful for a debugger to restart a debugging session.<br />

12.12.5 Registers available during power down<br />

12.12.6 Scenarios and usage models<br />

Some debug registers reside in the debug power domain so they can be available while the core<br />

is powered down. This register set is chosen so the debugger can identify the part at any time<br />

and debug the OS power-up sequence.<br />

This section describes the different debugging scenarios for systems with energy management<br />

capabilities along with a description of how the debug features help with those.<br />

Application debug on a stable OS<br />

For this system, set the DBGNOPWRDWN signal to 1 to emulate power down.<br />

Application debug on an OS with save and restore capability<br />

For this system, application debug is possible without power-down emulation if<br />

the OS supports storing and recovering of the debug registers. This is useful in<br />

systems where either:<br />

• the save and restore capability is already implemented in the OS<br />

• power-down emulation is undesirable because it makes it difficult to<br />

reproduce the error<br />

• the system design does not support the power-down emulation.<br />

<strong>ARM</strong> DDI 0344K Copyright © 2006-2010 <strong>ARM</strong> Limited. All rights reserved. 12-88<br />

ID060510 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!