4.104.114.84.95
Rev | Line | |
---|
[abd9401] | 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> |
---|
[acddd7d2] | 15 | #include <bspIo.h> |
---|
[abd9401] | 16 | |
---|
| 17 | /* |
---|
| 18 | * Generate inline code to read Processor Version Register |
---|
| 19 | */ |
---|
| 20 | SPR_RO(PVR) |
---|
| 21 | |
---|
| 22 | ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN; |
---|
| 23 | ppc_cpu_revision_t current_ppc_revision = 0xff; |
---|
| 24 | |
---|
| 25 | ppc_cpu_id_t get_ppc_cpu_type() |
---|
| 26 | { |
---|
[eaedd00] | 27 | unsigned int pvr = (_read_PVR() >> 16); |
---|
[abd9401] | 28 | |
---|
| 29 | current_ppc_cpu = (ppc_cpu_id_t) pvr; |
---|
| 30 | switch (pvr) { |
---|
[eaedd00] | 31 | case PPC_601: |
---|
| 32 | case PPC_603: |
---|
| 33 | case PPC_603ev: |
---|
[acddd7d2] | 34 | case PPC_604: |
---|
[eaedd00] | 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 of 0x%x. Please add it to <libcpu/powerpc/shared/cpu.h>\n", pvr ); |
---|
[abd9401] | 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.