source: rtems/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c.nocache @ bc98089

4.104.115
Last change on this file since bc98089 was fe6cce1c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/15/08 at 22:05:03

2008-09-15 Joel Sherrill <joel.sherrill@…>

  • startup/bspstart.c, startup/bspstart.c.nocache: Add use of bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization.
  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*  bspstart.c
2 *
3 *  This set of routines starts the application.  It includes application,
4 *  board, and monitor specific initialization and configuration.
5 *  The generic CPU dependent initialization has been performed
6 *  before this routine is invoked.
7 *
8 *  COPYRIGHT (c) 1989-2007.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  Modifications for MBX860:
16 *  Copyright (c) 1999, National Research Council of Canada
17 *
18 *  $Id$
19 */
20
21#include <bsp.h>
22 
23/*
24 *  Driver configuration parameters
25 */
26uint32_t   bsp_clicks_per_usec;
27uint32_t   bsp_serial_per_sec;         /* Serial clocks per second */
28bool       bsp_serial_external_clock;
29bool       bsp_serial_xon_xoff;
30bool       bsp_serial_cts_rts;
31uint32_t   bsp_serial_rate;
32uint32_t   bsp_timer_average_overhead; /* Average overhead of timer in ticks */
33uint32_t   bsp_timer_least_valid;      /* Least valid number from timer      */
34bool       bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
35
36/*
37 *  bsp_start()
38 *
39 *  Board-specific initialization code. Called from the generic boot_card()
40 *  function defined in rtems/c/src/lib/libbsp/shared/main.c. That function
41 *  does some of the board independent initialization. It is called from the
42 *  MBX8xx entry point _start() defined in
43 *  rtems/c/src/lib/libbsp/powerpc/mbx8xx/startup/start.S
44 *
45 *  _start() has set up a stack, has zeroed the .bss section, has turned off
46 *  interrupts, and placed the processor in the supervisor mode. boot_card()
47 *  has left the processor in that state when bsp_start() was called.
48 *
49 *  RUNS WITH ADDRESS TRANSLATION AND CACHING TURNED OFF!
50 *  ASSUMES THAT THE VIRTUAL ADDRESSES WILL BE IDENTICAL TO THE PHYSICAL
51 *  ADDRESSES. Software-controlled address translation would be required
52 *  otherwise.
53 *
54 *  Input parameters: NONE
55 *
56 *  Output parameters: NONE
57 *
58 *  Return values: NONE
59 */
60void bsp_start(void)
61{
62  uint32_t   r1;
63
64  mmu_init();
65 
66  /*
67   * Enable instruction and data caches. Do not force writethrough mode.
68   */
69  #ifdef INSTRUCTION_CACHE_ENABLE
70  r1 = M8xx_CACHE_CMD_ENABLE;
71  _mtspr( M8xx_IC_CST, r1 );
72  _isync;
73  #endif
74
75  /*
76   * Warning: EPPCBug 1.1 chokes to death if the data cache is turned on.
77   * Set DATA_CACHE_ENABLE to zero in mbx8xx.cfg if EPPCBUG is used.
78   */
79  #ifdef DATA_CACHE_ENABLE
80  r1 = M8xx_CACHE_CMD_ENABLE;
81  _mtspr( M8xx_DC_CST, r1 );
82  _isync;
83  #endif
84   
85  /*
86   *  initialize the device driver parameters
87   */
88  bsp_clicks_per_usec = 1;  /* for 4MHz extclk */
89  bsp_serial_per_sec = 10000000;
90  bsp_serial_external_clock = 1;
91  bsp_serial_xon_xoff = 0;
92  bsp_serial_cts_rts = 1;
93  bsp_serial_rate = 9600;
94#if ( defined(mbx821_001) || defined(mbx821_001b) || defined(mbx860_001b) )
95  bsp_clock_speed = 50000000;
96  bsp_timer_average_overhead = 3;
97  bsp_timer_least_valid = 3;
98#else
99  bsp_clock_speed = 40000000;
100  bsp_timer_average_overhead = 3;
101  bsp_timer_least_valid = 3;
102#endif
103
104  m8xx.scc2.sccm=0;
105  m8xx.scc2p.rbase=0;
106  m8xx.scc2p.tbase=0;
107  m8xx_cp_execute_cmd( M8xx_CR_OP_STOP_TX | M8xx_CR_CHAN_SCC2 );
108}
109
Note: See TracBrowser for help on using the repository browser.