Skip to content

ARMV7: OMAP: I2C driver: Restructure code to eliminate udelay calls and improve performance

Heiko Schocher u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest0 of 4 patches 0 repliesNew

Patches in v2 No applies recorded yet

None of the 4 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [U-Boot] [PATCH v2 0/4] ARMV7: OMAP: I2C driver: Restructure code to eliminate udelay calls and improve performance

Hello Steve,

Quoted 31 lines · Steve Sakoman

I've been preparing a patch series for Beagle and Overo that detects expansion board configuration information by reading a 128 byte I2C EEPROM on each expansion board.

Using the OMAP I2C driver in its current form takes about 5-6 seconds to read this small number of bytes! Executing the i2c probe command takes close to 10 seconds.

Examining the code I see that there are a large number of fairly long udelay calls throughout the driver (10 - 50 milliseconds). I looked through the linux driver and did not see equivalent delays in that code. In fact the longest delay in the linux code was one millisecond.

In looking at the TRM I2C section for OMAP3 and OMAP4 I don't see any requirement for delays in the programming model description.

This patch restructures the i2c driver to eliminate most of the udelay calls by monitoring state changes in the status register.

The EEPROM reads and the i2c probe execution are now instantaneous.

This patch series was tested on OMAP3 (Overo) and OMAP4 (Panda). I do not have access to OMAP2 hardware for testing.

Steve Sakoman (4):
ARMV7: OMAP: I2C driver: Use same timeout value as linux kernel
driver
ARMV7: OMAP: I2C driver: Restructure i2c_read_byte function
ARMV7: OMAP: I2C driver: Restructure i2c_write_byte function
ARMV7: OMAP: I2C driver: Restructure i2c_probe function

Quoted 2 lines
 drivers/i2c/omap24xx_i2c.c |  204 ++++++++++++++++++++++++-------------------
 1 files changed, 114 insertions(+), 90 deletions(-)

Applied v2 to u-boot-i2c.git master

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany