linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* I2C bus clock on MPC85XX systems
@ 2009-12-22 15:38 Felix Radensky
  2009-12-22 16:18 ` Wolfgang Grandegger
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Radensky @ 2009-12-22 15:38 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

Almost all MPC85XX based systems have the compatible=:"fsl-i2c" in 
respective
i2c device tree nodes. This causes FSL i2c driver to use the following 
"backward
compatible" values: FSR=0x31 DFSR=0x10. This is regardless of CCB clock
frequency and i2c clock prescaler.

On my custom MPC8536 based board with 432MHz CCB clock this results in
65KHz i2c clock frequency (checked with scope). U-Boot correctly configures
the clock to 400KHz.

I've fixed the problem by modifying device tree to use different 
compatible value,
similar to what socrates board does. Is this the right approach ?

Thanks.

Felix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: I2C bus clock on MPC85XX systems
  2009-12-22 15:38 I2C bus clock on MPC85XX systems Felix Radensky
@ 2009-12-22 16:18 ` Wolfgang Grandegger
  2009-12-22 18:16   ` Felix Radensky
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Grandegger @ 2009-12-22 16:18 UTC (permalink / raw)
  To: Felix Radensky; +Cc: linuxppc-dev

Felix Radensky wrote:
> Hi,
> 
> Almost all MPC85XX based systems have the compatible=:"fsl-i2c" in
> respective
> i2c device tree nodes. This causes FSL i2c driver to use the following
> "backward
> compatible" values: FSR=0x31 DFSR=0x10. This is regardless of CCB clock
> frequency and i2c clock prescaler.
> 
> On my custom MPC8536 based board with 432MHz CCB clock this results in
> 65KHz i2c clock frequency (checked with scope). U-Boot correctly configures
> the clock to 400KHz.
> 
> I've fixed the problem by modifying device tree to use different
> compatible value,
> similar to what socrates board does. Is this the right approach ?

Are you aware of the properties described in
"Documentation/powerpc/dts-bindings/fsl/i2c.txt":

http://lxr.linux.no/#linux+v2.6.32/Documentation/powerpc/dts-bindings/fsl/i2c.txt

Wolfgang.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: I2C bus clock on MPC85XX systems
  2009-12-22 16:18 ` Wolfgang Grandegger
@ 2009-12-22 18:16   ` Felix Radensky
  2009-12-22 18:40     ` Wolfgang Grandegger
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Radensky @ 2009-12-22 18:16 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linuxppc-dev

Hi, Wolfgang

Wolfgang Grandegger wrote:
> Felix Radensky wrote:
>   
>> Hi,
>>
>> Almost all MPC85XX based systems have the compatible=:"fsl-i2c" in
>> respective
>> i2c device tree nodes. This causes FSL i2c driver to use the following
>> "backward
>> compatible" values: FSR=0x31 DFSR=0x10. This is regardless of CCB clock
>> frequency and i2c clock prescaler.
>>
>> On my custom MPC8536 based board with 432MHz CCB clock this results in
>> 65KHz i2c clock frequency (checked with scope). U-Boot correctly configures
>> the clock to 400KHz.
>>
>> I've fixed the problem by modifying device tree to use different
>> compatible value,
>> similar to what socrates board does. Is this the right approach ?
>>     
>
> Are you aware of the properties described in
> "Documentation/powerpc/dts-bindings/fsl/i2c.txt":
>
> http://lxr.linux.no/#linux+v2.6.32/Documentation/powerpc/dts-bindings/fsl/i2c.txt
>
> Wolfgang.
>
>   
Sure, I'm aware of these properties. I've used

compatible = "fsl,mpc8543-i2c", "fsl-i2c";
clock-frequency = <400000>;

for my custom board.

I think, however, that device trees for FSL reference designs should use 
them as well, to avoid setting i2c
clock to some strange values. I may be wrong, but I think most custom 
board developers borrow from
reference device trees, so having a sane starting point would help.

Thanks.

Felix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: I2C bus clock on MPC85XX systems
  2009-12-22 18:16   ` Felix Radensky
@ 2009-12-22 18:40     ` Wolfgang Grandegger
  2009-12-22 19:06       ` Felix Radensky
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Grandegger @ 2009-12-22 18:40 UTC (permalink / raw)
  To: Felix Radensky; +Cc: linuxppc-dev

Felix Radensky wrote:
> Hi, Wolfgang
> 
> Wolfgang Grandegger wrote:
>> Felix Radensky wrote:
>>  
>>> Hi,
>>>
>>> Almost all MPC85XX based systems have the compatible=:"fsl-i2c" in
>>> respective
>>> i2c device tree nodes. This causes FSL i2c driver to use the following
>>> "backward
>>> compatible" values: FSR=0x31 DFSR=0x10. This is regardless of CCB clock
>>> frequency and i2c clock prescaler.
>>>
>>> On my custom MPC8536 based board with 432MHz CCB clock this results in
>>> 65KHz i2c clock frequency (checked with scope). U-Boot correctly
>>> configures
>>> the clock to 400KHz.
>>>
>>> I've fixed the problem by modifying device tree to use different
>>> compatible value,
>>> similar to what socrates board does. Is this the right approach ?
>>>     
>>
>> Are you aware of the properties described in
>> "Documentation/powerpc/dts-bindings/fsl/i2c.txt":
>>
>> http://lxr.linux.no/#linux+v2.6.32/Documentation/powerpc/dts-bindings/fsl/i2c.txt
>>
>>
>> Wolfgang.
>>
>>   
> Sure, I'm aware of these properties. I've used
> 
> compatible = "fsl,mpc8543-i2c", "fsl-i2c";
> clock-frequency = <400000>;
> 
> for my custom board.
> 
> I think, however, that device trees for FSL reference designs should use
> them as well, to avoid setting i2c
> clock to some strange values. I may be wrong, but I think most custom

The FSR=0x31 DFSR=0x10 are not strange values. They have been used in
mainline kernels (< 2.6.30) for a long time.

> board developers borrow from
> reference device trees, so having a sane starting point would help.

The trees provided by Freescale are usually based on older kernel
version. Borrow from such trees is OK, but the project developers should
use a recent kernel version for development.

Wolfgang.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: I2C bus clock on MPC85XX systems
  2009-12-22 18:40     ` Wolfgang Grandegger
@ 2009-12-22 19:06       ` Felix Radensky
  2009-12-22 19:20         ` Wolfgang Grandegger
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Radensky @ 2009-12-22 19:06 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linuxppc-dev

Hi, Wolfgang

Wolfgang Grandegger wrote:
> Felix Radensky wrote:
>   
>> Hi, Wolfgang
>>
>> Wolfgang Grandegger wrote:
>>     
>>> Felix Radensky wrote:
>>>  
>>>       
>>>> Hi,
>>>>
>>>> Almost all MPC85XX based systems have the compatible=:"fsl-i2c" in
>>>> respective
>>>> i2c device tree nodes. This causes FSL i2c driver to use the following
>>>> "backward
>>>> compatible" values: FSR=0x31 DFSR=0x10. This is regardless of CCB clock
>>>> frequency and i2c clock prescaler.
>>>>
>>>> On my custom MPC8536 based board with 432MHz CCB clock this results in
>>>> 65KHz i2c clock frequency (checked with scope). U-Boot correctly
>>>> configures
>>>> the clock to 400KHz.
>>>>
>>>> I've fixed the problem by modifying device tree to use different
>>>> compatible value,
>>>> similar to what socrates board does. Is this the right approach ?
>>>>     
>>>>         
>>> Are you aware of the properties described in
>>> "Documentation/powerpc/dts-bindings/fsl/i2c.txt":
>>>
>>> http://lxr.linux.no/#linux+v2.6.32/Documentation/powerpc/dts-bindings/fsl/i2c.txt
>>>
>>>
>>> Wolfgang.
>>>
>>>   
>>>       
>> Sure, I'm aware of these properties. I've used
>>
>> compatible = "fsl,mpc8543-i2c", "fsl-i2c";
>> clock-frequency = <400000>;
>>
>> for my custom board.
>>
>> I think, however, that device trees for FSL reference designs should use
>> them as well, to avoid setting i2c
>> clock to some strange values. I may be wrong, but I think most custom
>>     
>
> The FSR=0x31 DFSR=0x10 are not strange values. They have been used in
> mainline kernels (< 2.6.30) for a long time.
>
>   
>> board developers borrow from
>> reference device trees, so having a sane starting point would help.
>>     
>
> The trees provided by Freescale are usually based on older kernel
> version. Borrow from such trees is OK, but the project developers should
> use a recent kernel version for development.
>   

I was talking about modern vanilla kernels for Freescale reference 
boards. See, for example
http://lxr.linux.no/#linux+v2.6.32/arch/powerpc/boot/dts/mpc8536ds.dts

Felix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: I2C bus clock on MPC85XX systems
  2009-12-22 19:06       ` Felix Radensky
@ 2009-12-22 19:20         ` Wolfgang Grandegger
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Grandegger @ 2009-12-22 19:20 UTC (permalink / raw)
  To: Felix Radensky; +Cc: linuxppc-dev

Hi Felix,

Felix Radensky wrote:
> Hi, Wolfgang
> 
> Wolfgang Grandegger wrote:
[snip]
>> The trees provided by Freescale are usually based on older kernel
>> version. Borrow from such trees is OK, but the project developers should
>> use a recent kernel version for development.
>>   
> 
> I was talking about modern vanilla kernels for Freescale reference
> boards. See, for example
> http://lxr.linux.no/#linux+v2.6.32/arch/powerpc/boot/dts/mpc8536ds.dts

Only a few boards use these new properties to set a reasonable I2C
clock. But I agree, adding "clock-frequency = <100000>;" would make it
more obvious to the users how to define a proper frequency.

Wolfgang.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-22 19:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-22 15:38 I2C bus clock on MPC85XX systems Felix Radensky
2009-12-22 16:18 ` Wolfgang Grandegger
2009-12-22 18:16   ` Felix Radensky
2009-12-22 18:40     ` Wolfgang Grandegger
2009-12-22 19:06       ` Felix Radensky
2009-12-22 19:20         ` Wolfgang Grandegger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).