armv7a: fix handling of inner caches

ARMv7 architecture allows up to 7 cache levels that are architecturally
visible, as opposed to "system caches", which are outside of the domain
defined by ARMv7 and require separate management. This patch enables
detection and identification of caches at all levels. It also implements
a new "flush-all" function that cleans & invalidates all cache levels to
the "Point of Coherence".

Change-Id: Ib77115d6044d39845907941c6f031e208f6e0aa5
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3024
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
This commit is contained in:
Matthias Welwarsky
2015-10-16 09:25:25 +02:00
committed by Paul Fertser
parent 3a292a1f34
commit 8704e53665
6 changed files with 190 additions and 138 deletions

View File

@@ -63,12 +63,20 @@ struct armv7a_cachesize {
uint32_t way_shift;
};
struct armv7a_cache_common {
int ctype;
/* information about one architecture cache at any level */
struct armv7a_arch_cache {
int ctype; /* cache type, CLIDR encoding */
struct armv7a_cachesize d_u_size; /* data cache */
struct armv7a_cachesize i_size; /* instruction cache */
};
/* common cache information */
struct armv7a_cache_common {
int info; /* -1 invalid, else valid */
int loc; /* level of coherency */
uint32_t dminline; /* minimum d-cache linelen */
uint32_t iminline; /* minimum i-cache linelen */
struct armv7a_arch_cache arch[6]; /* cache info, L1 - L7 */
int i_cache_enabled;
int d_u_cache_enabled;
int auto_cache_enabled; /* openocd automatic