lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5CE77AC80B4242C98833109D6F1C9F85@kosagi.com>
Date:	Mon, 5 Aug 2013 10:23:58 +0800
From:	Sean Cross <xobs@...agi.com>
To:	Duan Fugang-B38611 <B38611@...escale.com>
Cc:	Sascha Hauer <s.hauer@...gutronix.de>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"devicetree@...r.kernel.org" 
	<devicetree@...r.kernel.org>, David Miller <davem@...emloft.net>,
	"stephen@...workplumber.org" 
	<stephen@...workplumber.org>, Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v3] net/phy: micrel: Add OF configuration support
 for ksz9021

On Monday, 5 August, 2013 at 9:58 AM, Duan Fugang-B38611 wrote:
> From: Sean Cross [mailto:xobs@...agi.com]
> Data: Thursday, August 01, 2013 5:19 PM
> 
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/micrel-ksz9021.txt
> > @@ -0,0 +1,19 @@
> > +Micrel KSZ9021 Gigabit Ethernet PHY
> > +
> > +Some boards require special tuning values, particularly when it comes
> > +to clock delays. You can specify clock delay values by adding
> > +micrel-specific properties to an Ethernet OF device node.
> > +
> > +Optional properties:
> > +- micrel,clk-control-pad-skew : Timing offset for the MII clock line
> > +- micrel,rx-data-pad-skew : Timing offset for the RX MII pad
> > +- micrel,tx-data-pad-skew : Timing offset for the TX MII pad
> > +
> > +Example:
> > + &enet {
> > + micrel,clk-control-pad-skew = <0xf0f0>;
> > + micrel,rx-data-pad-skew = <0x0000>;
> > + micrel,tx-data-pad-skew = <0xffff>;
> > + status = "okay";
> > + };
> > +
> 
> 
> 
> The phy binding must be the phy node, not the ethernet node.
> Pls refer to: 
> Documentation/devicetree/booting-without-of.txt
> Documentation/devicetree/bindings/net/phy.txt

This won't necessarily work.  In my board, I don't think it's possible to manually specify the PHY, as most of the fields required by the OF PHY node don't apply to this device (at least according to phy.txt).  There are no interrupts, no interrupt parent, and it's unclear what the reg or linux,phandle fields do.  All of these are required fields, none of which seem to apply to this particular board.  Furthermore, it doesn't seem to be possible to specify a particular PHY, such as the ksz9021.

I see the pattern of getting OF settings from a parent's node used elsewhere in the kernel.  For example, in mmc_of_parse(), or more similarly in the chipidea ci_hdrc_probe() driver.  
> > +static int ksz9021_config_init(struct phy_device *phydev) {
> > + struct device *dev = &phydev->dev;
> > + struct device_node *of_node = dev->of_node;
> > +
> > + if (!of_node && dev->parent->of_node)
> > + of_node = dev->parent->of_node;
> > +
> 
> 
> If phy binding is phy node, there only check of_node, don't re-evaluate the phy node.
It's done this way in case it's not possible to add a phy node, as in this case. 

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ