[b6394ae] | 1 | /* |
---|
[28fa54d9] | 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 | * |
---|
[08311cc3] | 7 | * COPYRIGHT (c) 1989-1999. |
---|
[28fa54d9] | 8 | * On-Line Applications Research Corporation (OAR). |
---|
| 9 | * |
---|
[98e4ebf5] | 10 | * The license and distribution terms for this file may be |
---|
| 11 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 12 | * http://www.OARcorp.com/rtems/license.html. |
---|
[28fa54d9] | 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 <bsp.h> |
---|
| 22 | #include <rtems/libio.h> |
---|
| 23 | |
---|
| 24 | #include <libcsupport.h> |
---|
| 25 | |
---|
| 26 | #include <string.h> |
---|
| 27 | |
---|
| 28 | /* |
---|
| 29 | * The original table from the application and our copy of it with |
---|
| 30 | * some changes. |
---|
| 31 | */ |
---|
| 32 | |
---|
| 33 | extern rtems_configuration_table Configuration; |
---|
| 34 | rtems_configuration_table BSP_Configuration; |
---|
| 35 | |
---|
| 36 | rtems_cpu_table Cpu_table; |
---|
| 37 | |
---|
| 38 | char *rtems_progname; |
---|
| 39 | |
---|
[b6394ae] | 40 | /* |
---|
| 41 | * Use the shared implementations of the following routines |
---|
[28fa54d9] | 42 | */ |
---|
[b6394ae] | 43 | |
---|
| 44 | void bsp_postdriver_hook(void); |
---|
| 45 | void bsp_libc_init( void *, unsigned32, int ); |
---|
[b8c9883] | 46 | void bsp_pretasking_hook(void); /* m68k version */ |
---|
[28fa54d9] | 47 | |
---|
| 48 | /* |
---|
[b6394ae] | 49 | * bsp_start |
---|
| 50 | * |
---|
| 51 | * This routine does the bulk of the system initialization. |
---|
[28fa54d9] | 52 | */ |
---|
| 53 | |
---|
[e2a2ec60] | 54 | void bsp_start( void ) |
---|
[28fa54d9] | 55 | { |
---|
| 56 | m68k_isr_entry *monitors_vector_table; |
---|
| 57 | int index; |
---|
[df49c60] | 58 | extern void *_WorkspaceBase; |
---|
| 59 | extern void *_RamSize; |
---|
| 60 | extern unsigned long _M68k_Ramsize; |
---|
| 61 | |
---|
| 62 | _M68k_Ramsize = (unsigned long)&_RamSize; /* RAM size set in linker script */ |
---|
[28fa54d9] | 63 | |
---|
| 64 | monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */ |
---|
| 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 | pcc->int_base_vector = PCC_BASE_VECTOR; /* Set the PCC int vectors base */ |
---|
| 78 | |
---|
| 79 | (*(rtems_unsigned8 *)0xfffe2001) = 0x08; |
---|
| 80 | /* make VME access round-robin */ |
---|
| 81 | |
---|
[5e77d129] | 82 | rtems_cache_enable_instruction(); |
---|
[28fa54d9] | 83 | |
---|
| 84 | /* |
---|
| 85 | * we only use a hook to get the C library initialized. |
---|
| 86 | */ |
---|
| 87 | |
---|
| 88 | Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ |
---|
| 89 | Cpu_table.postdriver_hook = bsp_postdriver_hook; |
---|
| 90 | Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; |
---|
[df49c60] | 91 | Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY; |
---|
[28fa54d9] | 92 | |
---|
[b8c9883] | 93 | BSP_Configuration.work_space_start = (void *) &_WorkspaceBase; |
---|
[28fa54d9] | 94 | } |
---|