lkml.org 
[lkml]   [2014]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Query: Phy: How to find consumer device on dt platform
Date
On Tuesday 28 January 2014, Kishon Vijay Abraham I wrote:
> > I have a common set of registers, which need to be programmed
> > differently for PCIe and SATA during phy init/exit.
>
> One way is differentiate using different compatible strings fro pcie and sata
> and use of_device_is_compatible to select a particular path.

But if the IP block is the same, the compatible string should be
identical.

> > Therefore, in the init/exit routine of phy_ops, I need some way of
> > identifying that phy_init/exit has been called from PCIe driver or
> > SATA driver.
>
> In this case you'll be actually registering two different PHYs (each for pcie
> and sata), so your phy_get should give you the only the appropriate phy.

I would instead recommend making the mode of the PHY device the
argument to the phy handle in DT, so that the sata node uses

phys = <&phyA 0>;

and the PCIe node uses

phys = <&phyB 1>;

Then the binding for the phy defines that an argument of '0' means sata mode,
while '1' means pcie mode, plus you should define all other valid modes.

Arnd


\
 
 \ /
  Last update: 2014-01-28 22:41    [W:0.900 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site