All of lore.kernel.org
 help / color / mirror / Atom feed
* I2C not working upon 2.6.24 to 2.6.28 kernel upgrade
@ 2009-03-12 17:37 Johns Daniel
       [not found] ` <ba5d9360903121037m6d5be5e9m4b164d56bd6b5f3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Johns Daniel @ 2009-03-12 17:37 UTC (permalink / raw)
  To: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A

We have had this device tree (a section shown below) working for a long time:
	soc8343@e0000000 {
		#address-cells = <1>;
		#size-cells = <1>;
		#interrupt-cells = <2>;
		device_type = "soc";
		ranges = <00000000 e0000000 00100000>;
		reg = <e0000000 00000200>;
		bus-frequency = <0>;

		i2c@3000 {
			device_type = "i2c";
			compatible = "fsl-i2c";
			reg = <3000 100>;
			interrupts = <e 8>;
			interrupt-parent = <700>;
			dfsrr;
		};
...
}

With linux-2.6.24, it worked with this struct defined in the
board-specific file:
          static struct of_device_id __initdata of_bus_ids[] = {
          	{ .compatible = "fsl,pq2pro-localbus", },
          	{},
          };

With linux-2.6.28, it needs the following struct in the board-specific
file for I2C to work:
          static struct of_device_id __initdata of_bus_ids[] = {
          	{ .type = "soc", },
          	{ .name = "localbus", },
          	{},
          };

Is this easily explained?

What is the right way to do this now? Ideally, I would like to keep
the device tree unchanged since I need for it to work with older
versions of the kernel!

-- Johns

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I2C not working upon 2.6.24 to 2.6.28 kernel upgrade
       [not found] ` <ba5d9360903121037m6d5be5e9m4b164d56bd6b5f3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-12 18:08   ` Grant Likely
       [not found]     ` <fa686aa40903121108p50338218w18714686d1f8bdbf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2009-03-12 18:08 UTC (permalink / raw)
  To: Johns Daniel; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A

On Thu, Mar 12, 2009 at 11:37 AM, Johns Daniel <johns.daniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> We have had this device tree (a section shown below) working for a long time:
>        soc8343@e0000000 {
>                #address-cells = <1>;
>                #size-cells = <1>;
>                #interrupt-cells = <2>;
>                device_type = "soc";
>                ranges = <00000000 e0000000 00100000>;
>                reg = <e0000000 00000200>;
>                bus-frequency = <0>;
>
>                i2c@3000 {
>                        device_type = "i2c";
>                        compatible = "fsl-i2c";
>                        reg = <3000 100>;
>                        interrupts = <e 8>;
>                        interrupt-parent = <700>;
>                        dfsrr;
>                };
> ...
> }
>
> With linux-2.6.24, it worked with this struct defined in the
> board-specific file:
>          static struct of_device_id __initdata of_bus_ids[] = {
>                { .compatible = "fsl,pq2pro-localbus", },
>                {},
>          };

This doesn't make much sense since the snippit above doesn't show a
compatible value in the soc node.

> With linux-2.6.28, it needs the following struct in the board-specific
> file for I2C to work:
>          static struct of_device_id __initdata of_bus_ids[] = {
>                { .type = "soc", },
>                { .name = "localbus", },
>                {},
>          };
>
> Is this easily explained?

Binding on device_type or name is strongly discouraged, so the above
snippit isn't a good idea.

Is it okay to add a property to your device tree?  If so, then add:
compatible = "fsl,mpc8315-immr", "simple-bus" and make sure that {
.compatible = "simple-bus"} is in the of_bus_ids list.  Adding this
property will not break older versions of the kernel.

> What is the right way to do this now? Ideally, I would like to keep
> the device tree unchanged since I need for it to work with older
> versions of the kernel!

compatible = "simple-bus" is the right way to describe simple memory
mapped translations like on the internally memory mapped registers.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I2C not working upon 2.6.24 to 2.6.28 kernel upgrade
       [not found]     ` <fa686aa40903121108p50338218w18714686d1f8bdbf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-12 21:38       ` Johns Daniel
       [not found]         ` <ba5d9360903121438p57e068b6n46e58868b814539c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Johns Daniel @ 2009-03-12 21:38 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A

On Thu, Mar 12, 2009 at 1:08 PM, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> On Thu, Mar 12, 2009 at 11:37 AM, Johns Daniel <johns.daniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> We have had this device tree (a section shown below) working for a long time:
>>        soc8343@e0000000 {
>>                #address-cells = <1>;
>>                #size-cells = <1>;
>>                #interrupt-cells = <2>;
>>                device_type = "soc";
>>                ranges = <00000000 e0000000 00100000>;
>>                reg = <e0000000 00000200>;
>>                bus-frequency = <0>;
>>
>>                i2c@3000 {
>>                        device_type = "i2c";
>>                        compatible = "fsl-i2c";
>>                        reg = <3000 100>;
>>                        interrupts = <e 8>;
>>                        interrupt-parent = <700>;
>>                        dfsrr;
>>                };
>> ...
>> }
>>
>> With linux-2.6.24, it worked with this struct defined in the
>> board-specific file:
>>          static struct of_device_id __initdata of_bus_ids[] = {
>>                { .compatible = "fsl,pq2pro-localbus", },
>>                {},
>>          };
>
> This doesn't make much sense since the snippit above doesn't show a
> compatible value in the soc node.

I am glad I am not the only one to whom some of this does not make sense!    ;~)

But I can assure you that I have been using this with 2.6.20 and
2.6.24 without any problems---and there has not been a compatible
value in the soc node. (There are compatible values in the subnodes of
soc.) Even with linux 2.6.28, everything but I2C works.

>
>> With linux-2.6.28, it needs the following struct in the board-specific
>> file for I2C to work:
>>          static struct of_device_id __initdata of_bus_ids[] = {
>>                { .type = "soc", },
>>                { .name = "localbus", },
>>                {},
>>          };
>>
>> Is this easily explained?
>
> Binding on device_type or name is strongly discouraged, so the above
> snippit isn't a good idea.

Would you please explain why? I just want to weigh the risk of
changing the DTB vs. the risk of using a device_type binding.

>
> Is it okay to add a property to your device tree?  If so, then add:
> compatible = "fsl,mpc8315-immr", "simple-bus" and make sure that {
> .compatible = "simple-bus"} is in the of_bus_ids list.  Adding this
> property will not break older versions of the kernel.

Thanks for your excellent answers!

>
>> What is the right way to do this now? Ideally, I would like to keep
>> the device tree unchanged since I need for it to work with older
>> versions of the kernel!
>
> compatible = "simple-bus" is the right way to describe simple memory
> mapped translations like on the internally memory mapped registers.
>
> Cheers,
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I2C not working upon 2.6.24 to 2.6.28 kernel upgrade
       [not found]         ` <ba5d9360903121438p57e068b6n46e58868b814539c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-12 22:18           ` Mitch Bradley
  2009-03-17 18:36           ` Scott Wood
  1 sibling, 0 replies; 5+ messages in thread
From: Mitch Bradley @ 2009-03-12 22:18 UTC (permalink / raw)
  To: Johns Daniel; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A

>
> Binding on device_type or name is strongly discouraged, so the above
> > snippit isn't a good idea.
>   
>
> Would you please explain why? I just want to weigh the risk of
> changing the DTB vs. the risk of using a device_type binding.
>   


This has been discussed to death, but ...

The proper meaning of "device_type" is to tell Open Firmware that the 
device node contains a specific set of methods that implements a 
specific API that the firmware can for internal purposes like, for 
example, a console.

People have tried to co-opt it for other uses, but doing so just makes 
its meaning ambiguous, thus making it difficult to use for any purpose.

The "compatible" property is specifically intended for driver selection.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I2C not working upon 2.6.24 to 2.6.28 kernel upgrade
       [not found]         ` <ba5d9360903121438p57e068b6n46e58868b814539c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2009-03-12 22:18           ` Mitch Bradley
@ 2009-03-17 18:36           ` Scott Wood
  1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2009-03-17 18:36 UTC (permalink / raw)
  To: Johns Daniel; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A

Johns Daniel wrote:
> But I can assure you that I have been using this with 2.6.20 and
> 2.6.24 without any problems---and there has not been a compatible
> value in the soc node. (There are compatible values in the subnodes of
> soc.) Even with linux 2.6.28, everything but I2C works.

Most likely, i2c was a platform-bus driver in 2.6.24 and was converted 
to an of-platform-bus driver sometime between then and 2.6.28.  It 
wasn't that of-platform worked before, but rather you weren't using it.

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-17 18:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 17:37 I2C not working upon 2.6.24 to 2.6.28 kernel upgrade Johns Daniel
     [not found] ` <ba5d9360903121037m6d5be5e9m4b164d56bd6b5f3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-12 18:08   ` Grant Likely
     [not found]     ` <fa686aa40903121108p50338218w18714686d1f8bdbf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-12 21:38       ` Johns Daniel
     [not found]         ` <ba5d9360903121438p57e068b6n46e58868b814539c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-12 22:18           ` Mitch Bradley
2009-03-17 18:36           ` Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.