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

4.104.115
Last change on this file since 60e3b00 was 4909a30, checked in by Joel Sherrill <joel.sherrill@…>, on 09/10/08 at 21:35:37

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

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