adiv5: More checks for a sensible DPIDR.
This commit is contained in:
parent
752bc26536
commit
48a79ff9da
|
@ -614,8 +614,10 @@ ADIv5_AP_t *adiv5_new_ap(ADIv5_DP_t *dp, uint8_t apsel)
|
|||
|
||||
void adiv5_dp_init(ADIv5_DP_t *dp)
|
||||
{
|
||||
/* Check IDCODE for a valid designer*/
|
||||
if ((dp->idcode & 0xfff) == 0) {
|
||||
#define DPIDR_PARTNO_MASK 0x0ff00000
|
||||
/* Check IDCODE for a valid designer and sensible PARTNO*/
|
||||
if (((dp->idcode & 0xfff) == 0) ||
|
||||
((dp->idcode & DPIDR_PARTNO_MASK)) == DPIDR_PARTNO_MASK) {
|
||||
DEBUG_WARN("Invalid DP idcode %08" PRIx32 "\n", dp->idcode);
|
||||
free(dp);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue