在为at91sam9260移植2.6.33内核的I2C时,直接用driver/bus/i2c-at91.c这个iic的adapter驱动是不能用的,而且在makemenuconfig时,在devicedriver/i2c菜单下是看不到它的选项的。这是为什么呢?

可以通过看driver/i2c/buses/Kconfig看到,对于I2C_AT91项选的依赖多了一个BROKEN这个选项,如下:

280 config I2C_AT91

281         tristate"Atmel AT91 I2C Two-Wire interface (TWI)"

282         depends onARCH_AT91 && EXPERIMENTAL&&BROKEN

283         help

284           Thissupports the use of the I2C interface on Atmel AT91

285          processors.

286

287           Thisdriver is BROKEN because the controller which it uses

288           willeasily trigger RX overrun and TX underrun errors.  Using

289           low I2Cclock rates may partially work around those issues

290           on somesystems.  Another serious problem is thatthere is no

291          documented way to issue repeated START conditions, as needed

292           tosupport combined I2C messages.  Use thei2c-gpio driver

293           unlessyour system can cope with those limitations.

而这个broken是在init/Kconfig下定义的,如下:

57 config BROKEN

58         bool

59

60 config BROKEN_ON_SMP

61         bool

62         depends onBROKEN || !SMP

63         default y
在这里broken是一个bool值,同时它没有一个显示的菜单名,所以在makemenuconfig时,我们是看不到它的选项的,所以它也就没有打开,一直为n。

这就说明,在2.6.33中at91sam9260的i2c的驱动i2c-at91.c是不能用的,同时可以通过I2C_AT91下的comments也可以看到:

This driver is BROKEN because the controller which it uses willeasily trigger RX overrun and TX underrun errors.  Using  lowI2C clock rates may partially work around those issues on some systems.  Another serious problem is that there is no  documented way to issue repeated STARTconditions, as needed  to supportcombined I2C messages.  Use the i2c-gpiodriver  unless your system can cope withthose limitations.

此驱动程序被破坏,因为它使用的控制器很容易会触发溢出RX和TX欠载错误。在某些系统上,使用低 时钟速率可能部分地解决这些问题。另一个严重的问题是,有没有记录的方式发出重复的起始条件,需要支持结合I2C消息。请使用I2C-GPIO驱动程序,除非您的系统可以应付这些限制。

所以我们在2.6.33的内核中,对于at91sam9260的i2c  controller的驱动我们用i2c-gpio.c,用gpio来模拟。

364 config I2C_GPIO

365         tristate "GPIO-based bitbangingI2C"

366         depends on GENERIC_GPIO

367         select I2C_ALGOBIT

368         help

369           This is a very simple bitbanging I2Cdriver utilizing the

370           arch-neutral GPIO API to control theSCL and SDA lines.

至于为什么这样,暂时不管,我用了i2c-at91.c的驱动,是有问题,在接收时会超时。

2.6.33中关于at91sam9260的i2c controller驱动的问题的更多相关文章

  1. linux中的i2c控制器驱动应该做些什么?

    答:完成读写功能即可,不要涉及任何针对从设备的特殊操作,这样就可以避免与从设备的代码产生冗余,linux中的i2c控制器驱动就做的特别棒,做好最简单的读写,然后其它的从设备驱动就是直接调用这些最简单的 ...

  2. Linux i2c子系统(一) _动手写一个i2c设备驱动

    i2c总线是一种十分常见的板级总线,本文以linux3.14.0为参考, 讨论Linux中的i2c驱动模型并利用这个模型写一个mpu6050的驱动, 最后在应用层将mpu6050中的原始数据读取出来 ...

  3. i2c总线驱动,总线设备(适配器),从设备,从设备驱动的注册以及匹配

    常用链接 我的随笔 我的评论 我的参与 最新评论 我的标签 随笔分类 ARM裸机(13) C(8) C++(8) GNU-ARM汇编 Linux驱动(24) Linux应用编程(5) Makefile ...

  4. Linux I2C设备驱动编写(三)-实例分析AM3359

    TI-AM3359 I2C适配器实例分析 I2C Spec简述 特性: 兼容飞利浦I2C 2.1版本规格 支持标准模式(100K bits/s)和快速模式(400K bits/s) 多路接收.发送模式 ...

  5. Linux I2C设备驱动编写(二)

    在(一)中简述了Linux I2C子系统的三个主要成员i2c_adapter.i2c_driver.i2c_client.三者的关系也在上一节进行了描述.应该已经算是对Linux I2C子系统有了初步 ...

  6. Linux I2C设备驱动编写(一)

    在Linux驱动中I2C系统中主要包含以下几个成员: I2C adapter 即I2C适配器 I2C driver 某个I2C设备的设备驱动,可以以driver理解. I2C client 某个I2C ...

  7. 【转】Linux I2C设备驱动编写(三)-实例分析AM3359

    原文网址:http://www.cnblogs.com/biglucky/p/4059586.html TI-AM3359 I2C适配器实例分析 I2C Spec简述 特性: 兼容飞利浦I2C 2.1 ...

  8. 【转】Linux I2C设备驱动编写(二)

    原文网址:http://www.cnblogs.com/biglucky/p/4059582.html 在(一)中简述了Linux I2C子系统的三个主要成员i2c_adapter.i2c_drive ...

  9. 【转】Linux I2C设备驱动编写(一)

    原文网址:http://www.cnblogs.com/biglucky/p/4059576.html 在Linux驱动中I2C系统中主要包含以下几个成员: I2C adapter 即I2C适配器 I ...

随机推荐

  1. Codeforces Round #358 (Div. 2) C. Alyona and the Tree 水题

    C. Alyona and the Tree 题目连接: http://www.codeforces.com/contest/682/problem/C Description Alyona deci ...

  2. INFORMATION_SCHEMA.COLUMNS-表的字段信息

    当前数据库中当前用户可以访问的每一个列在该视图中占一行.INFORMATION_SCHEMA.COLUMNS 视图以 sysobjects.spt_data type_info.systypes.sy ...

  3. nginx 注册为linux系统服务

    #! /bin/sh # chkconfig: - 85 15 # description: nginx is a World Wide Web server. It is used to serve ...

  4. 使用清华大学开源软件镜像AOSP的“每月更新初始化包”更新指定版本的Android源码

    参照官方教程:Tsinghua Open Source Mirror 1. 下载了repo工具 mkdir  ~/bin PATH = ~/bin:$PATH curl  https://storag ...

  5. ubuntu 13.04 编译 安装 升级 gcc 4.9.0 address sanitizer

    @ 前记: 最近查一个线上项目的crash,review代码无果,crash几率低,不可在本地环境重现.之后在线上好几个服务器跑valgrind就不crash了.个人猜测可能是跑valgrind后性能 ...

  6. warning,C4996,sprintf,deprecated,C4996,strcpy,C4996,strcat

    在vs2003, vs2005中用sprintf 会出现warning C4996: 'sprintf' was declared deprecated或warning C4996: 'strcpy' ...

  7. 利用Squid + DNSPOD 搭建CDN服务器

    首先下载squid for windows安装包 squid-2.7.STABLE5-bin.zip 然后解压缩,放到C盘squid目录内. 进入目录C:\squid\etc内,将所有文件的.defa ...

  8. JobDataMap 不能被序列化如何解决研究中

    JobDataMap被用来保存一系列的(序列化的)对象,这些对象在Job执行时可以得到.JobDataMap是Java Map接口的一个实现,而且还增加了一些存储和读取主类型数据的便捷方法. 如果使用 ...

  9. 使用msm配置分布式tomat,实现session共享

    一,环境说明 操作系统是Windows7家庭版(有点不专业哦,呵呵!),JDK是1.6的版本, Tomcat是apache-tomcat-6.0.35-windows-x86,下载链接:http:// ...

  10. LDAP Error Codes

    Error / Data Code Error Description 0 LDAP_SUCCESS Indicates the requested client operation complete ...