05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Common Memory System <strong>Architecture</strong> Features<br />

The Cache Type Register holds minimum line length values for:<br />

the instruction caches<br />

the data <strong>and</strong> unified caches.<br />

These values enable a range of addresses to be invalidated in an efficient manner. For details of the register<br />

see:<br />

c0, Cache Type Register (CTR) on page B3-83 for a VMSA implementation<br />

c0, Cache Type Register (CTR) on page B4-34 for a PMSA implementation.<br />

For details of the CP15 c7 encodings for all cache maintenance operations see:<br />

CP15 c7, Cache <strong>and</strong> branch predictor maintenance functions on page B3-126 for a VMSA<br />

implementation<br />

CP15 c7, Cache <strong>and</strong> branch predictor maintenance functions on page B4-68 for a PMSA<br />

implementation.<br />

Cache hierarchy abstraction for set/way-based operations<br />

The set/way-based cache maintenance operations are:<br />

Invalidate data cache or unified cache line by set/way<br />

Clean data cache or unified cache line by set/way<br />

Clean <strong>and</strong> invalidate data cache or unified cache line by set/way<br />

The CP15 c7 encodings of these operations include a field that must be used to specify the cache level for<br />

the operation:<br />

a clean operation cleans from the level of cache specified through to at least the next level of cache,<br />

moving further from the processor<br />

an invalidate operation invalidates only at the level specified.<br />

In addition to these set/way operations, a cache operation is provided for instruction cache maintenance, to<br />

Invalidate all instruction cache lines to the point of unification.<br />

For details of the CP15 c7 encodings for all cache maintenance operations see:<br />

CP15 c7, Cache <strong>and</strong> branch predictor maintenance functions on page B3-126 for a VMSA<br />

implementation<br />

CP15 c7, Cache <strong>and</strong> branch predictor maintenance functions on page B4-68 for a PMSA<br />

implementation.<br />

Example code for cache maintenance operations<br />

This code sequence illustrates a generic mechanism for cleaning the entire data or unified cache to the point<br />

of coherency:<br />

MRC p15, 1, R0, c0, c0, 1 ; Read CLIDR<br />

ANDS R3, R0, #&7000000<br />

MOV R3, R3, LSR #23 ; Cache level value (naturally aligned)<br />

BEQ Finished<br />

MOV R10, #0<br />

B2-16 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

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

Saved successfully!

Ooh no, something went wrong!