URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [m68k/] [mvme167/] [README] - Rev 1765
Compare with Previous | Blame | View Log
## README,v 1.6 2000/08/11 19:26:31 joel Exp#This is a README file for the MVME167 port of RTEMS 4.5.0.Please send any comments, improvements, or bug reports to:Charles-Antoine Gauthiercharles.gauthier@nrc.caorDarlene StewartDarlene.Stewart@nrc.caSoftware Engineering GroupInstitute for Information TechnologyNational Research Council of CanadaOttawa, ON, K1A 0R6CanadaDisclaimer----------The National Research Council of Canada is distributing this RTEMSboard support package for the Motorola MVME167 as free software; youcan redistribute it and/or modify it under terms of the GNU GeneralPublic License as published by the Free Software Foundation; eitherversion 2, or (at your option) any later version. This software isdistributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licensefor more details. You should have received a copy of the GNU GeneralPublic License along with RTEMS; see file COPYING. If not, write tothe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.Under no circumstances will the National Research Council of Canadanor Her Majesty the Queen in right of Canada assume any liablilityfor the use this software, nor any responsibility for its quality orits support.Installation------------Nothing unique to the MVME167. It uses the standard build process form68k targets. You will need to edit linkcmds to put in the start addressof your board. We do TFTP transfers to our target. The mvme167.cfg filebuilds only the ELF images, which we download to the target, skippingover the first 0x54 bytes; Motorola S-records are not generated. Editthis file if you want S-records.Port DescriptionConsole driver---------------This BSP includes an termios-capable interrupt-driven I/O console driverthat supports all four serial ports on the MVME167 model. The port labelledSerial Port 1/Console on the MVME712 is normally used by 167Bug; do not open/dev/tty00 if you are debugging using 167Bug.Limited support is provided for polled terminal I/O. This is used whenrunning the timing tests, and by the printk() debug output function.Polled I/O may use termios, or it may bypass those services. The printk()function does not use termios. When polled I/O is used, the terminal settingsmust be set through 167-Bug; trying to change the line settings through RTEMShas no effect.Three is no support for using interrupt-driven I/O without termios support.The default configuration is to use polled I/O and to bypass termios. Thisis done so the test can be built at the same time as the rest of the system.It is highly recommended that the defaults be changed in the mvme167.cfg fileto reflect the desired defaults, or that the appropriate parameters be set upin NVRAM to select the appropriate I/O modes at boot time.When configured for interrupt-driven I/O, the console is initialized withwhatever parameters are set up in termios before it calls the firtOpen drivercallback, EXCEPT THAT HARDWARE HANDSHAKING IS TURNED OFF, i.e. CLOCAL is setin the struct termios c_cflag field. We use 3-wire cables for I/O, and findhardware handshaking a pain. If you enable hardware handshaking, you must driveCTS* low on the CD2401 for output to occur. If the port is in the DTEconfiguration, you must drive the RS-232 CTS line to space; if the port isin the DCE configuration, you must drive the RS-232 RTS line to space.To use interrupt-driven I/O, set the CD2401_IO_MODE manifest constant to 1 inrtems/make/custom/mvme167.cfg, or configure the appropriate parameter inUser Area Non-volatile RAM. See the Configuration Parameters section belowfor instructions on setting up NVRAM.To use termios, set the CD2401_USE_TERMIOS manifest constant to 1 inrtems/make/custom/mvme167.cfg, or configure the appropriate parameter inUser Area Non-volatile RAM. See the Configuration Parameters sectionbelow for instructions on setting up NVRAM.The RTEMS console, i.e. the port used by stdin, stdout and stderr (do notconfuse it with the port labelled Console on the MVME712), must bespecified in the rtems/make/custom/mvme167.cfg file, or in the NVRAMparameters. Set the value of CONSOLE_MINOR appropriately. See below for alist of choices. See the Configuration Parameters section below forinstructions on setting up NVRAM.The RTEMS printk port, i.e. the port where printk sends it debugging outputtext, must be specified in the rtems/make/custom/mvme167.cfg file, or in theNVRAM parameters. Set the value of PRINTK_MINOR appropriately. See below for alist of choices. See the Configuration Parameters section below forinstructions on setting up NVRAM.Interrupt-driven and polled I/O cannot be mixed in the MVME167, except thatprintk always used polled I/O without termios. If interrupt-driven I/O isused and printk is used, do not open the device that printk uses from anRTEMS application.Console and printk port choices:0 - /dev/tty0, Serial Port 1/Console on the MVME712M.1 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.2 - /dev/tty2, Serial Port 3 on the MVME712M.3 - /dev/tty3, Serial Port 4 on the MVME712M.Setting the RTEMS console to port 0 when interrupt-driven I/O is specifiedwill prevent 167-Bug from using that port.To use polled I/O on port 2 or 3, the port must be configured in 167-Bug. Seethe "PF" command in the "Debugging Package for Motorola 68K CISC CPUs User'sManual", part number 68KBUG.Floating-point--------------The MC68040 has a built-in FPU. This FPU does not implement all theinstruction of the MC68881/MC68882 floating-point coprocessors inhardware. The -m68040 compilation options instructs gcc to not generatethe missing instructions. All of the RTEMS code is built this way. Someof the missing functionality must be supplied by external libraries. Therequired functions are part of libgcc.a.The issue gets complicated because libc, libm and libgcc do not come asm68040-specific variants. The default variants of these libraries are for theMC68020 and MC68030. There are specific variants for the MC68000 (which haslimited addressing modes with respect to later family members), and specificvariants for systems without a floating-point unit, either a built-in FPU ora coprocessor. These latter variants will be referred to as the msoft-floatvariants. There is a msoft-float variant for the MC68000, and one for theother family members.The default variants of libc, libm and libgcc appear to work just fine for theMC68040, AS LONG AS NO FLOATING POINT FUNCTIONS ARE CALLED. In particular,printf() and scanf() raise unimplemented floating-point instruction exceptionsat run time. Expect almost every function that must compute a floating-pointresult to also raise unimplemented floating-point instruction exceptions. Donot use these variants if your application does any floating-point operations,unless you use the Motorola FPSP package (described further down).The msoft-float variants do print out floating-point numbers properly, but wehave not tested them extensively, so use them with caution. In particular,the Paranoia test fails when linked with the msoft-float variants of thelibraries; it goes into an infinite loop after milestone 40.MSOFT_FLOAT VARIANTS MUST BE USED TOGETHER. If you use the msoft-float variantof libc and libm, you must also linked with the msoft-float variant of libgcc,otherwise calls such as printf() print out floating-point values incorrectly.RTEMS comes with the Motorola FPSP (Floating-Point Support Package) for theMC68040 (rtems/c/src/lib/libcp/m68k/m68040/fpsp). This package emulates themissing floating-point instructions. It is built automatically for theMVME167 and installed in bsp_start().The FPSP allows the use of the default variants of libc, libm and libgcc.It also runs the paranoia test properly, and prints out the correct results.It should probably be used in preference to the msoft-float libraries, as itappears to work better. The disadvantage of the FPSP is that it increases thesize of the executable by about 60KB and that it relies on run timeexceptions.If your application does not do any floating-point operations at all, youshould consider disabling the FPSP. In bsp_start(), emove the call toM68KFPSPInstallExceptionHandlers(), and uncomment the three lines inmvme167.cfg that redefine which variants of libc, libm and libgcc to linkagainst.Configuration Parameters------------------------If Jumper J1-4 is installed, certain configuration parameters may be read fromthe first 31 bytes of User Area NVRAM starting at 0xFFFC0000. In this case, theremaining J1-[5-7] jumpers are ignored, and the user is responsible for writingthe appropriate values in NVRAM (via 167-Bug) in order to alter the defaultbehaviour. A zero value in NVRAM results in the default behaviour. The paramatersthat are configurable and their default settings are described below.Cache Mode (0xFFFC0000 - 1 byte)Set the following bits in the byte to set the desired cache mode:bit 00 - data cache disable1 - data cache enablebit 10 - instruction cache disable1 - instruction cache enablebits 2 & 3:00 = cachable, write-through01 = cachable, copyback10 = noncachable, serialized11 = noncachableConsole driver I/O mode (0xFFFC0001 - 1 byte)Set the following bits in the byte to set the desired I/O mode:bit 00 - do not use termios1 - use termiosbit 10 - polled I/O1 - interrupt-driven I/OConsole driver ports (0xFFFC0002 - 1 byte)Set the following bits in the byte to select the console and printk ports:bit 0 & 1 select the RTEMS console port00 - /dev/tty0, Serial Port 1/Console on the MVME712M.01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.10 - /dev/tty2, Serial Port 3 on the MVME712M.11 - /dev/tty3, Serial Port 4 on the MVME712M.bit 4 & 5 select the RTEMS printk port00 - /dev/tty0, Serial Port 1/Console on the MVME712M.01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.10 - /dev/tty2, Serial Port 3 on the MVME712M.11 - /dev/tty3, Serial Port 4 on the MVME712M.If the printk port is the same as some other port that will be opened by anRTEMS application, then the driver must use polled I/O, or the printk portmust not be used.IP Address (0xFFFC0004 - 4 bytes)write the hexadecimal representation of the IP address of the board in thislocatio, e.g. 192.168.1.2 = 0xC0A80102default: obtain the IP address from an rtems_bsdnet_ifconfig structureNetmask (0xFFFC0008 - 4 bytes)write the hexadecimal representation of the netmask in this locationfor example, 255.255.255.0 = 0xFFFFFF00default: obtain the netmask from an rtems_bsdnet_ifconfig structureEthernet Address (0xFFFC000C - 6 bytes)write the Ethernet address of the board in this locationdefault: obtain the hardware address from an rtems_bsdnet_ifconfigstructureProcessor ID (0xFFFC0012 - 2 bytes)reserved for future useRMA start (0xFFFC0014 - 4 bytes)reserved for future useVMA start (0xFFFC0018 - 4 bytes)reserved for future useRamSize (0xFFFC001C - 4 bytes)reserved for future useCache Control and Memory Mapping--------------------------------If configuration is not obtained from non-volatile RAM (ie. J1-4 is off),cache control is done through the remaining J1 jumpers as follows:If Jumper J1-7 is installed, the data cache will be turned on. If JumperJ1-6 is installed, the instruction cache will be turned on. (If a jumperis off, its corresponding cache will remain disabled).If Jumper J1-5 is installed, the data cache will be placed in copybackmode. If it is removed, it will be placed in writethrough mode.Currently, block address translation is set up to map the virtual0x00000000--0x7FFFFFFF to the physical range 0x00000000--0x7FFFFFFF. Theport relies on the hardware to raise exceptions when addressingnon-existent memory. Caching is not controllable on a finer grain.Networking----------If configuration is not obtained from non-volatile RAM (ie. J1-4 is off),the networking parameters shown above must be specified in an initializedrtems_bsdnet_ifconfig struct. This structure is declared and initialized tospecify any network devices and includes entries for ip_address, ip_netmaskand hardware_address. See the Network Device Configuration section of theRTEMS Networking Supplement.When non-default (non-zero) networking paramaters are provided in NVRAM (ie.j1-4 is on), the user MUST ensure that the corresponding entries in theifconfig struct are NULL. Failing to do so is an error, because it causesthe memory allocated for the initialized struct values to be lost.Miscellaneous-------------The timer and clock drivers were patterned after the MVME162 and MVME152ports.At this time, we do not have an MPCI layer for the MVME167. We are planningto write one.This port supplies its own fatal_error_handler, which attempts to print someerror message through 167Bug (on the Serial Port 1/Console on the MVME712M).Host System-----------The port was initially developed on an RS-6000 running AIX 4.2. The followingtools were used:- GNU gcc 2.8.1 configured for a powerpc-ibm-aix4.2.0.0 host andm68k-rtems target;- GNU binutils 2.9.1 configured for a powerpc-ibm-aix4.2.0.0 host andm68k-rtems target;It was also tested on a Pentium II-based PC running Windows NT Workstation 4.0and the Cygnus Cygwin32 release b20.1 environment, with the following tools:- EGCS 1.1.1 configured for a i586-cygwin32 host and m68k-rtems target;- GNU binutils 2.9.4 configured for a i586-cygwin32 host and m68k-rtemstarget;With the latter environment, be patient; builds take a very looong time...Current development is done on a Pentium III PC running RedHat Linux 6.1.At the time this README was composed, the latest working compiler that wasused successfully was gcc version 2.96 20000213 (experimental). Both the Cand C++ compilers were working. Binutils 2.10 are used.Known Problems--------------Polled I/O without termios may not work very well on input. The problemis that input processing is not done: applications may get characters tooearly, and may get characters that they normally would not get, such asbackspace or delete. Furthermore, input is not buffered at all. The latestversions of rtems seem to set the count field in the rtems_libio_rw_args_targument to the buffer size, not to the number of characters expected oninput. Rather than wait for 1024 characters on each call, the driverreturns each character when it is received.The cdtest will not run with interrupt-driven I/O. The reason is that theconstructors for the static objects are called at boot time when theinterrupts are still disabled. The output buffer fills up, but never empties,and the application goes into an infinite loop waiting for buffer space. Thisshould have been documented in the rtems/c/src/tests/PROBLEMS file. The moralof this story is: do not do I/O from the constructors or destructors of staticobjects.Output stops prematurely in the termios test when the console is operating ininterrupt-driven mode because the serial port is re-initialized before allcharacters in the last raw output buffer are sent. Adding calls to tcdrain()in the test task helps, but it does not solve the problem. What happens isthat the CD2401 raises a transmit interrupt when the last character in theDMA buffer is written into the transmit FIFO, not when the last characterhas been transmitted. When tcdrain() returns, there might be up to 16characters in the output FIFO. The call to tcsetattr() causes the serial portto re-initialize, at which point the output FIFO is cleared. We could not finda way to detect whether characters are still in the FIFO and to wait for themto be transmitted.The first raw buffer to be transmitted after the console is re-initializedwith tcsetattr() is garbled. At this time, it does not seem worth while totrack this problem down.In the stackchk test, an access fault exception is raised after the stack isblown. This is one case were overwritting the first or last 16 bytes of thestack does cause problems (but hey, an exception occurred, which is betterthan propagating the error).In the stackchk test, an access fault exception is raised after the stack isblown. This is one case were overwritting the first or last 16 bytes of thestack does cause problems (but hey, an exception occurred, which is betterthan propagating the error).When using interrupt-driven I/O, psx08 produces all the expected output, butit does not return control to 167Bug. Is this test supposed to work withinterrupt-driven console I/O?What is new-----------Support for Java is being actively worked on.Thanks------- to On-Line Applications Research Corporation (OAR) for developingRTEMS and making it available on a Technology Transfer basis;- to FSF and Cygnus Support for great free software;Test Configuration------------------Board: Motorola MVME167CPU: Motorola MC68040Clock Speed: 25 MHzRAM: 4 MBytes of 32-bit DRAM with parityCache Configuration: Instruction cache on; data cache on, copyback mode.Times Reported in: microsecondsTimer Source: VMEchip2 Tick Timer 1GCC Flags: -m68040 -g -O4 -fomit-frame-pointerConsole: Operate in polled mode. Set CD2401_POLLED_IO to 1 inrtems/c/src/lib/libbsp/m68k/mvme167/console/console.c.Test Results------------Single processor tests: All tests passed, except the following ones:- paranoia required the FPSP and the default variants of libm (and libc andlibgcc) for us. It may work with the msoft-float variants for you, but itdoes require the FPSP.- cpuuse and malloctest did not work.- The stackchk test got an access fault exception before the RTEMS stackchecker had had a chance to detect the corrupted stack.Multi-processort tests: not applicable -- No MPCI layer yet.Timing tests: See rtems/c/src/lib/libbsp/m68k/mvme167/times
