source: rtems/c/src/lib/libbsp/m68k/mvme167/include/bsp.h @ 45805cc

4.104.114.84.95
Last change on this file since 45805cc was 45805cc, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 6, 2002 at 8:06:53 PM

2002-01-03 Ralf Corsepius <corsepiu@…>

  • include/bsp.h: Include rtems/bspIo.h instead of bspIo.h.
  • Property mode set to 100644
File size: 15.0 KB
Line 
1/*  bsp.h
2 *
3 *  Following defines must reflect the setup of the particular MVME167.
4 *  All page references are to the MVME166/MVME167/MVME187 Single Board
5 *  Computer Programmer's Reference Guide (MVME187PG/D2) with the April
6 *  1993 supplements/addenda (MVME187PG/D2A1).
7 *
8 *  COPYRIGHT (c) 1989-1999.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.OARcorp.com/rtems/license.html.
14 *
15 *  Modifications of respective RTEMS file:
16 *  Copyright (c) 1998, National Research Council of Canada
17 *
18 *  $Id$
19 */
20
21#ifndef __MVME167_H
22#define __MVME167_H
23
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <bspopts.h>
30
31#include <rtems.h>
32#include <clockdrv.h>
33#include <console.h>
34#include <iosupp.h>
35#include <rtems/bspIo.h>
36
37
38/*
39 *  confdefs.h overrides for this BSP:
40 *   - termios serial ports (defaults to 1)
41 *   - Interrupt stack space is not minimum if defined.
42 */
43
44#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 4
45#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
46 
47#include <mvme16x_hw.h>
48
49/* GCSR is in mvme16x_hw.h */
50/* LCSR is in mvme16x_hw.h */
51/* i82596 is in mvme16x_hw.h */
52/* NVRAM is in mvme16x_hw.h */
53
54#if 0
55/*
56 *  Representation of the PCCchip2
57 */
58typedef volatile struct pccchip2_regs_ {
59  unsigned char     chip_id;            /* 0xFFF42000 */
60  unsigned char     chip_revision;      /* 0xFFF42001 */
61  unsigned char     gen_control;        /* 0xFFF42002 */
62  unsigned char     vector_base;        /* 0xFFF42003 */
63  unsigned long     timer_cmp_1;        /* 0xFFF42004 */
64  unsigned long     timer_cnt_1;        /* 0xFFF42008 */
65  unsigned long     timer_cmp_2;        /* 0xFFF4200C */
66  unsigned long     timer_cnt_2;        /* 0xFFF42010 */
67  unsigned char     LSB_prescaler_count;/* 0xFFF42014 */
68  unsigned char     prescaler_clock_adjust; /* 0xFFF42015 */
69  unsigned char     timer_ctl_2;        /* 0xFFF42016 */
70  unsigned char     timer_ctl_1;        /* 0xFFF42017 */
71  unsigned char     gpi_int_ctl;        /* 0xFFF42018 */
72  unsigned char     gpio_ctl;           /* 0xFFF42019 */
73  unsigned char     timer_int_ctl_2;    /* 0xFFF4201A */
74  unsigned char     timer_int_ctl_1;    /* 0xFFF4201B */
75  unsigned char     SCC_error;          /* 0xFFF4201C */
76  unsigned char     SCC_modem_int_ctl;  /* 0xFFF4201D */
77  unsigned char     SCC_tx_int_ctl;     /* 0xFFF4201E */
78  unsigned char     SCC_rx_int_ctl;     /* 0xFFF4201F */
79  unsigned char     reserved1[3];
80  unsigned char     modem_piack;        /* 0xFFF42023 */
81  unsigned char     reserved2;
82  unsigned char     tx_piack;           /* 0xFFF42025 */
83  unsigned char     reserved3;
84  unsigned char     rx_piack;           /* 0xFFF42027 */
85  unsigned char     LANC_error;         /* 0xFFF42028 */
86  unsigned char     reserved4;
87  unsigned char     LANC_int_ctl;       /* 0xFFF4202A */
88  unsigned char     LANC_berr_ctl;      /* 0xFFF4202B */
89  unsigned char     SCSI_error;         /* 0xFFF4202C */
90  unsigned char     reserved5[2];
91  unsigned char     SCSI_int_ctl;       /* 0xFFF4202F */
92  unsigned char     print_ack_int_ctl;  /* 0xFFF42030 */
93  unsigned char     print_fault_int_ctl;/* 0xFFF42031 */
94  unsigned char     print_sel_int_ctl;  /* 0xFFF42032 */
95  unsigned char     print_pe_int_ctl;   /* 0xFFF42033 */
96  unsigned char     print_busy_int_ctl; /* 0xFFF42034 */
97  unsigned char     reserved6;
98  unsigned char     print_input_status; /* 0xFFF42036 */
99  unsigned char     print_ctl;          /* 0xFFF42037 */
100  unsigned char     chip_speed;         /* 0xFFF42038 */
101  unsigned char     reserved7;
102  unsigned char     print_data;         /* 0xFFF4203A */
103  unsigned char     reserved8[3];
104  unsigned char     int_level;          /* 0xFFF4203E */
105  unsigned char     int_mask;           /* 0xFFF4203F */
106} pccchip2_regs;
107
108/*
109 *  Base address of the PCCchip2.
110 *  This is not configurable in the MVME167.
111 */
112#define pccchip2    ((pccchip2_regs * const) 0xFFF42000)
113
114#endif
115/*
116 * The MVME167 is equiped with one or two MEMC040 memory controllers at
117 * 0xFFF43000 and 0xFFF43100. This port assumes that the controllers
118 * were initialized by 167Bug.
119 */
120typedef volatile struct memc040_regs_ {
121  unsigned char     chip_id;            /* 0xFFF43000/0xFFF43100 */
122  unsigned char     reserved1[3];
123  unsigned char     chip_revision;      /* 0xFFF43004/0xFFF43104 */
124  unsigned char     reserved2[3];
125  unsigned char     mem_config;         /* 0xFFF43008/0xFFF43108 */
126  unsigned char     reserved3[3];
127  unsigned char     alt_status;         /* 0xFFF4300C/0xFFF4310C */
128  unsigned char     reserved4[3];
129  unsigned char     alt_ctl;            /* 0xFFF43010/0xFFF43110 */
130  unsigned char     reserved5[3];
131  unsigned char     base_addr;          /* 0xFFF43014/0xFFF43114 */
132  unsigned char     reserved6[3];
133  unsigned char     ram_ctl;            /* 0xFFF43018/0xFFF43118 */
134  unsigned char     reserved7[3];
135  unsigned char     bus_clk;            /* 0xFFF4301C/0xFFF4311C */
136} memc040_regs;
137
138/*
139 *  Base address of the MEMC040s.
140 *  This is not configurable in the MVME167.
141 */
142#define memc040_1   ((memc040_regs * const) 0xFFF43000)
143#define memc040_2   ((memc040_regs * const) 0xFFF43100)
144
145
146/*
147 *  The MVME167 may be equiped with error-correcting RAM cards. In this case,
148 *  each MEMC040 is replaced by two MCECC ECC DRAM controllers. This port
149 *  assumes that these controllers, if present, are initialized by 167Bug.
150 *  They do not appear to hold information of interest at this time, so they
151 *  are not described. However, each MCECC pair lives at the same address as
152 *  the MEMC040 is replaces. The first eight registers of the MCECC are
153 *  nearly identical to the ones of the MEMC040, and the memc040_X structures
154 *  can be used to read those first eight registers.
155 */
156 
157
158/*
159 *  Representation of the Cirrus Logic CL-CD2401 Multi-Protocol Controller
160 */
161typedef volatile struct cd2401_regs_ {
162  unsigned char     reserved1[7];
163  unsigned char     cor7;           /* 0xFFF45007 - Channel Option 7 */
164  unsigned char     reserved2;
165  unsigned char     livr;           /* 0xFFF45009 - Local Interrupt Vector */
166  unsigned char     reserved3[6];
167  unsigned char     cor1;           /* 0xFFF45010 - Channel Option 1 */
168  unsigned char     ier;            /* 0xFFF45011 - Interrupt Enable */
169  unsigned char     stcr;           /* 0xFFF45012 - Special Transmit Command */
170  unsigned char     ccr;            /* 0xFFF45013 - Channel Command */
171  unsigned char     cor5;           /* 0xFFF45014 - Channel Option 5 */
172  unsigned char     cor4;           /* 0xFFF45015 - Channel Option 4 */
173  unsigned char     cor3;           /* 0xFFF45016 - Channel Option 3 */
174  unsigned char     cor2;           /* 0xFFF45017 - Channel Option 2 */
175  unsigned char     cor6;           /* 0xFFF45018 - Channel Option 6 */
176  unsigned char     dmabsts;        /* 0xFFF45019 - DMA Buffer Status */
177  unsigned char     csr;            /* 0xFFF4501A - Channel Status */
178  unsigned char     cmr;            /* 0xFFF4501B - Channel Mode */
179  union {
180    struct {
181      unsigned char schr4;          /* 0xFFF4501C - Special Character 4 */
182      unsigned char schr3;          /* 0xFFF4501D - Special Character 3 */
183      unsigned char schr2;          /* 0xFFF4501E - Special Character 2 */
184      unsigned char schr1;          /* 0xFFF4501F - Special Character 1 */
185    } async;
186    struct {
187      unsigned char rfar4;          /* 0xFFF4501C - Receive Frame Address 4 */
188      unsigned char rfar3;          /* 0xFFF4501D - Receive Frame Address 3 */
189      unsigned char rfar2;          /* 0xFFF4501E - Receive Frame Address 2 */
190      unsigned char rfar1;          /* 0xFFF4501F - Receive Frame Address 1 */
191    } sync;
192  } u1;   
193  unsigned char     reserved4[2];
194  unsigned char     scrh;           /* 0xFFF45022 - Special Character Range High */
195  unsigned char     scrl;           /* 0xFFF45023 - Special Character Range Low */
196  union {
197    struct {
198      unsigned short rtpr;          /* 0xFFF45024 - Receive Timeout Period */
199    } w;
200    struct {
201      unsigned char rtprh;          /* 0xFFF45024 - Receive Timeout Period High */
202      unsigned char rtprl;          /* 0xFFF45025 - Receive Timeout Period Low */
203    } b;
204  } u2;
205  unsigned char     licr;           /* 0xFFF45026 - Local Interrupt Channel */
206  unsigned char     reserved5[2];
207  union {
208    struct {
209      unsigned char ttr;            /* 0xFFF45029 - Transmit Timer */
210    } async;
211    struct {
212      unsigned char gt2;            /* 0xFFF45029 - General Timer 2 */
213    } sync;
214  } u3;
215  union {
216    struct {
217      unsigned short gt1;           /* 0xFFF4502A - General Timer 1 */
218    } w;
219    struct {
220      unsigned char gt1h;           /* 0xFFF4502A - General Timer 2 High */
221      unsigned char gt1l;           /* 0xFFF4502B - General Timer 1 Low */
222    } b;
223  } u4;
224  unsigned char     reserved6[2];
225  unsigned char     lnxt;           /* 0xFF4502E - LNext Character */
226  unsigned char     reserved7;
227  unsigned char     rfoc;           /* 0xFFF45030 - Receive FIFO Output Count */
228  unsigned char     reserved8[7];
229  unsigned short    tcbadru;        /* 0xFF45038 - Transmit Current Buffer Address Upper */
230  unsigned short    tcbadrl;        /* 0xFF4503A - Transmit Current Buffer Address Lower */
231  unsigned short    rcbadru;        /* 0xFF4503C - Receive Current Buffer Address Upper */
232  unsigned short    rcbadrl;        /* 0xFF4503E - Receive Current Buffer Address Lower */
233  unsigned short    arbadru;        /* 0xFF45040 - A Receive Buffer Address Upper */
234  unsigned short    arbardl;        /* 0xFF45042 - A Receive Buffer Address Lower */
235  unsigned short    brbadru;        /* 0xFF45044 - B Receive Buffer Address Upper */
236  unsigned short    brbadrl;        /* 0xFF45046 - B Receive Buffer Address Lower */
237  unsigned short    brbcnt;         /* 0xFF45048 - B Receive Buffer Byte Count */
238  unsigned short    arbcnt;         /* 0xFF4504A - A Receive Buffer Byte Count */
239  unsigned short    reserved9;
240  unsigned char     brbsts;         /* 0xFF4504E - B Receive Buffer Status */
241  unsigned char     arbsts;         /* 0xFF4504F - A Receive Buffer Status */
242  unsigned short    atbadru;        /* 0xFF45050 - A Transmit Buffer Address Upper */
243  unsigned short    atbadrl;        /* 0xFF45052 - A Transmit Buffer Address Lower */
244  unsigned short    btbadru;        /* 0xFF45054 - B Transmit Buffer Address Upper */
245  unsigned short    btbadrl;        /* 0xFF45056 - B Transmit Buffer Address Lower */
246  unsigned short    btbcnt;         /* 0xFF45058 - B Transmit Buffer Byte Count */
247  unsigned short    atbcnt;         /* 0xFF4505A - A Transmit Buffer Byte Count */
248  unsigned short    reserved10;
249  unsigned char     btbsts;         /* 0xFF4505E - B Transmit Buffer Status */
250  unsigned char     atbsts;         /* 0xFF4505F - A Transmit Buffer Status */
251  unsigned char     reserved11[32];
252  unsigned char     tftc;           /* 0xFFF45080 - Transmit FIFO Transfer Count */
253  unsigned char     gfrcr;          /* 0xFFF45081 - Global Firmware Revision Code */
254  unsigned char     reserved12[2];
255  unsigned char     reoir;          /* 0xFFF45084 - Receive End Of Interrupt */
256  unsigned char     teoir;          /* 0xFFF45085 - Transmit End Of Interrupt */
257  unsigned char     meoir;          /* 0xFFF45086 - Modem End Of Interrupt */
258  union {
259    struct {
260      unsigned short risr;          /* 0xFFF45088 - Receive Interrupt Status */
261    } w;
262    struct {
263      unsigned char risrh;          /* 0xFFF45088 - Receive Interrupt Status High */
264      unsigned char risrl;          /* 0xFFF45089 - Receive Interrupt Status Low */
265    } b;
266  } u5;   
267  unsigned char     tisr;           /* 0xFFF4508A - Transmit Interrupt Status */
268  unsigned char     misr;           /* 0xFFF4508B - Modem/Timer Interrupt Status */
269  unsigned char     reserved13[2];
270  unsigned char     bercnt;         /* 0xFFF4508E - Bus Error Retry Count */
271  unsigned char     reserved14[49];
272  unsigned char     tcor;           /* 0xFFF450C0 - Transmit Clock Option */
273  unsigned char     reserved15[2];
274  unsigned char     tbpr;           /* 0xFFF450C3 - Transmit Baud Rate Period */
275  unsigned char     reserved16[4];
276  unsigned char     rcor;           /* 0xFFF450C8 - Receive Clock Option */
277  unsigned char     reserved17[2];
278  unsigned char     rbpr;           /* 0xFFF450CB - Receive Baud Rate Period */
279  unsigned char     reserved18[10];
280  unsigned char     cpsr;           /* 0xFFF450D6 - CRC Polynomial Select */
281  unsigned char     reserved19[3];
282  unsigned char     tpr;            /* 0xFFF450DA - Timer Period */
283  unsigned char     reserved20[3];
284  unsigned char     msvr_rts;       /* 0xFFF450DE - Modem Signal Value - RTS */
285  unsigned char     msvr_dtr;       /* 0xFFF450DF - Modem Signal Value - DTR */
286  unsigned char     tpilr;          /* 0xFFF450E0 - Transmit Priority Interrupt Level */
287  unsigned char     rpilr;          /* 0xFFF450E1 - Receive Priority Interrupt Level */
288  unsigned char     stk;            /* 0xFFF450E2 - Stack */
289  unsigned char     mpilr;          /* 0xFFF450E3 - Modem Priority Interrupt Level */
290  unsigned char     reserved21[8];
291  unsigned char     tir;            /* 0xFFF450EC - Transmit Interrupt */
292  unsigned char     rir;            /* 0xFFF450ED - Receive Interrupt */
293  unsigned char     car;            /* 0xFFF450EE - Channel Access */
294  unsigned char     mir;            /* 0xFFF450EF - Model Interrupt */
295  unsigned char     reserved22[6];
296  unsigned char     dmr;            /* 0xFFF450F6 - DMA Mode */
297  unsigned char     reserved23;
298  unsigned char     dr;             /* 0xFFF450F8 - Receive/Transmit Data */
299} cd2401_regs;
300
301
302/*
303 *  Base address of the CD2401.
304 *  This is not configurable in the MVME167.
305 */
306#define cd2401          ((cd2401_regs * const) 0xFFF45000)
307
308
309/* CD2401 is clocked at 20 MHz */
310#define CD2401_CLK_RATE 20000000
311
312/* BSP-wide functions */
313
314void bsp_cleanup( void );
315
316m68k_isr_entry set_vector(
317  rtems_isr_entry     handler,
318  rtems_vector_number vector,
319  int                 type
320);
321
322#ifdef M167_INIT
323#undef EXTERN
324#define EXTERN
325#else
326#undef EXTERN
327#define EXTERN extern
328#endif
329
330/*
331 *  Device Driver Table Entries
332 */
333
334/*
335 * NOTE: Use the standard Console driver entry
336 */
337 
338/*
339 * NOTE: Use the standard Clock driver entry
340 */
341
342/*
343 * How many libio files we want
344 */
345
346#define BSP_LIBIO_MAX_FDS       20
347
348
349/* miscellaneous stuff assumed to exist */
350
351extern rtems_configuration_table BSP_Configuration;
352
353extern m68k_isr_entry M68Kvec[];   /* vector table address */
354
355
356/*
357 *  Define the time limits for RTEMS Test Suite test durations.
358 *  Long test and short test duration limits are provided.  These
359 *  values are in seconds and need to be converted to ticks for the
360 *  application.
361 *
362 */
363
364#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
365#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
366
367/*
368 *  Define the interrupt mechanism for Time Test 27
369 *
370 *  NOTE: We use software interrupt 0
371 */
372#define MUST_WAIT_FOR_INTERRUPT 0
373
374#define Install_tm27_vector( handler ) \
375            set_vector( (handler), VBR1 * 0x10 + 0x8, 1 ); \
376            lcsr->intr_level[2] |= 3; \
377            lcsr->intr_ena |= 0x100
378
379#define Cause_tm27_intr()  lcsr->intr_soft_set |= 0x100
380
381#define Clear_tm27_intr()  lcsr->intr_clear |= 0x100
382
383#define Lower_tm27_intr()
384
385#ifdef __cplusplus
386}
387#endif
388
389#endif
390/* end of include file */
Note: See TracBrowser for help on using the repository browser.