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 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #include <string.h> |
---|
18 | |
---|
19 | #include <bsp.h> |
---|
20 | #include <rtems/libio.h> |
---|
21 | #include <rtems/libcsupport.h> |
---|
22 | |
---|
23 | unsigned char *duart_base; |
---|
24 | extern struct duart_regs duart_info; |
---|
25 | |
---|
26 | #define DELAY 5000 |
---|
27 | |
---|
28 | void led_putnum(); |
---|
29 | |
---|
30 | /* |
---|
31 | * Use the shared implementations of the following routines |
---|
32 | */ |
---|
33 | |
---|
34 | void bsp_libc_init( void *, uint32_t, int ); |
---|
35 | void bsp_pretasking_hook(void); /* m68k version */ |
---|
36 | |
---|
37 | /* |
---|
38 | * bsp_start |
---|
39 | * |
---|
40 | * This routine does the bulk of the system initialization. |
---|
41 | */ |
---|
42 | |
---|
43 | void bsp_start( void ) |
---|
44 | { |
---|
45 | m68k_isr_entry *monitors_vector_table; |
---|
46 | int index; |
---|
47 | extern void *_WorkspaceBase; |
---|
48 | extern void *_RamSize; |
---|
49 | extern unsigned long _M68k_Ramsize; |
---|
50 | |
---|
51 | /* RAM size set in linker script */ |
---|
52 | _M68k_Ramsize = (unsigned long)&_RamSize; |
---|
53 | duart_base = (unsigned char *)DUART_ADDR; |
---|
54 | |
---|
55 | /* |
---|
56 | * Set the VBR here to the monitor's default. |
---|
57 | */ |
---|
58 | |
---|
59 | monitors_vector_table = (m68k_isr_entry *)0; |
---|
60 | /* This is where you set vector base register = 0 */ |
---|
61 | m68k_set_vbr( monitors_vector_table ); |
---|
62 | |
---|
63 | /* The vector interrupt table for the 680x0 is in appendix B-2 |
---|
64 | of the M68000 Family Programmer's reference table */ |
---|
65 | for ( index=2 ; index<=255 ; index++ ) |
---|
66 | M68Kvec[ index ] = monitors_vector_table[ 32 ]; |
---|
67 | |
---|
68 | M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */ |
---|
69 | M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */ |
---|
70 | M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */ |
---|
71 | |
---|
72 | /* |
---|
73 | * Set the VBR here if you do not want to use the monitor's vector table. |
---|
74 | */ |
---|
75 | |
---|
76 | m68k_set_vbr( &M68Kvec ); |
---|
77 | |
---|
78 | rtems_cache_enable_instruction(); |
---|
79 | rtems_cache_enable_data(); |
---|
80 | |
---|
81 | Configuration.work_space_start = (void *) &_WorkspaceBase; |
---|
82 | |
---|
83 | /* led_putnum('e'); * for debugging purposes only */ |
---|
84 | |
---|
85 | /* Clock_exit is done as an atexit() function */ |
---|
86 | } |
---|