Readme for the Intel® IXP400 Software Linux* I2C Driver Patch
===========================================================================
Copyright
Notice
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL(R) PRODUCTS EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS. INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life-saving, life-sustaining, critical control or safety systems, or in nuclear-facility applications.
Intel may make changes to specifications and product descriptions at any time, without notice.
Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or “undefined.” Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information.
Intel processor numbers are not a measure of performance. Processor numbers differentiate features within each processor family, not across different processor families. See http://www.intel.com/products/processor_number for details.
The Intel(R) IXP400 Software may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.
This ReadMe as well as the software described in it are furnished under license and may only be used or copied in accordance with the terms of the license. The information in this manual is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Intel Corporation. Intel Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear in this document or any software that may be provided in association with this document.
Except as permitted by such license, no part of this document may be reproduced, stored in a retrieval system, or transmitted in any form or by any means without the express written consent of Intel Corporation.
Contact your local Intel
sales office or your distributor to obtain the latest specifications and before
placing your product order.
Copies of documents which
have an order number and are referenced in this document, or other Intel
literature, may be obtained by calling 1-800-548-4725, or by visiting Intel's
Web Site.
BunnyPeople, Celeron, Celeron Inside, Centrino, Centrino logo, Core Inside, FlashFile, i960, InstantIP, Intel, Intel logo, Intel386, Intel486, Intel740, IntelDX2, IntelDX4, IntelSX2, Intel Core, Intel Inside, Intel Inside logo, Intel Leap ahead, Intel Leap ahead logo, Intel NetBurst, Intel NetMerge, Intel NetStructure, Intel SingleDriver, Intel SpeedStep, Intel StrataFlash, Intel Viiv, Intel vPro, Intel XScale, Itanium, Itanium Inside, MCS, MMX, Oplus, OverDrive, PDCharm, Pentium, Pentium Inside, skoool, Sound Mark, The Journey Inside, VTune, Xeon, and Xeon Inside are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
*Other names and brands may
be claimed as the property of others.
February 6,
2007
<Introduction>
===========
This readme contains
instructions for installing the Linux* I2C driver for the Intel(R) IXP46X
Product Line of Network Processors
(Filename:
GPL_ixp400LinuxI2CDriver-<version>.zip).
The
GPL_ixp400LinuxI2CDriver-<version>.zip file contains the I2C adapter
module driver for Intel IXP46X network processors.
<Supported
Versions>
================
Intel(R) IXP400
Software Release v2.4
Linux kernel
2.6.16.11
<Features Supported by the Intel® IXP400 Software Linux*
I2C Driver>
===================================================
1. I2C device configuration (fast or normal mode, interrupt or poll mode, enable/disable slave response, enable/disable general call response)
2. Slave address response
3. General call response
4. Master-initiated repeated start transfer
5. Master-initiated single-byte read/write
6. Master-initiated multiple-bytes read/write
7. Statistics of master, slave, and general call transactions
8. Status register display
9. Bus scan for slave devices
<Features Not Supported by Intel® IXP400 Software Linux*
I2C Driver>
===================================================
Callbacks are not
supported as the callbacks with user space address is not allowed to be called
by the kernel.
<Notes>
======
1. This driver supports six additional features (features 1, 2, 3, 7, 8, and 9 of the above feature list) compared to the Intel® IOP3xx/IXP46X I2C driver
2. This driver is dependent upon the Intel® IXP400 Software Release Access Layer I2C component
<Files contained in
GPL_ixp400LinuxI2CDriver-<version>.zip>
===========================================
i2c-adap-ixp400.c
i2c-adap-ixp400.h
<Prerequisites>
===========
Ensure the
environment file is being sourced according to the instruction found in the
Intel(R) IXP400 Software Release Notes.
Ensure the environment is set up
for the IXP46X product line by checking the env for IX_DEVICE=ixp46X.
<Instructions>
==========
Steps to compile the
i2c-adap-ixp400.c:
1. Copy the i2c-adap-ixp400.c and i2c-adap-ixp400.h to the LSP's drivers/i2c/busses folder.
Example: $ cp i2c-adap-ixp400.c <LSP>/drivers/i2c/busses
$ cp i2c-adap-ixp400.h <LSP>/drivers/i2c/busseswhere <LSP> denotes the directory in which the LSP is installed.
2. Modify the <LSP>/drivers/i2c/busses/Kconfig: Add the following after the entry before "endmenu" for 'Intel XScale IOP3xx/IXP46X on-chip I2C interface':config I2C_IXP46X
tristate "Intel XScale IXP46X on-chip CSR I2C interface"
requires m
depends on I2C3. Modify the <LSP>/drivers/i2c/busses/Makefile:
a) Find "obj-$(CONFIG_I2C_IXP4XX) += i2c-ixp4xx.o" and add below it:
obj-$(CONFIG_I2C_IXP46X) += i2c-adap-ixp400.o
b) Add the following to the end of the Makefile:
OSAL_SRCDIR := $(IX_XSCALE_SW)/../ixp_osal
include ${OSAL_SRCDIR}/platforms/ixp46X/os/linux/make/OsalConfig.mkCFLAGS_i2c-adap-ixp400.o = -DWall -D__ixp46X -I$(IX_XSCALE_SW)/src/include/ \
$(OSAL_INCLUDES) $(OSAL_CFLAGS)4. Enable the I2C adapter as a module and compile
Example: $ make ${IX_KBUILD_CROSSCOMPILE} menuconfig
go to -> Device Drivers -> I2C support -> I2C Hardware Bus Support
Set 'Intel XScale IXP46X on-chip CSR I2C interface' to <M> (module)$ make ${IX_KBUILD_CROSSCOMPILE} modules
5. The compilation will produce an object - i2c-adap-ixp400.ko
6. i2c-adap-ixp400.ko can be loaded only after the I2C algorithm module is loaded into the kernel.Example: $ insmod ixp400.ko OR $ insmod ixp400_i2c.ko
$ insmod i2c-adap-ixp400.ko
<Instructions on
Usage>
==================
1. The I2C device file must be opened by the application in order to access the I2C device from the user space. The presence of I2C device file in the system depends on the setup. It will be automatically created in system with udev daemon running or with devfs enabled, while the rest require mknod. The minor number of IXP4XX I2C device also varies from system to system. The minor number is determined by the kernel and depends on the number of I2C bus device drivers registered to the kernel. If you have one existing I2C bus driver registered to the kernel, then the minor number assigned to IXP4XX I2C driver is 1, and 0 if no other I2C bus drivers are present. The common names used are either /dev/i2c-<minor number> or /dev/i2c/<minor number>.
2. The list of commands for the I2C driver is available in i2c-adap-ixp400.hExample: ioctl(i2cFd, I2C_DRV_INIT, &initI2cVarsSelected)
ioctl(i2cFd, I2C_DRV_STATS_GET, &i2cStats)3. The read and write commands will perform master read and write
Example: read(i2cFd, &i2cBuffer, 4)
write(i2cFd, &i2cBuffer, 4)4. To set the slave to be accessed, use the standard I2C ioctl command of I2C_SLAVE.
Example: ioctl(i2cFd, I2C_SLAVE, SLAVE_DEVICE_ADDR)