The old code relies upon hartsel being able to hold invalid values, so that dmstatus.anynonexistent will go high. But if hartsel is incapable of holding invalid values (e.g. because it is hardwired to 0), then this code will try to enumerate up to 1K harts (and might not terminate). Fix by seeing how many bits of hartsel are implemented.
The old code relies upon hartsel being able to hold invalid values, so that dmstatus.anynonexistent will go high. But if hartsel is incapable of holding invalid values (e.g. because it is hardwired to 0), then this code will try to enumerate up to 1K harts (and might not terminate). Fix by seeing how many bits of hartsel are implemented.