[i2c] [PATCH] Is review of AT91 patch pending?

Ronny Nilsson rln-i2c at arbetsmyra.dyndns.org
Fri Oct 12 16:41:19 CEST 2007


Hi
Here's an update of my AT91 bus driver with IRQ support. Previously 
the best speed it could handle was in the range of 30-50 kHz, any 
higher and transfer errors began occurring. This has however changed. 
The attached patch can handle 400 kHz, even on a loaded system!

The patch size ha grown considerably, modifying ten files because 
achieving this kind of speed with the Atmel TWI controller require 
some dirty SW tricks... One effect of this is that the I2C throughput 
will decrease when the cpu has much to do. For example, a basic 
clockrate of 400 kHz might drop towards 100 kHz when the cpu is very 
heavily loaded. The general speed of your cpu, ram and flash will 
also have impact. Default speed is 100 kHz but it can be changed in 
runtime with /sys/devices/platform/at91_i2c/clockrate. If you change 
it, ensure to monitor the syslog for error messages from the TWI 
driver!

Disclaimer:
This patch is a hack! I mean it! It's highly experimental, ugly and 
only tested for Atmel AT91RM9200. Suggestions are most welcome for 
how to make it nicer looking. Testers are wanted too.

Regards
/Ronny Nilsson

-------------- next part --------------
 arch/arm/kernel/entry-armv.S            |    7 
 arch/arm/kernel/entry-common.S          |    6 
 arch/arm/mach-at91/at91rm9200.c         |    2 
 drivers/i2c/busses/Kconfig              |   10 
 drivers/i2c/busses/i2c-at91.c           |  441 +++++++++++++++++++++++++-------
 include/asm-arm/arch-at91/at91_twi.h    |   38 ++
 include/asm-arm/arch-at91/entry-macro.S |   12 
 include/asm-arm/arch-at91/system.h      |    4 
 include/asm-arm/assembler.h             |   33 ++
 include/asm-arm/irqflags.h              |   74 +++++
 10 files changed, 537 insertions(+), 90 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-2.6.23-rc9-at91-i2c-irq-support.patch
Type: text/x-diff
Size: 27517 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20071012/cceb1d3c/attachment-0001.bin 


More information about the i2c mailing list