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

4.104.114.84.95
Last change on this file since 29cd553 was 29cd553, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 13:46:54

2003-09-04 Joel Sherrill <joel@…>

  • console/conscfg.c, include/bsp.h, scv64/scv64.c, startup/bspstart.c, tod/todcfg.c: Removed incorrect statement about copyright assignment.
  • Property mode set to 100644
File size: 4.2 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 *
8 *  $Id$
9 */
10
11#ifndef __DMV170_BSP_h
12#define __DMV170_BSP_h
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <bspopts.h>
19
20/*
21 *  confdefs.h overrides for this BSP:
22 *   - termios serial ports (defaults to 1)
23 *   - Interrupt stack space is not minimum if defined.
24 */
25
26#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 4
27#define CONFIGURE_INTERRUPT_STACK_MEMORY  (12 * 1024)
28 
29#ifdef ASM
30/* Definition of where to store registers in alignment handler */
31#define ALIGN_REGS 0x0140
32
33#else
34#include <rtems.h>
35#include <console.h>
36#include <clockdrv.h>
37#include <console.h>
38#include <iosupp.h>
39
40#include <dmv170.h>
41
42#if 0
43#define Enable_Debug() \
44  DMV170_WRITE( 0xffffbd0c, 0 )
45
46#define Debug_Entry( num ) \
47  DMV170_WRITE( 0xffffbd06, num )
48#else
49#define Enable_Debug()
50#define Debug_Entry( num )
51#endif
52
53/*
54 * Network driver configuration
55 */
56struct rtems_bsdnet_ifconfig;
57int rtems_dmv177_sonic_driver_attach(struct rtems_bsdnet_ifconfig *config);
58#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
59#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_dmv177_sonic_driver_attach
60
61
62/*
63 * The following macro calculates the Baud constant. For the Z8530 chip.
64 */
65#define Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
66  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
67
68
69/*
70 *  Define the time limits for RTEMS Test Suite test durations.
71 *  Long test and short test duration limits are provided.  These
72 *  values are in seconds and need to be converted to ticks for the
73 *  application.
74 *
75 */
76
77#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
78#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
79
80
81/*
82 *  Stuff for Time Test 27
83 */
84
85#define MUST_WAIT_FOR_INTERRUPT 1
86
87#define Install_tm27_vector( _handler ) \
88  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
89
90#define Cause_tm27_intr()  \
91  do { \
92    unsigned32 _clicks = 1; \
93    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
94  } while (0)
95
96#define Clear_tm27_intr() \
97  do { \
98    unsigned32 _clicks = 0xffffffff; \
99    unsigned32 _msr = 0; \
100    _ISR_Set_level( 0 ); \
101    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
102    _msr &=  ~0x8000; \
103    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
104    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
105  } while (0)
106
107#define Lower_tm27_intr() \
108  do { \
109    unsigned32 _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/* Constants */
117
118/*
119 *  Device Driver Table Entries
120 */
121 
122/*
123 * NOTE: Use the standard Console driver entry
124 */
125 
126/*
127 * NOTE: Use the standard Clock driver entry
128 */
129 
130
131/*
132 *  Information placed in the linkcmds file.
133 */
134
135extern int   RAM_START;
136extern int   RAM_END;
137extern int   RAM_SIZE;
138
139extern int   PROM_START;
140extern int   PROM_END;
141extern int   PROM_SIZE;
142
143extern int   CLOCK_SPEED;
144
145extern int   end;        /* last address in the program */
146
147/*
148 * How many libio files we want
149 */
150 
151#define BSP_LIBIO_MAX_FDS       20
152
153/* functions */
154
155/*
156 * genvec.c
157 */
158rtems_isr_entry  set_EE_vector(
159  rtems_isr_entry     handler,                  /* isr routine        */
160  rtems_vector_number vector                    /* vector number      */
161);
162void initialize_external_exception_vector ();
163
164/*
165 * console.c
166 */
167void DEBUG_puts( char *string );
168
169void BSP_fatal_return( void );
170
171
172
173void bsp_start( void );
174
175void bsp_cleanup( void );
176
177rtems_isr_entry set_vector(                    /* returns old vector */
178  rtems_isr_entry     handler,                  /* isr routine        */
179  rtems_vector_number vector,                   /* vector number      */
180  int                 type                      /* RTEMS or RAW intr  */
181);
182
183void BSP_fatal_return( void );
184
185void bsp_spurious_initialize( void );
186
187extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
188
189extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
190
191extern rtems_unsigned32          bsp_isr_level;
192
193extern int   CPU_PPC_CLICKS_PER_MS;
194
195#endif /* ASM */
196
197#ifdef __cplusplus
198}
199#endif
200
201#endif
202/* end of include file */
Note: See TracBrowser for help on using the repository browser.