diff options
author | Erhan Kurubas <erhan.kurubas@espressif.com> | 2024-02-24 20:29:41 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2024-03-02 11:04:14 +0000 |
commit | 271c4e5253abcd2ec617d5fb5e1a374d2b6a543d (patch) | |
tree | fb46d91ea422873b7517e3b30ea20b19ada91b69 | |
parent | 56a7925a1d2d890adbb5dbd76542bfe901620103 (diff) | |
download | riscv-openocd-271c4e5253abcd2ec617d5fb5e1a374d2b6a543d.zip riscv-openocd-271c4e5253abcd2ec617d5fb5e1a374d2b6a543d.tar.gz riscv-openocd-271c4e5253abcd2ec617d5fb5e1a374d2b6a543d.tar.bz2 |
target/esp_xtensa_smp: don't use coreid as an SMP index
For the sake of https://review.openocd.org/c/openocd/+/7957
Instead of "coreid", 'target smp' command call order used as
an index
Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Iab86b81868d37c0bf8663707ee11367c41f6b96d
Reviewed-on: https://review.openocd.org/c/openocd/+/8162
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r-- | src/target/espressif/esp_xtensa_smp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/target/espressif/esp_xtensa_smp.c b/src/target/espressif/esp_xtensa_smp.c index f883b1c..c49146d 100644 --- a/src/target/espressif/esp_xtensa_smp.c +++ b/src/target/espressif/esp_xtensa_smp.c @@ -94,8 +94,11 @@ int esp_xtensa_smp_soft_reset_halt(struct target *target) LOG_TARGET_DEBUG(target, "begin"); /* in SMP mode we need to ensure that at first we reset SOC on PRO-CPU and then call xtensa_assert_reset() for all cores */ - if (target->smp && target->coreid != 0) - return ERROR_OK; + if (target->smp) { + head = list_first_entry(target->smp_targets, struct target_list, lh); + if (head->target != target) + return ERROR_OK; + } /* Reset the SoC first */ if (esp_xtensa_smp->chip_ops->reset) { res = esp_xtensa_smp->chip_ops->reset(target); |