Back to home page

LXR

 
 

    


Warning, /bsps/m68k/mvme167/README.md is written in an unsupported language. File is not indexed.

0001 MVME167
0002 =======
0003 This is a README file for the MVME167 port of RTEMS 4.5.0.
0004 
0005 Please send any comments, improvements, or bug reports to:
0006 
0007 Charles-Antoine Gauthier
0008 charles.gauthier@nrc.ca
0009 
0010 or
0011 
0012 Darlene Stewart
0013 Darlene.Stewart@nrc.ca
0014   
0015 Software Engineering Group
0016 Institute for Information Technology
0017 National Research Council of Canada
0018 Ottawa, ON, K1A 0R6
0019 Canada
0020 
0021 
0022 Disclaimer
0023 ----------
0024 
0025 The National Research Council of Canada is distributing this RTEMS
0026 board support package for the Motorola MVME167 as free software; you
0027 can redistribute it and/or modify it under terms of the GNU General
0028 Public License as published by the Free Software Foundation; either
0029 version 2, or (at your option) any later version.  This software is
0030 distributed in the hope that it will be useful, but WITHOUT ANY
0031 WARRANTY; without even the implied warranty of MERCHANTABILITY or
0032 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0033 for more details. You should have received a copy of the GNU General
0034 Public License along with RTEMS; see file COPYING. If not, write to
0035 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
0036 
0037 Under no circumstances will the National Research Council of Canada
0038 nor Her Majesty the Queen in right of Canada assume any liablility
0039 for the use this software, nor any responsibility for its quality or
0040 its support.
0041 
0042 
0043 Installation
0044 ------------
0045 
0046 Nothing unique to the MVME167. It uses the standard build process for
0047 m68k targets. You will need to edit linkcmds to put in the start address
0048 of your board. We do TFTP transfers to our target. The mvme167.cfg file
0049 builds only the ELF images, which we download to the target, skipping
0050 over the first 0x54 bytes; Motorola S-records are not generated. Edit
0051 this file if you want S-records.
0052 
0053 
0054 Port Description
0055 
0056 Console driver
0057 ---------------
0058 
0059 This BSP includes an termios-capable interrupt-driven I/O console driver
0060 that supports all four serial ports on the MVME167 model. The port labelled
0061 Serial Port 1/Console on the MVME712 is normally used by 167Bug; do not open
0062 /dev/tty00 if you are debugging using 167Bug.
0063 
0064 Limited support is provided for polled terminal I/O. This is used when
0065 running the timing tests, and by the printk() debug output function.
0066 Polled I/O may use termios, or it may bypass those services. The printk()
0067 function does not use termios. When polled I/O is used, the terminal settings
0068 must be set through 167-Bug; trying to change the line settings through RTEMS
0069 has no effect.
0070 
0071 Three is no support for using interrupt-driven I/O without termios support.
0072 
0073 The default configuration is to use polled I/O and to bypass termios. This
0074 is done so the test can be built at the same time as the rest of the system.
0075 It is highly recommended that the defaults be changed in the mvme167.cfg file
0076 to reflect the desired defaults, or that the appropriate parameters be set up
0077 in NVRAM to select the appropriate I/O modes at boot time.
0078 
0079 When configured for interrupt-driven I/O, the console is initialized with
0080 whatever parameters are set up in termios before it calls the firtOpen driver
0081 callback, EXCEPT THAT HARDWARE HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set
0082 in the struct termios c_cflag field. We use 3-wire cables for I/O, and find
0083 hardware handshaking a pain. If you enable hardware handshaking, you must drive
0084 CTS* low on the CD2401 for output to occur. If the port is in the DTE
0085 configuration, you must drive the RS-232 CTS line to space; if the port is
0086 in the DCE configuration, you must drive the RS-232 RTS line to space.
0087 
0088 To use interrupt-driven I/O, set the CD2401_IO_MODE manifest constant to 1 in
0089 rtems/make/custom/mvme167.cfg, or configure the appropriate parameter in
0090 User Area Non-volatile RAM. See the Configuration Parameters section below
0091 for instructions on setting up NVRAM.
0092 
0093 To use termios, set the CD2401_USE_TERMIOS manifest constant to 1 in
0094 rtems/make/custom/mvme167.cfg, or configure the appropriate parameter in
0095 User Area Non-volatile RAM. See the Configuration Parameters section
0096 below for instructions on setting up NVRAM.
0097 
0098 The RTEMS console, i.e. the port used by stdin, stdout and stderr (do not
0099 confuse it with the port labelled Console on the MVME712), must be
0100 specified in the rtems/make/custom/mvme167.cfg file, or in the NVRAM
0101 parameters. Set the value of CONSOLE_MINOR appropriately. See below for a
0102 list of choices. See the Configuration Parameters section below for
0103 instructions on setting up NVRAM.
0104 
0105 The RTEMS printk port, i.e. the port where printk sends it debugging output
0106 text, must be specified in the rtems/make/custom/mvme167.cfg file, or in the
0107 NVRAM parameters. Set the value of PRINTK_MINOR appropriately. See below for a
0108 list of choices. See the Configuration Parameters section below for
0109 instructions on setting up NVRAM.
0110 
0111 Interrupt-driven and polled I/O cannot be mixed in the MVME167, except that
0112 printk always used polled I/O without termios. If interrupt-driven I/O is
0113 used and printk is used, do not open the device that printk uses from an
0114 RTEMS application.
0115 
0116 Console and printk port choices:
0117 
0118 ```
0119   0 - /dev/tty0, Serial Port 1/Console on the MVME712M.
0120   1 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.
0121   2 - /dev/tty2, Serial Port 3 on the MVME712M.
0122   3 - /dev/tty3, Serial Port 4 on the MVME712M.
0123 ```
0124 
0125 Setting the RTEMS console to port 0 when interrupt-driven I/O is specified
0126 will prevent 167-Bug from using that port.
0127 
0128 To use polled I/O on port 2 or 3, the port must be configured in 167-Bug. See
0129 the "PF" command in the "Debugging Package for Motorola 68K CISC CPUs User's
0130 Manual", part number 68KBUG.
0131 
0132 
0133 Floating-point
0134 --------------
0135 
0136 The MC68040 has a built-in FPU. This FPU does not implement all the
0137 instruction of the MC68881/MC68882 floating-point coprocessors in
0138 hardware. The -m68040 compilation options instructs gcc to not generate
0139 the missing instructions. All of the RTEMS code is built this way. Some
0140 of the missing functionality must be supplied by external libraries. The
0141 required functions are part of libgcc.a.
0142 
0143 The issue gets complicated because libc, libm and libgcc do not come as
0144 m68040-specific variants. The default variants of these libraries are for the
0145 MC68020 and MC68030. There are specific variants for the MC68000 (which has
0146 limited addressing modes with respect to later family members), and specific
0147 variants for systems without a floating-point unit, either a built-in FPU or
0148 a coprocessor. These latter variants will be referred to as the msoft-float
0149 variants. There is a msoft-float variant for the MC68000, and one for the
0150 other family members.
0151 
0152 The default variants of libc, libm and libgcc appear to work just fine for the
0153 MC68040, AS LONG AS NO FLOATING POINT FUNCTIONS ARE CALLED. In particular,
0154 printf() and scanf() raise unimplemented floating-point instruction exceptions
0155 at run time. Expect almost every function that must compute a floating-point
0156 result to also raise unimplemented floating-point instruction exceptions. Do
0157 not use these variants if your application does any floating-point operations,
0158 unless you use the Motorola FPSP package (described further down).
0159 
0160 The msoft-float variants do print out floating-point numbers properly, but we
0161 have not tested them extensively, so use them with caution. In particular,
0162 the Paranoia test fails when linked with the msoft-float variants of the
0163 libraries; it goes into an infinite loop after milestone 40.
0164 
0165 MSOFT_FLOAT VARIANTS MUST BE USED TOGETHER. If you use the msoft-float variant
0166 of libc and libm, you must also linked with the msoft-float variant of libgcc,
0167 otherwise calls such as printf() print out floating-point values incorrectly.
0168 
0169 RTEMS comes with the Motorola FPSP (Floating-Point Support Package) for the
0170 MC68040 (rtems/c/src/lib/libcp/m68k/m68040/fpsp). This package emulates the
0171 missing floating-point instructions. It is built automatically for the
0172 MVME167 and installed in bsp_start().
0173 
0174 The FPSP allows the use of the default variants of libc, libm and libgcc.
0175 It also runs the paranoia test properly, and prints out the correct results.
0176 It should probably be used in preference to the msoft-float libraries, as it
0177 appears to work better. The disadvantage of the FPSP is that it increases the
0178 size of the executable by about 60KB and that it relies on run time
0179 exceptions.
0180 
0181 If your application does not do any floating-point operations at all, you
0182 should consider disabling the FPSP. In bsp_start(), emove the call to
0183 M68KFPSPInstallExceptionHandlers(), and uncomment the three lines in
0184 mvme167.cfg that redefine which variants of libc, libm and libgcc to link
0185 against.
0186 
0187 
0188 Configuration Parameters
0189 ------------------------
0190 
0191 If Jumper J1-4 is installed, certain configuration parameters may be read from
0192 the first 31 bytes of User Area NVRAM starting at 0xFFFC0000. In this case, the
0193 remaining J1-[5-7] jumpers are ignored, and the user is responsible for writing
0194 the appropriate values in NVRAM (via 167-Bug) in order to alter the default
0195 behaviour. A zero value in NVRAM results in the default behaviour. The paramaters
0196 that are configurable and their default settings are described below. 
0197                 
0198         Cache Mode (0xFFFC0000 - 1 byte)
0199           Set the following bits in the byte to set the desired cache mode:
0200             bit 0
0201               0 - data cache disable
0202               1 - data cache enable
0203             bit 1
0204               0 - instruction cache disable
0205               1 - instruction cache enable
0206             bits 2 & 3:
0207                     00 = cachable, write-through
0208                     01 = cachable, copyback
0209                     10 = noncachable, serialized
0210                     11 = noncachable
0211 
0212         Console driver I/O mode (0xFFFC0001 - 1 byte)
0213           Set the following bits in the byte to set the desired I/O mode:
0214             bit 0
0215               0 - do not use termios
0216               1 - use termios
0217             bit 1
0218               0 - polled I/O
0219               1 - interrupt-driven I/O
0220 
0221         Console driver ports (0xFFFC0002 - 1 byte)
0222           Set the following bits in the byte to select the console and printk ports:
0223             bit 0 & 1 select the RTEMS console port
0224         00 - /dev/tty0, Serial Port 1/Console on the MVME712M.
0225         01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.
0226         10 - /dev/tty2, Serial Port 3 on the MVME712M.
0227         11 - /dev/tty3, Serial Port 4 on the MVME712M.
0228             bit 4 & 5 select the RTEMS printk port
0229         00 - /dev/tty0, Serial Port 1/Console on the MVME712M.
0230         01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.
0231         10 - /dev/tty2, Serial Port 3 on the MVME712M.
0232         11 - /dev/tty3, Serial Port 4 on the MVME712M.
0233     If the printk port is the same as some other port that will be opened by an
0234     RTEMS application, then the driver must use polled I/O, or the printk port
0235     must not be used.
0236     
0237         IP Address (0xFFFC0004 - 4 bytes)
0238                 write the hexadecimal representation of the IP address of the board in this
0239                 locatio, e.g. 192.168.1.2 = 0xC0A80102
0240                 default: obtain the IP address from an rtems_bsdnet_ifconfig structure
0241 
0242         Netmask (0xFFFC0008 - 4 bytes)
0243                 write the hexadecimal representation of the netmask in this location
0244                 for example, 255.255.255.0 = 0xFFFFFF00
0245                 default: obtain the netmask from an rtems_bsdnet_ifconfig structure
0246                 
0247         Ethernet Address (0xFFFC000C - 6 bytes)
0248                 write the Ethernet address of the board in this location
0249                 default: obtain the hardware address from an rtems_bsdnet_ifconfig
0250                          structure
0251 
0252         Processor ID (0xFFFC0012 - 2 bytes)
0253                 reserved for future use
0254                 
0255         RMA start (0xFFFC0014 - 4 bytes)
0256                 reserved for future use
0257                 
0258         VMA start (0xFFFC0018 - 4 bytes)
0259                 reserved for future use
0260                 
0261         RamSize (0xFFFC001C - 4 bytes)
0262                 reserved for future use
0263 
0264 
0265 Cache Control and Memory Mapping
0266 --------------------------------
0267 
0268 If configuration is not obtained from non-volatile RAM (ie. J1-4 is off),
0269 cache control is done through the remaining J1 jumpers as follows:
0270 
0271 If Jumper J1-7 is installed, the data cache will be turned on. If Jumper
0272 J1-6 is installed, the instruction cache will be turned on. (If a jumper
0273 is off, its corresponding cache will remain disabled).
0274 
0275 If Jumper J1-5 is installed, the data cache will be placed in copyback
0276 mode. If it is removed, it will be placed in writethrough mode.
0277 
0278 Currently, block address translation is set up to map the virtual
0279 0x00000000--0x7FFFFFFF to the physical range 0x00000000--0x7FFFFFFF. The
0280 port relies on the hardware to raise exceptions when addressing
0281 non-existent memory. Caching is not controllable on a finer grain.
0282 
0283 
0284 Networking
0285 ----------
0286 
0287 If configuration is not obtained from non-volatile RAM (ie. J1-4 is off),
0288 the networking parameters shown above must be specified in an initialized
0289 rtems_bsdnet_ifconfig struct. This structure is declared and initialized to
0290 specify any network devices and includes entries for ip_address, ip_netmask
0291 and hardware_address. See the Network Device Configuration section of the
0292 RTEMS Networking Supplement.
0293 
0294 When non-default (non-zero) networking paramaters are provided in NVRAM (ie.
0295 j1-4 is on), the user MUST ensure that the corresponding entries in the
0296 ifconfig struct are NULL. Failing to do so is an error, because it causes
0297 the memory allocated for the initialized struct values to be lost.
0298 
0299 
0300 Miscellaneous
0301 -------------
0302 
0303 The timer and clock drivers were patterned after the MVME162 and MVME152
0304 ports.
0305 
0306 At this time, we do not have an MPCI layer for the MVME167. We are planning
0307 to write one.
0308 
0309 This port supplies its own fatal_error_handler, which attempts to print some
0310 error message through 167Bug (on the Serial Port 1/Console on the MVME712M).
0311 
0312 
0313 Host System
0314 -----------
0315 
0316 The port was initially developed on an RS-6000 running AIX 4.2. The following
0317 tools were used:
0318 
0319     - GNU gcc 2.8.1 configured for a powerpc-ibm-aix4.2.0.0 host and
0320       m68k-rtems target;
0321     - GNU binutils 2.9.1 configured for a powerpc-ibm-aix4.2.0.0 host and
0322       m68k-rtems target;
0323 
0324 It was also tested on a Pentium II-based PC running Windows NT Workstation 4.0
0325 and the Cygnus Cygwin32 release b20.1 environment, with the following tools:
0326 
0327     - EGCS 1.1.1 configured for a i586-cygwin32 host and m68k-rtems target;
0328     - GNU binutils 2.9.4 configured for a i586-cygwin32 host and m68k-rtems
0329       target;
0330 
0331 With the latter environment, be patient; builds take a very looong time...
0332 
0333 Current development is done on a Pentium III PC running RedHat Linux 6.1.
0334 At the time this README was composed, the latest working compiler that was
0335 used successfully was gcc version 2.96 20000213 (experimental). Both the C
0336 and C++ compilers were working. Binutils 2.10 are used.
0337 
0338 
0339 Known Problems
0340 --------------
0341 
0342 Polled I/O without termios may not work very well on input. The problem
0343 is that input processing is not done: applications may get characters too
0344 early, and may get characters that they normally would not get, such as
0345 backspace or delete. Furthermore, input is not buffered at all. The latest
0346 versions of rtems seem to set the count field in the rtems_libio_rw_args_t
0347 argument to the buffer size, not to the number of characters expected on
0348 input. Rather than wait for 1024 characters on each call, the driver
0349 returns each character when it is received.
0350 
0351 The cdtest will not run with interrupt-driven I/O. The reason is that the
0352 constructors for the static objects are called at boot time when the
0353 interrupts are still disabled. The output buffer fills up, but never empties,
0354 and the application goes into an infinite loop waiting for buffer space. This
0355 should have been documented in the rtems/c/src/tests/PROBLEMS file. The moral
0356 of this story is: do not do I/O from the constructors or destructors of static
0357 objects.
0358 
0359 Output stops prematurely in the termios test when the console is operating in
0360 interrupt-driven mode because the serial port is re-initialized before all
0361 characters in the last raw output buffer are sent. Adding calls to tcdrain()
0362 in the test task helps, but it does not solve the problem. What happens is
0363 that the CD2401 raises a transmit interrupt when the last character in the
0364 DMA buffer is written into the transmit FIFO, not when the last character
0365 has been transmitted. When tcdrain() returns, there might be up to 16
0366 characters in the output FIFO. The call to tcsetattr() causes the serial port
0367 to re-initialize, at which point the output FIFO is cleared. We could not find
0368 a way to detect whether characters are still in the FIFO and to wait for them
0369 to be transmitted.
0370 
0371 The first raw buffer to be transmitted after the console is re-initialized
0372 with tcsetattr() is garbled. At this time, it does not seem worth while to
0373 track this problem down.
0374 
0375 In the stackchk test, an access fault exception is raised after the stack is
0376 blown. This is one case were overwritting the first or last 16 bytes of the
0377 stack does cause problems (but hey, an exception occurred, which is better
0378 than propagating the error).
0379 
0380 In the stackchk test, an access fault exception is raised after the stack is
0381 blown. This is one case were overwritting the first or last 16 bytes of the
0382 stack does cause problems (but hey, an exception occurred, which is better
0383 than propagating the error).
0384 
0385 When using interrupt-driven I/O, psx08 produces all the expected output, but
0386 it does not return control to 167Bug. Is this test supposed to work with
0387 interrupt-driven console I/O?
0388 
0389 
0390 What is new
0391 -----------
0392 
0393 Support for Java is being actively worked on.
0394 
0395 
0396 Thanks
0397 ------
0398 
0399 - to On-Line Applications Research Corporation (OAR) for developing
0400 RTEMS and making it available on a Technology Transfer basis;
0401 
0402 - to FSF and Cygnus Support for great free software;
0403 
0404 
0405 Test Configuration
0406 ------------------
0407 
0408 Board:                Motorola MVME167
0409 CPU:                  Motorola MC68040
0410 Clock Speed:          25 MHz
0411 RAM:                  4 MBytes of 32-bit DRAM with parity
0412 Cache Configuration:  Instruction cache on; data cache on, copyback mode.
0413 Times Reported in:    microseconds
0414 Timer Source:         VMEchip2 Tick Timer 1
0415 GCC Flags:            -m68040 -g -O4 -fomit-frame-pointer
0416 Console:              Operate in polled mode. Set CD2401_POLLED_IO to 1 in
0417                       rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c.     
0418 
0419 
0420 Test Results
0421 ------------
0422 
0423 Single processor tests:  All tests passed, except the following ones:
0424 
0425   - paranoia required the FPSP and the default variants of libm (and libc and
0426     libgcc) for us. It may work with the msoft-float variants for you, but it
0427     does require the FPSP.
0428   
0429   - cpuuse and malloctest did not work.
0430   
0431   - The stackchk test got an access fault exception before the RTEMS stack
0432     checker had had a chance to detect the corrupted stack.
0433                          
0434                          
0435 Multi-processort tests:  not applicable -- No MPCI layer yet.
0436 
0437 Timing tests: See `rtems/c/src/lib/libbsp/m68k/mvme167/times`