source: rtems/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h @ bfcd473

4.104.114.84.95
Last change on this file since bfcd473 was b1a2ae92, checked in by Joel Sherrill <joel.sherrill@…>, on 05/24/01 at 20:03:27

2001-05-22 Ralf Corsepius <corsepiu@…>

  • configure.in: Add bspopts.h, AC_DEFINE CONSOLE_USE_INTERRUPTS, CONSOLE_USE_POLLED, HAS_RTC.
  • include/.cvsignore: Add bspopts.h*, stamp-h*, coverhd.h, tod.h.
  • include/Makefile.am: Use *_HEADERS instead of *H_FILES, New treatment of tod.h, coverhd.h.
  • include/bsp.h: Add include bspopts.h.
  • Property mode set to 100644
File size: 4.5 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all DY-4 DMV170 board IO definitions.
4 *
5 *  COPYRIGHT (c) 1989-1997.
6 *  On-Line Applications Research Corporation (OAR).
7 *  All rights assigned to U.S. Government, 1994.
8 *
9 *  This material may be reproduced by or for the U.S. Government pursuant
10 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11 *  notice must appear in all copies of this file and its derivatives.
12 *
13 *  $Id$
14 */
15
16#ifndef __DMV170_BSP_h
17#define __DMV170_BSP_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <bspopts.h>
24
25/*
26 *  confdefs.h overrides for this BSP:
27 *   - termios serial ports (defaults to 1)
28 *   - Interrupt stack space is not minimum if defined.
29 */
30
31#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 4
32#define CONFIGURE_INTERRUPT_STACK_MEMORY  (12 * 1024)
33 
34#ifdef ASM
35/* Definition of where to store registers in alignment handler */
36#define ALIGN_REGS 0x0140
37
38#else
39#include <rtems.h>
40#include <console.h>
41#include <clockdrv.h>
42#include <console.h>
43#include <iosupp.h>
44
45#include <dmv170.h>
46
47#if 0
48#define Enable_Debug() \
49  DMV170_WRITE( 0xffffbd0c, 0 )
50
51#define Debug_Entry( num ) \
52  DMV170_WRITE( 0xffffbd06, num )
53#else
54#define Enable_Debug()
55#define Debug_Entry( num )
56#endif
57
58/*
59 * Network driver configuration
60 */
61struct rtems_bsdnet_ifconfig;
62int rtems_dmv177_sonic_driver_attach(struct rtems_bsdnet_ifconfig *config);
63#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
64#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_dmv177_sonic_driver_attach
65
66
67/*
68 * The following macro calculates the Baud constant. For the Z8530 chip.
69 */
70#define Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
71  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
72
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/*
87 *  Stuff for Time Test 27
88 */
89
90#define MUST_WAIT_FOR_INTERRUPT 1
91
92#define Install_tm27_vector( _handler ) \
93  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
94
95#define Cause_tm27_intr()  \
96  do { \
97    unsigned32 _clicks = 1; \
98    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
99  } while (0)
100
101#define Clear_tm27_intr() \
102  do { \
103    unsigned32 _clicks = 0xffffffff; \
104    unsigned32 _msr = 0; \
105    _ISR_Set_level( 0 ); \
106    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
107    _msr &=  ~0x8000; \
108    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
109    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
110  } while (0)
111
112#define Lower_tm27_intr() \
113  do { \
114    unsigned32 _msr = 0; \
115    _ISR_Set_level( 0 ); \
116    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
117    _msr |=  0x8002; \
118    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
119  } while (0)
120
121/* Constants */
122
123/*
124 *  Device Driver Table Entries
125 */
126 
127/*
128 * NOTE: Use the standard Console driver entry
129 */
130 
131/*
132 * NOTE: Use the standard Clock driver entry
133 */
134 
135
136/*
137 *  Information placed in the linkcmds file.
138 */
139
140extern int   RAM_START;
141extern int   RAM_END;
142extern int   RAM_SIZE;
143
144extern int   PROM_START;
145extern int   PROM_END;
146extern int   PROM_SIZE;
147
148extern int   CLOCK_SPEED;
149
150extern int   end;        /* last address in the program */
151
152/*
153 * How many libio files we want
154 */
155 
156#define BSP_LIBIO_MAX_FDS       20
157
158/* functions */
159
160/*
161 * genvec.c
162 */
163rtems_isr_entry  set_EE_vector(
164  rtems_isr_entry     handler,                  /* isr routine        */
165  rtems_vector_number vector                    /* vector number      */
166);
167void initialize_external_exception_vector ();
168
169/*
170 * console.c
171 */
172void DEBUG_puts( char *string );
173
174void BSP_fatal_return( void );
175
176
177
178void bsp_start( void );
179
180void bsp_cleanup( void );
181
182rtems_isr_entry set_vector(                    /* returns old vector */
183  rtems_isr_entry     handler,                  /* isr routine        */
184  rtems_vector_number vector,                   /* vector number      */
185  int                 type                      /* RTEMS or RAW intr  */
186);
187
188void BSP_fatal_return( void );
189
190void bsp_spurious_initialize( void );
191
192extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
193
194extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
195
196extern rtems_unsigned32          bsp_isr_level;
197
198extern int   CPU_PPC_CLICKS_PER_MS;
199
200#endif /* ASM */
201
202#ifdef __cplusplus
203}
204#endif
205
206#endif
207/* end of include file */
Note: See TracBrowser for help on using the repository browser.