2022-06-26 18:24:07 -05:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
2006-06-02 05:36:31 -05:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2005 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
***************************************************************************/
|
2012-02-05 06:03:04 -06:00
|
|
|
|
2015-09-21 14:07:46 -05:00
|
|
|
#ifndef OPENOCD_TARGET_ARMV4_5_CACHE_H
|
|
|
|
#define OPENOCD_TARGET_ARMV4_5_CACHE_H
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2021-04-19 15:04:30 -05:00
|
|
|
#include "helper/types.h"
|
|
|
|
|
2019-03-31 21:42:23 -05:00
|
|
|
struct command_invocation;
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2012-02-05 06:03:04 -06:00
|
|
|
struct armv4_5_cachesize {
|
2006-06-02 05:36:31 -05:00
|
|
|
int linelen;
|
|
|
|
int associativity;
|
|
|
|
int nsets;
|
|
|
|
int cachesize;
|
2009-11-13 10:41:18 -06:00
|
|
|
};
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2012-02-05 06:03:04 -06:00
|
|
|
struct armv4_5_cache_common {
|
2006-06-02 05:36:31 -05:00
|
|
|
int ctype; /* specify supported cache operations */
|
|
|
|
int separate; /* separate caches or unified cache */
|
2009-11-13 10:41:18 -06:00
|
|
|
struct armv4_5_cachesize d_u_size; /* data cache */
|
|
|
|
struct armv4_5_cachesize i_size; /* instruction cache */
|
2006-06-02 05:36:31 -05:00
|
|
|
int i_cache_enabled;
|
|
|
|
int d_u_cache_enabled;
|
2009-11-13 10:41:22 -06:00
|
|
|
};
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2009-11-09 06:22:23 -06:00
|
|
|
int armv4_5_identify_cache(uint32_t cache_type_reg,
|
2009-11-13 10:41:22 -06:00
|
|
|
struct armv4_5_cache_common *cache);
|
2009-11-09 06:22:23 -06:00
|
|
|
int armv4_5_cache_state(uint32_t cp15_control_reg,
|
2009-11-13 10:41:22 -06:00
|
|
|
struct armv4_5_cache_common *cache);
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2019-03-31 21:42:23 -05:00
|
|
|
int armv4_5_handle_cache_info_command(struct command_invocation *cmd,
|
2009-11-13 10:41:22 -06:00
|
|
|
struct armv4_5_cache_common *armv4_5_cache);
|
2006-06-02 05:36:31 -05:00
|
|
|
|
2012-02-05 06:03:04 -06:00
|
|
|
enum {
|
2006-08-31 07:41:49 -05:00
|
|
|
ARMV4_5_D_U_CACHE_ENABLED = 0x4,
|
|
|
|
ARMV4_5_I_CACHE_ENABLED = 0x1000,
|
|
|
|
ARMV4_5_WRITE_BUFFER_ENABLED = 0x8,
|
|
|
|
ARMV4_5_CACHE_RR_BIT = 0x5000,
|
|
|
|
};
|
|
|
|
|
2015-09-21 14:07:46 -05:00
|
|
|
#endif /* OPENOCD_TARGET_ARMV4_5_CACHE_H */
|