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

4.104.114.84.95
Last change on this file since 50f93fb was 50f93fb, checked in by Joel Sherrill <joel.sherrill@…>, on 09/17/07 at 14:09:43

2007-09-17 Joel Sherrill <joel.sherrill@…>

  • PCI_bus/universe.c, console/console.c, include/bsp.h, irq/FPGA.c, startup/bspstart.c, startup/genpvec.c, startup/spurious.c: Eliminate DEBUG_puts.
  • Property mode set to 100644
File size: 4.9 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#include <rtems.h>
24#include <rtems/console.h>
25#include <libcpu/io.h>
26#include <rtems/clockdrv.h>
27#include <bsp/vectors.h>
28
29/*
30 *  confdefs.h overrides for this BSP:
31 *   - termios serial ports (defaults to 1)
32 *   - Interrupt stack space is not minimum if defined.
33 */
34
35#if (HAS_PMC_PSC8)
36#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS (4 + 4)
37#else
38#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS (4)
39#endif
40#define CONFIGURE_INTERRUPT_STACK_MEMORY  (12 * 1024)
41
42#ifdef ASM
43/* Definition of where to store registers in alignment handler */
44#define ALIGN_REGS 0x0140
45
46#else
47#include <rtems.h>
48#include <rtems/console.h>
49#include <rtems/clockdrv.h>
50#include <rtems/iosupp.h>
51
52/*
53 *  We no longer support the first generation board.
54 */
55
56#include <gen2.h>
57
58/*
59 * The following macro calculates the Baud constant. For the Z8530 chip.
60 *
61 * Note: baud constant = ((clock frequency / Clock_X) / (2 * Baud Rate)) - 2
62 *       for the Score603e ((10,000,000 / 16) / (2 * Baud Rate)) - 2
63 */
64#define _Score603e_Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
65  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
66
67#define Score603e_Z8530_Chip1_Baud( _value ) \
68  _Score603e_Z8530_Baud( SCORE603E_85C30_1_CLOCK, \
69     SCORE603E_85C30_1_CLOCK_X, _value )
70
71#define Score603e_Z8530_Chip0_Baud( _value ) \
72  _Score603e_Z8530_Baud( SCORE603E_85C30_0_CLOCK, \
73     SCORE603E_85C30_0_CLOCK_X, _value )
74
75#define Initialize_Board_ctrl_register()                         \
76  *SCORE603E_BOARD_CTRL_REG = (*SCORE603E_BOARD_CTRL_REG |       \
77                               SCORE603E_BRD_FLASH_DISABLE_MASK)
78
79#define Processor_Synchronize() \
80  asm(" eieio ")
81
82
83/* Constants */
84
85/*
86 *  Device Driver Table Entries
87 */
88
89/*
90 * NOTE: Use the standard Console driver entry
91 */
92
93/*
94 * NOTE: Use the standard Clock driver entry
95 */
96
97/*
98 *  Information placed in the linkcmds file.
99 */
100
101extern int   RAM_START;
102extern int   RAM_END;
103extern int   RAM_SIZE;
104
105extern int   PROM_START;
106extern int   PROM_END;
107extern int   PROM_SIZE;
108
109extern int   CLOCK_SPEED;
110extern int   CPU_PPC_CLICKS_PER_MS;
111
112extern int   end;        /* last address in the program */
113
114/*
115 * How many libio files we want
116 */
117
118#define BSP_LIBIO_MAX_FDS       20
119
120/* functions */
121
122void bsp_start( void );
123
124void bsp_cleanup( void );
125
126rtems_isr_entry set_vector(                    /* returns old vector */
127  rtems_isr_entry     handler,                  /* isr routine        */
128  rtems_vector_number vector,                   /* vector number      */
129  int                 type                      /* RTEMS or RAW intr  */
130);
131
132/*
133 * spurious.c
134 */
135rtems_isr bsp_stub_handler(
136   rtems_vector_number trap
137);
138rtems_isr bsp_spurious_handler(
139   rtems_vector_number trap
140);
141void bsp_spurious_initialize();
142
143/*
144 * genvec.c
145 */
146rtems_isr_entry  set_EE_vector(
147  rtems_isr_entry     handler,                  /* isr routine        */
148  rtems_vector_number vector                    /* vector number      */
149);
150void initialize_external_exception_vector ();
151
152/*
153 * console.c
154 */
155void BSP_fatal_return( void );
156
157/*
158 * Hwr_init.c
159 */
160void init_PCI();
161void instruction_cache_enable ();
162void data_cache_enable ();
163
164void initialize_PCI_bridge ();
165uint16_t         read_and_clear_irq ();
166void set_irq_mask(
167  uint16_t         value
168);
169uint16_t         get_irq_mask();
170
171/*
172 * universe.c
173 */
174void initialize_universe();
175
176void set_irq_mask(
177  uint16_t         value
178);
179
180uint16_t         get_irq_mask();
181
182void unmask_irq(
183  uint16_t         irq_idx
184);
185
186void init_irq_data_register();
187
188uint16_t         read_and_clear_PMC_irq(
189  uint16_t            irq
190);
191
192rtems_boolean Is_PMC_IRQ(
193  uint32_t           pmc_irq,
194  uint16_t           status_word
195);
196
197uint16_t         read_and_clear_irq();
198
199/*
200 * FPGA.c
201 */
202void initialize_PCI_bridge ();
203
204/* flash.c */
205
206unsigned int SCORE603e_FLASH_Disable(
207  uint32_t                       unused
208);
209unsigned int SCORE603e_FLASH_verify_enable();
210unsigned int SCORE603e_FLASH_Enable_writes(
211  uint32_t                       area        /* Unused  */
212);
213
214#define BSP_FLASH_ENABLE_WRITES( _area) SCORE603e_FLASH_Enable_writes( _area )
215#define BSP_FLASH_DISABLE_WRITES(_area) SCORE603e_FLASH_Disable( _area )
216
217#define Convert_Endian_32( _data ) \
218  ( ((_data&0x000000ff)<<24) | ((_data&0x0000ff00)<<8) |  \
219    ((_data&0x00ff0000)>>8)  | ((_data&0xff000000)>>24) )
220
221#define Convert_Endian_16( _data ) \
222  ( ((_data&0x00ff)<<8) | ((_data&0xff00)>>8) )
223
224extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
225extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
226extern uint32_t                  bsp_isr_level;
227
228#endif /* ASM */
229
230#ifdef __cplusplus
231}
232#endif
233
234#endif
Note: See TracBrowser for help on using the repository browser.