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

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

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

G.7.14 c9, Cache lockdown support<br />

<strong>ARM</strong>v6 Differences<br />

One problem with caches is that although they normally improve average access time to data <strong>and</strong><br />

instructions, they usually increase the worst-case access time. This occurs for a number of reasons,<br />

including:<br />

There is a delay before the system determines that a cache miss has occurred <strong>and</strong> starts the main<br />

memory access.<br />

If a Write-Back cache is being used, there might be an extra delay because of the requirement to store<br />

the contents of the cache line that is being reallocated.<br />

A whole cache line is loaded from main memory, not only the data requested by the <strong>ARM</strong> processor.<br />

In real-time applications, this increase in the worst-case access time can be significant.<br />

Cache lockdown is an optional feature designed to alleviate this. It enables critical code <strong>and</strong> data, for<br />

example high priority interrupt routines <strong>and</strong> the data they access, to be loaded into the cache in such a way<br />

that the cache lines containing them are not subsequently reallocated. This ensures that all subsequent<br />

accesses to the code <strong>and</strong> data concerned are cache hits <strong>and</strong> therefore complete as quickly as possible.<br />

From <strong>ARM</strong>v7, cache lockdown is IMPLEMENTATION DEFINED with no recommended formats or<br />

mechanisms on how it is achieved other than reserved CP15 register space. See Cache lockdown on<br />

page B2-8 <strong>and</strong> CP15 c9, Cache <strong>and</strong> TCM lockdown registers <strong>and</strong> performance monitors on page B3-141.<br />

<strong>ARM</strong>v4 <strong>and</strong> <strong>ARM</strong>v5 specify four formats for the cache lockdown mechanism, known as Format A, Format<br />

B, Format C, <strong>and</strong> Format D. The Cache Type Register contains information on the lockdown mechanism<br />

adopted. See c0, Cache Type Register (CTR) on page AppxH-35. Formats A, B, <strong>and</strong> C all operate on cache<br />

ways. Format D is a cache entry locking mechanism.<br />

<strong>ARM</strong>v6 cache lockdown support must comply with Format C or Format D. For more information, see c9,<br />

cache lockdown support on page AppxH-52.<br />

Note<br />

A Format D implementation must use the CP15 lockdown operations with the CRm == {c5,c6} encodings,<br />

<strong>and</strong> not the alternative encodings with CRm == {c1,c2}.<br />

Interaction with CP15 c7 operations<br />

Cache lockdown only prevents the normal replacement strategy used on cache misses from choosing to<br />

reallocate cache lines in the locked-down region. CP15 c7 operations that invalidate, clean, or clean <strong>and</strong><br />

invalidate cache contents affect locked-down cache lines as normal. If invalidate operations are used, you<br />

must ensure that they do not use virtual addresses or cache set/way combinations that affect the locked-down<br />

cache lines. Otherwise, if it is difficult to avoid affecting the locked-down cache lines, repeat the cache<br />

lockdown procedure afterwards.<br />

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

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

Saved successfully!

Ooh no, something went wrong!