source: rtems/c/src/lib/libbsp/m68k/idp/startup/bspstart.c @ 6ea100c1

4.104.114.95
Last change on this file since 6ea100c1 was 6ea100c1, checked in by Joel Sherrill <joel.sherrill@…>, on 05/12/08 at 18:43:55

2008-05-12 Joel Sherrill <joel.sherrill@…>

  • startup/bspstart.c: Refactored and renamed initialization routines to rtems_initialize_data_structures, rtems_initialize_before_drivers, rtems_initialize_device_drivers, and rtems_initialize_start_multitasking. This opened the sequence up so that bootcard() could provide a more robust and flexible framework which is easier to explain and understand. This also lays the groundwork for sharing the division of available memory between the RTEMS workspace and heap and the C library initialization across all BSPs.
  • Property mode set to 100644
File size: 2.2 KB
Line 
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
23unsigned char *duart_base;
24extern struct duart_regs duart_info;
25
26#define DELAY 5000
27
28void led_putnum();
29
30/*
31 *  Use the shared implementations of the following routines
32 */
33
34void bsp_libc_init( void *, uint32_t, int );
35void bsp_pretasking_hook(void);               /* m68k version */
36
37/*
38 *  bsp_start
39 *
40 *  This routine does the bulk of the system initialization.
41 */
42
43void 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}
Note: See TracBrowser for help on using the repository browser.