28 LOG_ERROR(
"%s: target not halted", __func__);
32 if (!l2x_cache || !l2x_cache->
base) {
54 l2_way_val = (1 << l2x_cache->
way) - 1;
68 uint32_t i, linelen = 32;
75 for (i = 0; i <
size; i += linelen) {
103 uint32_t i, linelen = 32;
110 for (i = 0; i <
size; i += linelen) {
138 uint32_t i, linelen = 32;
145 for (i = 0; i <
size; i += linelen) {
172 if (armv7a_cache->
info == -1) {
178 "L2 unified cache Base Address 0x%" PRIx32
", %" PRIu32
" ways",
179 l2x_cache->
base, l2x_cache->
way);
191 LOG_ERROR(
"L2 cache was already initialised\n");
196 l2x_cache->
base = base;
197 l2x_cache->
way = way;
207 LOG_ERROR(
"smp target : cache l2 already initialized\n");
314 .handler = armv7a_l2x_cache_conf_cmd,
316 .help =
"configure l2x cache",
317 .usage =
"<base_addr> <number_of_way>",
321 .handler = arm7a_l2x_cache_info_command,
323 .help =
"print cache related information",
328 .handler = arm7a_l2x_cache_flush_all_command,
330 .help =
"flush complete l2x cache",
335 .handler = arm7a_l2x_cache_flush_virt_cmd,
337 .help =
"flush (clean and invalidate) l2x cache by virtual address offset and range size",
338 .usage =
"<virt_addr> [size]",
342 .handler = arm7a_l2x_cache_inval_virt_cmd,
344 .help =
"invalidate l2x cache by virtual address offset and range size",
345 .usage =
"<virt_addr> [size]",
349 .handler = arm7a_l2x_cache_clean_virt_cmd,
351 .help =
"clean l2x cache by virtual address address offset and range size",
352 .usage =
"<virt_addr> [size]",
361 .help =
"l2x cache command group",
Holds the interface to ARM cores.
static struct armv7a_common * target_to_armv7a(struct target *target)
COMMAND_HANDLER(arm7a_l2x_cache_info_command)
static int arm7a_l2x_sanity_check(struct target *target)
static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t way)
static int armv7a_l2x_cache_clean_virt(struct target *target, target_addr_t virt, unsigned int size)
static const struct command_registration arm7a_l2x_cache_commands[]
int arm7a_l2x_flush_all_data(struct target *target)
static int arm7a_handle_l2x_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache)
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[]
static int armv7a_l2x_cache_inval_virt(struct target *target, target_addr_t virt, uint32_t size)
#define L2X0_CLEAN_LINE_PA
#define L2X0_CLEAN_INV_WAY
#define L2X0_CLEAN_INV_LINE_PA
void command_print(struct command_invocation *cmd, const char *format,...)
#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 COMMAND_PARSE_ADDRESS(in, out)
#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_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
size_t size
Size of the control block search area.
#define foreach_smp_target(pos, head)
struct armv7a_mmu_common armv7a_mmu
struct armv7a_cache_common armv7a_cache
When run_command is called, a new instance will be created on the stack, filled with the proper value...
int(* virt2phys)(struct target *target, target_addr_t address, target_addr_t *physical)
struct list_head * smp_targets
struct target_type * type
int target_write_phys_u32(struct target *target, target_addr_t address, uint32_t value)
struct target * get_current_target(struct command_context *cmd_ctx)
#define ERROR_TARGET_NOT_HALTED