source: rtems/c/src/lib/libbsp/m68k/mvme167/README @ 8ef3818

4.104.114.84.95
Last change on this file since 8ef3818 was 8ef3818, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 12, 2000 at 7:57:02 PM

Patch from John Cotton <john.cotton@…>, Charles-Antoine Gauthier
<charles.gauthier@…>, and Darlene A. Stewart
<Darlene.Stewart@…> to add support for a number of very
significant things:

+ BSPs for many variations on the Motorola MBX8xx board series
+ Cache Manager including initial support for m68040

and PowerPC

+ Rework of mpc8xx libcpu code so all mpc8xx CPUs now use

same code base.

+ Rework of eth_comm BSP to utiltize above.

John reports this works on the 821 and 860

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