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

4.115
Last change on this file since a052181 was a052181, checked in by Sebastian Huber <sebastian.huber@…>, on 11/14/12 at 08:59:10

score: Add RTEMS_FATAL_SOURCE_EXIT

Include <bsp/default-initial-extension.h> in all BSPs. Call
rtems_fatal() with RTEMS_FATAL_SOURCE_EXIT as source and the exit()
status code as fatal code in every bsp_cleanup(). Move previous
bsp_cleanup() code into bsp_fatal_extension().

  • Property mode set to 100644
File size: 5.3 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.rtems.com/license/LICENSE.
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
20#ifndef _BSP_H
21#define _BSP_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <bspopts.h>
28#include <bsp/default-initial-extension.h>
29
30#include <rtems.h>
31#include <rtems/clockdrv.h>
32#include <rtems/console.h>
33#include <rtems/iosupp.h>
34
35#include <mvme16x_hw.h>
36
37/*----------------------------------------------------------------*/
38
39typedef volatile struct {
40
41  unsigned char     chipID;
42  unsigned char     chipREV;
43  unsigned char     gen_control;
44  unsigned char     vector_base;
45
46  unsigned long     timer_cmp_1;
47  unsigned long     timer_cnt_1;
48  unsigned long     timer_cmp_2;
49  unsigned long     timer_cnt_2;
50
51  unsigned char     LSB_prescaler_count;
52  unsigned char     prescaler_clock_adjust;
53  unsigned char     time_ctl_2;
54  unsigned char     time_ctl_1;
55
56  unsigned char     time_int_ctl_4;
57  unsigned char     time_int_ctl_3;
58  unsigned char     time_int_ctl_2;
59  unsigned char     time_int_ctl_1;
60
61  unsigned char     dram_err_int_ctl;
62  unsigned char     SCC_int_ctl;
63  unsigned char     time_ctl_4;
64  unsigned char     time_ctl_3;
65
66  unsigned short    DRAM_space_base;
67  unsigned short    SRAM_space_base;
68
69  unsigned char     DRAM_size;
70  unsigned char     DRAM_SRAM_opt;
71  unsigned char     SRAM_size;
72  unsigned char     reserved;
73
74  unsigned char     LANC_error;
75  unsigned char     reserved1;
76  unsigned char     LANC_int_ctl;
77  unsigned char     LANC_berr_ctl;
78
79  unsigned char     SCSI_error;
80  unsigned char     general_inputs;
81  unsigned char     MVME_162_version;
82  unsigned char     SCSI_int_ctl;
83
84  unsigned long     timer_cmp_3;
85  unsigned long     timer_cnt_3;
86  unsigned long     timer_cmp_4;
87  unsigned long     timer_cnt_4;
88
89  unsigned char     bus_clk;
90  unsigned char     PROM_acc_time_ctl;
91  unsigned char     FLASH_acc_time_ctl;
92  unsigned char     ABORT_int_ctl;
93
94  unsigned char     RESET_ctl;
95  unsigned char     watchdog_timer_ctl;
96  unsigned char     acc_watchdog_time_base_sel;
97  unsigned char     reserved2;
98
99  unsigned char     DRAM_ctl;
100  unsigned char     reserved4;
101  unsigned char     MPU_status;
102  unsigned char     reserved3;
103
104  unsigned long     prescaler_count;
105
106} mcchip_regs;
107
108#define mcchip      ((mcchip_regs * const) 0xFFF42000)
109
110/*----------------------------------------------------------------*/
111
112/*
113 * SCC Z8523(0) defines and macros
114 * -------------------------------
115 * Prototypes for the low-level serial io are also included here,
116 * because such stuff is bsp-specific (yet). The function bodies
117 * are in console.c
118 *
119 * NOTE from Eric Vaitl <evaitl@viasat.com>:
120 *
121 * I dropped RTEMS into a 162FX today (the MVME162-513). The 162FX has a
122 * bug in the MC2 chip (revision 1) such that the SCC data register is
123 * not accessible, it has to be accessed indirectly through the SCC
124 * control register.
125 */
126
127enum {portB, portA};
128
129extern bool char_ready(int port, char *ch);
130extern char char_wait(int port);
131extern void char_put(int port, char ch);
132
133#define TX_BUFFER_EMPTY   0x04
134#define RX_DATA_AVAILABLE 0x01
135#define SCC_VECTOR        0x40
136
137typedef volatile struct {
138  unsigned char pad1;
139  volatile unsigned char          csr;
140  unsigned char pad2;
141  volatile unsigned char          buf;
142} scc_regs;
143
144#define scc       ((scc_regs * const) 0xFFF45000)
145
146#define ZWRITE0(port, v)  (scc[port].csr = (unsigned char)(v))
147#define ZREAD0(port)  (scc[port].csr)
148
149#define ZREAD(port, n)  (ZWRITE0(port, n), (scc[port].csr))
150#define ZREADD(port)  (scc[port].csr=0x08, scc[port].csr )
151
152#define ZWRITE(port, n, v) (ZWRITE0(port, n), ZWRITE0(port, v))
153#define ZWRITED(port, v)  (scc[port].csr = 0x08, \
154                           scc[port].csr = (unsigned char)(v))
155/*----------------------------------------------------------------*/
156
157#ifdef M162_INIT
158#undef EXTERN
159#define EXTERN
160#else
161#undef EXTERN
162#define EXTERN extern
163#endif
164
165
166/*
167 *  This value is the default address location of the 162Bug vector table
168 *  and is also the default start address of the boards DRAM.  This value
169 *  may be different for your specific board based on a number of factors:
170 *
171 *     Default DRAM address:   0x00000000
172 *     Default SRAM address:   0xFFE00000
173 *
174 *  o  If no DRAM can be found by the 162Bug program, it will use SRAM.
175 *  o  The default SRAM address may be different if SRAM mezzanine boards
176 *     are installed on the main board.
177 *  o  Both the DRAM and SRAM addresses can be modified by changing the
178 *     appropriate values in NVRAM using the ENV command at the 162Bug
179 *     prompt.
180 *
181 *  If your board has different values than the defaults, change the value
182 *  of the following define.
183 *
184 */
185#define MOT_162BUG_VEC_ADDRESS  0x00000000
186
187extern rtems_isr_entry M68Kvec[];   /* vector table address */
188
189/* functions */
190
191rtems_isr_entry set_vector(
192  rtems_isr_entry     handler,
193  rtems_vector_number vector,
194  int                 type
195);
196
197#ifdef __cplusplus
198}
199#endif
200
201#endif
Note: See TracBrowser for help on using the repository browser.