Re: [PATCH] i2c: davinci: Increase module clock frequency

2015-11-19 Thread santosh shilimkar

On 11/19/2015 4:21 AM, Alexander Sverdlin wrote:

I2C controller used in Keystone SoC has an undocumented peculiarity which
results in SDA-SCL margins being dependent on module clock. Driving high
capacity bus near its limits can result in STOP condition sometimes being
understood as REPEATED-START by slaves (or NACK instead of ACK, etc...).
Driving the module with higher clocks increases the margin between SDA and SCL
transitions, making the operations with higher bus rates more robust. Therefore,
target the module clock to 12MHz instead of 7MHz, still staying within
the specification limits.

Before the change STOP timing looked like this on 400kHz:

SDA   --+  +
  \/
   \  /
++
(1)
SCL   --+  +
  \/
   \  /
++
(2)

While only point (1) signals STOP, point (2) could be incorrectly recognized as
repeated-START (almost no margin between SDA and SCL transitions).

After the change there is at least 600ns margin measured between SCL fall and
SDA fall during STOP generation:

SDA   --+  +
  \/
   \  /
++

SCL   --+  +
  \/
   \  /
++
->||<- 600ns
 ->|   |<- tSUSTO

So called tSUSTO (setup time for STOP condition) is still slightly higher than
600ns, so no problem here.

Signed-off-by: Alexander Sverdlin 
---

Nice text artwork.
Acked-by: Santosh Shilimkar 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: davinci: Increase module clock frequency

2015-11-30 Thread Wolfram Sang
>   /* get minimum of 7 MHz clock, but max of 12 MHz */
> - psc = (input_clock / 700) - 1;
> + psc = (input_clock / 1200) - 1;

Doesn't make this the above comment invalid?



signature.asc
Description: Digital signature


Re: [PATCH] i2c: davinci: Increase module clock frequency

2015-11-30 Thread Alexander Sverdlin
Hi!

On 30.11.2015 14:55, EXT Wolfram Sang wrote:
>>  /* get minimum of 7 MHz clock, but max of 12 MHz */
>> > -  psc = (input_clock / 700) - 1;
>> > +  psc = (input_clock / 1200) - 1;
> Doesn't make this the above comment invalid?

The comment refers to datasheet, not really to the code. And eventual changes 
to the datasheet
that's what can make it invalid (though I don't know TI's plans on it). 
Nevertheless, yes, I
think, it's better to drop the comment. Should I re-spin the patch with comment 
removal in it? 

-- 
Best regards,
Alexander Sverdlin.
Sent from my pdp-11
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: davinci: Increase module clock frequency

2015-11-30 Thread Wolfram Sang
> The comment refers to datasheet, not really to the code. And eventual changes 
> to the datasheet
> that's what can make it invalid (though I don't know TI's plans on it). 
> Nevertheless, yes, I
> think, it's better to drop the comment. Should I re-spin the patch with 
> comment removal in it? 

Thanks. Even better would be replacing the comment: can you give a short
explanation why there is now 12MHz and what needs to be considered if
the value is to be changed again?



signature.asc
Description: Digital signature