diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c index dab61288e8..2bc7bfb178 100644 --- a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c +++ b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c @@ -75,18 +75,41 @@ char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu) ppc_cpu_id_t get_ppc_cpu_type(void) { + /* + * cpu types listed here have the lowermost nibble as a version identifier + * we will tweak them to the starndard version + */ + const uint32_t ppc_cpu_id_version_nibble[] = { + PPC_e200z6, + PPC_e200z0, + PPC_e200z1}; + unsigned int pvr; + int i; if ( PPC_UNKNOWN != current_ppc_cpu ) return current_ppc_cpu; pvr = (_read_PVR() >> 16); + /* + * apply tweaks to ignore version + */ + for (i = 0; + i < (sizeof(ppc_cpu_id_version_nibble) + /sizeof(ppc_cpu_id_version_nibble[0])); + i++) { + if ((pvr & 0xfff0) == (ppc_cpu_id_version_nibble[i] & 0xfff0)) { + pvr = ppc_cpu_id_version_nibble[i]; + break; + } + } + current_ppc_cpu = (ppc_cpu_id_t) pvr; switch (pvr) { case PPC_405: - case PPC_405GP: - case PPC_405EX: + case PPC_405GP: + case PPC_405EX: case PPC_601: case PPC_5XX: case PPC_603: diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h index a0adf2324c..0e64af84e2 100644 --- a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h +++ b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h @@ -57,7 +57,8 @@ typedef enum PPC_e300c3 = 0x8085, /* e300c3 core */ PPC_e200z0 = 0x8171, PPC_e200z1 = 0x8144, - PPC_e200z6 = 0x8115, + PPC_e200z6 = 0x8112, + PPC_e200z6v5= 0x8115, PPC_PSIM = 0xfffe, /* GDB PowerPC simulator -- fake version */ PPC_UNKNOWN = 0xffff } ppc_cpu_id_t;