13.07.2015 Views

Cortex-A8 R2P2.pdf - ARM Information Center

Cortex-A8 R2P2.pdf - ARM Information Center

Cortex-A8 R2P2.pdf - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Debug}dscr := ReadDebugRegister(34);++timeout;}// Step 9. Restore the corrupted register r0.WriteRegisterInStallMode(0, saved_r0);// Step 10. Check the DSCR for a sticky abort.aborted := CheckForAborts();Example 12-26 shows the sequence for writing a block of words to memory.Example 12-26 Writing a block of words to memory (fast download)WriteWords(uint32 address, bool &aborted, uint32 *data, int nwords){// Step 1. Save the value of r0.saved_r0 := ReadRegister(0);// Step 2. Write the value 2'b10 to DSCR[21:20] for fast mode.SetDTRAccessMode(2b10);// Step 3. Write the opcode for MCR p14, 0, r0, c5, c0 to the ITR.// Write stalls until the ITR is ready but the instruction is not issued.WriteDebugRegister(33, 0xEE000E15);// Step 4. Write the address to read from to the DTRRX// Write stalls until the ITR is ready, but the instruction is not reissued.WriteDebugRegister(33, address);// Step 5. Write the opcode for STC p14, c5, [r0], 4 to the ITR.// Write stalls until the ITR is ready but the instruction is not issued.WriteDebugRegister(33, 0xED803E00);// Step 6. Loop writing the data.// Each time a word is written to the DTR, the instruction is reissued.while (nwords > 0){WriteDebugRegister(33, *data++);--nwords;}// Step 7. Write the value 2'b00 to DSCR[21:20] for normal mode.SetDTRAccessMode(2'b00);// Step 8. Restore the corrupted register r0.WriteRegister(0, saved_r0);// Step 9. Check the DSCR for a sticky abort.aborted := CheckForAborts();}<strong>ARM</strong> DDI 0344E Copyright © 2006-2008 <strong>ARM</strong> Limited. All rights reserved. 12-113

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

Saved successfully!

Ooh no, something went wrong!