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

Jon Smirl jonsmirl at gmail.com
Fri Aug 1 05:11:55 EST 2008


On 7/31/08, Scott Wood <scottwood at freescale.com> wrote:
> Timur Tabi wrote:
>
> > Grant Likely wrote:
> >
> >
> > > No it doesn't, it depends on the register interface to decide
> > > compatibility.  Clock interface is part of that.
> > >
> >
> > I don't think so.  The interface for programming the clock registers is
> > identical on all 8[356]xx parts.  The only thing that matters is what
> specific
> > values to put in the FDR and DFSR registers to get a desired I2C bus
> speed.
> >
>
>  If it affects the values you need to write to the registers to achieve a
> given result, how is it not a difference in the register interface?
>
>
> > I propose the property "clock-frequency", like this:
> >
> >                i2c at 3000 {
> >                        #address-cells = <1>;
> >                        #size-cells = <0>;
> >                        cell-index = <0>;
> >                        compatible = "fsl-i2c";
> >                        reg = <0x3000 0x100>;
> >                        interrupts = <14 0x8>;
> >                        interrupt-parent = <&ipic>;
> >                        dfsrr;
> >                        clock-frequency = <0xblablabla>;  <-- added by
> U-Boot
> >                };
> >
>
>  A clock-frequency property is OK, and is in line with what we do in other
> types of nodes.  However, in the long run it might be nice to introduce some
> sort of clock binding where, for example, the i2c node can point to a clock
> elsewhere in the device tree as an input clock.
>
>  That way, less knowledge is required by the firmware to poke values all
> over the place, and it also allows one to describe situations where the
> frequency of the input clock can change (such as in low-power modes).

		PowerPC,5200 at 0 {
			timebase-frequency = <0>;	/* From Bootloader  */
			bus-frequency = <0>;		/* From Bootloader  */
			clock-frequency = <0>;		/* From Bootloader  */
		};

The mpc5200 code already has mpc52xx_find_ipb_freq() to get it.

I should grep before suggesting things.

-- 
Jon Smirl
jonsmirl at gmail.com



More information about the Linuxppc-dev mailing list