source: rtems/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c @ 7657233d

4.104.114.84.95
Last change on this file since 7657233d was 7657233d, checked in by Joel Sherrill <joel.sherrill@…>, on 10/31/02 at 20:12:09

2002-10-31 Joel Sherrill <joel@…>

  • bootloader/em86.c, console/inch.c, console/polled_io.c, irq/irq.c, motorola/motorola.c, pci/detect_raven_bridge.c, vectors/vectors_init.c: Removed warnings.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/* motorola.h
2 *
3 *  This include file describe the data structure and the functions implemented
4 *  by rtems to identify motorola boards.
5 *
6 *  CopyRight (C) 1999 valette@crf.canon.fr
7 *
8 *  The license and distribution terms for this file may be
9 *  found in found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15
16#include <bsp/motorola.h>
17#include <rtems/bspIo.h>
18#include <libcpu/io.h>
19#include <string.h>
20
21typedef struct {
22  /*
23   * 0x100 mask assumes for Raven and Hawk boards
24   * that the level/edge are set.
25   * 0x200 if this board has a Hawk chip.
26   */
27  int           cpu_type;
28  int           base_type;
29  const char    *name;
30} mot_info_t;
31
32
33static const mot_info_t mot_boards[] = {
34  {0x300, 0x00, "MVME 2400"},
35  {0x010, 0x00, "Genesis"},
36  {0x020, 0x00, "Powerstack (Series E)"},
37  {0x040, 0x00, "Blackhawk (Powerstack)"},
38  {0x050, 0x00, "Omaha (PowerStack II Pro3000)"},
39  {0x060, 0x00, "Utah (Powerstack II Pro4000)"},
40  {0x0A0, 0x00, "Powerstack (Series EX)"},
41  {0x1E0, 0xE0, "Mesquite cPCI (MCP750)"},
42  {0x1E0, 0xE1, "Sitka cPCI (MCPN750)"},
43  {0x1E0, 0xE2, "Mesquite cPCI (MCP750) w/ HAC"},
44  {0x1E0, 0xF6, "MTX Plus"},
45  {0x1E0, 0xF7, "MTX wo/ Parallel Port"},
46  {0x1E0, 0xF8, "MTX w/ Parallel Port"},
47  {0x1E0, 0xF9, "MVME 2300"},
48  {0x1E0, 0xFA, "MVME 2300SC/2600"},
49  {0x1E0, 0xFB, "MVME 2600 with MVME712M"},
50  {0x1E0, 0xFC, "MVME 2600/2700 with MVME761"},
51  {0x1E0, 0xFD, "MVME 3600 with MVME712M"},
52  {0x1E0, 0xFE, "MVME 3600 with MVME761"},
53  {0x1E0, 0xFF, "MVME 1600-001 or 1600-011"},
54  {0x000, 0x00, ""}
55};
56
57prep_t currentPrepType;
58motorolaBoard           currentBoard;
59prep_t checkPrepBoardType(RESIDUAL *res)
60{
61  prep_t PREP_type;
62  /* figure out what kind of prep workstation we are */
63  if ( res->ResidualLength != 0 ) {
64    if ( !strncmp(res->VitalProductData.PrintableModel,"IBM",3) )
65      PREP_type = PREP_IBM;
66    else if (!strncmp(res->VitalProductData.PrintableModel,
67                      "Radstone",8)){
68      PREP_type = PREP_Radstone;
69    }
70    else
71      PREP_type = PREP_Motorola;
72  }
73  else /* assume motorola if no residual (netboot?) */ {
74    PREP_type = PREP_Motorola;
75  }
76  currentPrepType = PREP_type;
77  return PREP_type;
78}
79
80motorolaBoard   getMotorolaBoard()
81{
82  unsigned char  cpu_type;
83  unsigned char  base_mod;
84  int            entry;
85  int            mot_entry = -1;
86
87  cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0;
88  base_mod = inb(MOTOROLA_BASETYPE_REG);
89
90  for (entry = 0; mot_boards[entry].cpu_type != 0; entry++) {
91    if ((mot_boards[entry].cpu_type & 0xff) != cpu_type)
92      continue;
93     
94    if (mot_boards[entry].base_type == 0) {
95      mot_entry = entry;
96      break;
97    }
98     
99    if (mot_boards[entry].base_type != base_mod)
100      continue;
101    else{
102      mot_entry = entry;
103      break;
104    }
105  }
106  if (mot_entry == -1) {
107    printk("Unknown motorola board Please update libbsp/powerpc/shared/motorola/motorola.c\n");
108    printk("cpu_type = %x\n", (unsigned) cpu_type);
109    printk("base_mod = %x\n", (unsigned) base_mod);
110    currentBoard = MOTOROLA_UNKNOWN;
111    return currentBoard;
112  }
113  currentBoard = (motorolaBoard) mot_entry;
114  return currentBoard;
115}
116
117const char* motorolaBoardToString(motorolaBoard board)
118{
119  if (board == MOTOROLA_UNKNOWN) return "Unknown motorola board";
120  return (mot_boards[board].name);
121}
122
Note: See TracBrowser for help on using the repository browser.