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

Trent Piepho xyzzy at speakeasy.org
Fri Aug 1 11:16:49 EST 2008


On Thu, 31 Jul 2008, Timur Tabi wrote:
> Wolfgang Grandegger wrote:
>
> > U-Boot does not (yet) use the FDT and it has therefore to use that ugly
> > code to derive the I2C input clock frequency. I think its completely
> > legal to put that hardware specific information into the FDT and get rid
> > of such code.
>
> Huh?  U-Boot initializes several fields and creates several properties in the
> FDT today, so what's wrong with adding another one?  The clock frequencies have
> always been calculated by U-Boot, because putting them in the device tree is a
> bad idea.

I think Wolfgang means u-boot doesn't _read_ information from the device
tree.  Put the I2C source clock into the device tree and have u-boot read it
in.

But that simply doesn't work at all.  The i2c source clock isn't constant.
It's not a constant divider from the core clock either.  Flip a dip switch,
and the divider changes.

But that's irrelevant.  U-boot needs to configure the i2c controller to
read SPD data from the DIMM's EPROM, which is necessary to get DRAM
working.  That happens long long before the FDT is loaded via TFTP,
y-modem, NFS, or from disk or flash.  Might as well have u-boot get the i2c
source clock via Linux's sysfs.



More information about the Linuxppc-dev mailing list