source: rtems/c/src/lib/libbsp/m68k/mvme136/include/bsp.h @ 5fa14794

4.104.114.84.95
Last change on this file since 5fa14794 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all MVME136 board IO definitions.
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#ifndef __MVME136_h
16#define __MVME136_h
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include <rtems.h>
23#include <clockdrv.h>
24#include <console.h>
25#include <iosupp.h>
26
27/*
28 *  Define the time limits for RTEMS Test Suite test durations.
29 *  Long test and short test duration limits are provided.  These
30 *  values are in seconds and need to be converted to ticks for the
31 *  application.
32 *
33 */
34
35#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
36#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
37
38/*
39 *  Define the interrupt mechanism for Time Test 27
40 *
41 *  NOTE: Use the MPCSR vector for the MVME136
42 */
43
44#define MUST_WAIT_FOR_INTERRUPT 0
45
46#define Install_tm27_vector( handler ) set_vector( (handler), 75, 1 )
47
48#define Cause_tm27_intr()  (*(volatile rtems_unsigned8 *)0xfffb006b) = 0x80
49
50#define Clear_tm27_intr()  (*(volatile rtems_unsigned8 *)0xfffb006b) = 0x00
51
52#define Lower_tm27_intr()
53
54/*
55 *  Simple spin delay in microsecond units for device drivers.
56 *  This is very dependent on the clock speed of the target.
57 */
58
59#define delay( microseconds ) \
60  { register rtems_unsigned32 _delay=(microseconds); \
61    register rtems_unsigned32 _tmp=123; \
62    asm volatile( "0: \
63                     nbcd      %0 ; \
64                     nbcd      %0 ; \
65                     dbf       %1,0b" \
66                  : "=d" (_tmp), "=d" (_delay) \
67                  : "0"  (_tmp), "1"  (_delay) ); \
68  }
69
70/* Constants */
71
72#define RAM_START 0
73#define RAM_END   0x100000
74
75#define M681ADDR      0xfffb0040         /* address of the M68681 chip */
76#define RXRDYB        0x01               /* status reg recv ready mask */
77#define TXRDYB        0x04               /* status reg trans ready mask */
78#define PARITYERR     0x20               /* status reg parity error mask */
79#define FRAMEERR      0x40               /* status reg frame error mask */
80
81
82#define FOREVER       1                  /* infinite loop */
83
84/* Structures */
85
86struct r_m681_info {
87  char fill1[ 5 ];                       /* channel A regs ( not used ) */
88  char isr;                              /* interrupt status reg */
89  char fill2[ 2 ];                       /* counter regs (not used) */
90  char mr1mr2b;                          /* MR1B and MR2B regs */
91  char srb;                              /* status reg channel B */
92  char fill3;                            /* do not access */
93  char rbb;                              /* receive buffer channel B */
94  char ivr;                              /* interrupt vector register */
95};
96
97struct w_m681_info {
98  char fill1[ 4 ];                       /* channel A regs (not used) */
99  char acr;                              /* auxillary control reg */
100  char imr;                              /* interrupt mask reg */
101  char fill2[ 2 ];                       /* counter regs (not used) */
102  char mr1mr2b;                          /* MR1B and MR2B regs */
103  char csrb;                             /* clock select reg */
104  char crb;                              /* command reg */
105  char tbb;                              /* transmit buffer channel B */
106  char ivr;                              /* interrupt vector register */
107};
108
109#ifdef M136_INIT
110#undef EXTERN
111#define EXTERN
112#else
113#undef EXTERN
114#define EXTERN extern
115#endif
116
117/* miscellaneous stuff assumed to exist */
118
119extern rtems_configuration_table BSP_Configuration;
120
121/* M68681 DUART chip register variables */
122
123EXTERN volatile struct r_m681_info *_Read_m681;  /* M68681 read registers */
124EXTERN volatile struct w_m681_info *_Write_m681; /* M68681 write registers */
125
126extern m68k_isr_entry M68Kvec[];   /* vector table address */
127
128/*
129 *  Device Driver Table Entries
130 */
131
132/*
133 * NOTE: Use the standard Console driver entry
134 */
135 
136/*
137 * NOTE: Use the standard Clock driver entry
138 */
139
140/* functions */
141
142void bsp_cleanup( void );
143
144m68k_isr_entry set_vector(
145  rtems_isr_entry     handler,
146  rtems_vector_number vector,
147  int                 type
148);
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif
155/* end of include file */
Note: See TracBrowser for help on using the repository browser.