skip version nibble when detecting e200 processor version

This commit is contained in:
Thomas Doerfler
2010-04-07 14:18:53 +00:00
parent 232cdcb3d6
commit 9a66caae9b
2 changed files with 27 additions and 3 deletions

View File

@@ -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:

View File

@@ -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;