Porting a driver to powerpc using FDT

Grant Likely grant.likely at secretlab.ca
Fri Jun 18 00:55:27 EST 2010


On Wed, Jun 16, 2010 at 10:25 PM, Chris Alfred
<c.alfred at internode.on.net> wrote:
>>>>> dsa_of_init is successfully called; but dsa_of_probe is not
>>>>> called.
>>>>
>>>> That means the node is not being used to register an of_device. I
>>>> need some more information to suggest how best to fix this.
>>>
>>>> What SoC are you using?
>>>> What file in arch/powerpc/platforms/* is used to setup your
>>>> machine?
>>>
>>> We are using the MPC5200. Very similar to the Lite5200.
>>
>> So you're board is driver by
>> arch/powerpc/platforms/52xx/mpc5200_simple.c then?
>
> The Lite5200 is based on arch/powerpc/platforms/52xx/lite5200.c
>
> We have only done a text search/replace lite5200 to jkc5200.
> Based on your email, we have now also changed fsl,jkc5200n8 to
> jkc,jkc5200n8

Unless you need to add a bunch of board specific setup, you shouldn't
need to do this.  It should be sufficient to add jkc,jkc5200n8 to the
list of boards in mpc5200_simple.c.  The Lite5200 has a separate board
file because the original u-boot firmware for it didn't setup clocks
or port_config correctly.  Almost every other board uses
mpc5200_simple.c

media5200 is the other exception because it needs to add a whole other
irq controller.

>> As mentioned, drop the reg property and be more specific in the
>> compatible value.
>
> Done, changed fsl,jkc5200n8 to jkc,jkc5200n8
>
>> If you do the
>> following, then it should start working:
>>
>> virtual-devices {
>>         compatible = "simple-bus";
>>         dsa {
>>               compatible = "<vendor>,jkc5200n8-dsa";
>>         };
>> };
>
> Where did "simple-bus" come from?
>
> Did you mean "mpc5200-simple-platform" from:
>
>    define_machine(mpc5200_simple_platform) {
>     .name  = "mpc5200-simple-platform",

No, mpc5200-simple-platform is just a name shown to users.  It doesn't
actually match against anything in the device tree.

"simple-bus" means that a node represents a simple transparent bridge
device.  Linux uses that value to decide that the bus node contains
device nodes that it should register.  Take a look at the ePAPR spec.

g.

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


More information about the Linuxppc-dev mailing list