@@ -454,12 +454,16 @@ static int target_selection(void)
target_select(pib);
pdbg_for_each_target("core", pib, chip) {
int chip_index = pdbg_target_index(chip);
- target_select(chip);
+ if (pdbg_parent_index(chip, "pib") != proc_index)
+ continue;
+
if (chipsel[proc_index][chip_index]) {
+ target_select(chip);
pdbg_for_each_target("thread", chip, thread) {
int thread_index = pdbg_target_index(thread);
- target_select(thread);
- if (!threadsel[proc_index][chip_index][thread_index])
+ if (threadsel[proc_index][chip_index][thread_index])
+ target_select(thread);
+ else
target_unselect(thread);
}
} else
I2C based access is unique in that to access the PIB on secondary processors we need to traverse the PIB on the primary processor. This confuses our current selection logic as every core becomes a child of the primary PIB. Hopefully our selection logic will get rewritten soon, but in the meantime add a check to ensure a cores immediate parent PIB matches the currently selected processor. Signed-off-by: Alistair Popple <alistair@popple.id.au> --- src/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)