diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-04-07 14:18:53 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-04-07 14:18:53 +0000 |
commit | 9a66caae9b06cb90f66770c60cd0625d4b232bcc (patch) | |
tree | a741db26c3a87dff00c44e591b4180a550656e12 /c/src/lib | |
parent | 2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-9a66caae9b06cb90f66770c60cd0625d4b232bcc.tar.bz2 |
skip version nibble when detecting e200 processor version
Diffstat (limited to 'c/src/lib')
-rw-r--r-- | c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c | 27 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h | 3 |
2 files changed, 27 insertions, 3 deletions
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; |