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 | * MVME147 port for TNI - Telecom Bretagne |
---|
15 | * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr) |
---|
16 | * May 1996 |
---|
17 | * |
---|
18 | * $Id$ |
---|
19 | */ |
---|
20 | |
---|
21 | #include <string.h> |
---|
22 | |
---|
23 | #include <bsp.h> |
---|
24 | #include <rtems/libio.h> |
---|
25 | #include <rtems/libcsupport.h> |
---|
26 | |
---|
27 | /* |
---|
28 | * Use the shared implementations of the following routines |
---|
29 | */ |
---|
30 | |
---|
31 | void bsp_postdriver_hook(void); |
---|
32 | void bsp_libc_init( void *, uint32_t, int ); |
---|
33 | void bsp_pretasking_hook(void); /* m68k version */ |
---|
34 | |
---|
35 | /* |
---|
36 | * bsp_start |
---|
37 | * |
---|
38 | * This routine does the bulk of the system initialization. |
---|
39 | */ |
---|
40 | |
---|
41 | void bsp_start( void ) |
---|
42 | { |
---|
43 | m68k_isr_entry *monitors_vector_table; |
---|
44 | int index; |
---|
45 | extern void *_WorkspaceBase; |
---|
46 | extern void *_RamSize; |
---|
47 | extern unsigned long _M68k_Ramsize; |
---|
48 | |
---|
49 | /* RAM size set in linker script */ |
---|
50 | _M68k_Ramsize = (unsigned long)&_RamSize; |
---|
51 | |
---|
52 | monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */ |
---|
53 | m68k_set_vbr( monitors_vector_table ); |
---|
54 | |
---|
55 | for ( index=2 ; index<=255 ; index++ ) |
---|
56 | M68Kvec[ index ] = monitors_vector_table[ 32 ]; |
---|
57 | |
---|
58 | M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */ |
---|
59 | M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */ |
---|
60 | M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */ |
---|
61 | M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */ |
---|
62 | |
---|
63 | m68k_set_vbr( &M68Kvec ); |
---|
64 | |
---|
65 | pcc->int_base_vector = PCC_BASE_VECTOR; /* Set the PCC int vectors base */ |
---|
66 | |
---|
67 | (*(uint8_t*)0xfffe2001) = 0x08; |
---|
68 | /* make VME access round-robin */ |
---|
69 | |
---|
70 | rtems_cache_enable_instruction(); |
---|
71 | rtems_cache_enable_data(); |
---|
72 | |
---|
73 | Configuration.work_space_start = (void *) &_WorkspaceBase; |
---|
74 | } |
---|