Skip to content

Commit

Permalink
riscv_debug: Handle propagating the AP partno to the target for DMIs …
Browse files Browse the repository at this point in the history
…accessed over ADI
  • Loading branch information
dragonmux committed Sep 8, 2024
1 parent 928efc7 commit 9ff6491
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/target/riscv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ static bool riscv_hart_init(riscv_hart_s *const hart)
/* If the hart implements mvendorid, this gives us the JEP-106, otherwise use the DTM designer code */
target->designer_code = hart->vendorid ? hart->vendorid : hart->dbg_module->dmi_bus->designer_code;
target->cpuid = hart->archid;
/* If the DMI bus is provided via ADI, grab the AP's partno for the target */
if (hart->dbg_module->dmi_bus->dev_index == 0xffU && hart->dbg_module->dmi_bus->idle_cycles == 0xffU)
target->part_id = ((riscv_dmi_ap_s *)hart->dbg_module->dmi_bus)->ap->partno;

/* Now we're in a safe environment, leasurely read out the triggers, etc. */
riscv_hart_discover_triggers(hart);
Expand Down

0 comments on commit 9ff6491

Please sign in to comment.