diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-12-29 09:51:18 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-12-29 09:51:18 +0000 |
commit | 644448f8401368d0614bc4e296e966031a97bef4 (patch) | |
tree | 69649eab626c36d2885bf0aaf77c619dcadceb06 /c/src/lib/libcpu/powerpc/shared | |
parent | 2010-12-29 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-644448f8401368d0614bc4e296e966031a97bef4.tar.bz2 |
2010-12-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/include/cpuIdent.c, shared/include/cpuIdent.h: Added support
for e500v2. Removed IVPR/IVOR/HWIVOR features since they are included
in Book E.
* new-exceptions/bspsupport/vectors.h,
new-exceptions/bspsupport/ppc_exc.S,
new-exceptions/bspsupport/ppc_exc_address.c,
new-exceptions/bspsupport/ppc_exc_categories.c,
new-exceptions/bspsupport/ppc_exc_initialize.c,
new-exceptions/bspsupport/ppc_exc_prologue.c: Added support for
e500v2. Added exception vector defines for Book E types. Removed
e200 exception vector defines. Added e500 exception vector defines.
Unified IVOR calculation for e200 and e500 (e200z1 has hard wired
IVOR values).
Diffstat (limited to 'c/src/lib/libcpu/powerpc/shared')
-rw-r--r-- | c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c | 31 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h | 28 |
2 files changed, 18 insertions, 41 deletions
diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c index 2bc7bfb178..7ece3a724c 100644 --- a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c +++ b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c @@ -25,19 +25,7 @@ SPR_RO(PVR) ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN; ppc_cpu_revision_t current_ppc_revision = 0xff; -ppc_feature_t current_ppc_features = { - .has_altivec = 0, - .has_fpu = 0, - .has_hw_ptbl_lkup = 0, - .is_bookE = 0, - .has_16byte_clne = 0, - .is_60x = 0, - .has_8_bats = 0, - .has_epic = 0, - .has_shadowed_gprs = 0, - .has_ivpr = 0, - .has_ivor = 0 -}; +ppc_feature_t current_ppc_features; char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu) { @@ -66,6 +54,7 @@ char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu) case PPC_e200z0: return "e200z0"; case PPC_e200z1: return "e200z1"; case PPC_e200z6: return "e200z6"; + case PPC_e500v2: return "e500v2"; default: printk("Unknown CPU value of 0x%x. Please add it to " "<libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu ); @@ -134,6 +123,7 @@ ppc_cpu_id_t get_ppc_cpu_type(void) case PPC_e300c1: case PPC_e300c2: case PPC_e300c3: + case PPC_e500v2: break; default: printk("Unknown PVR value of 0x%x. Please add it to " @@ -189,6 +179,7 @@ ppc_cpu_id_t get_ppc_cpu_type(void) case PPC_e200z0: case PPC_e200z1: case PPC_e200z6: + case PPC_e500v2: current_ppc_features.is_bookE = PPC_BOOKE_E500; default: break; @@ -214,20 +205,6 @@ ppc_cpu_id_t get_ppc_cpu_type(void) break; } - switch (current_ppc_cpu) { - case PPC_e200z0: - case PPC_e200z1: - current_ppc_features.has_ivpr = 1; - current_ppc_features.has_hwivor = 1; - break; - case PPC_e200z6: - current_ppc_features.has_ivpr = 1; - current_ppc_features.has_ivor = 1; - break; - default: - break; - } - return current_ppc_cpu; } diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h index 0e64af84e2..dd48f1640f 100644 --- a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h +++ b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h @@ -51,6 +51,7 @@ typedef enum PPC_8240 = PPC_8260, PPC_8245 = 0x8081, PPC_8540 = 0x8020, + PPC_e500v2 = 0x8021, PPC_603le = 0x8082, /* 603le core, in MGT5100 and MPC5200 */ PPC_e300c1 = 0x8083, /* e300c1 core, in MPC83xx*/ PPC_e300c2 = 0x8084, /* e300c2 core */ @@ -82,9 +83,6 @@ typedef struct { unsigned has_8_bats : 1; unsigned has_epic : 1; unsigned has_shadowed_gprs : 1; - unsigned has_ivpr : 1; - unsigned has_ivor : 1; - unsigned has_hwivor : 1; } ppc_feature_t; extern ppc_feature_t current_ppc_features; @@ -113,32 +111,34 @@ _PPC_FEAT_DECL(is_60x) _PPC_FEAT_DECL(has_8_bats) _PPC_FEAT_DECL(has_epic) _PPC_FEAT_DECL(has_shadowed_gprs) -_PPC_FEAT_DECL(has_ivpr) -_PPC_FEAT_DECL(has_ivor) -_PPC_FEAT_DECL(has_hwivor) #undef _PPC_FEAT_DECL -static inline unsigned ppc_cpu_has_ivpr_and_ivor() { \ - return ppc_cpu_has_ivpr() - && (ppc_cpu_has_ivor() || ppc_cpu_has_hwivor()); -} - static inline ppc_cpu_id_t ppc_cpu_current(void) { return current_ppc_cpu; } +static inline bool ppc_cpu_is_e200() +{ + return ppc_cpu_current() == PPC_e200z0 + || ppc_cpu_current() == PPC_e200z1 + || ppc_cpu_current() == PPC_e200z6; +} + static inline bool ppc_cpu_is_e300() { - if (ppc_cpu_current() == PPC_UNKNOWN) { - get_ppc_cpu_type(); - } return ppc_cpu_current() == PPC_e300c1 || ppc_cpu_current() == PPC_e300c2 || ppc_cpu_current() == PPC_e300c3; } +static inline bool ppc_cpu_is_e500() +{ + return ppc_cpu_current() == PPC_8540 + || ppc_cpu_current() == PPC_e500v2; +} + static inline bool ppc_cpu_is(ppc_cpu_id_t cpu) { return ppc_cpu_current() == cpu; |