source: rtems/c/src/lib/libbsp/m68k/mvme162/include/bsp.h @ 4906d72f

4.104.114.84.95
Last change on this file since 4906d72f was 23e3ce64, checked in by Joel Sherrill <joel.sherrill@…>, on 08/02/00 at 16:28:06

Split out items shared with mvme167.

  • Property mode set to 100644
File size: 5.8 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all MVME162fx 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 *  Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
13 *  EISCAT Scientific Association. M.Savitski
14 *
15 *  This material is a part of the MVME162 Board Support Package
16 *  for the RTEMS executive. Its licensing policies are those of the
17 *  RTEMS above.
18 *
19 *  $Id$
20 */
21
22#ifndef __MVME162_h
23#define __MVME162_h
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <rtems.h>
30#include <clockdrv.h>
31#include <console.h>
32#include <iosupp.h>
33
34/*
35 *  confdefs.h overrides for this BSP:
36 *   - number of termios serial ports (defaults to 1)
37 *   - Interrupt stack space is not minimum if defined.
38 */
39
40/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
41#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
42
43#include <mvme16x_hw.h>
44
45
46/*----------------------------------------------------------------*/
47
48typedef volatile struct {
49
50  unsigned char     chipID;
51  unsigned char     chipREV;
52  unsigned char     gen_control;
53  unsigned char     vector_base;
54 
55  unsigned long     timer_cmp_1;
56  unsigned long     timer_cnt_1;
57  unsigned long     timer_cmp_2;
58  unsigned long     timer_cnt_2;
59 
60  unsigned char     LSB_prescaler_count;
61  unsigned char     prescaler_clock_adjust;
62  unsigned char     time_ctl_2;
63  unsigned char     time_ctl_1;
64 
65  unsigned char     time_int_ctl_4;
66  unsigned char     time_int_ctl_3;
67  unsigned char     time_int_ctl_2;
68  unsigned char     time_int_ctl_1;
69 
70  unsigned char     dram_err_int_ctl;
71  unsigned char     SCC_int_ctl;
72  unsigned char     time_ctl_4;
73  unsigned char     time_ctl_3;
74 
75  unsigned short    DRAM_space_base;
76  unsigned short    SRAM_space_base;
77 
78  unsigned char     DRAM_size;
79  unsigned char     DRAM_SRAM_opt;
80  unsigned char     SRAM_size;
81  unsigned char     reserved;
82
83  unsigned char     LANC_error;
84  unsigned char     reserved1;
85  unsigned char     LANC_int_ctl;
86  unsigned char     LANC_berr_ctl;
87
88  unsigned char     SCSI_error;
89  unsigned char     general_inputs;
90  unsigned char     MVME_162_version;
91  unsigned char     SCSI_int_ctl;
92
93  unsigned long     timer_cmp_3;
94  unsigned long     timer_cnt_3;
95  unsigned long     timer_cmp_4;
96  unsigned long     timer_cnt_4;
97 
98  unsigned char     bus_clk;
99  unsigned char     PROM_acc_time_ctl;
100  unsigned char     FLASH_acc_time_ctl;
101  unsigned char     ABORT_int_ctl;
102 
103  unsigned char     RESET_ctl;
104  unsigned char     watchdog_timer_ctl;
105  unsigned char     acc_watchdog_time_base_sel;
106  unsigned char     reserved2;
107 
108  unsigned char     DRAM_ctl;
109  unsigned char     reserved4;
110  unsigned char     MPU_status;
111  unsigned char     reserved3;
112 
113  unsigned long     prescaler_count;
114 
115} mcchip_regs;
116 
117#define mcchip      ((mcchip_regs * const) 0xFFF42000)
118
119/*----------------------------------------------------------------*/
120
121/*
122 * SCC Z8523(0) defines and macros
123 * -------------------------------
124 * Prototypes for the low-level serial io are also included here,
125 * because such stuff is bsp-specific (yet). The function bodies
126 * are in console.c
127 *
128 * NOTE from Eric Vaitl <evaitl@viasat.com>:
129 *
130 * I dropped RTEMS into a 162FX today (the MVME162-513). The 162FX has a
131 * bug in the MC2 chip (revision 1) such that the SCC data register is
132 * not accessible, it has to be accessed indirectly through the SCC
133 * control register.
134 */
135
136enum {portB, portA};
137
138rtems_boolean char_ready(int port, char *ch);
139char char_wait(int port);
140void char_put(int port, char ch);
141
142#define TX_BUFFER_EMPTY   0x04
143#define RX_DATA_AVAILABLE 0x01
144#define SCC_VECTOR        0x40
145
146typedef volatile struct {
147  unsigned char pad1;
148  volatile unsigned char          csr;
149  unsigned char pad2;
150  volatile unsigned char          buf;
151} scc_regs;
152
153#define scc       ((scc_regs * const) 0xFFF45000)
154
155#define ZWRITE0(port, v)  (scc[port].csr = (unsigned char)(v))
156#define ZREAD0(port)  (scc[port].csr)
157
158#define ZREAD(port, n)  (ZWRITE0(port, n), (scc[port].csr))
159#define ZREADD(port)  (scc[port].csr=0x08, scc[port].csr )
160
161#define ZWRITE(port, n, v) (ZWRITE0(port, n), ZWRITE0(port, v))
162#define ZWRITED(port, v)  (scc[port].csr = 0x08, \
163                           scc[port].csr = (unsigned char)(v))
164/*----------------------------------------------------------------*/
165
166/*
167 *  Define the time limits for RTEMS Test Suite test durations.
168 *  Long test and short test duration limits are provided.  These
169 *  values are in seconds and need to be converted to ticks for the
170 *  application.
171 *
172 */
173
174#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
175#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
176
177/*
178 *  Define the interrupt mechanism for Time Test 27
179 *
180 *  NOTE: We use software interrupt 0
181 */
182
183#define MUST_WAIT_FOR_INTERRUPT 0
184
185#define Install_tm27_vector( handler ) \
186            set_vector( (handler), VBR1 * 0x10 + 0x8, 1 ); \
187            lcsr->intr_level[2] |= 3; \
188            lcsr->intr_ena |= 0x100;
189
190#define Cause_tm27_intr()  lcsr->intr_soft_set |= 0x100
191
192#define Clear_tm27_intr()  lcsr->intr_clear |= 0x100
193
194#define Lower_tm27_intr()
195
196#ifdef M162_INIT
197#undef EXTERN
198#define EXTERN
199#else
200#undef EXTERN
201#define EXTERN extern
202#endif
203
204/*
205 *  Device Driver Table Entries
206 */
207
208/*
209 * NOTE: Use the standard Console driver entry
210 */
211 
212/*
213 * NOTE: Use the standard Clock driver entry
214 */
215
216/* miscellaneous stuff assumed to exist */
217
218extern rtems_configuration_table BSP_Configuration;
219
220extern m68k_isr_entry M68Kvec[];   /* vector table address */
221
222/* functions */
223
224void bsp_cleanup( void );
225
226m68k_isr_entry set_vector(
227  rtems_isr_entry     handler,
228  rtems_vector_number vector,
229  int                 type
230);
231
232#ifdef __cplusplus
233}
234#endif
235
236#endif
237/* end of include file */
Note: See TracBrowser for help on using the repository browser.