source: rtems/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c @ 48694da

4.104.114.84.95
Last change on this file since 48694da was 48694da, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 22, 2001 at 1:46:37 PM

2001-10-22 Andy Dachs <a.dachs@…>

  • Makefile.am, README, configure.ac, new_exception_processing/cpu.h, shared/include/cpu.h, shared/include/cpuIdent.c, shared/src/cache.c: Added mpc8260 support.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  cpuIdent.c -- Cpu identification code
3 *
4 *  Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
5 *
6 *  Added MPC8260 Andy Dachs <a.dachs@sstl.co.uk>
7 *  Surrey Satellite Technology Limited
8 *
9 *  The license and distribution terms for this file may be
10 *  found in found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 * $Id$
14 *
15 */
16
17#include <libcpu/spr.h>
18#include <bspIo.h>
19
20/*
21 * Generate inline code to read Processor Version Register
22 */
23SPR_RO(PVR)
24
25ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;
26ppc_cpu_revision_t current_ppc_revision = 0xff;
27
28ppc_cpu_id_t get_ppc_cpu_type()
29{
30  unsigned int pvr = (_read_PVR() >> 16);
31
32  current_ppc_cpu = (ppc_cpu_id_t) pvr;
33  switch (pvr) {
34    case PPC_601:
35    case PPC_603:
36    case PPC_603ev:
37    case PPC_604:
38    case PPC_750:
39    case PPC_604e:
40    case PPC_604r:
41    case PPC_620:
42    case PPC_860:
43    case PPC_8260:
44      current_ppc_cpu = (ppc_cpu_id_t) pvr;
45      return current_ppc_cpu;
46    default:
47      printk("Unknown PVR value of 0x%x. Please add it to <libcpu/powerpc/shared/cpu.h>\n", pvr );
48    return PPC_UNKNOWN;
49  }
50 
51}
52ppc_cpu_revision_t get_ppc_cpu_revision()
53{
54  ppc_cpu_revision_t rev = (ppc_cpu_revision_t) (_read_PVR() & 0xffff);
55  current_ppc_revision = rev;
56  return rev;
57}
Note: See TracBrowser for help on using the repository browser.