1 | /* bsp.h |
---|
2 | * |
---|
3 | * This include file contains all DMV152 board IO definitions. |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-1997. |
---|
6 | * On-Line Applications Research Corporation (OAR). |
---|
7 | * Copyright assigned to U.S. Government, 1994. |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.OARcorp.com/rtems/license.html. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef __DMV152_h |
---|
17 | #define __DMV152_h |
---|
18 | |
---|
19 | #ifdef __cplusplus |
---|
20 | extern "C" { |
---|
21 | #endif |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | #include <console.h> |
---|
25 | #include <clockdrv.h> |
---|
26 | #include <iosupp.h> |
---|
27 | #include <vmeintr.h> |
---|
28 | #include <zilog/z8530.h> |
---|
29 | #include <zilog/z8536.h> |
---|
30 | |
---|
31 | /* |
---|
32 | * Define the time limits for RTEMS Test Suite test durations. |
---|
33 | * Long test and short test duration limits are provided. These |
---|
34 | * values are in seconds and need to be converted to ticks for the |
---|
35 | * application. |
---|
36 | * |
---|
37 | */ |
---|
38 | |
---|
39 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
40 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
41 | |
---|
42 | /* |
---|
43 | * Define the interrupt mechanism for Time Test 27 |
---|
44 | */ |
---|
45 | |
---|
46 | /* use a VMEbus interrupt */ |
---|
47 | |
---|
48 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
49 | |
---|
50 | #define Install_tm27_vector( handler ) \ |
---|
51 | { \ |
---|
52 | set_vector( (handler), 0x50, 1 ); \ |
---|
53 | (*(volatile rtems_unsigned32 *)0x0d800024) = 0x50; /* set IVECT reg */ \ |
---|
54 | (*(volatile rtems_unsigned8 *)0x0d00000c) = 0x40; /* set VIE reg */ \ |
---|
55 | } |
---|
56 | |
---|
57 | #define Cause_tm27_intr() \ |
---|
58 | (*(volatile rtems_unsigned8 *)0x0d000003) = 0x0f /* set VINT */ |
---|
59 | |
---|
60 | #define Clear_tm27_intr() /* no operation necessary */ |
---|
61 | |
---|
62 | #define Lower_tm27_intr() |
---|
63 | |
---|
64 | /* |
---|
65 | * Simple spin delay in microsecond units for device drivers. |
---|
66 | * This is very dependent on the clock speed of the target. |
---|
67 | */ |
---|
68 | |
---|
69 | #define delay( microseconds ) \ |
---|
70 | { register rtems_unsigned32 _delay=(microseconds); \ |
---|
71 | register rtems_unsigned32 _tmp=123; \ |
---|
72 | asm volatile( "0: \ |
---|
73 | nbcd %0 ; \ |
---|
74 | nbcd %0 ; \ |
---|
75 | dbf %1,0b" \ |
---|
76 | : "=d" (_tmp), "=d" (_delay) \ |
---|
77 | : "0" (_tmp), "1" (_delay) ); \ |
---|
78 | } |
---|
79 | |
---|
80 | /* macros */ |
---|
81 | |
---|
82 | #undef Z8x36_STATE0 |
---|
83 | #undef Z8x36_WRITE |
---|
84 | #undef Z8x36_READ |
---|
85 | |
---|
86 | #define Z8x36_STATE0 ( z8536 ) \ |
---|
87 | { char *garbage; \ |
---|
88 | (garbage) = *(VOL8(z8536+0x7)) \ |
---|
89 | } |
---|
90 | |
---|
91 | #define Z8x36_WRITE( z8536, reg, data ) \ |
---|
92 | *(VOL8(z8536+0x7)) = (reg); \ |
---|
93 | *(VOL8(z8536+0x7)) = (data) |
---|
94 | |
---|
95 | #define Z8x36_READ( z8536, reg, data ) \ |
---|
96 | *(VOL8(z8536+0x7)) = (reg); \ |
---|
97 | (data) = *(VOL8(z8536+0x7)) |
---|
98 | |
---|
99 | /* |
---|
100 | * ACC Register Addresses |
---|
101 | */ |
---|
102 | |
---|
103 | #define ACC_BASE 0x0D000000 |
---|
104 | |
---|
105 | #define ACC_STAT0 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x00)) |
---|
106 | #define ACC_STAT1 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x01)) |
---|
107 | #define ACC_GENCTL ((volatile rtems_unsigned8 *) (ACC_BASE + 0x02)) |
---|
108 | #define ACC_VINT ((volatile rtems_unsigned8 *) (ACC_BASE + 0x03)) |
---|
109 | #define ACC_VREQ ((volatile rtems_unsigned8 *) (ACC_BASE + 0x04)) |
---|
110 | #define ACC_VARB ((volatile rtems_unsigned8 *) (ACC_BASE + 0x05)) |
---|
111 | #define ACC_ID ((volatile rtems_unsigned8 *) (ACC_BASE + 0x06)) |
---|
112 | #define ACC_CTL2 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x07)) |
---|
113 | #define ACC_7IS ((volatile rtems_unsigned8 *) (ACC_BASE + 0x08)) |
---|
114 | #define ACC_LIS ((volatile rtems_unsigned8 *) (ACC_BASE + 0x09)) |
---|
115 | #define ACC_7IE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0A)) |
---|
116 | #define ACC_LIE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0B)) |
---|
117 | #define ACC_VIE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0C)) |
---|
118 | #define ACC_IC10 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0D)) |
---|
119 | #define ACC_IC32 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0E)) |
---|
120 | #define ACC_IC54 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0F)) |
---|
121 | |
---|
122 | /* constants */ |
---|
123 | |
---|
124 | #define RAM_START 0 |
---|
125 | #define RAM_END 0x100000 |
---|
126 | |
---|
127 | #define TIMER 0x0c000000 |
---|
128 | #define TIMER_VECTOR 0x4D |
---|
129 | |
---|
130 | #define CONSOLE_CONTROL_A 0x0C800005 |
---|
131 | #define CONSOLE_DATA_A 0x0C800007 |
---|
132 | #define CONSOLE_CONTROL_B 0x0C800001 |
---|
133 | #define CONSOLE_DATA_B 0x0C800003 |
---|
134 | |
---|
135 | /* Structures */ |
---|
136 | |
---|
137 | /* none */ |
---|
138 | |
---|
139 | /* miscellaneous stuff assumed to exist */ |
---|
140 | |
---|
141 | extern rtems_configuration_table BSP_Configuration; |
---|
142 | |
---|
143 | extern m68k_isr_entry M68Kvec[]; /* vector table address */ |
---|
144 | |
---|
145 | /* |
---|
146 | * Device Driver Table Entries |
---|
147 | */ |
---|
148 | |
---|
149 | /* |
---|
150 | * NOTE: Use the standard Console driver entry |
---|
151 | */ |
---|
152 | |
---|
153 | /* |
---|
154 | * NOTE: Use the standard Clock driver entry |
---|
155 | */ |
---|
156 | |
---|
157 | /* |
---|
158 | * How many libio files we want |
---|
159 | */ |
---|
160 | |
---|
161 | #define BSP_LIBIO_MAX_FDS 20 |
---|
162 | |
---|
163 | /* functions */ |
---|
164 | |
---|
165 | void bsp_cleanup( void ); |
---|
166 | |
---|
167 | m68k_isr_entry set_vector( |
---|
168 | rtems_isr_entry handler, |
---|
169 | rtems_vector_number vector, |
---|
170 | int type |
---|
171 | ); |
---|
172 | |
---|
173 | #ifdef __cplusplus |
---|
174 | } |
---|
175 | #endif |
---|
176 | |
---|
177 | #endif |
---|
178 | /* end of include file */ |
---|