OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [m68k/] [mvme147s/] [include/] [bsp.h] - Blame information for rev 773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  bsp.h
2
 *
3
 *  This include file contains all MVME147 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
 *  MVME147 port for TNI - Telecom Bretagne
13
 *  by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
14
 *  May 1996
15
 *
16
 *  $Id: bsp.h,v 1.2 2001-09-27 12:00:17 chris Exp $
17
 */
18
 
19
#ifndef __MVME147_h
20
#define __MVME147_h
21
 
22
#ifdef __cplusplus
23
extern "C" {
24
#endif
25
 
26
#include <rtems.h>
27
#include <clockdrv.h>
28
#include <console.h>
29
#include <iosupp.h>
30
 
31
/*
32
 *  confdefs.h overrides for this BSP:
33
 *   - number of termios serial ports (defaults to 1)
34
 *   - Interrupt stack space is not minimum if defined.
35
 */
36
 
37
/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
38
#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
39
 
40
/* Constants */
41
 
42
#define RAM_START 0x00007000
43
#define RAM_END   0x003e0000
44
#define DRAM_END  0x00400000
45
  /* We leave 128k for the shared memory */
46
 
47
  /* MVME 147 Peripheral controller chip
48
     see MVME147/D1, 3.4 */
49
 
50
struct pcc_map {
51
  /* 32 bit registers */
52
  rtems_unsigned32 dma_table_address;            /* 0xfffe1000 */
53
  rtems_unsigned32 dma_data_address;             /* 0xfffe1004 */
54
  rtems_unsigned32 dma_bytecount;                /* 0xfffe1008 */
55
  rtems_unsigned32 dma_data_holding;             /* 0xfffe100c */
56
 
57
  /* 16 bit registers */
58
  rtems_unsigned16 timer1_preload;               /* 0xfffe1010 */
59
  rtems_unsigned16 timer1_count;                 /* 0xfffe1012 */
60
  rtems_unsigned16 timer2_preload;               /* 0xfffe1014 */
61
  rtems_unsigned16 timer2_count;                 /* 0xfffe1016 */
62
 
63
  /* 8 bit registers */
64
  rtems_unsigned8 timer1_int_control;            /* 0xfffe1018 */
65
  rtems_unsigned8 timer1_control;                /* 0xfffe1019 */
66
  rtems_unsigned8 timer2_int_control;            /* 0xfffe101a */
67
  rtems_unsigned8 timer2_control;                /* 0xfffe101b */
68
 
69
  rtems_unsigned8 acfail_int_control;            /* 0xfffe101c */
70
  rtems_unsigned8 watchdog_control;              /* 0xfffe101d */
71
 
72
  rtems_unsigned8 printer_int_control;           /* 0xfffe101e */
73
  rtems_unsigned8 printer_control;               /* 0xfffe102f */
74
 
75
  rtems_unsigned8 dma_int_control;               /* 0xfffe1020 */
76
  rtems_unsigned8 dma_control;                   /* 0xfffe1021 */
77
  rtems_unsigned8 bus_error_int_control;         /* 0xfffe1022 */
78
  rtems_unsigned8 dma_status;                    /* 0xfffe1023 */
79
  rtems_unsigned8 abort_int_control;             /* 0xfffe1024 */
80
  rtems_unsigned8 table_address_function_code;   /* 0xfffe1025 */
81
  rtems_unsigned8 serial_port_int_control;       /* 0xfffe1026 */
82
  rtems_unsigned8 general_purpose_control;       /* 0xfffe1027 */
83
  rtems_unsigned8 lan_int_control;               /* 0xfffe1028 */
84
  rtems_unsigned8 general_purpose_status;        /* 0xfffe1029 */
85
  rtems_unsigned8 scsi_port_int_control;         /* 0xfffe102a */
86
  rtems_unsigned8 slave_base_address;            /* 0xfffe102b */
87
  rtems_unsigned8 software_int_1_control;        /* 0xfffe102c */
88
  rtems_unsigned8 int_base_vector;               /* 0xfffe102d */
89
  rtems_unsigned8 software_int_2_control;        /* 0xfffe102e */
90
  rtems_unsigned8 revision_level;                /* 0xfffe102f */
91
};
92
 
93
#define pcc      ((volatile struct pcc_map * const) 0xfffe1000)
94
 
95
/* VME chip configuration registers */
96
 
97
struct vme_lcsr_map {
98
  rtems_unsigned8 unused_1;
99
  rtems_unsigned8 system_controller;             /* 0xfffe2001 */
100
  rtems_unsigned8 unused_2;
101
  rtems_unsigned8 vme_bus_requester;             /* 0xfffe2003 */
102
  rtems_unsigned8 unused_3;
103
  rtems_unsigned8 master_configuration;          /* 0xfffe2005 */
104
  rtems_unsigned8 unused_4;
105
  rtems_unsigned8 slave_configuration;           /* 0xfffe2007 */
106
  rtems_unsigned8 unused_5;
107
  rtems_unsigned8 timer_configuration;           /* 0xfffe2009 */
108
  rtems_unsigned8 unused_6;
109
  rtems_unsigned8 slave_address_modifier;        /* 0xfffe200b */
110
  rtems_unsigned8 unused_7;
111
  rtems_unsigned8 master_address_modifier;       /* 0xfffe200d */
112
  rtems_unsigned8 unused_8;
113
  rtems_unsigned8 interrupt_handler_mask;        /* 0xfffe200f */
114
  rtems_unsigned8 unused_9;
115
  rtems_unsigned8 utility_interrupt_mask;        /* 0xfffe2011 */
116
  rtems_unsigned8 unused_10;
117
  rtems_unsigned8 utility_interrupt_vector;      /* 0xfffe2013 */
118
  rtems_unsigned8 unused_11;
119
  rtems_unsigned8 interrupt_request;             /* 0xfffe2015 */
120
  rtems_unsigned8 unused_12;
121
  rtems_unsigned8 vme_bus_status_id;             /* 0xfffe2017 */
122
  rtems_unsigned8 unused_13;
123
  rtems_unsigned8 bus_error_status;              /* 0xfffe2019 */
124
  rtems_unsigned8 unused_14;
125
  rtems_unsigned8 gcsr_base_address;             /* 0xfffe201b */
126
};
127
 
128
#define vme_lcsr      ((volatile struct vme_lcsr_map * const) 0xfffe2000)
129
 
130
 
131
struct vme_gcsr_map {
132
  rtems_unsigned8 unused_1;
133
  rtems_unsigned8 global_0;                      /* 0xfffe2021 */
134
  rtems_unsigned8 unused_2;
135
  rtems_unsigned8 global_1;                      /* 0xfffe2023 */
136
  rtems_unsigned8 unused_3;
137
  rtems_unsigned8 board_identification;          /* 0xfffe2025 */
138
  rtems_unsigned8 unused_4;
139
  rtems_unsigned8 general_purpose_0;             /* 0xfffe2027 */
140
  rtems_unsigned8 unused_5;
141
  rtems_unsigned8 general_purpose_1;             /* 0xfffe2029 */
142
  rtems_unsigned8 unused_6;
143
  rtems_unsigned8 general_purpose_2;             /* 0xfffe202b */
144
  rtems_unsigned8 unused_7;
145
  rtems_unsigned8 general_purpose_3;             /* 0xfffe202d */
146
  rtems_unsigned8 unused_8;
147
  rtems_unsigned8 general_purpose_4;             /* 0xfffe202f */
148
};
149
 
150
#define vme_gcsr      ((volatile struct vme_gcsr_map * const) 0xfffe2020)
151
 
152
 
153
 
154
#define z8530 0xfffe3001
155
 
156
 
157
/* interrupt vectors - see MVME147/D1 4.14 */
158
#define PCC_BASE_VECTOR        0x40 /* First user int */
159
#define SCC_VECTOR             PCC_BASE_VECTOR+3
160
#define TIMER_1_VECTOR         PCC_BASE_VECTOR+8
161
#define TIMER_2_VECTOR         PCC_BASE_VECTOR+9  
162
#define SOFT_1_VECTOR          PCC_BASE_VECTOR+10
163
#define SOFT_2_VECTOR          PCC_BASE_VECTOR+11 
164
 
165
#define VME_BASE_VECTOR        0x50
166
#define VME_SIGLP_VECTOR       VME_BASE_VECTOR+1
167
 
168
#define USE_CHANNEL_A   1                /* 1 = use channel A for console */
169
#define USE_CHANNEL_B   0                /* 1 = use channel B for console */
170
 
171
#if (USE_CHANNEL_A == 1)
172
#define CONSOLE_CONTROL  0xfffe3002
173
#define CONSOLE_DATA     0xfffe3003
174
#elif (USE_CHANNEL_B == 1)
175
#define CONSOLE_CONTROL  0xfffe3000
176
#define CONSOLE_DATA     0xfffe3001
177
#endif
178
 
179
 
180
 
181
#define FOREVER       1                  /* infinite loop */
182
 
183
#ifdef M147_INIT
184
#undef EXTERN
185
#define EXTERN
186
#else
187
#undef EXTERN
188
#define EXTERN extern
189
#endif
190
 
191
/*
192
 *  Define the time limits for RTEMS Test Suite test durations.
193
 *  Long test and short test duration limits are provided.  These
194
 *  values are in seconds and need to be converted to ticks for the
195
 *  application.
196
 *
197
 */
198
 
199
#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
200
#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
201
 
202
/*
203
 *  Define the interrupt mechanism for Time Test 27
204
 *
205
 *  NOTE: Use the MPCSR vector for the MVME147
206
 */
207
 
208
#define MUST_WAIT_FOR_INTERRUPT 0
209
 
210
#define Install_tm27_vector( handler ) set_vector( (handler), \
211
                                                   SOFT_1_VECTOR, 1 )
212
 
213
#define Cause_tm27_intr()  pcc->software_int_1_control = 0x0c
214
  /* generate level 4 sotware int. */
215
 
216
#define Clear_tm27_intr()  pcc->software_int_1_control = 0x00
217
 
218
#define Lower_tm27_intr()
219
 
220
 
221
/* miscellaneous stuff assumed to exist */
222
 
223
extern rtems_configuration_table BSP_Configuration;
224
 
225
extern m68k_isr_entry M68Kvec[];   /* vector table address */
226
 
227
/*
228
 *  Device Driver Table Entries
229
 */
230
 
231
/*
232
 * NOTE: Use the standard Console driver entry
233
 */
234
 
235
/*
236
 * NOTE: Use the standard Clock driver entry
237
 */
238
 
239
/* functions */
240
 
241
void bsp_cleanup( void );
242
 
243
m68k_isr_entry set_vector(
244
  rtems_isr_entry     handler,
245
  rtems_vector_number vector,
246
  int                 type
247
);
248
 
249
#ifdef __cplusplus
250
}
251
#endif
252
 
253
#endif
254
/* end of include file */
255
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.