Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: AT91SAM9G20: TWI + Linux
PostPosted: Sun Feb 07, 2010 1:00 pm 
Offline

Joined: Fri Aug 21, 2009 5:41 am
Posts: 2
Hi,

I would like to take advantages of the hardware TWI (I2C) functionality, which is available on the AT91SAM9G20. Therefore, I would like to write a Linux kernel module for it.

However, when reading the documentation in the Linux kernel source tree regarding TWI (Linux kernel 2.6.30.9), I see some "worrying" comments.

To start with, in the file /linux-2.6.30.9/drivers/i2c/busses/Kconfig, I read the following:

Quote:
config I2C_AT91
tristate "Atmel AT91 I2C Two-Wire interface (TWI)"
depends on ARCH_AT91 && EXPERIMENTAL && BROKEN
help
This supports the use of the I2C interface on Atmel AT91
processors.

This driver is BROKEN because the controller which it uses
will easily trigger RX overrun and TX underrun errors. Using
low I2C clock rates may partially work around those issues
on some systems. Another serious problem is that there is no
documented way to issue repeated START conditions, as needed
to support combined I2C messages. Use the i2c-gpio driver
unless your system can cope with those limitations.


Next, when looking into the file /linux-2.6.30.9/arch/arm/mach-at91/at91sam9260_devices.c, I see the following comment:

Quote:
/*
* Prefer the GPIO code since the TWI controller isn't robust
* (gets overruns and underruns under load) and can only issue
* repeated STARTs in one scenario (the driver doesn't yet handle them).
*/


Before I start to put some effort in that new driver, I would like to know if the above mentioned shortcomings are still valid.

Does anyone has any idea? If the shortcomings are still in place, are there ways to work around it (still using the HW TWI functionality available and not switching to a kind of bit-banging sSW TWI/I2C)?

Best rgds,

--Geert


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20: TWI + Linux
PostPosted: Fri Feb 12, 2010 7:11 pm 
Offline

Joined: Tue Nov 24, 2009 4:04 am
Posts: 4
I am also very interested in doing the same. I wouldn't mind not having the capability for repeated start conditions if that's a sacrifice necessary to use the hardware TWI. The AT91 kernel claims its fully supported (since .20 if I recall correctly), so I would imagine that it should work in some form, but I have searched pretty hard for a solid example of someone using it and turned up empty handed.

edit: I dug up this thread from the arm-linux-kernel mailing list. The response seems to indicate that the sam9g20 driver should work, but there doesn't appear to be one in the mainline kernel. It seems odd that there exists a file for the sam9g20-ek board, but none for the sam9g20 chip itself...seems kind of lazy, just to keep using the sam9620 drivers (and also defeats the purpose of using the updated chip?).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: