Subject: Re: [PATCH] powerpc: i2c-mpc: make speed registers configurable via FDT

From: Timur Tabi <[email-masked]>
Date: Thu, 31 Jul 2008 15:19:16 -0500

Wolfgang Grandegger wrote:

> I'm a bit confused. The frequency of the I2C source clock and the real 
> I2C clock frequency are two different things. 

There are two frequencies:

1) The frequency of the input clock to the I2C device, after it has gone through
a divider.  This is what I call the "I2C clock frequency" and what I think
belongs in the clock-frequency property.  This is usually the platform clock
divided by 1, 2, or 3.

2) The speed of the I2C bus, as seen by devices on that bus.  This is usually
400KHz.

> The first one is common 
> for all I2C devices, the second can be different. What properties would 
> you like to use for defining both?

The platform clock has no value to the I2C hardware, so I don't care anything
about it.

>> Besides, U-Boot does not currently store the divider value.  Look at the code
>> I've posted twice already - it stores the frequency in i2c1_clk.  So now I would
>> need to create another variable in the gd_t to store the divider?  No thanks.
> 
> OK, that's an argument but it's biased by U-Boot.

As long as a method that is favorable to U-Boot does not put any undo hardship
on non-U-Boot methods, I would say that it is the preferred method.

-- 
Timur Tabi
Linux kernel developer at Freescale