i2c-mpc clocking scheme

Trent Piepho tpiepho at freescale.com
Tue Dec 2 09:07:51 EST 2008


On Mon, 1 Dec 2008, André Schwarz wrote:
> Timur Tabi wrote:
>>  Trent Piepho wrote:
>>
>> 
>> >  Seems like it should keep the clock registers at what u-boot set them 
>> >  too.
>> > 
>>
>>  Or we could have U-Boot put the i2c clock frequency into the I2C node, and
>>  let
>>  the driver program the hardware again.  That would keep the ugliness in
>>  U-Boot.
>>
>> 
> Wouldn't it be easier to omit frequency re-programming at all ?
> Maybe configurable for non U-Boot users ...

That's what I'm thinking too.  Calculating the settings for a given bus
frequency, even with the system specific source clock provided by u-boot,
involves either a complex algorithm or a big ugly black box table that's
even larger than the algorithm.  I also think it's different for 8xxx and
52xx.

On the other hand just keeping the clock the same doesn't require any code
at all.

U-boot could pass in "bus-frequency" to let software know the speed of the
I2C bus from Linux.  Seems like a standard property for bus nodes.

There could be a "current-speed" property that tells linux to keep the
registers the same, in case we have to worry about u-boot not programming
the i2c clock.  I think the serial drivers have something like this.


More information about the Linuxppc-dev mailing list