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

4.104.115
Last change on this file since c00b49f8 was a3a6fae, checked in by Joel Sherrill <joel.sherrill@…>, on 08/21/09 at 17:59:31

2009-08-21 Joel Sherrill <joel.sherrill@…>

  • include/bsp.h: Eliminate BSPs defining NUMBER_OF_TERMIOS_PORTS. Should be automatically handled by confdefs.h or the application.
  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[42b6dd2a]1/*  bsp.h
2 *
[9c448e1]3 *  This include file contains all board IO definitions.
4 *
[42b6dd2a]5 *  COPYRIGHT (c) 1989-2009.
[9c448e1]6 *  On-Line Applications Research Corporation (OAR).
7 *
[42b6dd2a]8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
[b14e2f2]10 *  http://www.rtems.com/license/LICENSE.
[9c448e1]11 *
12 *  $Id$
13 */
14
[34c4852]15#ifndef _BSP_H
16#define _BSP_H
[9c448e1]17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
[42b6dd2a]22#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
23
[d4f9cef5]24#include <bspopts.h>
[bb41881e]25#include <rtems.h>
26#include <rtems/console.h>
27#include <libcpu/io.h>
28#include <rtems/clockdrv.h>
29#include <bsp/vectors.h>
[d4f9cef5]30
[9c448e1]31#ifdef ASM
32/* Definition of where to store registers in alignment handler */
33#define ALIGN_REGS 0x0140
34
35#else
36#include <rtems.h>
[1c54724]37#include <rtems/console.h>
38#include <rtems/clockdrv.h>
39#include <rtems/iosupp.h>
[9c448e1]40
[f5e7b4c3]41/*
42 *  We no longer support the first generation board.
43 */
[9c448e1]44
45#include <gen2.h>
[42b6dd2a]46#include <bsp/irq.h>
[9c448e1]47
48/*
49 * The following macro calculates the Baud constant. For the Z8530 chip.
50 *
51 * Note: baud constant = ((clock frequency / Clock_X) / (2 * Baud Rate)) - 2
52 *       for the Score603e ((10,000,000 / 16) / (2 * Baud Rate)) - 2
53 */
54#define _Score603e_Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
55  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
56
57#define Score603e_Z8530_Chip1_Baud( _value ) \
58  _Score603e_Z8530_Baud( SCORE603E_85C30_1_CLOCK, \
[6128a4a]59     SCORE603E_85C30_1_CLOCK_X, _value )
[9c448e1]60
61#define Score603e_Z8530_Chip0_Baud( _value ) \
62  _Score603e_Z8530_Baud( SCORE603E_85C30_0_CLOCK, \
[6128a4a]63     SCORE603E_85C30_0_CLOCK_X, _value )
[9c448e1]64
65#define Initialize_Board_ctrl_register()                         \
66  *SCORE603E_BOARD_CTRL_REG = (*SCORE603E_BOARD_CTRL_REG |       \
[f309cda]67                               SCORE603E_BRD_FLASH_DISABLE_MASK)
68
69#define Processor_Synchronize() \
[3d50574]70  asm volatile(" eieio ")
[f309cda]71
[9c448e1]72
[42b6dd2a]73/* Constants */
74
75/*
76 *  Device Driver Table Entries
77 */
78
79/*
80 * NOTE: Use the standard Console driver entry
81 */
82
83/*
84 * NOTE: Use the standard Clock driver entry
85 */
86
[9c448e1]87/*
88 *  Information placed in the linkcmds file.
89 */
90
[42b6dd2a]91extern int   RAM_START;
92extern int   RAM_END;
93extern int   RAM_SIZE;
94
95extern int   PROM_START;
96extern int   PROM_END;
97extern int   PROM_SIZE;
[9c448e1]98
99extern int   CLOCK_SPEED;
100extern int   CPU_PPC_CLICKS_PER_MS;
101
[42b6dd2a]102extern int   end;        /* last address in the program */
103
[387a69a]104/*
105 * Total RAM available
106 */
[42b6dd2a]107extern int        end;        /* last address in the program */
108extern int        RAM_END;
109extern uint32_t   BSP_mem_size;
110
111
112/*
113 * How many libio files we want
114 */
115
116#define BSP_LIBIO_MAX_FDS       20
[387a69a]117
[9c448e1]118/* functions */
119
[6128a4a]120/*
[42b6dd2a]121 *
[9c448e1]122 */
123rtems_isr_entry  set_EE_vector(
124  rtems_isr_entry     handler,                  /* isr routine        */
125  rtems_vector_number vector                    /* vector number      */
126);
127void initialize_external_exception_vector ();
128
129/*
130 * console.c
131 */
132void BSP_fatal_return( void );
133
134/*
135 * Hwr_init.c
136 */
137void init_PCI();
138void instruction_cache_enable ();
139void data_cache_enable ();
140
141void initialize_PCI_bridge ();
[dac4208]142uint16_t         read_and_clear_irq ();
[9c448e1]143void set_irq_mask(
[dac4208]144  uint16_t         value
[9c448e1]145);
[dac4208]146uint16_t         get_irq_mask();
[9c448e1]147
148/*
149 * universe.c
150 */
151void initialize_universe();
152
153void set_irq_mask(
[dac4208]154  uint16_t         value
[9c448e1]155);
156
[dac4208]157uint16_t         get_irq_mask();
[9c448e1]158
[6128a4a]159void unmask_irq(
[dac4208]160  uint16_t         irq_idx
[9c448e1]161);
162
[42b6dd2a]163void mask_irq(
164  uint16_t         irq_idx
165);
166
[9c448e1]167void init_irq_data_register();
168
[dac4208]169uint16_t         read_and_clear_PMC_irq(
170  uint16_t            irq
[9c448e1]171);
172
[40e7ae2]173bool Is_PMC_IRQ(
[dac4208]174  uint32_t           pmc_irq,
175  uint16_t           status_word
[9c448e1]176);
177
[dac4208]178uint16_t         read_and_clear_irq();
[9c448e1]179
180/*
181 * FPGA.c
182 */
183void initialize_PCI_bridge ();
184
185/* flash.c */
186
187unsigned int SCORE603e_FLASH_Disable(
[dac4208]188  uint32_t                       unused
[9c448e1]189);
190unsigned int SCORE603e_FLASH_verify_enable();
191unsigned int SCORE603e_FLASH_Enable_writes(
[dac4208]192  uint32_t                       area        /* Unused  */
[9c448e1]193);
194
[f309cda]195#define BSP_FLASH_ENABLE_WRITES( _area) SCORE603e_FLASH_Enable_writes( _area )
196#define BSP_FLASH_DISABLE_WRITES(_area) SCORE603e_FLASH_Disable( _area )
197
[9c448e1]198#define Convert_Endian_32( _data ) \
199  ( ((_data&0x000000ff)<<24) | ((_data&0x0000ff00)<<8) |  \
200    ((_data&0x00ff0000)>>8)  | ((_data&0xff000000)>>24) )
201
202#define Convert_Endian_16( _data ) \
203  ( ((_data&0x00ff)<<8) | ((_data&0xff00)>>8) )
204
205#endif /* ASM */
206
207#ifdef __cplusplus
208}
209#endif
210
211#endif
Note: See TracBrowser for help on using the repository browser.