source: rtems/c/src/lib/libbsp/powerpc/score603e/startup/spurious.c @ 50f93fb

4.104.114.84.9
Last change on this file since 50f93fb was 50f93fb, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 17, 2007 at 2:09:43 PM

2007-09-17 Joel Sherrill <joel.sherrill@…>

  • PCI_bus/universe.c, console/console.c, include/bsp.h, irq/FPGA.c, startup/bspstart.c, startup/genpvec.c, startup/spurious.c: Eliminate DEBUG_puts.
  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*
2 *  Score603e Spurious Trap Handler
3 *
4 *  This is just enough of a trap handler to let us know what
5 *  the likely source of the trap was.
6 *
7 *  Developed as part of the port of RTEMS to the ERC32 implementation
8 *  of the SPARC by On-Line Applications Research Corporation (OAR)
9 *  under contract to the European Space Agency (ESA).
10 *
11 *  COPYRIGHT (c) 1995. European Space Agency.
12 *
13 *  This terms of the RTEMS license apply to this file.
14 *
15 *  $Id$
16 */
17
18#include <bsp.h>
19#include <rtems/bspIo.h>
20
21#include <string.h>
22
23rtems_isr bsp_stub_handler(
24   rtems_vector_number trap
25)
26{
27}
28
29/*
30 *  bsp_spurious_handler
31 *
32 *  Print a message on the debug console and then die
33 */
34rtems_isr bsp_spurious_handler(
35   rtems_vector_number trap
36)
37{
38
39  switch ( trap ) {
40    case PPC_IRQ_SYSTEM_RESET:
41      printk( "\nTrap: System reset\n" );
42      break;
43    case PPC_IRQ_MCHECK:
44      printk( "\nTrap: Machine check\n" );
45      break;
46    case PPC_IRQ_PROTECT:
47      printk( "\nTrap: DSI\n" );
48      break;
49    case PPC_IRQ_ISI:
50      printk( "ISI\n" );
51      break;
52    case PPC_IRQ_EXTERNAL:
53      printk( "\nTrap: External interupt\n" );
54      break;
55    case PPC_IRQ_ALIGNMENT:
56      printk( "\nTrap: Alignment Exception\n" );
57      break;
58    case PPC_IRQ_PROGRAM:
59      printk( "\nTrap: Program\n" );
60      break;
61    case PPC_IRQ_NOFP:
62      printk( "\nTrap: Floating point unavailable\n" );
63      break;
64    case PPC_IRQ_DECREMENTER:
65      printk( "\nTrap: Decrementer\n" );
66      break;
67    case PPC_IRQ_RESERVED_A:
68      printk( "\nTrap: Reserved 0x00a00\n" );
69      break;
70    case PPC_IRQ_RESERVED_B:
71      printk( "\nTrap: Reserved 0x00b00\n" );
72      break;
73    case PPC_IRQ_SCALL:
74      printk( "\nTrap: System call\n" );
75      break;
76    case PPC_IRQ_TRACE:
77      printk( "\nTrap: Trace\n" );
78      break;
79    case PPC_IRQ_FP_ASST:
80      printk( "\nTrap: Floating point Assist\n" );
81      break;
82
83#if defined(ppc403)
84#error "Please fill in names. "
85    case PPC_IRQ_CRIT :
86      printk( "\nTrap: Critical Error\n ");
87      break;
88    case PPC_IRQ_PIT:
89      printk( "\nTrap: 0x01000\n" );
90      break;
91    case PPC_IRQ_FIT:
92      printk( "\nTrap: 0x01010\n" );
93      break;
94    case PPC_IRQ_WATCHDOG :
95      printk( "\nTrap: 0x01020\n" );
96      break;
97    case PPC_IRQ_DEBUG   :
98      printk( "\nTrap: 0x02000\n" );
99      break;
100
101#elif defined(ppc601)
102#error "Please fill in names. "
103    case PPC_IRQ_TRACE    :
104      printk( "\nTrap: 0x02000\n" );
105      break;
106
107#elif defined(ppc603) || defined(ppc603e)
108    case PPC_IRQ_TRANS_MISS:
109      printk( "\nTrap: Instruction Translation Miss\n" );
110      break;
111    case PPC_IRQ_DATA_LOAD:
112      printk( "\nTrap: Data Load Translation Miss\n" );
113      break;
114    case PPC_IRQ_DATA_STORE:
115      printk( "\nTrap: Data store Translation Mis\ns");
116      break;
117    case PPC_IRQ_ADDR_BRK:
118      printk( "\nTrap: Instruction address break point\n" );
119      break;
120    case PPC_IRQ_SYS_MGT:
121      printk( "\nTrap: System management interrupt\n" );
122      break;
123
124#elif defined(mpc604)
125#error "Please fill in names. "
126    case PPC_IRQ_ADDR_BRK:
127      printk( "0x1300\n" );
128      break;
129    case PPC_IRQ_SYS_MGT:
130      printk( "0x1400\n" );
131      break;
132#endif
133
134  default:
135     printk( "\nTrap: Undefined exception\n" );
136     break;
137  }
138
139  /*
140   *  What else can we do but stop ...
141   */
142  /*
143   asm volatile( "" );
144   */
145   while (1);
146}
147
148/*
149 *  bsp_spurious_initialize
150 *
151 *  Install the spurious handler for most traps.
152 */
153
154void bsp_spurious_initialize()
155{
156  uint32_t         trap;
157
158  for ( trap=0 ; trap < PPC_IRQ_LAST ; trap++ ) {
159    if (trap == PPC_IRQ_DECREMENTER)
160      ;
161      /* set_vector( bsp_stub_handler, trap, 1 ); */
162    else
163      set_vector( bsp_spurious_handler, trap,  1 );
164  }
165}
166
167void bsp_set_trap_vectors( void )
168{
169  volatile uint32_t         *ptr;
170
171  /* reset_vector  */
172  ptr = (uint32_t*)0x00100  ;
173  *ptr = 0x48000000;
174
175  /* org    mach_vector  */
176  ptr = (uint32_t*)0x00200;
177  *ptr = 0x48000000;
178
179  /* org    prot_vector  */
180  ptr = (uint32_t*)0x00300;
181  *ptr = 0x48000000;
182
183  /* org    isi_vector  */
184  ptr = (uint32_t*)0x00400;
185  *ptr = 0x48000000;
186
187  /* org    ext_vector  */
188  ptr = (uint32_t*)0x0500  ;
189  *ptr = 0x48000000;
190
191  /* org    align_vector  */
192  ptr = (uint32_t*)0x00600  ;
193  *ptr = 0x48000000;
194
195  /* org    prog_vector  */
196  ptr = (uint32_t*)0x00700  ;
197  *ptr = 0x48000000;
198
199  /* org    float_vector  */
200  ptr = (uint32_t*)0x00800;
201  *ptr = 0x48000000;
202
203  /* org    dec_vector  - rfi */
204  ptr = (uint32_t*)0x900;
205  *ptr = 0x4c000064;
206
207  /* org    sys_vector  */
208  ptr = (uint32_t*)0x0c00  ;
209  *ptr = 0x48000000;
210
211  /* org    trace_vector  */
212  ptr = (uint32_t*)0x0d00  ;
213  *ptr = 0x48000000;
214
215  /* org    itm_vector  */
216  ptr = (uint32_t*)0x01000  ;
217  *ptr = 0x48000000;
218
219  /* org    dltm_vector  */
220  ptr = (uint32_t*)0x01100  ;
221  *ptr = 0x48000000;
222
223  /* org    dstm_vector  */
224  ptr = (uint32_t*)0x1200  ;
225  *ptr = 0x48000000;
226
227  /* org    addr_vector  */
228  ptr = (uint32_t*)0x1300  ;
229  *ptr = 0x48000000;
230
231  /* org    sysmgmt_vector  */
232  ptr = (uint32_t*)0x1400  ;
233  *ptr = 0x48000000;
234
235}
Note: See TracBrowser for help on using the repository browser.