1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | This is a README file for the MVME167 port of RTEMS 4.0.0. |
---|
6 | |
---|
7 | Please send any comments, improvements, or bug reports to: |
---|
8 | |
---|
9 | Charles-Antoine Gauthier |
---|
10 | Software Engineering Group |
---|
11 | Institute for Information Technology |
---|
12 | National Research Council of Canada |
---|
13 | Ottawa, ON, K1A 0R6 |
---|
14 | Canada |
---|
15 | |
---|
16 | charles.gauthier@iit.nrc.ca |
---|
17 | |
---|
18 | |
---|
19 | Disclaimer |
---|
20 | ---------- |
---|
21 | |
---|
22 | The National Research Council of Canada is distributing this RTEMS |
---|
23 | board support package for the Motorola MVME167 as free software; you |
---|
24 | can redistribute it and/or modify it under terms of the GNU General |
---|
25 | Public License as published by the Free Software Foundation; either |
---|
26 | version 2, or (at your option) any later version. This software is |
---|
27 | distributed in the hope that it will be useful, but WITHOUT ANY |
---|
28 | WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
29 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
30 | for more details. You should have received a copy of the GNU General |
---|
31 | Public License along with RTEMS; see file COPYING. If not, write to |
---|
32 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
33 | |
---|
34 | Under no circumstances will the National Research Council of Canada |
---|
35 | nor Her Majesty the Queen in right of Canada assume any liablility |
---|
36 | for the use this software, nor any responsibility for its quality or |
---|
37 | its support. |
---|
38 | |
---|
39 | |
---|
40 | Installation |
---|
41 | ------------ |
---|
42 | |
---|
43 | Nothing unique to the MVME167. It uses the standard build process for |
---|
44 | m68k targets. You will need to edit linkcmds to put in the start address |
---|
45 | of your board. We do TFTP transfers to our target. The mvme167.cfg file |
---|
46 | builds only the coff images, which we download to the target, skipping over |
---|
47 | the first 0xA8 bytes; Motorola S-records are not generated. Edit this file |
---|
48 | if you want S-records. |
---|
49 | |
---|
50 | |
---|
51 | Port Description |
---|
52 | Console driver |
---|
53 | |
---|
54 | ---------------- |
---|
55 | |
---|
56 | This BSP includes an termios-capable console driver that supports all |
---|
57 | four serial ports on the MVME167 model. The RTEMS console, /dev/console, |
---|
58 | corresponds to channel 1 in the CD2401. This corresponds to Serial Port |
---|
59 | 2/TTY01 on the MVME712M. Serial Port 1/Console is normally used by 167Bug; |
---|
60 | do not open /dev/tty00 if you are debugging using 167Bug. |
---|
61 | |
---|
62 | The console is initialized with whatever parameters are set up in termios |
---|
63 | before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE HANDSHAKING |
---|
64 | IS TURNED OFF, i.e. CLOCAL is set in the struct termios c_cflag field. We use |
---|
65 | 3-wire cables for I/O, and find hardware handshaking a pain. If you enable |
---|
66 | hardware handshaking, you must drive CTS* low on the CD2401 for output to |
---|
67 | occur. If the port is in the DTE configuration, you must drive the RS-232 CTS |
---|
68 | line to space; if the port is in the DCE configuration, you must drive the |
---|
69 | RS-232 RTS line to space. |
---|
70 | |
---|
71 | Limited support is provided for polled terminal I/O. This is used when running |
---|
72 | the timing tests. Set the CD2401_POLLED_IO manifest constant to 1 in |
---|
73 | rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled I/O. |
---|
74 | In this case, I/O is done through 167Bug, usually to the Serial Port 1/Console |
---|
75 | |
---|
76 | Floating-point |
---|
77 | |
---|
78 | The MC68040 has a built-in FPU. This FPU does not implement all the |
---|
79 | instruction of the MC68881/MC68882 floating-point coprocessors in hardware. |
---|
80 | The -m68040 compilation options instructs gcc to not generate the missing |
---|
81 | instructions. All of the RTEMS code is built this way. Some of the missing |
---|
82 | functionality must be supplied by external libraries. The required functions |
---|
83 | are part of libgcc.a. |
---|
84 | |
---|
85 | The issue gets complicated because libc, libm and libgcc do not come as |
---|
86 | m68040-specific variants. The default variants of these libraries are for the |
---|
87 | MC68020 and MC68030. There are specific variants for the MC68000 (which has |
---|
88 | limited addressing modes with respect to later family members), and specific |
---|
89 | variants for systems without a floating-point unit, either a built-in FPU or |
---|
90 | a coprocessor. These latter variants will be referred to as the msoft-float |
---|
91 | variants. There is a msoft-float variant for the MC68000, and one for the |
---|
92 | other family members. |
---|
93 | |
---|
94 | The default variants of libc, libm and libgcc appear to work just fine for the |
---|
95 | MC68040, AS LONG AS NO FLOATING POINT FUNCTIONS ARE CALLED. In particular, |
---|
96 | printf() and scanf() raise unimplemented floating-point instruction exceptions |
---|
97 | at run time. Expect almost every function that must compute a floating-point |
---|
98 | result to also raise unimplemented floating-point instruction exceptions. Do |
---|
99 | not use these variants if your application does any floating-point operations, |
---|
100 | unless you use the Motorola FPSP package (described further down). |
---|
101 | |
---|
102 | The msoft-float variants do print out floating-point numbers properly, but we |
---|
103 | have not tested them extensively, so use them with caution. In particular, |
---|
104 | the Paranoia test fails when linked with the msoft-float variants of the |
---|
105 | libraries; it goes into an infinite loop after milestone 40. |
---|
106 | |
---|
107 | MSOFT_FLOAT VARIANTS MUST BE USED TOGETHER. If you use the msoft-float variant |
---|
108 | of libc and libm, you must also linked with the msoft-float variant of libgcc, |
---|
109 | otherwise calls such as printf() print out floating-point values incorrectly. |
---|
110 | |
---|
111 | RTEMS comes with the Motorola FPSP (Floating-Point Support Package) for the |
---|
112 | MC68040 (rtems/c/src/lib/libcp/m68k/m68040/fpsp). This package emulates the |
---|
113 | missing floating-point instructions. It is built automatically for the |
---|
114 | MVME167 and installed in bsp_start(). |
---|
115 | |
---|
116 | The FPSP allows the use of the default variants of libc, libm and libgcc. |
---|
117 | It also runs the paranoia test properly, and prints out the correct results. |
---|
118 | It should probably be used in preference to the msoft-float libraries, as it |
---|
119 | appears to work better. The disadvantage of the FPSP is that it increases the |
---|
120 | size of the executable by about 60KB and that it relies on run time |
---|
121 | exceptions. |
---|
122 | |
---|
123 | If your application does not do any floating-point operations at all, you |
---|
124 | should consider disabling the FPSP. In bsp_start(), emove the call to |
---|
125 | M68KFPSPInstallExceptionHandlers(), and uncomment the three lines in |
---|
126 | mvme167.cfg that redefine which variants of libc, libm and libgcc to link |
---|
127 | against. |
---|
128 | |
---|
129 | |
---|
130 | Miscellaneous |
---|
131 | |
---|
132 | port. Interrupt-driven and polled I/O cannot be mixed in the MVME167. |
---|
133 | |
---|
134 | The timer and clock drivers were patterned after the MVME162 and MVME152 |
---|
135 | ports. |
---|
136 | |
---|
137 | At this time, we do not have an MPCI layer for the MVME167. We are planning |
---|
138 | to write one. |
---|
139 | |
---|
140 | The port does not have a network driver. |
---|
141 | |
---|
142 | This port supplies its own fatal_error_handler, which attempts to print some |
---|
143 | error message through 167Bug (on the Serial Port 1/Console on the MVME712M). |
---|
144 | |
---|
145 | |
---|
146 | Host System |
---|
147 | ----------- |
---|
148 | |
---|
149 | The port was initially developed on an RS-6000 running AIX 4.2. The following |
---|
150 | tools were used: |
---|
151 | |
---|
152 | - GNU gcc 2.8.1 configured for a powerpc-ibm-aix4.2.0.0 host and |
---|
153 | m68k-rtems target; |
---|
154 | - GNU binutils 2.9.1 configured for a powerpc-ibm-aix4.2.0.0 host and |
---|
155 | m68k-rtems target; |
---|
156 | It was also tested on a Pentium II-based PC running Windows NT Workstation 4.0 |
---|
157 | and the Cygnus Cygwin32 release b20.1 environment, witht he following tools: |
---|
158 | |
---|
159 | - EGCS 1.1.1 configured for a i586-cygwin32 host and m68k-rtems target; |
---|
160 | - GNU binutils 2.9.4 configured for a i586-cygwin32 host and m68k-rtems |
---|
161 | target; |
---|
162 | - Cygnus newlib 1.8.0 with RTEMS 4.0.0 patches. |
---|
163 | |
---|
164 | With the latter environment, be patient; builds take a very looong time... |
---|
165 | |
---|
166 | - Cygnus newlib 1.8.0 with RTEMS 4.0.0 patches. |
---|
167 | |
---|
168 | |
---|
169 | Known Problems |
---|
170 | -------------- |
---|
171 | |
---|
172 | The cdtest will not run with interrupt-driven I/O. The reason is that the |
---|
173 | constructors for the static objects are called at boot time when the |
---|
174 | interrupts are still disabled. The output buffer fills up, but never empties, |
---|
175 | and the application goes into an infinite loop waiting for buffer space. This |
---|
176 | should have been documented in the rtems/c/src/tests/PROBLEMS file. The moral |
---|
177 | of this story is: do not do I/O from the constructors or destructors of static |
---|
178 | objects. |
---|
179 | |
---|
180 | The cpuuse and malloctest tests do not work properly, either with polled I/O |
---|
181 | or interrupt-driven I/O. They are known not to work with interrupt-driven I/O, |
---|
182 | but should work with polled I/O? |
---|
183 | |
---|
184 | Output stops prematurely in the termios test when the console is operating in |
---|
185 | interrupt-driven mode because the serial port is re-initialized before all |
---|
186 | characters in the last raw output buffer are sent. Adding calls to tcdrain() |
---|
187 | in the test task helps, but it does not solve the problem. What happens is |
---|
188 | that the CD2401 raises a transmit interrupt when the last character in the |
---|
189 | DMA buffer is written into the transmit FIFO, not when the last character |
---|
190 | has been transmitted. When tcdrain() returns, there might be up to 16 |
---|
191 | characters in the output FIFO. The call to tcsetattr() causes the serial port |
---|
192 | to re-initialize, at which point the output FIFO is cleared. We could not find |
---|
193 | a way to detect whether characters are still in the FIFO and to wait for them |
---|
194 | to be transmitted. |
---|
195 | |
---|
196 | The first raw buffer to be transmitted after the console is re-initialized |
---|
197 | with tcsetattr() is garbled. At this time, it does not seem worth while to |
---|
198 | track this problem down. |
---|
199 | |
---|
200 | In the stackchk test, an access fault exception is raised after the stack is |
---|
201 | blown. This is one case were overwritting the first or last 16 bytes of the |
---|
202 | stack does cause problems (but hey, an exception occurred, which is better |
---|
203 | than propagating the error). |
---|
204 | |
---|
205 | When using interrupt-driven I/O, psx08 produces all the expected output, but |
---|
206 | it does not return control to 167Bug. Is this test supposed to work with |
---|
207 | interrupt-driven console I/O? |
---|
208 | |
---|
209 | |
---|
210 | What's new |
---|
211 | ---------- |
---|
212 | |
---|
213 | |
---|
214 | Thanks |
---|
215 | ------ |
---|
216 | |
---|
217 | - to On-Line Applications Research Corporation (OAR) for developing |
---|
218 | RTEMS and making it available on a Technology Transfer basis; |
---|
219 | |
---|
220 | - to FSF and Cygnus Support for great free software; |
---|
221 | |
---|
222 | |
---|
223 | Test Configuration |
---|
224 | ------------------ |
---|
225 | |
---|
226 | Board: Motorola MVME167 |
---|
227 | CPU: Motorola MC68040 |
---|
228 | Clock Speed: 25 MHz |
---|
229 | RAM: 4 MBytes of 32-bit DRAM with parity |
---|
230 | Cache Configuration: Instruction cache on; data cache on, copyback mode. |
---|
231 | Times Reported in: microseconds |
---|
232 | Timer Source: VMEchip2 Tick Timer 1 |
---|
233 | GCC Flags: -m68040 -g -O4 -fomit-frame-pointer |
---|
234 | Console: Operate in polled mode. Set CD2401_POLLED_IO to 1 in |
---|
235 | rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c. |
---|
236 | |
---|
237 | |
---|
238 | Test Results |
---|
239 | ------------ |
---|
240 | |
---|
241 | Single processor tests: All tests passed, except the following ones: |
---|
242 | |
---|
243 | - paranoia required the FPSP and the default variants of libm (and libc and |
---|
244 | libgcc) for us. It may work with the msoft-float variants for you, but it |
---|
245 | does require the FPSP. |
---|
246 | |
---|
247 | - cpuuse and malloctest did not work. |
---|
248 | |
---|
249 | - The stackchk test got an access fault exception before the RTEMS stack |
---|
250 | checker had had a chance to detect the corrupted stack. |
---|
251 | |
---|
252 | |
---|
253 | Multi-processort tests: not applicable -- No MPCI layer yet. |
---|
254 | |
---|
255 | |
---|
256 | Timing tests: |
---|
257 | |
---|
258 | Context Switch |
---|
259 | |
---|
260 | context switch: no floating point contexts 12 |
---|
261 | context switch: self 3 |
---|
262 | context switch: to another task 3 |
---|
263 | fp context switch: restore 1st FP task 14 |
---|
264 | fp context switch: save idle, restore initialized 5 |
---|
265 | fp context switch: save idle, restore idle 15 |
---|
266 | fp context switch: save initialized, restore initialized 5 |
---|
267 | |
---|
268 | |
---|
269 | Miscellaneous |
---|
270 | |
---|
271 | _ISR_Disable 1 |
---|
272 | _ISR_Flash 0 |
---|
273 | _ISR_Enable 0 |
---|
274 | |
---|
275 | _Thread_Disable_dispatch 0 |
---|
276 | _Thread_Enable_dispatch 3 |
---|
277 | _Thread_Set_state 9 |
---|
278 | _Thread_Disptach (NO FP) 16 |
---|
279 | _Thread_Resume 6 |
---|
280 | _Thread_Unblock 4 |
---|
281 | _Thread_Ready 6 |
---|
282 | _Thread_Get 3 |
---|
283 | _Thread_Get: invalid id 0 |
---|
284 | |
---|
285 | _Semaphore_Get 2 |
---|
286 | |
---|
287 | |
---|
288 | Task Manager |
---|
289 | |
---|
290 | rtems_task_create 56 |
---|
291 | rtems_task_ident 106 |
---|
292 | rtems_task_start 21 |
---|
293 | rtems_task_restart: calling task 24 |
---|
294 | rtems_task_restart: suspended task -- returns to caller 27 |
---|
295 | rtems_task_restart: blocked task -- returns to caller 36 |
---|
296 | rtems_task_restart: ready task -- returns to caller 27 |
---|
297 | rtems_task_restart: suspended task -- preempts caller 40 |
---|
298 | rtems_task_restart: blocked task -- preempts caller 51 |
---|
299 | rtems_task_restart: ready task -- preempts caller 52 |
---|
300 | rtems_task_delete: calling task 67 |
---|
301 | rtems_task_delete: suspended task 52 |
---|
302 | rtems_task_delete: blocked task 54 |
---|
303 | rtems_task_delete: ready task 54 |
---|
304 | rtems_task_suspend: calling task 23 |
---|
305 | rtems_task_suspend: returns to caller 12 |
---|
306 | rtems_task_resume: task readied -- returns to caller 13 |
---|
307 | rtems_task_resume: task readied -- preempts caller 22 |
---|
308 | rtems_task_set_priority: obtain current priority 8 |
---|
309 | rtems_task_set_priority: returns to caller 16 |
---|
310 | rtems_task_set_priority: preempts caller 34 |
---|
311 | rtems_task_mode: obtain current mode 4 |
---|
312 | rtems_task_mode: no reschedule 5 |
---|
313 | rtems_task_mode: reschedule -- returns to caller 12 |
---|
314 | rtems_task_mode: reschedule -- preempts caller 26 |
---|
315 | rtems_task_get_note 8 |
---|
316 | rtems_task_set_note 8 |
---|
317 | rtems_task_wake_after: yield -- returns to caller 4 |
---|
318 | rtems_task_wake_after: yields -- preempts caller 19 |
---|
319 | rtems_task_wake_when 36 |
---|
320 | |
---|
321 | |
---|
322 | Interrupt Manager |
---|
323 | |
---|
324 | interrupt entry overhead: returns to nested interrupt 5 |
---|
325 | interrupt entry overhead: returns to interrupted task 9 |
---|
326 | interrupt entry overhead: returns to preempting task 7 |
---|
327 | interrupt exit overhead: returns to nested interrupt 1 |
---|
328 | interrupt exit overhead: returns to interrupted task 2 |
---|
329 | interrupt exit overhead: returns to preempting task 26 |
---|
330 | |
---|
331 | |
---|
332 | Clock Manager |
---|
333 | |
---|
334 | rtems_clock_set 20 |
---|
335 | rtems_clock_get <1 |
---|
336 | rtems_clock_tick 8 |
---|
337 | |
---|
338 | |
---|
339 | Timer Manager |
---|
340 | |
---|
341 | rtems_timer_create 8 |
---|
342 | rtems_timer_ident 104 |
---|
343 | rtems_timer_delete: inactive 12 |
---|
344 | rtems_timer_delete: active 13 |
---|
345 | rtems_timer_fire_after: inactive 17 |
---|
346 | rtems_timer_fire_after: active 18 |
---|
347 | rtems_timer_fire_when: inactive 23 |
---|
348 | rtems_timer_fire_when: active 23 |
---|
349 | rtems_timer_reset: inactive 16 |
---|
350 | rtems_timer_reset: active 17 |
---|
351 | rtems_timer_cancel: inactive 9 |
---|
352 | rtems_timer_cancel: active 10 |
---|
353 | |
---|
354 | |
---|
355 | Semaphore Manager |
---|
356 | |
---|
357 | rtems_semaphore_create 22 |
---|
358 | rtems_semaphore_ident 119 |
---|
359 | rtems_semaphore_delete 24 |
---|
360 | rtems_semaphore_obtain: available 10 |
---|
361 | rtems_semaphore_obtain: not available -- NO_WAIT 10 |
---|
362 | rtems_semaphore_obtain: not available -- caller blocks 35 |
---|
363 | rtems_semaphore_release: no waiting tasks 11 |
---|
364 | rtems_semaphore_release: task readied -- returns to caller 17 |
---|
365 | rtems_semaphore_release: task readied -- preempts caller 27 |
---|
366 | |
---|
367 | |
---|
368 | Message Queue Manager |
---|
369 | |
---|
370 | rtems_message_queue_create 85 |
---|
371 | rtems_message_queue_ident 103 |
---|
372 | rtems_message_queue_delete 32 |
---|
373 | rtems_message_queue_send: no waiting tasks 25 |
---|
374 | rtems_message_queue_send: task readied -- returns to caller 27 |
---|
375 | rtems_message_queue_send: task readied -- preempts caller 39 |
---|
376 | rtems_message_queue_urgent: no waiting tasks 26 |
---|
377 | rtems_message_queue_urgent: task readied -- returns to caller 28 |
---|
378 | rtems_message_queue_urgent: task readied -- preempts caller 39 |
---|
379 | rtems_message_queue_broadcast: no waiting tasks 13 |
---|
380 | rtems_message_queue_broadcast: task readied -- returns to caller 37 |
---|
381 | rtems_message_queue_broadcast: task readied -- preempts caller 45 |
---|
382 | rtems_message_queue_receive: available 21 |
---|
383 | rtems_message_queue_receive: not available -- NO_WAIT 11 |
---|
384 | rtems_message_queue_receive: not available -- caller blocks 37 |
---|
385 | rtems_message_queue_flush: no messages flushed 7 |
---|
386 | rtems_message_queue_flush: messages flushed 10 |
---|
387 | |
---|
388 | |
---|
389 | Event Manager |
---|
390 | |
---|
391 | rtems_event_send: no task readied 7 |
---|
392 | rtems_event_send: task readied -- returns to caller 18 |
---|
393 | rtems_event_send: task readied -- preempts caller 29 |
---|
394 | rtems_event_receive: obtain current events <1 |
---|
395 | rtems_event_receive: available 10 |
---|
396 | rtems_event_receive: not available -- NO_WAIT 5 |
---|
397 | rtems_event_receive: not available -- caller blocks 28 |
---|
398 | |
---|
399 | |
---|
400 | Signal Manager |
---|
401 | |
---|
402 | rtems_signal_catch 5 |
---|
403 | rtems_signal_send: returns to caller 15 |
---|
404 | rtems_signal_send: signal to self 24 |
---|
405 | exit ASR overhead: returns to calling task 20 |
---|
406 | exit ASR overhead: returns to preempting task 21 |
---|
407 | |
---|
408 | |
---|
409 | Partition Manager |
---|
410 | |
---|
411 | rtems_partition_create 30 |
---|
412 | rtems_partition_ident 103 |
---|
413 | rtems_partition_delete 14 |
---|
414 | rtems_partition_get_buffer: available 14 |
---|
415 | rtems_partition_get_buffer: not available 9 |
---|
416 | rtems_partition_return_buffer 18 |
---|
417 | |
---|
418 | |
---|
419 | Region Manager |
---|
420 | |
---|
421 | rtems_region_create 25 |
---|
422 | rtems_region_ident 105 |
---|
423 | rtems_region_delete 13 |
---|
424 | rtems_region_get_segment: available 13 |
---|
425 | rtems_region_get_segment: not available -- NO_WAIT 17 |
---|
426 | rtems_region_get_segment: not available -- caller blocks 49 |
---|
427 | rtems_region_return_segment: no waiting tasks 16 |
---|
428 | rtems_region_return_segment: task readied -- returns to caller 35 |
---|
429 | rtems_region_return_segment: task readied -- preempts caller 58 |
---|
430 | |
---|
431 | |
---|
432 | Dual-Ported Memory Manager |
---|
433 | |
---|
434 | rtems_port_create 13 |
---|
435 | rtems_port_ident 103 |
---|
436 | rtems_port_delete 14 |
---|
437 | rtems_port_external_to_internal 5 |
---|
438 | rtems_port_internal_to_external 5 |
---|
439 | |
---|
440 | |
---|
441 | IO Manager |
---|
442 | |
---|
443 | rtems_io_initialize <1 |
---|
444 | rtems_io_open <1 |
---|
445 | rtems_io_close <1 |
---|
446 | rtems_io_read <1 |
---|
447 | rtems_io_write <1 |
---|
448 | rtems_io_control <1 |
---|
449 | |
---|
450 | |
---|
451 | Rate Monotonic Manager |
---|
452 | |
---|
453 | rtems_rate_monotonic_create 15 |
---|
454 | rtems_rate_monotonic_ident 103 |
---|
455 | rtems_rate_monotonic_cancel 16 |
---|
456 | rtems_rate_monotonic_delete: active 18 |
---|
457 | rtems_rate_monotonic_delete: inactive 20 |
---|
458 | rtems_rate_monotonic_period: initiate period -- returns to caller 23 |
---|
459 | rtems_rate_monotonic_period: conclude periods -- caller blocks 25 |
---|
460 | rtems_rate_monotonic_period: obtain status 13 |
---|
461 | |
---|
462 | |
---|
463 | Network tests: |
---|
464 | Network driver is not implemented. |
---|
465 | |
---|
466 | |
---|
467 | |
---|