[U-Boot] ofnode -> udevice question

Simon Glass sjg at chromium.org
Sun Jul 14 01:53:12 UTC 2019


Hi Adam,

On Sat, 13 Jul 2019 at 06:52, Adam Ford <aford173 at gmail.com> wrote:
>
> I am trying to improve the OMAP EHCI driver.  Currently, I pushed a
> pending patch which loads a USB host controller device which contains
> several child nodes.
>
> We search the child nodes to find the compatible flag, then grab the
> address of that node and initialize the corresponding EHCI controller.
> I do this because we need some of the info from the parent combined
> with data from the child to work.

But you should be able to use a driver for the compatible string. The
driver can access its parent. Best to let DM bind your drivers if you
can.

>
> What I'm trying to do is enhance the feature to support a nop-phy, but
> to get the phy, I call generic_phy_get_by_index(struct udevice *,...)
> where dev points to the parent and not the child.
>
> I have an ofnode pointing to the child, but I need to somehow convert
> the ofnode to a udevice so the phy_get_by_index can search the correct
> location for the phy list.  Any suggestions?
>

There is device_find_global_by_ofnode() but it is slow. If you know
the uclass you can use uclass_get_device_by_ofnode().

> My origin patch lacking the phy reference is located:
> https://patchwork.ozlabs.org/patch/1125016/
>
> adam

Regards,
Simon


More information about the U-Boot mailing list