source: rtems/c/src/lib/libbsp/m68k/dmv152/include/bsp.h @ 497428a2

4.104.114.84.95
Last change on this file since 497428a2 was 497428a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/30/95 at 19:42:36

cpu/*types.h added and successfully compiled.
IDLE task priority changed from 0 to 255 during initialization.

  • Property mode set to 100644
File size: 4.5 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all DMV152 board IO definitions.
4 *
5 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
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 __DMV152_h
17#define __DMV152_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems.h>
24#include <iosupp.h>
25#include <z8530.h>
26#include <z8536.h>
27
28/*
29 *  Define the time limits for RTEMS Test Suite test durations.
30 *  Long test and short test duration limits are provided.  These
31 *  values are in seconds and need to be converted to ticks for the
32 *  application.
33 *
34 */
35
36#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
37#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
38
39/*
40 *  Define the interrupt mechanism for Time Test 27
41 */
42
43/* use a VMEbus interrupt */
44
45#define MUST_WAIT_FOR_INTERRUPT 1
46
47#define Install_tm27_vector( handler ) \
48  { \
49    set_vector( (handler), 0x50, 1 );  \
50    (*(volatile rtems_unsigned32 *)0x0d800024) = 0x50; /* set IVECT reg */ \
51    (*(volatile rtems_unsigned8  *)0x0d00000c) = 0x40; /* set VIE reg */ \
52  }
53
54#define Cause_tm27_intr()  \
55  (*(volatile rtems_unsigned8 *)0x0d000003) = 0x0f  /* set VINT */
56
57#define Clear_tm27_intr()  /* no operation necessary */
58
59#define Lower_tm27_intr()
60
61/*
62 *  Simple spin delay in microsecond units for device drivers.
63 *  This is very dependent on the clock speed of the target.
64 */
65
66#define delay( microseconds ) \
67  { register rtems_unsigned32 _delay=(microseconds); \
68    register rtems_unsigned32 _tmp=123; \
69    asm volatile( "0: \
70                     nbcd      %0 ; \
71                     nbcd      %0 ; \
72                     dbf       %1,0b" \
73                  : "=d" (_tmp), "=d" (_delay) \
74                  : "0"  (_tmp), "1"  (_delay) ); \
75  }
76
77/* macros */
78
79#undef Z8x36_STATE0
80#undef Z8x36_WRITE
81#undef Z8x36_READ
82
83#define Z8x36_STATE0 ( z8536 ) \
84  { char *garbage; \
85    (garbage) = *(VOL8(z8536+0x7)) \
86  }
87
88#define Z8x36_WRITE( z8536, reg, data ) \
89   *(VOL8(z8536+0x7)) = (reg); \
90   *(VOL8(z8536+0x7)) = (data)
91
92#define Z8x36_READ( z8536, reg, data ) \
93   *(VOL8(z8536+0x7)) = (reg); \
94   (data) = *(VOL8(z8536+0x7))
95
96/*
97 *  ACC Register Addresses
98 */
99
100#define ACC_BASE    0x0D000000
101
102#define ACC_STAT0   ((volatile rtems_unsigned8 *) (ACC_BASE + 0x00))
103#define ACC_STAT1   ((volatile rtems_unsigned8 *) (ACC_BASE + 0x01))
104#define ACC_GENCTL  ((volatile rtems_unsigned8 *) (ACC_BASE + 0x02))
105#define ACC_VINT    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x03))
106#define ACC_VREQ    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x04))
107#define ACC_VARB    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x05))
108#define ACC_ID      ((volatile rtems_unsigned8 *) (ACC_BASE + 0x06))
109#define ACC_CTL2    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x07))
110#define ACC_7IS     ((volatile rtems_unsigned8 *) (ACC_BASE + 0x08))
111#define ACC_LIS     ((volatile rtems_unsigned8 *) (ACC_BASE + 0x09))
112#define ACC_7IE     ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0A))
113#define ACC_LIE     ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0B))
114#define ACC_VIE     ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0C))
115#define ACC_IC10    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0D))
116#define ACC_IC32    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0E))
117#define ACC_IC54    ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0F))
118
119/* constants */
120
121#define RAM_START 0
122#define RAM_END   0x100000
123
124#define USE_CHANNEL_A   0                /* 1 = use channel A for console */
125#define USE_CHANNEL_B   1                /* 1 = use channel B for console */
126
127#define TIMER 0x0c000000
128#define TIMER_VECTOR 0x4D
129
130#if (USE_CHANNEL_A == 1)
131#define CONSOLE_CONTROL  0x0C800007
132#define CONSOLE_DATA     0x0C800005
133#elif (USE_CHANNEL_B == 1)
134#define CONSOLE_CONTROL  0x0C800001
135#define CONSOLE_DATA     0x0C800003
136#endif
137
138/* Structures */
139
140#ifdef D152_INIT
141#undef EXTERN
142#define EXTERN
143#else
144#undef EXTERN
145#define EXTERN extern
146#endif
147
148/* miscellaneous stuff assumed to exist */
149
150extern rtems_configuration_table BSP_Configuration;
151
152extern m68k_isr_entry M68Kvec[];   /* vector table address */
153
154/* functions */
155
156void bsp_cleanup( void );
157
158m68k_isr_entry set_vector(
159  rtems_isr_entry     handler,
160  rtems_vector_number vector,
161  int                 type
162);
163
164#ifdef __cplusplus
165}
166#endif
167
168#endif
169/* end of include file */
Note: See TracBrowser for help on using the repository browser.