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

Last change on this file since d700909e was d700909e, checked in by Joel Sherrill <joel.sherrill@…>, on 11/10/04 at 22:37:57

2004-11-10 Richard Campbell <richard.campbell@…>

  • configure.ac, mpc6xx/exceptions/raw_exception.c, mpc6xx/exceptions/raw_exception.h, mpc6xx/mmu/bat.c, mpc6xx/mmu/bat.h, mpc6xx/mmu/mmuAsm.S, shared/include/cpuIdent.c, shared/include/cpuIdent.h: Add MPC8240 and MPC8245 support. There was also a significant amount of spelling and whitespace cleanup.
  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[abd9401]1/*
2 *  cpuIdent.c -- Cpu identification code
3 *
4 *  Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
5 *
[48694da]6 *  Added MPC8260 Andy Dachs <a.dachs@sstl.co.uk>
7 *  Surrey Satellite Technology Limited
8 *
[abd9401]9 *  The license and distribution terms for this file may be
10 *  found in found in the file LICENSE in this distribution or at
[8209461b]11 *  http://www.rtems.com/license/LICENSE.
[abd9401]12 *
13 * $Id$
14 *
15 */
16
[f054b51]17#include <libcpu/cpuIdent.h>
[abd9401]18#include <libcpu/spr.h>
[5c76213]19#include <rtems/bspIo.h>
[abd9401]20
21/*
22 * Generate inline code to read Processor Version Register
23 */
24SPR_RO(PVR)
25
26ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;
27ppc_cpu_revision_t current_ppc_revision = 0xff;
28
[0d776cd2]29char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu)
30{
31  switch (cpu) {
32    case PPC_601:               return "MPC601";
33    case PPC_603:               return "MPC603";
34    case PPC_603ev:             return "MPC603ev";
35    case PPC_604:               return "MPC604";
36    case PPC_750:               return "MPC750";
37    case PPC_7400:              return "MPC7400";
38    case PPC_604e:              return "MPC604e";
[c074ea2e]39    case PPC_604r:              return "MPC604r";
[0d776cd2]40    case PPC_620:               return "MPC620";
41    case PPC_860:               return "MPC860";
42    case PPC_8260:              return "MPC8260";
[d700909e]43    case PPC_8245:              return "MPC8245";
[0d776cd2]44    default:
[d700909e]45      printk("Unknown CPU value of 0x%x. Please add it to "
46             "<libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu );
[0d776cd2]47  }
48  return "UNKNOWN";
49}
50
[abd9401]51ppc_cpu_id_t get_ppc_cpu_type()
52{
[eaedd00]53  unsigned int pvr = (_read_PVR() >> 16);
[abd9401]54  current_ppc_cpu = (ppc_cpu_id_t) pvr;
55  switch (pvr) {
[eaedd00]56    case PPC_601:
57    case PPC_603:
58    case PPC_603ev:
[acddd7d2]59    case PPC_604:
[c960a72]60    case PPC_604r:
[eaedd00]61    case PPC_750:
[0d776cd2]62    case PPC_7400:
[eaedd00]63    case PPC_604e:
64    case PPC_620:
65    case PPC_860:
[48694da]66    case PPC_8260:
[d700909e]67    case PPC_8245:
[eaedd00]68      return current_ppc_cpu;
69    default:
[d700909e]70      printk("Unknown PVR value of 0x%x. Please add it to "
71             "<libcpu/powerpc/shared/include/cpuIdent.c>\n", pvr );
[abd9401]72    return PPC_UNKNOWN;
73  }
74}
[0d776cd2]75
[abd9401]76ppc_cpu_revision_t get_ppc_cpu_revision()
77{
78  ppc_cpu_revision_t rev = (ppc_cpu_revision_t) (_read_PVR() & 0xffff);
79  current_ppc_revision = rev;
80  return rev;
81}
Note: See TracBrowser for help on using the repository browser.