Skip to content

Commit

Permalink
Support for smp in multiple DMs by dealing with riscv hartid and inde…
Browse files Browse the repository at this point in the history
…x of each hart simply
  • Loading branch information
lz-bro committed Aug 28, 2023
1 parent 928f2b3 commit 7c1b89f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/target/riscv/riscv-013.c
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,6 @@ static int examine(struct target *target)

riscv013_info_t *info = get_info(target);

info->index = target->coreid;
info->abits = get_field(dtmcontrol, DTM_DTMCS_ABITS);
info->dtmcs_idle = get_field(dtmcontrol, DTM_DTMCS_IDLE);

Expand Down Expand Up @@ -2027,6 +2026,9 @@ static int examine(struct target *target)
return ERROR_FAIL;
}

/* The RISC-V hartid is sequential, and the index of each hart on the Debug Module should start at 0 and be contiguous. */
info->index = target->coreid % dm->hart_count;

/* Don't call any riscv_* functions until after we've counted the number of
* cores and initialized registers. */

Expand Down

0 comments on commit 7c1b89f

Please sign in to comment.