Linux and RTAI on ARM Processors
================================


Maintainers
-----------

The ARM-port of RTAI is maintained by

  Thomas Gleixner, autronix automation (gleixner@autronix.de) 
  Guennadi Liakhovetski, DSA GmbH (gl@dsa-ac.de)
  Wolfgang Müller, DSA GmbH (wolfgang.mueller@dsa-ac.de)
  Alex Züpke, SYSGO RTS GmbH (azu@sysgo.de)

The base port was started by Alexander Züpke (azu@sysgo.de), SYSGO RTS
GmbH, and Wolfgang Müller (wm@dsa-ac.de), DSA Daten- und Systemtechnik
GmbH, independently, based on ideas from Paolo Mantegazza
(mantegazza@aero.polimi.it), DIAPM. Later, as Guennadi Liakhovetski
(gl@dsa-ac.de) and Thomas Gleixner, autronix automation
(gleixner@autronix.de) joined them, the two ports were merged.


Supported architectures
-----------------------

Support is limited to StrongARM SA1100/1110 and ARM7 based Cirrus Logic
CPU's (everthing that fits into arch/arm/clps711x) at the moment.

If your CPU isn't supported right yet, feel free to add the necessary code
to RTAI. See Documentation/armporting.txt for more information.


Stability 
---------

The current state is prerelease. As the port is still in the state of
improvement, there might be some points, where the functionality is not as
exspected. If it doesn't work for you, feel free to fix it, or report it to
the maintainers or on the rtai mailinglist (rtai@rtai.org).

The port is already working in industrial usage with real life
applications.  There are no known stability issues at the moment.


What do you need?
-----------------

- GCC (cross) toolchain (version 2.95.3 or 3.0.4)
- If you want to use RTAI's softfloat support, your toolchain must
  be compiled to support softfloat !
- binutils, version >= 2.11.2
- Kernel version >= 2.4.13 (ftp://ftp.kernel.org/pub/linux/kernel/v2.4/)
- RMK patch for this kernel (http://www.arm.linux.org.uk)
- Maybe some board specific patches
- A snapshot from rtai-CVS


Bring up RTAI to life ...
-------------------------

First, extract the kernel and apply the RMK-patch and a eventually
necessary board specific patch. You should now compile your kernel to test
if it's working properly. Any oopses and lockups here are not RTAI's fault
...

If your kernel runs fine, apply the RTHAL patch. You will find it in the patches
directory of RTAI.

The patch is named patch-2.4.x-rmk-arm-rthal, because it worked fine with
2.4.13 and 2.4.16 kernels. Maybe you can apply the patch to early 2.4.x
kernels, but we didn't test them.

There is another patch for Kernel versions >= 2.4.17 named
patch-2.4.17-rmk-arm-rthal. This patch works with kernel versions >= 2.4.17

Do not apply any other patch from this directory. They are for different
cpu-families like x86 and PPC.

Next, use your favorite kernel configuration tool and enable in "General setup"
the new option "RTAI Realtime Hardware abstraction Layer".

Start compiling your patched kernel now, fetch a cup of coffee and prepare for
the following.

cd into the RTAI-directory, and type "make menuconfig". It will ask you for a
kernel-directory, enter your RTHAL-patched kernel location. It will analyse
your kernel's .config and Makefile to get the architecture (ARM, of course)
and the cross toolchain prefix.

Please disable "Enable floating point support", "SMP scheduler", "MUP
scheduler" and "Real-Time serial driver" in the menu, because we didn't
program SMP or MUP support now, rt_com is for x86-stylish hardware and most
ARM-processors usually don't have a FPU ...

Save this configuration and leave menuconfig now.

Now you should do 'make dep' and 'make'.

You will find a set of compiled modules in modules directory, copy these to
your arm filesystem. If you want to try the examples, just copy the binaries
from the examples directory to your ARM filesystem or mount your PC filesystem
via NFS.

Be careful with the examples. They have default TICK_PERIODS, which fit almost
for 400MHZ and above Pentium machines. Adjust this values before using it.
Start with 1ms or something like that. You can speed it up later.
If the TICK_PERIOD is too fast, your machine will block the standard Linux due
to realtime overload.

Install the new kernel, reboot and try to load the modules. 
1st is rtai.o
2nd is rtai_sched.o
You should see some information about rtai and scheduler on your console output.
If your system still runs, try to load one of the examples.


Missing points
--------------

- FIQ interrupts are not implemented yet
- LXRT is missing. Maybe someone will port it soon :-)
- FPU-Support is missing. 
- Multiprocessor support
- Something like rt_com support
- Exception handling is implemented only for undefined opcodes.

