49 LOG_DEBUG(
"instruction cache is not enabled");
59 int32_t c_way, c_index =
size->index;
66 uint32_t value = (c_index <<
size->index_shift)
67 | (c_way <<
size->way_shift) | (cl << 1);
80 }
while (c_index >= 0);
103 for (cl = 0; cl < cache->
loc; cl++) {
111 retval = dpm->
finish(dpm);
152 uint32_t linelen = armv7a_cache->
dminline;
153 uint32_t va_line, va_end;
164 va_line = virt & (-linelen);
165 va_end = virt +
size;
168 if (virt != va_line) {
178 if ((va_end & (linelen-1)) != 0) {
179 va_end &= (-linelen);
187 while (va_line < va_end) {
188 if ((i++ & 0x3f) == 0)
216 uint32_t linelen = armv7a_cache->
dminline;
217 uint32_t va_line, va_end;
228 va_line = virt & (-linelen);
229 va_end = virt +
size;
231 while (va_line < va_end) {
232 if ((i++ & 0x3f) == 0)
260 uint32_t linelen = armv7a_cache->
dminline;
261 uint32_t va_line, va_end;
272 va_line = virt & (-linelen);
273 va_end = virt +
size;
275 while (va_line < va_end) {
276 if ((i++ & 0x3f) == 0)
342 uint32_t linelen = armv7a_cache->
iminline;
343 uint32_t va_line, va_end;
354 va_line = virt & (-linelen);
355 va_end = virt +
size;
357 while (va_line < va_end) {
358 if ((i++ & 0x3f) == 0)
477 .handler = armv7a_l1_d_cache_clean_inval_all_cmd,
479 .help =
"flush (clean and invalidate) complete l1 d-cache",
484 .handler = arm7a_l1_d_cache_inval_virt_cmd,
486 .help =
"invalidate l1 d-cache by virtual address offset and range size",
487 .usage =
"<virt_addr> [size]",
491 .handler = arm7a_l1_d_cache_clean_virt_cmd,
493 .help =
"clean l1 d-cache by virtual address address offset and range size",
494 .usage =
"<virt_addr> [size]",
502 .handler = armv7a_i_cache_clean_inval_all_cmd,
504 .help =
"invalidate complete l1 i-cache",
509 .handler = arm7a_l1_i_cache_inval_virt_cmd,
511 .help =
"invalidate l1 i-cache by virtual address offset and range size",
512 .usage =
"<virt_addr> [size]",
520 .handler = arm7a_l1_cache_info_cmd,
522 .help =
"print cache related information",
528 .help =
"l1 d-cache command group",
535 .help =
"l1 i-cache command group",
546 .help =
"l1 cache command group",
560 .help =
"cache command group",
Holds the interface to ARM cores.
Macros used to generate various ARM or Thumb opcodes.
#define ARMV4_5_MCR(cp, op1, rd, crn, crm, op2)
int armv7a_handle_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache)
static struct armv7a_common * target_to_armv7a(struct target *target)
static int armv7a_l1_d_cache_sanity_check(struct target *target)
int armv7a_l1_d_cache_flush_virt(struct target *target, uint32_t virt, unsigned int size)
int armv7a_l1_i_cache_inval_virt(struct target *target, uint32_t virt, uint32_t size)
int armv7a_l1_i_cache_inval_all(struct target *target)
static const struct command_registration arm7a_l1_i_cache_commands[]
static int armv7a_l1_i_cache_sanity_check(struct target *target)
static int armv7a_l1_d_cache_clean_inval_all(struct target *target)
static int armv7a_l1_d_cache_flush_level(struct arm_dpm *dpm, struct armv7a_cachesize *size, int cl)
int armv7a_cache_flush_all_data(struct target *target)
int armv7a_l1_d_cache_clean_virt(struct target *target, uint32_t virt, unsigned int size)
static const struct command_registration arm7a_l1_di_cache_group_handlers[]
int armv7a_cache_flush_virt(struct target *target, uint32_t virt, uint32_t size)
static const struct command_registration arm7a_cache_group_handlers[]
const struct command_registration arm7a_cache_command_handlers[]
COMMAND_HANDLER(arm7a_l1_cache_info_cmd)
static const struct command_registration arm7a_l1_d_cache_commands[]
int armv7a_l1_d_cache_inval_virt(struct target *target, uint32_t virt, uint32_t size)
#define CACHE_LEVEL_HAS_D_CACHE
int arm7a_l2x_flush_all_data(struct target *target)
int armv7a_l2x_cache_flush_virt(struct target *target, target_addr_t virt, uint32_t size)
const struct command_registration arm7a_l2x_cache_command_handler[]
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
size_t size
Size of the control block search area.
#define foreach_smp_target(pos, head)
This wraps an implementation of DPM primitives.
int(* instr_write_data_r0)(struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
Runs one instruction, writing data to R0 before execution.
int(* finish)(struct arm_dpm *dpm)
Invoke after a series of instruction operations.
int(* prepare)(struct arm_dpm *dpm)
Invoke before a series of instruction operations.
struct arm_dpm * dpm
Handle for the debug module, if one is present.
struct armv7a_cachesize d_u_size
struct armv7a_arch_cache arch[6]
struct armv7a_mmu_common armv7a_mmu
struct armv7a_cache_common armv7a_cache
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
struct list_head * smp_targets
struct target * get_current_target(struct command_context *cmd_ctx)
#define ERROR_TARGET_NOT_HALTED
#define ERROR_TARGET_INVALID