[PATCH] at91sam9g45: fix i2c bus speed

STALE5804d

4 messages, 3 authors, 2010-09-22 · open the first message on its own page

[PATCH] at91sam9g45: fix i2c bus speed

From: jacmet@sunsite.dk (Peter Korsgaard)
Date: 2010-09-22 11:08:29

quoted
quoted
quoted
quoted
"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD [off-list ref] writes:
Hi,

 >> Use a correct udelay value to get bus speed around 100KHz. The udelay
 >> value was most likely copied from the older devices, but the 9g45
 >> is signicantly faster (400MHz, DDR, ..), so a udelay of 2 gives a
 >> bus speed of around 190KHz, which is too fast for some devices.
 >> A udelay value of 5 gives a bus speed of around 90KHz here.
 >> 
 >> Signed-off-by: Peter Korsgaard [off-list ref]

 Jean-Christophe> in this case it will be better to overwite it at board
 Jean-Christophe> than force it for all of them

You don't expect most 9g45 users will run at 400MHz? It seems pretty
likely to me. In any case, a safe (but somewhat slow) default seems
better than a potentially unsafe one.

Now, I agree that it would be nice to add an interface to tweak this
delay if needed (extra argument to at91_add_device_i2c()?), but that's
next to the discussion about what the default should be.

-- 
Bye, Peter Korsgaard

[PATCH] at91sam9g45: fix i2c bus speed

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2010-09-22 14:34:06

On 13:08 Wed 22 Sep     , Peter Korsgaard wrote:
quoted
quoted
quoted
quoted
quoted
"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD [off-list ref] writes:
Hi,

 >> Use a correct udelay value to get bus speed around 100KHz. The udelay
 >> value was most likely copied from the older devices, but the 9g45
 >> is signicantly faster (400MHz, DDR, ..), so a udelay of 2 gives a
 >> bus speed of around 190KHz, which is too fast for some devices.
 >> A udelay value of 5 gives a bus speed of around 90KHz here.
 >> 
 >> Signed-off-by: Peter Korsgaard [off-list ref]

 Jean-Christophe> in this case it will be better to overwite it at board
 Jean-Christophe> than force it for all of them

You don't expect most 9g45 users will run at 400MHz? It seems pretty
likely to me. In any case, a safe (but somewhat slow) default seems
better than a potentially unsafe one.

Now, I agree that it would be nice to add an interface to tweak this
delay if needed (extra argument to at91_add_device_i2c()?), but that's
next to the discussion about what the default should be.
I'd prefer to calculate it

so we specify which max freq we want in my mind it will be good to be as in
spi to specific per device it's max speed so we can adapt the bus freq

Best Regards,
J.

[PATCH] at91sam9g45: fix i2c bus speed

From: Wolfgang Wegner <hidden>
Date: 2010-09-22 14:54:42

Hi,

On Wed, Sep 22, 2010 at 04:34:06PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
On 13:08 Wed 22 Sep     , Peter Korsgaard wrote:
[...]
quoted
Now, I agree that it would be nice to add an interface to tweak this
delay if needed (extra argument to at91_add_device_i2c()?), but that's
next to the discussion about what the default should be.
I'd prefer to calculate it

so we specify which max freq we want in my mind it will be good to be as in
spi to specific per device it's max speed so we can adapt the bus freq
sorry in case I got you wrong, but please keep in mind that in
contrast to SPI the addressing in I2C is done via the serial data,
so the bus speed has to be _permanently_ adapted to match the
slowest device present.

Regards,
Wolfgang

[PATCH] at91sam9g45: fix i2c bus speed

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2010-09-22 16:09:04

On 16:54 Wed 22 Sep     , Wolfgang Wegner wrote:
Hi,

On Wed, Sep 22, 2010 at 04:34:06PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 13:08 Wed 22 Sep     , Peter Korsgaard wrote:
[...]
quoted
quoted
Now, I agree that it would be nice to add an interface to tweak this
delay if needed (extra argument to at91_add_device_i2c()?), but that's
next to the discussion about what the default should be.
I'd prefer to calculate it

so we specify which max freq we want in my mind it will be good to be as in
spi to specific per device it's max speed so we can adapt the bus freq
sorry in case I got you wrong, but please keep in mind that in
contrast to SPI the addressing in I2C is done via the serial data,
so the bus speed has to be _permanently_ adapted to match the
slowest device present.
yeah that's the idea but each i2c device specify it's speed then we put the
bus speed at the lowest

Best Regards,
J.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help