target/arc: Introduce L1I,L1D,L2 caches support
With this commit we introduce L1 and L2 cache flush and invalidate operations which are necessary for getting/setting actual data during memory r/w operations. We introduce L2 cache support, which is not presented on currently support EMSK board. But L2 is presented on HSDK board, which soon will be introduced. Change-Id: I2fda505a47ecb8833cc9f5ffe24f6a4e22ab6eb0 Signed-off-by: Evgeniy Didin <didin@synopsys.com> Reviewed-on: http://openocd.zylin.com/5688 Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Antonio Borneo
parent
2e6904eef5
commit
057aed11a2
@@ -909,10 +909,60 @@ static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *
|
||||
return JIM_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(arc_l1_cache_disable_auto_cmd)
|
||||
{
|
||||
bool value;
|
||||
int retval = 0;
|
||||
struct arc_common *arc = target_to_arc(get_current_target(CMD_CTX));
|
||||
retval = CALL_COMMAND_HANDLER(handle_command_parse_bool,
|
||||
&value, "target has caches enabled");
|
||||
arc->has_l2cache = value;
|
||||
arc->has_dcache = value;
|
||||
arc->has_icache = value;
|
||||
return retval;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(arc_l2_cache_disable_auto_cmd)
|
||||
{
|
||||
struct arc_common *arc = target_to_arc(get_current_target(CMD_CTX));
|
||||
return CALL_COMMAND_HANDLER(handle_command_parse_bool,
|
||||
&arc->has_l2cache, "target has l2 cache enabled");
|
||||
}
|
||||
|
||||
/* ----- Exported target commands ------------------------------------------ */
|
||||
|
||||
const struct command_registration arc_l2_cache_group_handlers[] = {
|
||||
{
|
||||
.name = "auto",
|
||||
.handler = arc_l2_cache_disable_auto_cmd,
|
||||
.mode = COMMAND_ANY,
|
||||
.usage = "(1|0)",
|
||||
.help = "Disable or enable L2",
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
|
||||
const struct command_registration arc_cache_group_handlers[] = {
|
||||
{
|
||||
.name = "auto",
|
||||
.handler = arc_l1_cache_disable_auto_cmd,
|
||||
.mode = COMMAND_ANY,
|
||||
.help = "Disable or enable L1",
|
||||
.usage = "(1|0)",
|
||||
},
|
||||
{
|
||||
.name = "l2",
|
||||
.mode = COMMAND_ANY,
|
||||
.help = "L2 cache command group",
|
||||
.usage = "",
|
||||
.chain = arc_l2_cache_group_handlers,
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
|
||||
|
||||
static const struct command_registration arc_core_command_handlers[] = {
|
||||
{
|
||||
{
|
||||
.name = "add-reg-type-flags",
|
||||
.jim_handler = jim_arc_add_reg_type_flags,
|
||||
.mode = COMMAND_CONFIG,
|
||||
@@ -967,6 +1017,13 @@ static const struct command_registration arc_core_command_handlers[] = {
|
||||
.usage = "",
|
||||
.chain = arc_jtag_command_group,
|
||||
},
|
||||
{
|
||||
.name = "cache",
|
||||
.mode = COMMAND_ANY,
|
||||
.help = "cache command group",
|
||||
.usage = "",
|
||||
.chain = arc_cache_group_handlers,
|
||||
},
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user