(there is no such thing as linux-net@xxxxxxxxxxxxxxx, please remove itBut what about this part of of_mdio.c:of_phy_register_fixed_link():
from your future submissions).
On 09/07/15 10:38, Stas Sergeev wrote:
Currently for fixed-link the link state is always set to UP.Not quite true, this is always a driver decision to make.
The DTs have a common parts that are included by otherThis patch introduces the new property 'link' that accepts theIn which case you probably do not even care about inserting such a
following string arguments: "up", "down" and "auto".
"down" may be needed if the link is physically unconnected.
property in the first place, do you? What would be the value of forcibly
having a link permanently down (not counting loopback)?
Thanks, will take that into account in v2."auto" is needed to enable the link paramaters auto-negotiation,RGMII also has an in-band status FWIW.
that is built into some MII protocols, namely SGMII.
This doesn't work.The appropriate documentation is added and explicitly states thatAnd therefore probably be made a device (and driver) specific decision
"auto" is very specific (protocol, HW and driver-specific), and
is therefore should be used with care.
whether this is the right thing to do.
Exactly.- return -EINVAL;This is a completely arbitrary speed, that does not more or less sense
+ if (of_property_read_u32(fixed_link_node, "speed",
+ &status.speed) != 0) {
+ /* in auto mode just set to some sane value:
+ * it will be changed by MAC later */
+ if (link_auto)
+ status.speed = 1000;
than defaulting to 100 or anything else,
a driver should be able to setIt actually does, that value is just to "cheat" fixed-phy.
the speed it wants, based on the parsing of a 'phy-mode' property for
instance.