2.6.33中关于at91sam9260的i2c controller驱动的问题

16 篇文章 0 订阅

在为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的驱动,是有问题,在接收时会超时。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值