1 | /* 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.rtems.org/license/LICENSE. |
---|
11 | * |
---|
12 | * MVME147 port for TNI - Telecom Bretagne |
---|
13 | * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr) |
---|
14 | * May 1996 |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef LIBBSP_M68K_MVME147S_BSP_H |
---|
18 | #define LIBBSP_M68K_MVME147S_BSP_H |
---|
19 | |
---|
20 | #include <bspopts.h> |
---|
21 | #include <bsp/default-initial-extension.h> |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | |
---|
25 | #ifdef __cplusplus |
---|
26 | extern "C" { |
---|
27 | #endif |
---|
28 | |
---|
29 | /* Constants */ |
---|
30 | |
---|
31 | #define RAM_START 0x00007000 |
---|
32 | #define RAM_END 0x003e0000 |
---|
33 | #define DRAM_END 0x00400000 |
---|
34 | /* We leave 128k for the shared memory */ |
---|
35 | |
---|
36 | /* MVME 147 Peripheral controller chip |
---|
37 | see MVME147/D1, 3.4 */ |
---|
38 | |
---|
39 | struct pcc_map { |
---|
40 | /* 32 bit registers */ |
---|
41 | uint32_t dma_table_address; /* 0xfffe1000 */ |
---|
42 | uint32_t dma_data_address; /* 0xfffe1004 */ |
---|
43 | uint32_t dma_bytecount; /* 0xfffe1008 */ |
---|
44 | uint32_t dma_data_holding; /* 0xfffe100c */ |
---|
45 | |
---|
46 | /* 16 bit registers */ |
---|
47 | uint16_t timer1_preload; /* 0xfffe1010 */ |
---|
48 | uint16_t timer1_count; /* 0xfffe1012 */ |
---|
49 | uint16_t timer2_preload; /* 0xfffe1014 */ |
---|
50 | uint16_t timer2_count; /* 0xfffe1016 */ |
---|
51 | |
---|
52 | /* 8 bit registers */ |
---|
53 | uint8_t timer1_int_control; /* 0xfffe1018 */ |
---|
54 | uint8_t timer1_control; /* 0xfffe1019 */ |
---|
55 | uint8_t timer2_int_control; /* 0xfffe101a */ |
---|
56 | uint8_t timer2_control; /* 0xfffe101b */ |
---|
57 | |
---|
58 | uint8_t acfail_int_control; /* 0xfffe101c */ |
---|
59 | uint8_t watchdog_control; /* 0xfffe101d */ |
---|
60 | |
---|
61 | uint8_t printer_int_control; /* 0xfffe101e */ |
---|
62 | uint8_t printer_control; /* 0xfffe102f */ |
---|
63 | |
---|
64 | uint8_t dma_int_control; /* 0xfffe1020 */ |
---|
65 | uint8_t dma_control; /* 0xfffe1021 */ |
---|
66 | uint8_t bus_error_int_control; /* 0xfffe1022 */ |
---|
67 | uint8_t dma_status; /* 0xfffe1023 */ |
---|
68 | uint8_t abort_int_control; /* 0xfffe1024 */ |
---|
69 | uint8_t table_address_function_code; /* 0xfffe1025 */ |
---|
70 | uint8_t serial_port_int_control; /* 0xfffe1026 */ |
---|
71 | uint8_t general_purpose_control; /* 0xfffe1027 */ |
---|
72 | uint8_t lan_int_control; /* 0xfffe1028 */ |
---|
73 | uint8_t general_purpose_status; /* 0xfffe1029 */ |
---|
74 | uint8_t scsi_port_int_control; /* 0xfffe102a */ |
---|
75 | uint8_t slave_base_address; /* 0xfffe102b */ |
---|
76 | uint8_t software_int_1_control; /* 0xfffe102c */ |
---|
77 | uint8_t int_base_vector; /* 0xfffe102d */ |
---|
78 | uint8_t software_int_2_control; /* 0xfffe102e */ |
---|
79 | uint8_t revision_level; /* 0xfffe102f */ |
---|
80 | }; |
---|
81 | |
---|
82 | #define pcc ((volatile struct pcc_map * const) 0xfffe1000) |
---|
83 | |
---|
84 | /* VME chip configuration registers */ |
---|
85 | |
---|
86 | struct vme_lcsr_map { |
---|
87 | uint8_t unused_1; |
---|
88 | uint8_t system_controller; /* 0xfffe2001 */ |
---|
89 | uint8_t unused_2; |
---|
90 | uint8_t vme_bus_requester; /* 0xfffe2003 */ |
---|
91 | uint8_t unused_3; |
---|
92 | uint8_t master_configuration; /* 0xfffe2005 */ |
---|
93 | uint8_t unused_4; |
---|
94 | uint8_t slave_configuration; /* 0xfffe2007 */ |
---|
95 | uint8_t unused_5; |
---|
96 | uint8_t timer_configuration; /* 0xfffe2009 */ |
---|
97 | uint8_t unused_6; |
---|
98 | uint8_t slave_address_modifier; /* 0xfffe200b */ |
---|
99 | uint8_t unused_7; |
---|
100 | uint8_t master_address_modifier; /* 0xfffe200d */ |
---|
101 | uint8_t unused_8; |
---|
102 | uint8_t interrupt_handler_mask; /* 0xfffe200f */ |
---|
103 | uint8_t unused_9; |
---|
104 | uint8_t utility_interrupt_mask; /* 0xfffe2011 */ |
---|
105 | uint8_t unused_10; |
---|
106 | uint8_t utility_interrupt_vector; /* 0xfffe2013 */ |
---|
107 | uint8_t unused_11; |
---|
108 | uint8_t interrupt_request; /* 0xfffe2015 */ |
---|
109 | uint8_t unused_12; |
---|
110 | uint8_t vme_bus_status_id; /* 0xfffe2017 */ |
---|
111 | uint8_t unused_13; |
---|
112 | uint8_t bus_error_status; /* 0xfffe2019 */ |
---|
113 | uint8_t unused_14; |
---|
114 | uint8_t gcsr_base_address; /* 0xfffe201b */ |
---|
115 | }; |
---|
116 | |
---|
117 | #define vme_lcsr ((volatile struct vme_lcsr_map * const) 0xfffe2000) |
---|
118 | |
---|
119 | struct vme_gcsr_map { |
---|
120 | uint8_t unused_1; |
---|
121 | uint8_t global_0; /* 0xfffe2021 */ |
---|
122 | uint8_t unused_2; |
---|
123 | uint8_t global_1; /* 0xfffe2023 */ |
---|
124 | uint8_t unused_3; |
---|
125 | uint8_t board_identification; /* 0xfffe2025 */ |
---|
126 | uint8_t unused_4; |
---|
127 | uint8_t general_purpose_0; /* 0xfffe2027 */ |
---|
128 | uint8_t unused_5; |
---|
129 | uint8_t general_purpose_1; /* 0xfffe2029 */ |
---|
130 | uint8_t unused_6; |
---|
131 | uint8_t general_purpose_2; /* 0xfffe202b */ |
---|
132 | uint8_t unused_7; |
---|
133 | uint8_t general_purpose_3; /* 0xfffe202d */ |
---|
134 | uint8_t unused_8; |
---|
135 | uint8_t general_purpose_4; /* 0xfffe202f */ |
---|
136 | }; |
---|
137 | |
---|
138 | #define vme_gcsr ((volatile struct vme_gcsr_map * const) 0xfffe2020) |
---|
139 | |
---|
140 | #define z8530 0xfffe3001 |
---|
141 | |
---|
142 | /* interrupt vectors - see MVME147/D1 4.14 */ |
---|
143 | #define PCC_BASE_VECTOR 0x40 /* First user int */ |
---|
144 | #define SCC_VECTOR PCC_BASE_VECTOR+3 |
---|
145 | #define TIMER_1_VECTOR PCC_BASE_VECTOR+8 |
---|
146 | #define TIMER_2_VECTOR PCC_BASE_VECTOR+9 |
---|
147 | #define SOFT_1_VECTOR PCC_BASE_VECTOR+10 |
---|
148 | #define SOFT_2_VECTOR PCC_BASE_VECTOR+11 |
---|
149 | |
---|
150 | #define VME_BASE_VECTOR 0x50 |
---|
151 | #define VME_SIGLP_VECTOR VME_BASE_VECTOR+1 |
---|
152 | |
---|
153 | #define USE_CHANNEL_A 1 /* 1 = use channel A for console */ |
---|
154 | #define USE_CHANNEL_B 0 /* 1 = use channel B for console */ |
---|
155 | |
---|
156 | #if (USE_CHANNEL_A == 1) |
---|
157 | #define CONSOLE_CONTROL 0xfffe3002 |
---|
158 | #define CONSOLE_DATA 0xfffe3003 |
---|
159 | #elif (USE_CHANNEL_B == 1) |
---|
160 | #define CONSOLE_CONTROL 0xfffe3000 |
---|
161 | #define CONSOLE_DATA 0xfffe3001 |
---|
162 | #endif |
---|
163 | |
---|
164 | #define FOREVER 1 /* infinite loop */ |
---|
165 | |
---|
166 | #ifdef M147_INIT |
---|
167 | #undef EXTERN |
---|
168 | #define EXTERN |
---|
169 | #else |
---|
170 | #undef EXTERN |
---|
171 | #define EXTERN extern |
---|
172 | #endif |
---|
173 | |
---|
174 | extern rtems_isr_entry M68Kvec[]; /* vector table address */ |
---|
175 | |
---|
176 | /* |
---|
177 | * NOTE: Use the standard Clock driver entry |
---|
178 | */ |
---|
179 | |
---|
180 | /* functions */ |
---|
181 | |
---|
182 | rtems_isr_entry set_vector( |
---|
183 | rtems_isr_entry handler, |
---|
184 | rtems_vector_number vector, |
---|
185 | int type |
---|
186 | ); |
---|
187 | |
---|
188 | #ifdef __cplusplus |
---|
189 | } |
---|
190 | #endif |
---|
191 | |
---|
192 | #endif |
---|