1 | /* |
---|
2 | * This routine starts the application. It includes application, |
---|
3 | * board, and monitor specific initialization and configuration. |
---|
4 | * The generic CPU dependent initialization has been performed |
---|
5 | * before this routine is invoked. |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989-1999. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | * |
---|
14 | * Modifications of respective RTEMS file: COPYRIGHT (c) 1994. |
---|
15 | * EISCAT Scientific Association. M.Savitski |
---|
16 | * |
---|
17 | * This material is a part of the MVME162 Board Support Package |
---|
18 | * for the RTEMS executive. Its licensing policies are those of the |
---|
19 | * RTEMS above. |
---|
20 | * |
---|
21 | * $Id$ |
---|
22 | */ |
---|
23 | |
---|
24 | #include <string.h> |
---|
25 | |
---|
26 | #include <bsp.h> |
---|
27 | #include <rtems/libio.h> |
---|
28 | #include <rtems/libcsupport.h> |
---|
29 | #include <page_table.h> |
---|
30 | |
---|
31 | /* |
---|
32 | * Use the shared implementations of the following routines |
---|
33 | */ |
---|
34 | |
---|
35 | void bsp_libc_init( void *, uint32_t, int ); |
---|
36 | void bsp_pretasking_hook(void); /* m68k version */ |
---|
37 | |
---|
38 | /* |
---|
39 | * bsp_start |
---|
40 | * |
---|
41 | * This routine does the bulk of the system initialization. |
---|
42 | */ |
---|
43 | |
---|
44 | void bsp_start( void ) |
---|
45 | { |
---|
46 | m68k_isr_entry *monitors_vector_table; |
---|
47 | int index; |
---|
48 | extern void *_WorkspaceBase; |
---|
49 | extern void *_RamSize; |
---|
50 | extern unsigned long _M68k_Ramsize; |
---|
51 | |
---|
52 | _M68k_Ramsize = (unsigned long)&_RamSize; /* RAM size set in linker script */ |
---|
53 | |
---|
54 | /* |
---|
55 | * 162Bug Vectors are at 0xFFE00000 |
---|
56 | * 162Bug Vectors on LX are at 0x00000000 |
---|
57 | */ |
---|
58 | |
---|
59 | #if defined(mvme162lx) |
---|
60 | monitors_vector_table = (m68k_isr_entry *)0x00000000; |
---|
61 | #else |
---|
62 | monitors_vector_table = (m68k_isr_entry *)0xFFE00000; |
---|
63 | #endif |
---|
64 | |
---|
65 | m68k_set_vbr( monitors_vector_table ); |
---|
66 | |
---|
67 | for ( index=2 ; index<=255 ; index++ ) |
---|
68 | M68Kvec[ index ] = monitors_vector_table[ 32 ]; |
---|
69 | |
---|
70 | M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */ |
---|
71 | M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */ |
---|
72 | M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */ |
---|
73 | M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */ |
---|
74 | |
---|
75 | m68k_set_vbr( &M68Kvec ); |
---|
76 | |
---|
77 | /* |
---|
78 | * You may wish to make the VME arbitration round-robin here, currently |
---|
79 | * we leave it as it is. |
---|
80 | */ |
---|
81 | |
---|
82 | /* set the Interrupt Base Vectors */ |
---|
83 | |
---|
84 | lcsr->vector_base = (VBR0 << 28) | (VBR1 << 24); |
---|
85 | |
---|
86 | page_table_init(); |
---|
87 | |
---|
88 | Configuration.work_space_start = (void *) &_WorkspaceBase; |
---|
89 | } |
---|