diff mbox

[v3,5/5] powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board

Message ID 20090407082231.803193635@denx.de (mailing list archive)
State Accepted, archived
Commit c724d67dfff3bd547d2768b450af8d3b9f83bb27
Delegated to: Kumar Gala
Headers show

Commit Message

Wolfgang Grandegger April 7, 2009, 8:20 a.m. UTC
Preserve I2C clock settings for the Socrates MPC8544 board.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 arch/powerpc/boot/dts/socrates.dts |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Grant Likely April 7, 2009, 3:43 p.m. UTC | #1
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wrote:
> Preserve I2C clock settings for the Socrates MPC8544 board.

I had thought that the preserve-clocking property was intended for
older boards that don't currently have any method of getting the clock
setting out of u-boot.  Since Socrates is a new board, U-Boot should
probably be made to fill in the real clock rate setting.

g.

>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
> ---
>  arch/powerpc/boot/dts/socrates.dts |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Index: linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts
> ===================================================================
> --- linux-2.6-galak.orig/arch/powerpc/boot/dts/socrates.dts     2009-04-07 10:09:07.161718915 +0200
> +++ linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts  2009-04-07 10:09:16.207719258 +0200
> @@ -79,11 +79,11 @@
>                        #address-cells = <1>;
>                        #size-cells = <0>;
>                        cell-index = <0>;
> -                       compatible = "fsl-i2c";
> +                       compatible = "fsl,mpc8544-i2c", "fsl-i2c";
>                        reg = <0x3000 0x100>;
>                        interrupts = <43 2>;
>                        interrupt-parent = <&mpic>;
> -                       dfsrr;
> +                       fsl,preserve-clocking;
>
>                        dtt@28 {
>                                compatible = "winbond,w83782d";
> @@ -111,11 +111,11 @@
>                        #address-cells = <1>;
>                        #size-cells = <0>;
>                        cell-index = <1>;
> -                       compatible = "fsl-i2c";
> +                       compatible = "fsl,mpc8544-i2c", "fsl-i2c";
>                        reg = <0x3100 0x100>;
>                        interrupts = <43 2>;
>                        interrupt-parent = <&mpic>;
> -                       dfsrr;
> +                       fsl,preserve-clocking;
>                };
>
>                enet0: ethernet@24000 {
>
>
Wolfgang Grandegger April 8, 2009, 7:16 a.m. UTC | #2
Grant Likely wrote:
> On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wrote:
>> Preserve I2C clock settings for the Socrates MPC8544 board.
> 
> I had thought that the preserve-clocking property was intended for
> older boards that don't currently have any method of getting the clock
> setting out of u-boot.  Since Socrates is a new board, U-Boot should
> probably be made to fill in the real clock rate setting.

I'm not sure if I understand what you mean. If an old version of U-Boot
on an old board sets the I2C clock, it can be used (inherited) by Linux
using the property "preserve-clocking".

It is actually the customers choice to set the I2C clock in U-Boot and
re-use it by Linux.

Wolfgang.
Grant Likely April 8, 2009, 2:53 p.m. UTC | #3
On Wed, Apr 8, 2009 at 12:16 AM, Wolfgang Grandegger <wg@grandegger.com> wrote:
> Grant Likely wrote:
>> On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wrote:
>>> Preserve I2C clock settings for the Socrates MPC8544 board.
>>
>> I had thought that the preserve-clocking property was intended for
>> older boards that don't currently have any method of getting the clock
>> setting out of u-boot.  Since Socrates is a new board, U-Boot should
>> probably be made to fill in the real clock rate setting.
>
> I'm not sure if I understand what you mean. If an old version of U-Boot
> on an old board sets the I2C clock, it can be used (inherited) by Linux
> using the property "preserve-clocking".
>
> It is actually the customers choice to set the I2C clock in U-Boot and
> re-use it by Linux.

Setting it in the register != recording the value in the device tree.
I'm saying that since Socrates is a new board it should not use the
preserve-clocking dirty trick (and it is a dirty trick) because the
correct clocking data can be passed via the device tree.

g.
Wolfgang Grandegger April 8, 2009, 6:27 p.m. UTC | #4
Grant Likely wrote:
> On Wed, Apr 8, 2009 at 12:16 AM, Wolfgang Grandegger <wg@grandegger.com> wrote:
>> Grant Likely wrote:
>>> On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com> wrote:
>>>> Preserve I2C clock settings for the Socrates MPC8544 board.
>>> I had thought that the preserve-clocking property was intended for
>>> older boards that don't currently have any method of getting the clock
>>> setting out of u-boot.  Since Socrates is a new board, U-Boot should
>>> probably be made to fill in the real clock rate setting.
>> I'm not sure if I understand what you mean. If an old version of U-Boot
>> on an old board sets the I2C clock, it can be used (inherited) by Linux
>> using the property "preserve-clocking".
>>
>> It is actually the customers choice to set the I2C clock in U-Boot and
>> re-use it by Linux.
> 
> Setting it in the register != recording the value in the device tree.
> I'm saying that since Socrates is a new board it should not use the
> preserve-clocking dirty trick (and it is a dirty trick) because the
> correct clocking data can be passed via the device tree.

Why should an old board then use it. "fsl, preserve-clocking" is a new
feature, like using "clock-frequency" and you have the choice to
explicitly set the clocking via device tree or inherit it from the boot
loader. So far, a fixed FDR/DFRSS value (0x1031) was written to the
registers by Linux.

Wolfgang.
Kumar Gala April 8, 2009, 6:43 p.m. UTC | #5
On Apr 8, 2009, at 1:27 PM, Wolfgang Grandegger wrote:

> Grant Likely wrote:
>> On Wed, Apr 8, 2009 at 12:16 AM, Wolfgang Grandegger <wg@grandegger.com 
>> > wrote:
>>> Grant Likely wrote:
>>>> On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger <wg@grandegger.com 
>>>> > wrote:
>>>>> Preserve I2C clock settings for the Socrates MPC8544 board.
>>>> I had thought that the preserve-clocking property was intended for
>>>> older boards that don't currently have any method of getting the  
>>>> clock
>>>> setting out of u-boot.  Since Socrates is a new board, U-Boot  
>>>> should
>>>> probably be made to fill in the real clock rate setting.
>>> I'm not sure if I understand what you mean. If an old version of U- 
>>> Boot
>>> on an old board sets the I2C clock, it can be used (inherited) by  
>>> Linux
>>> using the property "preserve-clocking".
>>>
>>> It is actually the customers choice to set the I2C clock in U-Boot  
>>> and
>>> re-use it by Linux.
>>
>> Setting it in the register != recording the value in the device tree.
>> I'm saying that since Socrates is a new board it should not use the
>> preserve-clocking dirty trick (and it is a dirty trick) because the
>> correct clocking data can be passed via the device tree.
>
> Why should an old board then use it. "fsl, preserve-clocking" is a new
> feature, like using "clock-frequency" and you have the choice to
> explicitly set the clocking via device tree or inherit it from the  
> boot
> loader. So far, a fixed FDR/DFRSS value (0x1031) was written to the
> registers by Linux.

I think Grant's point is socrates is a new board with a new u-boot.   
That u-boot should be able to set the clock-frequency property in  
i2c.  One assumes if you a clock-frequency property you wouldn't use  
"fsl,preserve-clocking".  (However -- its feasible they are mutually  
exclusive).

- k
Wolfgang Grandegger April 8, 2009, 6:53 p.m. UTC | #6
Kumar Gala wrote:
> 
> On Apr 8, 2009, at 1:27 PM, Wolfgang Grandegger wrote:
> 
>> Grant Likely wrote:
>>> On Wed, Apr 8, 2009 at 12:16 AM, Wolfgang Grandegger
>>> <wg@grandegger.com> wrote:
>>>> Grant Likely wrote:
>>>>> On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger
>>>>> <wg@grandegger.com> wrote:
>>>>>> Preserve I2C clock settings for the Socrates MPC8544 board.
>>>>> I had thought that the preserve-clocking property was intended for
>>>>> older boards that don't currently have any method of getting the clock
>>>>> setting out of u-boot.  Since Socrates is a new board, U-Boot should
>>>>> probably be made to fill in the real clock rate setting.
>>>> I'm not sure if I understand what you mean. If an old version of U-Boot
>>>> on an old board sets the I2C clock, it can be used (inherited) by Linux
>>>> using the property "preserve-clocking".
>>>>
>>>> It is actually the customers choice to set the I2C clock in U-Boot and
>>>> re-use it by Linux.
>>>
>>> Setting it in the register != recording the value in the device tree.
>>> I'm saying that since Socrates is a new board it should not use the
>>> preserve-clocking dirty trick (and it is a dirty trick) because the
>>> correct clocking data can be passed via the device tree.
>>
>> Why should an old board then use it. "fsl, preserve-clocking" is a new
>> feature, like using "clock-frequency" and you have the choice to
>> explicitly set the clocking via device tree or inherit it from the boot
>> loader. So far, a fixed FDR/DFRSS value (0x1031) was written to the
>> registers by Linux.
> 
> I think Grant's point is socrates is a new board with a new u-boot. 
> That u-boot should be able to set the clock-frequency property in i2c. 
> One assumes if you a clock-frequency property you wouldn't use
> "fsl,preserve-clocking".  (However -- its feasible they are mutually
> exclusive).

OK, now it makes more sense to me even if I never thought that way. My
intention was to allow Linux to use a *different* frequency as the
bootloader by specifying the "clock-frequency" property. This would not
be possible with a fixup by the bootloader.

Wolfgang.
diff mbox

Patch

Index: linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts
===================================================================
--- linux-2.6-galak.orig/arch/powerpc/boot/dts/socrates.dts	2009-04-07 10:09:07.161718915 +0200
+++ linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts	2009-04-07 10:09:16.207719258 +0200
@@ -79,11 +79,11 @@ 
 			#address-cells = <1>;
 			#size-cells = <0>;
 			cell-index = <0>;
-			compatible = "fsl-i2c";
+			compatible = "fsl,mpc8544-i2c", "fsl-i2c";
 			reg = <0x3000 0x100>;
 			interrupts = <43 2>;
 			interrupt-parent = <&mpic>;
-			dfsrr;
+			fsl,preserve-clocking;
 
 			dtt@28 {
 				compatible = "winbond,w83782d";
@@ -111,11 +111,11 @@ 
 			#address-cells = <1>;
 			#size-cells = <0>;
 			cell-index = <1>;
-			compatible = "fsl-i2c";
+			compatible = "fsl,mpc8544-i2c", "fsl-i2c";
 			reg = <0x3100 0x100>;
 			interrupts = <43 2>;
 			interrupt-parent = <&mpic>;
-			dfsrr;
+			fsl,preserve-clocking;
 		};
 
 		enet0: ethernet@24000 {