OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [m68k/] [mvme162/] [startup/] [bspstart.c] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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.OARcorp.com/rtems/license.html.
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: bspstart.c,v 1.2 2001-09-27 12:00:18 chris Exp $
22
 */
23
 
24
#include <bsp.h>
25
#include <rtems/libio.h>
26
#include <page_table.h>
27
 
28
#include <libcsupport.h>
29
 
30
#include <string.h>
31
 
32
/*
33
 *  The original table from the application and our copy of it with
34
 *  some changes.
35
 */
36
 
37
extern rtems_configuration_table  Configuration;
38
rtems_configuration_table  BSP_Configuration;
39
 
40
rtems_cpu_table Cpu_table;
41
 
42
char *rtems_progname;
43
 
44
/*
45
 *  Use the shared implementations of the following routines
46
 */
47
 
48
void bsp_postdriver_hook(void);
49
void bsp_libc_init( void *, unsigned32, int );
50
void bsp_pretasking_hook(void);               /* m68k version */
51
 
52
/*
53
 *  bsp_start
54
 *
55
 *  This routine does the bulk of the system initialization.
56
 */
57
 
58
void bsp_start( void )
59
{
60
  m68k_isr_entry       *monitors_vector_table;
61
  int                   index;
62
  extern void          *_WorkspaceBase;
63
  extern void          *_RamSize;
64
  extern unsigned long  _M68k_Ramsize;
65
 
66
  _M68k_Ramsize = (unsigned long)&_RamSize;             /* RAM size set in linker script */
67
 
68
  /*
69
   *  162Bug Vectors are at 0xFFE00000
70
   *  162Bug Vectors on LX are at 0x00000000
71
   */
72
 
73
#if defined(mvme162lx)
74
  monitors_vector_table = (m68k_isr_entry *)0x00000000;
75
#else
76
  monitors_vector_table = (m68k_isr_entry *)0xFFE00000;
77
#endif
78
 
79
  m68k_set_vbr( monitors_vector_table );
80
 
81
  for ( index=2 ; index<=255 ; index++ )
82
    M68Kvec[ index ] = monitors_vector_table[ 32 ];
83
 
84
  M68Kvec[  2 ] = monitors_vector_table[  2 ];   /* bus error vector */
85
  M68Kvec[  4 ] = monitors_vector_table[  4 ];   /* breakpoints vector */
86
  M68Kvec[  9 ] = monitors_vector_table[  9 ];   /* trace vector */
87
  M68Kvec[ 47 ] = monitors_vector_table[ 47 ];   /* system call vector */
88
 
89
  m68k_set_vbr( &M68Kvec );
90
 
91
  /*
92
   *  You may wish to make the VME arbitration round-robin here, currently
93
   *  we leave it as it is.
94
   */
95
 
96
  /* set the Interrupt Base Vectors */
97
 
98
  lcsr->vector_base = (VBR0 << 28) | (VBR1 << 24);
99
 
100
  page_table_init();
101
 
102
  /*
103
   *  we only use a hook to get the C library initialized.
104
   */
105
 
106
  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
107
  Cpu_table.postdriver_hook = bsp_postdriver_hook;
108
  Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
109
  Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
110
 
111
  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
112
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.