DTS question - MPC5200b

Grant Likely grant.likely at secretlab.ca
Wed Feb 13 06:47:17 EST 2008


On Feb 12, 2008 11:07 AM, Jarno Manninen <jarno.manninen at tut.fi> wrote:
> On Tuesday 12 February 2008 19:37:07 Nick wrote:
>
> > How do I specify the timer based on the cell-index?
>
> I don't know if that is possible to do in a one call, but maybe using the
> approach from mpc52xx_uart might help?
>
> --clip--
>         for_each_node_by_type(np, "serial") {
>                 if (!of_match_node(mpc52xx_uart_of_match, np))
>                         continue;
>
>                 /* Is a particular device number requested? */
>                 devno = of_get_property(np, "port-number", NULL);
>                 mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
>         }
> --clip--

This code has actually changed in 2.6.25-rc1.  It is now
for_each_matching_node() and the call to of_match_node is no longer
necessary.

>
> And change  serial->gpt, port-number to cell-index and add some logic to
> select the devices you want.

use 'reg' instead.  cell-index (and port-number for that matter) will
probably be going away in the near future.

> Or if you wan't to do it a bit differently you
> could add a pseudo device outside the main tree like
>
>         mydev {
>                 gpt-dev = <&the_gpt_dev>:
>         };
>
> And get it that way. However I don't know if this is recommended approach, but
> I've used it for some simple stuff like binding gpt in PWM mode to
> framebuffer backlight, along with power-pin.

Yes, this is a good approach too.

g.

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



More information about the Linuxppc-dev mailing list