4.104.114.84.95
Last change
on this file since df49c60 was
3a96054,
checked in by Joel Sherrill <joel.sherrill@…>, on 12/02/99 at 14:58:38
|
Merged of mcp750 and mvme2307 BSP by Eric Valette <valette@…>.
As part of this effort, the mpc750 libcpu code is now shared with the
ppc6xx.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[3a96054] | 1 | /* |
---|
| 2 | * cpuIdent.c -- Cpu identification code |
---|
| 3 | * |
---|
| 4 | * Copyright (C) 1999 Eric Valette. valette@crf.canon.fr |
---|
| 5 | * |
---|
| 6 | * The license and distribution terms for this file may be |
---|
| 7 | * found in found in the file LICENSE in this distribution or at |
---|
| 8 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 9 | * |
---|
| 10 | * $Id$ |
---|
| 11 | * |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #include <libcpu/spr.h> |
---|
| 15 | |
---|
| 16 | /* |
---|
| 17 | * Generate inline code to read Processor Version Register |
---|
| 18 | */ |
---|
| 19 | SPR_RO(PVR) |
---|
| 20 | |
---|
| 21 | ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN; |
---|
| 22 | ppc_cpu_revision_t current_ppc_revision = 0xff; |
---|
| 23 | |
---|
| 24 | ppc_cpu_id_t get_ppc_cpu_type() |
---|
| 25 | { |
---|
| 26 | unsigned int pvr = (_read_PVR() >> 16) ; |
---|
| 27 | |
---|
| 28 | current_ppc_cpu = (ppc_cpu_id_t) pvr; |
---|
| 29 | switch (pvr) { |
---|
| 30 | case PPC_601 : |
---|
| 31 | case PPC_603 : |
---|
| 32 | case PPC_604 : |
---|
| 33 | case PPC_603e : |
---|
| 34 | case PPC_603ev: |
---|
| 35 | case PPC_750 : |
---|
| 36 | case PPC_604e : |
---|
| 37 | case PPC_604r : |
---|
| 38 | case PPC_620 : |
---|
| 39 | case PPC_860 : |
---|
| 40 | current_ppc_cpu = (ppc_cpu_id_t) pvr; |
---|
| 41 | return current_ppc_cpu; |
---|
| 42 | default : |
---|
| 43 | printk("Unknown PVR value. Please add it to <libcpu/powerpc/shared/cpu.h> \n"); |
---|
| 44 | return PPC_UNKNOWN; |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | } |
---|
| 48 | ppc_cpu_revision_t get_ppc_cpu_revision() |
---|
| 49 | { |
---|
| 50 | ppc_cpu_revision_t rev = (ppc_cpu_revision_t) (_read_PVR() & 0xffff); |
---|
| 51 | current_ppc_revision = rev; |
---|
| 52 | return rev; |
---|
| 53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.