This document came about to show the embedded system community how to run Linux on their VMEbus Pentium and other PCI local bus based VMEbus processor designs. The latest version is always available at <url name="Linux VME HOWTO" url="http://howto.vmelinux.org/">.
</ABSTRACT>&null;<!-- Table of contents --></TITLEPAG><TOC><!-- Beginning -->
Using Linux on an embedded VMEbus processor board is not difficult. However, more than fundamental knowledge is required. This document is not a primer on how to fully configure a Linux machine.
<ITEM> Setting up and use of the Tundra Universe PCI to VME Bridge Chip <URL NAME="Tundra Universe" URL="http://www.tundra.com/page.cfm?TREE_ID=100361">. The new VMEUtils program makes knowledge of the Universe unnecessary for those who do not wish to deal with register level Universe access.
</ITEM>
<ITEM> Compiling and installing various network packages like
<ITEM> The VMEbus Rev. D and VME64. Excellent information may be found at the <URL NAME=" VMEbus International Trade Association (VITA)" URL="http://www.vita.com/">.
</ITEM></ITEMIZE>
&psplit;If you are uncertain of how to proceed with any of the above it is STRONGLY recommended that you use the links provided to familiarize yourself with all packages. We may not reply to any mail regarding any of the above. Please direct any questions to the appropriate author of the HOWTO or consult the respective hardware manufacturer.
This document describes the installation and use of VMELinux on a Xycom XVME-655 6U VME processor board. Other brands of VME boards that use a Pentium and the Tundra Universe chip should be capable of running VMELinux. Please consult the Board Support Section of the VMELinux web site for tested boards.
Operating systems for VMEbus computers are usually Real-time Operating Systems (RTOS) which have high cost and a significant learning curve. In return the RTOS offers quick response to real world events for control of machinery or response to a process.
The VMEbus provides a rugged computer enclosure and interconnection system. Many system integrators require this ruggedness and also need very fast real-time response.
However, there are many times when there is little need for real-time response, but the software still needs:
The purpose of VMELinux is to give the VME system integrator another choice in operating systems. Rich in features, high in reliability and low in cost, Linux offers benefits to the embedded computer industry. High cost operating systems economically prohibit the use of VME in many applications. With Linux and the VMELinux drivers, the rugged VMEbus has new possibilities.
<ITEMIZE><ITEM> Maintain and improve the free VMELinux Kernel Driver software,
</ITEM>
<ITEM> Offer added value software components such as the VMEUtils program and VMEShell utilities.
</ITEM>
<ITEM> Test the software on various makes and brands of manufacturer supplied VME processor boards,
</ITEM>
<ITEM> Maintain web based documentation on each tested brand and make of boards,
</ITEM>
<ITEM> Maintain this HOWTO.
</ITEM>
<ITEM> Integrate user suggested and user supplied improvements into the virgin code so we may all benefit from the programming talents of others.
</ITEM>
<ITEM> Become the original source for all the above software so VMELinux users can be assured of original code from the authors.
</ITEM></ITEMIZE>
&psplit;</P></SECT1>
<SECT1><HEADING>Feedback
&null;</HEADING>
<P>
As VMELinux is tested in the field, we encourage comments about how well or how bad it works. Please feel free to send comments to <URL NAME="The VMELinux Project" URL="mailto:vmelinux@va.net">
As we get experience about each brand of VME CPU, we will list the different configurations in this HOWTO. For now we will describe only the Xycom board.
<item> October 16, 2001, v1.1 - Our first release with support for 2.4 and 2.2 kernels. </item>
<item> October 25, 2001 - All version numbers restructured to make more sense. What was version 1.1 is now 1.2.0. Development tree started at 1.3.0 which includes support for eight images.</item>
<item> February 11, 2002, More work done on ca91c042.c driver code available from the CVS respository.</item>
<ITEMIZE><ITEM> June, 1998, v0.8 - Created command line utilities that allow access to the VMEbus from the Linux shell prompt. These shell programs interface with the VMEUtils program.
</ITEM>
<ITEM> June 24, 1998, v0.8a - Changed the name of all the shell programs so they all begin with "vme." Current version made available on the website.
</ITEM>
<ITEM> April 2000, v 0.95 - Improved installation scripts.
A verbatim copy may be reproduced or distributed in any medium physical or electronic without permission of the author. Translations are similarly permitted without express permission if it includes a notice on who translated it. Commercial redistribution is allowed and encouraged; however please notify <URL NAME="The VMELinux Project" URL="mailto:vmelinux@va.net"> of any such distributions.
Excerpts from the document may be used without prior consent provided that the derivative work contains the verbatim copy or a pointer to a verbatim copy.
Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies.
In short, we wish to promote dissemination of this information through as many channels as possible. However, we wish to retain copyright on this HOWTO document, and would like to be notified of any plans to redistribute this HOWTO.
Once made, you should see the file "ca91c042.o" in the directory. This is a loadable module. See below for loading information. Plus, you should find several "vme..." files in the /dev directory.
This will compile the "vmeutils" program. This program directly speaks to the kernel driver. It is a reference work for those of you who wish to write your own programs to directly speak with the driver.
Copy the program "vmeutils" to your user binary directory or let the makelinks script do this for your in the next step. On our system this is "/usr/local/bin." Alternatively, you can create a link in the user bin directory to the "vmeutils" program.
Change to the "vmeshell" directory. There are no files to be compiled here. These are shell programs that use the "vmeutils" program to access the VMEbus. All the files beginning with "vme" should with have a link made or be copied to the "/usr/local/bin" directory.
Have a look in the libvme directory for a C++ example on how to communicate with the driver. You can use the libvme code as your interface to the driver for your programs if you wish. Docmentation for this is planned for the future.
The Universe driver does a good job of finding the Universe chip on a PCI bus, but differences in board design may prevent this. We tested all our routines on a Xycom XVME-655, Dynatem DPC and SBS VP7. There is little reason why this should not work on any other Intel board with a PCI bus and the Universe PCI-VME bridge chip. If you encounter problems, please let us know at the <URL NAME="The VMELinux Project Bug Reporter" URL="http://bugs.vmelinux.org/">
This program can be run as is. Once started, you will see a command prompt. Type ? And you will see a list of commands. While useful, I think you will find the VMEShell scripts a better way to go. They do use this program to speak with the kernel driver so it is necessary to have this program available in the current PATH.
The source code for "vmeutils" is also instruction on how to speak directly to the kernel driver. For those of you who wish to create programs that directly speak with the driver, these source files are good examples.
The VMEShell programs are unix shell scripts. They offer the operator a simple way to access the data on a VMEbus. Using these commands creates temporary files in the user's working directory which store information on the last access you did. This is nice because it will be possible to log off the machine, log back in and proceed from where you left off without having to re-enter VMEbus information again. Plus, these files are stored in the current working directory, so you can have different VME access configuration just by setting up different directories for each VME board of interest.
Assuming you placed the shell programs and the "vmeutils" program in the /usr/local/bin directory, you should be able to log in as a regular user and run them. What follows assumes exactly this.
This is where you tell VMELinux how you want to access the VMEbus. We assume you already know about the VMEbus' many modes of operation, but here is a short list to help you.
<ITEMIZE><ITEM> <BF>address</BF> is the actual VMEbus address you wish to see. This should be set to the lower most value of the address range of interest.
</ITEM>
<ITEM> <BF>count</BF> is the number of bytes you consider a valid range to view. This is the number of bytes starting at the address specified above.
<ITEM> <BF>space</BF> is the addressing space (mode). For those of you who do not know what we are talking about here, the VMEbus has four overlapping address spaces that can be called independent of each other. A16 is a 64 Kilobyte space. A24 is a 16 Megabyte space. A32 is a 4 Gigabyte space. There is an A64 space defined the VME specification, but the Universe does not support it.
<ITEM> <BF>Size</BF> refers to the maximum data width allowed for the VME board you are accessing. Some VMEbus board only handle 8 bit data paths. Others transfer 32 bits (four bytes) at a time. Some can handle a special VME block mode which can move 64 bits per transaction. The Universe can handle all these modes allowing you to mix inexpensive serial port boards with hugh memory arrays.
<ITEM> <BF>Type</BF> is the type of VME transaction performed. Some VME boards make a distinction between "User" access (USR) and "Supervisor" access (SUP). Also, some boards allow access to two "pages" of memory: Program (PRG) and Data. The Universe supports all modes.
<ITEMIZE><ITEM> address - The actual hexadecimal VMEbus address you wish to read. If the map command is set to access A16 VME address space, the address should be 0xABCD. If the space is A24 then use 0xABCDEF. For A32 space use 0xABCDEFGH.
</ITEM>
<ITEM> size - The number of bytes to read. This value is always the number of bytes regardless of the data word size read. For example, if you want to read 16 bytes of information and use vmerl, the display will show 16 bytes displayed as 4 long words.
</ITEM>
<ITEM> filename - The name of the file to send "read" VMEbus data to or "write" VMEbus data from.
VMELinux offers access to all the features of the Universe Chip. Especially useful is access to the DMA engine on the chip. With this feature the Universe chip transfers data on the PCI bus by becoming a PCI master. This is nice, but the real benefit comes from the VMEbus accesses. Even if the VMEbus interface is not using block mode transfers, the Universe chip can complete VMEbus transfers under 400 nanoseconds sustained. This is the direct result of the Universe taking complete control of both the PCI bus and the VMEbus. Thus, it is possible to access non block mode VMEbus peripherals much faster than older technologies.
The Universe chip offers the programmer eight VMEMaster windows to the VMEbus. These windows are called Images. The details of the registers within these windows is beyond the scope of this Howto. Please refer to the Universe documentation for details. <URL NAME="Tundra Universe" URL="http://www.tundra.com/">
</P>
<p> Version 1.1 of our tools only supported the first four images. This is because we originally designed this to work with the original Universe device. When the Universe II became available, Tundra did not update their documentation. Thanks to reports from other Universe users we are now aware of the new images, have found and downloaded the latest Universe manual from Tundra and have added these images to the 1.3.0 release.</SECT1>
The Universe chip offers the programmer four (eight for the UniverseII) VMESlave windows to the VMEbus. These windows are called Images. The details of the registers within these windows is beyond the scope of this Howto. Please refer to the Universe documentation for details. <URL NAME="Tundra Universe" URL="http://www.tundra.com/">
We originally intended to support the Universe's slave mode. We never had a need for this thus our efforts concentrated solely on using the Universe as a VME master only. So for 1.3.0 and the near future, we will not support the eight slave images.
For experienced users, this device allows direct access to the Universe chip's internal registers. Explanation of these registers and what they do is beyond the scope of this howto. Please consult the Universe documentation available from <URL NAME="Tundra Universe" URL="http://www.tundra.com/Tundra/unidex.html">
The VMEbus standard uses pin and socket connectors. This is superior to edge connections in that the connection is not exposed to humidity and other environmental conditions. It is a more expensive way of doing things, but offers longer times before failure.
A VME board is either a 3U (160 x 100 mm) or a 6U size (160 x 233.35 mm). These sizes correspond to the Eurocard standard for board modules and card cages. Eurocard is a popular format used by many different busses including CompactPCI. This popularity makes the materials needed for cage assembly inexpensive and easy to obtain.
The nature of Linux is in its user supported and freely available format. The number of people using Linux is growing. The number of people contributing to the continued development of the Linux software base is growing. It is unfair to state that Linux is a good value because it is available for little to no charge. Linux is a good value because it works.
There are those who say that Linux us an unstable operating system. It is true that the new Linux kernels in development are experimental and should not be relied on for critical applications. However, stable versions of the Linux OS are always available and provide very robust operation. VMELinux is always based on the stable versions of the kernel source; Today's stable kernels are the 2.0.X and 2.2.x series. We have received reports that the latest 2.4.x kernels appear to be solid. I would say the future is plenty bright for Linux.
Because so many people are developing Linux, you do not have to wait long for improvements, fixes or new features to become part of the Linux distribution.
<ITEMIZE><ITEM> This XyCom board is compatible with the standard VMELinux kernel driver package from <URL NAME="VMELinux Project" URL="http://www.vmelinux.org/">
<ITEM> A prepared kernel will be available soon. It will be based on the newest version of the Linux kernel and will include appropriate drivers for the on board NE2100 Ethernet interface. Check the website for details.
<ITEMIZE><ITEM> This XyCom board is compatible with the standard VMELinux kernel driver package from <URL NAME="VMELinux Project" URL="http://www.vmelinux.org/">
<ITEM> A prepared kernel will be available soon. It will be based on the newest version of the Linux kernel and will include appropriate drivers for the on board AHA2940/AIC7000 SCSI and 82558 Intel EtherExpress Ethernet peripherals. Check the website for details.
<ITEMIZE><ITEM> This board is compatible with the standard VMELinux kernel driver package from <URL NAME="VMELinux Project" URL="http://www.vmelinux.org/">
<ITEM> A prepared kernel will be available soon. It will be based on the newest version of the Linux kernel and will include appropriate drivers for the on board SCSI and Tulip Ethernet peripherals. Check the website for details.
<ITEMIZE><ITEM> This board is compatible with the standard VMELinux kernel driver package from <URL NAME="VMELinux Project" URL="http://www.vmelinux.org/">
</ITEM>
<ITEM> A prepared kernel will be available soon. It will be based on the newest version of the Linux kernel and will include appropriate drivers for PCNET Ethernet peripheral. Check the website for details.
</ITEM>
<ITEM> The VP7 has a nice feature which performs the BOOTP protocol without need of a bootrom or similar modification. However, you must ask SBS for an updated BIOS with this modification.
<ITEMIZE><ITEM> An independent engineer finds this board is compatible with the standard VMELinux kernel driver package from <URL NAME="VMELinux Project" URL="http://www.vmelinux.org/">
<P>This HOWTO emphasizes the efforts of just one particular way of accessing the VMEbus from a Linux system; Our way requires the Tundra Universe PCI/VME bridge device which will not work with many VME processor boards. Fortunately, there are several other efforts out there in various stages of development which provide the VME system integrator with options.</P>
<P>Since it is our desire to make this HOWTO reflect the efforts of the entire community of VME folks, we will be adding coverage of the other projects in future versions of this document. For the moment, we are simply going to list the other efforts in this section. Please refer to the latest documentation at <URL NAME="The VMELinux Project" URL="http://www.vmelinux.org/"> for up to date information.</P>
<ITEM>Linux for 680x0 based VME boards. Currently there are ports for Motorola boards (MVME147, MVME162, MVME166, MVME167, MVME172, MVME177), BVM boards (BVME4000 and BVME6000), and the Tadpole TP34V. <URL NAME="Web Site" URL="http://www.sleepie.demon.co.uk/linuxvme/">. Latest activity September 1, 2000.</ITEM>
<ITEM>The "other" Tundra Universe driver - Linux driver for the Tundra Semiconductor Universe PCI/VME bridge. Also known as the Hannappe driver. <URL NAME="Web Site" URL="http://lisa2.physik.uni-bonn.de/~hannappe/software/universe_doc/universe.html">.</ITEM>
<ITEM>Gabriel Paubert has been busy with yet another Tundra Universe driver. <URL NAME="FTP Site" URL="ftp://vlab1.iram.es/pub/linux-vme/">. His emphasis is having a driver that will allow writing kernel modules for specific devices in the VME cage. Emphasis includes interrupt handling and queuing DMA transfers.</ITEM>
<item>Synergy has a port for their PowerPC boards at <url name="Synergy" URL="http://www.synergymicro.com/Software/Linux.html">.</item>
<item>VMIC supports the 2.2.x and 2.4.x kernels for their boards. <url name="Linux on VMIC VME CPUs" url="http://www.vmic.com/products/embeddedpc/products/hw_sbc_linux.html">.</item>
<P>There has been some confusion about the major device number to assign VME bus devices. Originally, the VMELinux Universe driver used 70. This quickly came into conflict with the "SpellCaster Protocol" as the number became assigned by the Linux folks. I requested and received a device number of 221 for VME devices. In a perfect world, all Linux VME design efforts would have a common interface to their driver through this device. I doubt we will ever see unity on this particular aspect, however, I think we can all at least agree to use this number for our devices.</P>
<p>Up to version 1.2.0 The VMELinux driver supports the following devices:
<itemize>
<item>/dev/m0 c 221 0</item>
<item>/dev/m1 c 221 1</item>
<item>/dev/m2 c 221 2</item>
<item>/dev/m3 c 221 3</item>
<item>/dev/s0 c 221 4</item>
<item>/dev/s1 c 221 5</item>
<item>/dev/s2 c 221 6</item>
<item>/dev/s3 c 221 7</item>
<item>/dev/ctl c 221 8</item>
</itemize>
</p>
<p>As of version 1.3.0 The VMELinux driver drops support for the slave images (it never did support them) and substitutes the four additional master images offered by the Universe II:
<itemize>
<item>/dev/m0 c 221 0</item>
<item>/dev/m1 c 221 1</item>
<item>/dev/m2 c 221 2</item>
<item>/dev/m3 c 221 3</item>
<item>/dev/m4 c 221 4</item>
<item>/dev/m5 c 221 5</item>
<item>/dev/m6 c 221 6</item>
<item>/dev/m7 c 221 7</item>
<item>/dev/ctl c 221 8</item>
</itemize>
</p>
<p>The good folks responsible for organizing Linux devices suggest the following device organization:
<itemize>
<item>/dev/bus/vme/m0 c 221 0</item>
<item>/dev/bus/vme/m1 c 221 1</item>
<item>/dev/bus/vme/m2 c 221 2</item>
<item>/dev/bus/vme/m3 c 221 3</item>
<item>/dev/bus/vme/s0 c 221 4</item>
<item>/dev/bus/vme/s1 c 221 5</item>
<item>/dev/bus/vme/s2 c 221 6</item>
<item>/dev/bus/vme/s3 c 221 7</item>
<item>/dev/bus/vme/ctl c 221 8</item>
</itemize>
</p>
<p>This was established from our 1.2.0 and earlier collections and makes sense for the Universe I device. For the Universe II and the many other completely different ways to the VMEbus, it makes no sense at all. I may ask the Linux folks to further breakdown the device tree like this:
<itemize>
<item>/dev/bus/vme/ca91c142/m0..m3,s0..s4,ctl for the original Tundra Universe</item>
<item>/dev/bus/vme/ca91c042/m0..m7,s0..s7,ctl for the Tundra Universe II</item>
<item>/dev/bus/vme/motorola/680x0/whatever for the Motorola boards</item>
<item>etc.</item>
</itemize>
</p>
<p>All this is nice I suppose, but we like our devices to be /dev/vme* so our make file creates them in /dev. So far, the term "VME" has remained a unique identifier so conflicts with other devices should not occur; However, we should all remain watchful. So long as we all agree to use the major number of 221, all should be just fine. How we define the minor numbers does not need to be (and really cannot be) the same as other Linux-VME projects. However, this should not result in any conflicts in a particular installation. After all, one Linux VME system is not going to have more than one way to access the VMEbus.
</p>
<P>Refer to the <URL NAME="kernel.org web site" URL="http://www.kernel.org/pub/linux/docs/device-list/devices.txt"> for more details on this and every other assigned Linux device major number.
VMELinux and the other Linux on VME efforts offer the user a low cost way to implement a VMEbus system quickly, reliably and with all the advantages of a unix environment. We are using VMELinux in our projects. Our task list includes:
<ITEMIZE>
<ITEM>Porting to other brands of Intel VMEbus boards,</ITEM>
<ITEM>Porting of VMELinux to other processors that use the Universe chip,</ITEM>
<item>Creation of various slave board drivers for use by all VMELinux users,</item>
<ITEM>A study of running the VMELinux kernel driver module as a RT-Linux task.</ITEM>
This document outlines the steps you need to install the VMELinux Kernel Driver into the example Xycom XVME-655 Pentium VME board. It is our hope that others will attempt installation of VMELinux into other boards and let us know their success.
This method of code development works best when the users tell us of their successes and describe the equipment used. Please, please drop a note to the <URL NAME="VMELinux Mail List" URL="http://lists.va.net/mailman/listinfo/vmelinux-users"> and share your experience with others.
Send bug reports and feature requrests to the <URL NAME="VMELinux Project Bug Tracker" URL="http://bugs.vmelinux.org/">. If you have a question or an update to this document send email to <URL NAME="John" URL="mailto:jhuggins@va.net">.
Check to be sure the /dev/vme... files have their permissions set to 666. If not, the shell utilities will return a * in place of data to indicate an error condition similar to a VME bus error.
It is possible the ca91c042 Linux kernel module has been compromised. Get root access and type "lsmod" to review the loaded modules. Do you see the ca91c042? If yes, try removing it and reinstalling it with "rmmod ca91c042" and then "insmod /path/to/the/ca91c042.o" to get things up again. If it is not there check to see if you are loading the module when you boot the machine, etc.
Time to get a VMetro board into the VME cage and see if any accesses are occurring. Also look at the /proc/ca91c042 file to see if the read and write counters are incrementing.
The driver does handle interrupts, but if you compile your interrupt handler program as a Linux loadable module, that program can handle the interrupts directly. Examples of this will be available soon. It is important to note that user level program can be made to handle interrupts, but it is a much better idea to have your interrupt handlers as part of the Linux kernel via loadable modules. Yes, you can totally hose the kernel if you do something wrong, but that is the trade off between safety and performance.
RedHat 5.1 includes a new compiler. If you manually edit the Makefile in each directory to call up the new egcs compiler, things should compile. We fully intend to support RedHat 5.1 installations, but for now I suggest using 5.0 or Slackware.
Maybe. RedHat threw us, and many other kernel module driver writers, a curve ball with the move to the egcs compiler. Thankfully, the two compiler camps, GCC and egcs, have united their efforts. All this incompatibility should just go away. For the moment, however, VMELinux will only be tested with GCC 2.95.x so that is what we suggest you use for a compiler. If you type "gcc --version" at your prompt and get an "egcs..." back then we cannot say it will work for you.
&psplit;
&psplit;<!-- Ending -->
&psplit;</P>
<sect1><heading>When will your ca91c042 Tundra Universe driver support the 2.4 kernels?</heading>
<p>
Now. Download the latest tar ball from the download directory at the main site. 2.4 support was added in version vmelinux-1.2.0.
</p>
</SECT1>
<sect1><heading>Hey! The Universe II has eight master and eight slave images. You support four each. Why?</heading>
<p>
We have been at this a long time and initially created these tools for the original Universe I which according to the documentation has four images each. When boards arrived with the Universe II, we searched the Tundra web site in vain for new documentation. We were told by the board manufacturers the II works just like the original; Thus, we only worried about the original four images. Just recently some good folks pointed out our omission. We finally found the correct documentation on the web site and support the extra images as of the 1.3.0 development release.
</p>
<p>
More news! The latest CVS snapshots of the ca91c042.c and ca91c042.h files will notice which Universe version is in your system and act accordingly.
</p>
<p>
Please note, we have not yet found any good reason to spend time developing support for the eight (or four) slave images. The current tools only support the master images and this has proven adequate for every need we have come across. If you think slave support is a good thing, let us know.
</p>
<p>
The folks at VMIC have a kernel driver they say does support the slave images and is available under a BSD style license. The announcment may be found in our mail list archive <URL NAME="mail list archive" URL="http://lists.va.net/pipermail/vmelinux-devel/2002-January/000000.html"> and the correct link to there web site is <URL NAME="here" URL="http://www.vmic.com/products/embeddedpc/products/hw_sbc_linux.html">.
</p>
</sect1>
<sect1><heading>How can we contribute to your VME-LINUX working group?</heading>
<p>
All programming efforts thus far have been accomplished by Michael Wyrick. My role has been to coordinate the VMELinux Project and help define and test the resulting programs.
<p>
We have successfully placed the working code into a CVS system and are using it to track code changes. Right now only Mike and myself have write access to this. If you are seriously interested in VMELinux development and you know your way around Linux kernel programming, please join us by joining the developers mailing list and creating an account on our bug tracking system located <URL NAME="here" URL="http://bugs.vmelinux.org/">.
<p>
If you cannot develop code, please consider keeping us informed about any bugs you see or features we should add. You can send mail to the user or developer mail lists, but contributing your comments to the bug tracking system is much more useful. Just visit <URL NAME="VMELinux Project Bug Tracking System" URL="http://bugs.vmelinux.org/">, create an account, submit your report and we will address it as soon as we can.