/*
Copyright (c) 2009, Intel Corp.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of Intel Corporation nor the names of its contributors
      may be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

Driver: iommap

This driver was built with:

	gcc ver 3.4.6-3
	glibc ver 2.3.4-2.22
	Linux Kernel 2.6.9-5.EL (Redhat AS 4.0 for UP, SMP and EM64T)
	Linux Kernel 2.6.9-22.EL (Redhat AS 4.0 Update 2 for UP, SMP and EM64T)	
	Linux Kernel 2.6.9-30.EL (Redhat AS 4.0 Update 3 for UP, SMP and EM64T)		
	Linux Kernel 2.6.9-39.EL (Redhat AS 4.0 Update 4 Beta for UP, SMP and EM64T)			
	Linux Kernel 2.6.5-7.244-default (SuSE 9 Patch 3 for UP, SMP and EM64T)		
	Linux Kernel 2.6.13-15-default (SuSE 10 for UP, SMP and EM64T)
	Linux Kernel 2.6.16.21-0.8 (SuSE 10 for UP, SMP and EM64T)	
	Linux Kernel 2.6.30 (Moblin)	
	Linux Kernel 3.0.13-0.27-default (SuSE 11 SP2)
			
Below Linux Distribution are no longer support by driver:
	Linux Kernel 2.4.18-14 (UP and SMP)
	Linux Kernel 2.4.20-6 (Redhat 9.0 for UP and SMP)
	Linux Kernel 2.4.21-4.EL (Redhat AS 3.0 for UP, SMP and EM64T)
	Linux Kernel 2.6.8-1.528.2.10 (Redhat AS 4.0 for UP, SMP and EM64T)
	Linux Kernel 2.4.18-14 (SuSE 8.2 for UP and SMP)
	Linux Kernel 2.4.21-99-default (SuSE 9.0 for UP and SMP)
	Linux Kernel 2.6.4-52 (SuSE 9.1 for UP, SMP and EM64T)
	Linux Kernel 2.6.8-24 (SuSE 9.2 for UP, SMP and EM64T)
	Linux Kernel 2.4.20_mvlcge31 (MontaVista 3.1 for UP, SMP and EM64T)	

1. Log in as root.

2. Verify that the kernel source codes exists in kernel directory (usually /usr/src/linux-X.X.XX-XX/,
   where the X are replaced with your current kernel version.). 
   
	2.1. If the kernel source codes do not exist, you need to install the SRPM package from the
		 ISO source CDs.
   
3. Verify that the .config file exists in kernel directory (usually /usr/src/linux-X.X.XX-XX/,
   where the X are replaced with your current kernel version.).

	3.1. To view this hidden file, use "ls -al .config" command while in 
		 the /usr/src/linux-xxx direcotry
	
	3.2. If the file does not exist, you must create a new one
		
		3.2.1.  RedHat:
		 		make oldconfig
				make dep
				Note: you could manually copy over the config file to /usr/src/linux-xxx also.
					  cp /boot/config-`uname -r` /usr/src/linux-xxx/.config

		3.2.2.	SuSE: 
				make cloneconfig
				make dep
				Note: you could manually copy over the config file to /usr/src/linux-xxx also.
					  cp /boot/config-`uname -r` /usr/src/linux-xxx/.config
					  make modules_prepare (for SuSE 9.2 or kernel 2.6.8 above)

		3.2.3   or you could use manually configure the kernel by 
				make config or
				make menuconfig or 
				make xconfig
				Note: You need to enable the "Enable Loadable Module Support" section

4. To build the driver binary follow below:
	
	4.1. Move to directory containing driver source code.
	
	4.2. Build files:
		
		4.2.1.  DEBUG version
				make -S DEBUG=1
		
		4.2.2.	RELEASE version
				make

5. To build the driver on the machine with multiple kernel version:
	
	5.1. Move to directory containing driver source code (~root/iommap in this case).
	 
	5.2. Build files:

		5.2.1.  DEBUG version, replace X's with current kernel version
				make -S DEBUG=1 KERNELDIR=/usr/src/linux-X.X.XX.X 
		
		5.2.2.	--or-- RELEASE version, replace X's with current kernel version
				make -S KERNELDIR=/usr/src/linux-X.X.XX.X


6. To install on the current machine (installs driver configuration files and services 
   to run level 3 & 5 for RedHat and SuSE, and to the default run level for Gentoo), 
   move to driver binary directory (~root/iommap on this system) and run:

	make install

7. To create SRPM source and RPM binary files (RedHat/SuSE) or a binary tar package file (gentoo), 
   move to driver binary directory (~root/iommap on this system) and run:
	
	make dist

8. To create a default configuration file, move to driver binary directory 
   (~root/iommap on this system) and run:
	
	make conf

9. At any point, to clean up the release compiled file, move to driver binary 
   directory (~root/iommap on this system) and run:

	make clean

10.At any point, to read the build manual or build option, move to driver binary 
   directory (~root/iommap on this system) and run:

	make help

The files to be released are:

	/lib/modules/`uname -r`/iMTA/iommap/2.06.1.0523/iommap.ko (ELF binary for Linux Kernel 2.6)
	/lib/modules/`uname -r`/iMTA/iommap/2.06.1.0523/iommap.txt (help file)
	/lib/modules/`uname -r`/iMTA/iommap/iommap.ko (softlink to driver ELF binary for 2.06.1.0523)
	/lib/modules/`uname -r`/iMTA/iommap/iommap.txt (softlink to driver help for 2.06.1.0523)
	/etc/init.d/iommapd (service file)
	/etc/iommapd.conf (configuration file)
	iommap_load (installation file for Gentoo)
	iommap-<ver>-<release>.<platform>.rpm (rpm binary file for RedHat and SuSE)
	iommap-<ver>-<release>.src.rpm (rpm source file for RedHat and SuSE)
	iommap-<ver>-src.tar.gz (tar source files for RedHat and SuSE)	
	iommap-<ver>-bin.tar.gz (tar file for Gentoo)
	
The files to be removed are:	
	/usr/bin/iommap.o (ELF binary for Linux Kernel 2.4)
	/usr/bin/iommap.ko (ELF binary for Linux Kernel 2.6)	
	/usr/bin/iommap.txt (help binary)

This module can also be built from VS 7.0 using the iommap.2005.vcproj file.
