source: rtems/bsps/m68k/mvme167/start/bspstart.c @ adb85dd

5
Last change on this file since adb85dd was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 20, 2018 at 8:35:35 AM

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/**
2 *  @file
3 *
4 *  Board-specific initialization code. Called from the generic boot_card()
5 *  function defined in rtems/c/src/lib/libbsp/shared/main.c. That function
6 *  does some of the board independent initialization. It is called from the
7 *  generic MC680x0 entry point _start() defined in
8 *  rtems/c/src/lib/start/m68k/start.s
9 *
10 *  _start() has set up a stack, has zeroed the .bss section, has turned off
11 *  interrupts, and placed the processor in the supervisor mode. boot_card()
12 *  has left the processor in that state when bsp_start() was called.
13 *
14 *  RUNS WITH ADDRESS TRANSLATION AND CACHING TURNED OFF!
15 *  ASSUMES THAT THE VIRTUAL ADDRESSES WILL BE IDENTICAL TO THE PHYSICAL
16 *  ADDRESSES. Software-controlled address translation would be required
17 *  otherwise.
18 *
19 *  ASSUMES THAT 167BUG IS PRESENT TO CATCH ANY EXCEPTIONS DURING
20 *  INITIALIZATION.
21 */
22
23/*
24 *  COPYRIGHT (c) 1989-2012.
25 *  On-Line Applications Research Corporation (OAR).
26 *
27 *  The license and distribution terms for this file may be
28 *  found in the file LICENSE in this distribution or at
29 *  http://www.rtems.org/license/LICENSE.
30 *
31 *  Modifications of respective RTEMS files:
32 *  Copyright (c) 1998, National Research Council of Canada
33 */
34
35#include <bsp.h>
36#include <bsp/bootcard.h>
37#include <page_table.h>
38
39void M68KFPSPInstallExceptionHandlers (void);
40
41void bsp_start( void )
42{
43  void **rom_monitor_vector_table;
44  int index;
45
46  /*
47   *  167Bug Vectors are at 0xFFE00000
48   */
49  rom_monitor_vector_table = (void **)0xFFE00000;
50  m68k_set_vbr( rom_monitor_vector_table );
51
52  /*
53   *  Copy 167Bug Bus Error handler into our exception vector. All 167Bug
54   *  exception vectors are the same and point to the generalized exception
55   *  handler. The bus error handler is the one that Motorola says to copy
56   *  (p. 2-13, Debugging Package for Motorola 68K CISC CPUs User's Manual
57   *  68KBUG/D1A3, October 1993).
58   */
59  for ( index=2 ; index<=255 ; index++ )
60    M68Kvec[ index ] = rom_monitor_vector_table[ 2 ];
61
62  /* Any exceptions during initialization should be trapped by 167Bug */
63  m68k_set_vbr( &M68Kvec );
64
65  /* Install the 68040 FPSP here */
66  M68KFPSPInstallExceptionHandlers();
67
68  /*
69   *  You may wish to make the VME arbitration round-robin here, currently
70   *  we leave it as it is.
71   */
72
73  /* Set the Interrupt Base Vectors */
74  lcsr->vector_base = (VBR0 << 28) | (VBR1 << 24);
75
76  /*
77   *  Initialize address translation
78   */
79  page_table_init();
80}
Note: See TracBrowser for help on using the repository browser.