source: rtems/c/src/lib/libbsp/powerpc/score603e/include/bsp.h @ dac4208

4.104.114.84.95
Last change on this file since dac4208 was dac4208, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/31/04 at 03:47:07

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • PCI_bus/PCI.c, PCI_bus/PCI.h, PCI_bus/flash.c, PCI_bus/universe.c, clock/clock.c, console/85c30.c, console/console.c, console/consolebsp.h, include/bsp.h, include/gen2.h, startup/FPGA.c, startup/Hwr_init.c, startup/bspstart.c, startup/genpvec.c, startup/spurious.c, startup/vmeintr.c, timer/timer.c, tod/tod.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 5.8 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all board IO definitions.
4 *
5 *  COPYRIGHT (c) 1989-1997.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may in
9 *  the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#ifndef __BSP_h
16#define __BSP_h
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include <bspopts.h>
23
24/*
25 *  confdefs.h overrides for this BSP:
26 *   - termios serial ports (defaults to 1)
27 *   - Interrupt stack space is not minimum if defined.
28 */
29
30#if (HAS_PMC_PSC8)
31#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS (4 + 4)
32#else
33#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS (4)
34#endif
35#define CONFIGURE_INTERRUPT_STACK_MEMORY  (12 * 1024)
36 
37#ifdef ASM
38/* Definition of where to store registers in alignment handler */
39#define ALIGN_REGS 0x0140
40
41#else
42#include <rtems.h>
43#include <console.h>
44#include <clockdrv.h>
45#include <iosupp.h>
46
47/*
48 *  We no longer support the first generation board.
49 */
50
51#include <gen2.h>
52
53/*
54 * The following macro calculates the Baud constant. For the Z8530 chip.
55 *
56 * Note: baud constant = ((clock frequency / Clock_X) / (2 * Baud Rate)) - 2
57 *       for the Score603e ((10,000,000 / 16) / (2 * Baud Rate)) - 2
58 */
59#define _Score603e_Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
60  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
61
62#define Score603e_Z8530_Chip1_Baud( _value ) \
63  _Score603e_Z8530_Baud( SCORE603E_85C30_1_CLOCK, \
64     SCORE603E_85C30_1_CLOCK_X, _value )
65
66#define Score603e_Z8530_Chip0_Baud( _value ) \
67  _Score603e_Z8530_Baud( SCORE603E_85C30_0_CLOCK, \
68     SCORE603E_85C30_0_CLOCK_X, _value )
69
70#define Initialize_Board_ctrl_register()                         \
71  *SCORE603E_BOARD_CTRL_REG = (*SCORE603E_BOARD_CTRL_REG |       \
72                               SCORE603E_BRD_FLASH_DISABLE_MASK) \
73
74/*
75 *  Define the time limits for RTEMS Test Suite test durations.
76 *  Long test and short test duration limits are provided.  These
77 *  values are in seconds and need to be converted to ticks for the
78 *  application.
79 *
80 */
81
82#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
83#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
84
85/*
86 *  Stuff for Time Test 27
87 */
88
89#define MUST_WAIT_FOR_INTERRUPT 1
90
91#define Install_tm27_vector( _handler ) \
92  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
93
94#define Cause_tm27_intr()  \
95  do { \
96    uint32_t   _clicks = 8; \
97    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
98  } while (0)
99
100
101#define Clear_tm27_intr() \
102  do { \
103    uint32_t   _clicks = 0xffffffff; \
104    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
105  } while (0)
106
107#define Lower_tm27_intr() \
108  do { \
109    uint32_t   _msr = 0; \
110    _ISR_Set_level( 0 ); \
111    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
112    _msr |=  0x8002; \
113    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
114  } while (0)
115
116
117/* Constants */
118
119/*
120 *  Device Driver Table Entries
121 */
122 
123/*
124 * NOTE: Use the standard Console driver entry
125 */
126 
127/*
128 * NOTE: Use the standard Clock driver entry
129 */
130 
131
132/*
133 *  Information placed in the linkcmds file.
134 */
135
136extern int   RAM_START;
137extern int   RAM_END;
138extern int   RAM_SIZE;
139
140extern int   PROM_START;
141extern int   PROM_END;
142extern int   PROM_SIZE;
143
144extern int   CLOCK_SPEED;
145extern int   CPU_PPC_CLICKS_PER_MS;
146
147extern int   end;        /* last address in the program */
148
149/*
150 * How many libio files we want
151 */
152 
153#define BSP_LIBIO_MAX_FDS       20
154
155/* functions */
156
157void bsp_start( void );
158
159void bsp_cleanup( void );
160
161rtems_isr_entry set_vector(                    /* returns old vector */
162  rtems_isr_entry     handler,                  /* isr routine        */
163  rtems_vector_number vector,                   /* vector number      */
164  int                 type                      /* RTEMS or RAW intr  */
165);
166
167/*
168 * spurious.c
169 */
170rtems_isr bsp_stub_handler(
171   rtems_vector_number trap
172);
173rtems_isr bsp_spurious_handler(
174   rtems_vector_number trap
175);
176void bsp_spurious_initialize();
177
178/*
179 * genvec.c
180 */
181rtems_isr_entry  set_EE_vector(
182  rtems_isr_entry     handler,                  /* isr routine        */
183  rtems_vector_number vector                    /* vector number      */
184);
185void initialize_external_exception_vector ();
186
187/*
188 * console.c
189 */
190void DEBUG_puts( char *string );
191
192void BSP_fatal_return( void );
193
194/*
195 * Hwr_init.c
196 */
197void init_PCI();
198void instruction_cache_enable ();
199void data_cache_enable ();
200
201
202void initialize_PCI_bridge ();
203uint16_t         read_and_clear_irq ();
204void set_irq_mask(
205  uint16_t         value
206);
207uint16_t         get_irq_mask();
208
209/*
210 * universe.c
211 */
212void initialize_universe();
213
214void set_irq_mask(
215  uint16_t         value
216);
217
218uint16_t         get_irq_mask();
219
220void unmask_irq(
221  uint16_t         irq_idx
222);
223
224void init_irq_data_register();
225
226uint16_t         read_and_clear_PMC_irq(
227  uint16_t            irq
228);
229
230rtems_boolean Is_PMC_IRQ(
231  uint32_t           pmc_irq,
232  uint16_t           status_word
233);
234
235uint16_t         read_and_clear_irq();
236
237/*
238 * FPGA.c
239 */
240void initialize_PCI_bridge ();
241
242/* flash.c */
243
244unsigned int SCORE603e_FLASH_Disable(
245  uint32_t                       unused
246);
247unsigned int SCORE603e_FLASH_verify_enable();
248unsigned int SCORE603e_FLASH_Enable_writes(
249  uint32_t                       area        /* Unused  */
250);
251
252#define Convert_Endian_32( _data ) \
253  ( ((_data&0x000000ff)<<24) | ((_data&0x0000ff00)<<8) |  \
254    ((_data&0x00ff0000)>>8)  | ((_data&0xff000000)>>24) )
255
256#define Convert_Endian_16( _data ) \
257  ( ((_data&0x00ff)<<8) | ((_data&0xff00)>>8) )
258
259extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
260extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
261extern uint32_t                  bsp_isr_level;
262
263#endif /* ASM */
264
265#ifdef __cplusplus
266}
267#endif
268
269#endif
270/* end of include file */
271
Note: See TracBrowser for help on using the repository browser.