File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,7 @@ static bool check_dbgbase_exists(struct target *target)
538538{
539539 uint32_t next_dm = 0 ;
540540 unsigned int count = 1 ;
541+ riscv013_info_t * info = get_info (target );
541542
542543 LOG_TARGET_DEBUG (target , "Searching for DM with DMI base address (dbgbase) = 0x%x" , target -> dbgbase );
543544 while (1 ) {
@@ -552,6 +553,12 @@ static bool check_dbgbase_exists(struct target *target)
552553 LOG_TARGET_ERROR (target , "Reached the end of DM chain (detected %u DMs in total)." , count );
553554 break ;
554555 }
556+ if (next_dm >> info -> abits ) {
557+ LOG_TARGET_ERROR (target , "The address of the next Debug Module does not fit into %u bits, "
558+ "which is the width of the DMI bus address. This is a HW bug" ,
559+ info -> abits );
560+ break ;
561+ }
555562 /* Safety: Avoid looping forever in case of buggy nextdm values in the hardware. */
556563 if (count ++ > RISCV_MAX_DMS ) {
557564 LOG_TARGET_ERROR (target , "Supporting no more than %d DMs on a DMI bus. Aborting" , RISCV_MAX_DMS );
You can’t perform that action at this time.
0 commit comments