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)
538
538
{
539
539
uint32_t next_dm = 0 ;
540
540
unsigned int count = 1 ;
541
+ riscv013_info_t * info = get_info (target );
541
542
542
543
LOG_TARGET_DEBUG (target , "Searching for DM with DMI base address (dbgbase) = 0x%x" , target -> dbgbase );
543
544
while (1 ) {
@@ -552,6 +553,12 @@ static bool check_dbgbase_exists(struct target *target)
552
553
LOG_TARGET_ERROR (target , "Reached the end of DM chain (detected %u DMs in total)." , count );
553
554
break ;
554
555
}
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
+ }
555
562
/* Safety: Avoid looping forever in case of buggy nextdm values in the hardware. */
556
563
if (count ++ > RISCV_MAX_DMS ) {
557
564
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