From: openocd-gerrit <ope...@us...> - 2025-05-09 12:09:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 06c827757b0c44bef5a15558a71ab666375cbb87 (commit) via d71ed4f3bc58f97ec99f265e55faa1fed7e793ff (commit) from 3954896d6e41298efd74e8bb7af60ec49efae809 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 06c827757b0c44bef5a15558a71ab666375cbb87 Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 19 17:05:16 2025 +0200 target: armv7a: use proper type for struct armv7a_cache_common::outer_cache The field 'outer_cache' is always initialized and used as a pointer to 'struct armv7a_l2x_cache'. There is no reason for using type 'void *' for it. Change the type of 'outer_cache'. Drop the useless cast while reading 'outer_cache'. Change-Id: Iaea9d02e247da26e230f887c85fbf8e9d7be34d5 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8858 Tested-by: jenkins diff --git a/src/target/armv7a.c b/src/target/armv7a.c index fb8862611..4d353dec6 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -182,8 +182,7 @@ done: int armv7a_handle_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache) { - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a_cache->outer_cache); + struct armv7a_l2x_cache *l2x_cache = armv7a_cache->outer_cache; int cl; diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 8943f1c69..2706c4629 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -66,7 +66,7 @@ struct armv7a_cache_common { int i_cache_enabled; int d_u_cache_enabled; /* outer unified cache if some */ - void *outer_cache; + struct armv7a_l2x_cache *outer_cache; int (*flush_all_data_cache)(struct target *target); }; diff --git a/src/target/armv7a_cache_l2x.c b/src/target/armv7a_cache_l2x.c index 39c503f09..bc60e6d19 100644 --- a/src/target/armv7a_cache_l2x.c +++ b/src/target/armv7a_cache_l2x.c @@ -21,8 +21,8 @@ static int arm7a_l2x_sanity_check(struct target *target) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; if (target->state != TARGET_HALTED) { LOG_ERROR("%s: target not halted", __func__); @@ -42,8 +42,8 @@ static int arm7a_l2x_sanity_check(struct target *target) int arm7a_l2x_flush_all_data(struct target *target) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; uint32_t l2_way_val; int retval; @@ -62,8 +62,8 @@ int armv7a_l2x_cache_flush_virt(struct target *target, target_addr_t virt, uint32_t size) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; /* FIXME: different controllers have different linelen? */ uint32_t i, linelen = 32; int retval; @@ -97,8 +97,8 @@ static int armv7a_l2x_cache_inval_virt(struct target *target, target_addr_t virt uint32_t size) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; /* FIXME: different controllers have different linelen */ uint32_t i, linelen = 32; int retval; @@ -132,8 +132,8 @@ static int armv7a_l2x_cache_clean_virt(struct target *target, target_addr_t virt unsigned int size) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; /* FIXME: different controllers have different linelen */ uint32_t i, linelen = 32; int retval; @@ -166,8 +166,7 @@ done: static int arm7a_handle_l2x_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache) { - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a_cache->outer_cache); + struct armv7a_l2x_cache *l2x_cache = armv7a_cache->outer_cache; if (armv7a_cache->info == -1) { command_print(cmd, "cache not yet identified"); commit d71ed4f3bc58f97ec99f265e55faa1fed7e793ff Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 19 16:28:50 2025 +0200 target: armv7a: drop command 'cache_config l2x' The command was already tagged as deprecated in 2015 with commit 0df557728216 ("armv7a: remove l1 flush all data handler") but has never been removed. An equivalent command 'cache l2x conf' was introduced at the same time in commit cd440bd32a12 ("add armv7a_cache handlers"). Drop it and deprecate it. Replace the old command in the Tcl script. Change-Id: Ie24eccc99a78786903704d10ee1d9f6c924529b5 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8857 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index e0bdd5ca0..ca357c780 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -10710,10 +10710,6 @@ Display/set the current core displayed in GDB Selects whether interrupts will be processed when single stepping @end deffn -@deffn {Command} {cache_config l2x} [base way] -configure l2x cache -@end deffn - @deffn {Command} {cortex_a mmu dump} [@option{0}|@option{1}|@option{addr} address [@option{num_entries}]] Dump the MMU translation table from TTB0 or TTB1 register, or from physical memory location @var{address}. When dumping the table from @var{address}, print at most diff --git a/src/target/armv7a.c b/src/target/armv7a.c index c14155e01..fb8862611 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -179,54 +179,6 @@ done: return retval; } -/* FIXME: remove it */ -static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t way) -{ - struct armv7a_l2x_cache *l2x_cache; - struct target_list *head; - - struct armv7a_common *armv7a = target_to_armv7a(target); - l2x_cache = calloc(1, sizeof(struct armv7a_l2x_cache)); - l2x_cache->base = base; - l2x_cache->way = way; - /*LOG_INFO("cache l2 initialized base %x way %d", - l2x_cache->base,l2x_cache->way);*/ - if (armv7a->armv7a_mmu.armv7a_cache.outer_cache) - LOG_INFO("outer cache already initialized\n"); - armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache; - /* initialize all target in this cluster (smp target) - * l2 cache must be configured after smp declaration */ - foreach_smp_target(head, target->smp_targets) { - struct target *curr = head->target; - if (curr != target) { - armv7a = target_to_armv7a(curr); - if (armv7a->armv7a_mmu.armv7a_cache.outer_cache) - LOG_ERROR("smp target : outer cache already initialized\n"); - armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache; - } - } - return JIM_OK; -} - -/* FIXME: remove it */ -COMMAND_HANDLER(handle_cache_l2x) -{ - struct target *target = get_current_target(CMD_CTX); - uint32_t base, way; - - if (CMD_ARGC != 2) - return ERROR_COMMAND_SYNTAX_ERROR; - - /* command_print(CMD, "%s %s", CMD_ARGV[0], CMD_ARGV[1]); */ - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], base); - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], way); - - /* AP address is in bits 31:24 of DP_SELECT */ - armv7a_l2x_cache_init(target, base, way); - - return ERROR_OK; -} - int armv7a_handle_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache) { @@ -561,33 +513,7 @@ int armv7a_arch_state(struct target *target) return ERROR_OK; } -static const struct command_registration l2_cache_commands[] = { - { - .name = "l2x", - .handler = handle_cache_l2x, - .mode = COMMAND_EXEC, - .help = "configure l2x cache", - .usage = "[base_addr] [number_of_way]", - }, - COMMAND_REGISTRATION_DONE - -}; - -static const struct command_registration l2x_cache_command_handlers[] = { - { - .name = "cache_config", - .mode = COMMAND_EXEC, - .help = "cache configuration for a target", - .usage = "", - .chain = l2_cache_commands, - }, - COMMAND_REGISTRATION_DONE -}; - const struct command_registration armv7a_command_handlers[] = { - { - .chain = l2x_cache_command_handlers, - }, { .chain = arm7a_cache_command_handlers, }, diff --git a/src/target/startup.tcl b/src/target/startup.tcl index e9646097f..1cc9bb7fd 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -316,3 +316,9 @@ proc _post_init_target_cortex_a_cache_auto {} { } } lappend post_init_commands _post_init_target_cortex_a_cache_auto + +lappend _telnet_autocomplete_skip "cache_config l2x" +proc "cache_config l2x" {args} { + echo "DEPRECATED! use 'cache l2x conf' not 'cache_config l2x'" + eval cache_config l2x $args +} diff --git a/tcl/target/u8500.cfg b/tcl/target/u8500.cfg index 1fdc11fe3..ea3c7218e 100644 --- a/tcl/target/u8500.cfg +++ b/tcl/target/u8500.cfg @@ -133,7 +133,7 @@ proc enable_apetap {} { set status [$_TARGETNAME_1 curstate] if {[string equal "unknown" $status]} { $_TARGETNAME_1 arp_examine - cache_config l2x 0xa0412000 8 + cache l2x conf 0xa0412000 8 } set status [$_TARGETNAME_2 curstate] ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 4 --- src/target/armv7a.c | 77 +------------------------------------------ src/target/armv7a.h | 2 +- src/target/armv7a_cache_l2x.c | 23 +++++++------ src/target/startup.tcl | 6 ++++ tcl/target/u8500.cfg | 2 +- 6 files changed, 20 insertions(+), 94 deletions(-) hooks/post-receive -- Main OpenOCD repository |