I2C not working upon 2.6.24 to 2.6.28 kernel upgrade

Grant Likely grant.likely at secretlab.ca
Fri Mar 13 05:08:07 EST 2009


On Thu, Mar 12, 2009 at 11:37 AM, Johns Daniel <johns.daniel at gmail.com> wrote:
> We have had this device tree (a section shown below) working for a long time:
>        soc8343 at e0000000 {
>                #address-cells = <1>;
>                #size-cells = <1>;
>                #interrupt-cells = <2>;
>                device_type = "soc";
>                ranges = <00000000 e0000000 00100000>;
>                reg = <e0000000 00000200>;
>                bus-frequency = <0>;
>
>                i2c at 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.



More information about the devicetree-discuss mailing list