devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
       [not found]     ` <20140406110635.GA24260@dragon>
@ 2014-04-06 11:26       ` Russell King - ARM Linux
       [not found]         ` <20140406112655.GP7528-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Russell King - ARM Linux @ 2014-04-06 11:26 UTC (permalink / raw)
  To: Shawn Guo, devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Hubert Chaumette, Anatolij Gustschin,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Apr 06, 2014 at 07:06:38PM +0800, Shawn Guo wrote:
> On Thu, Apr 03, 2014 at 04:05:47PM +0200, Hubert Chaumette wrote:
> > Le mercredi 02 avril 2014 à 22:01 +0200, Anatolij Gustschin a écrit :
> > > It would be better to configure the pad skews in the board specific
> > > way in the device tree. There is a binding for ksz9021 PHY in
> > > Documentation/devicetree/bindings/net/micrel-ksz9021.txt.
> > 
> > I wonder why it it's not used in arch/arm/boot/dts/imx6q-sabrelite.dts
> > instead of ksz9021rn_phy_fixup().
> 
> Oh, if you look at arch/arm/boot/dts/imx6qdl-sabrelite.dtsi on mainline
> tree today, you will find it.

Ergh.  So much for "DT describes the hardware, not the software
implementation."

commit 954c396756e3d31985f7bc6a414a988a4736a7d0
Author: Sean Cross <xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
Date:   Wed Aug 21 01:46:12 2013 +0000

    net/phy: micrel: Add OF configuration support for ksz9021

    Some boards require custom PHY configuration, for example due to trace
    length differences.  Add the ability to configure these registers in
    order to get the PHY to function on boards that need it.

    Because PHYs are auto-detected based on MDIO device IDs, allow PHY
    configuration to be specified in the parent Ethernet device node if no
    PHY device node is present.

If we were describing the hardware, we'd create a node for the phy and put
the phy specific properties in there, and reference it from the ethernet
driver, and have some way to look up the phy node when we automatically
discover the phy.

Well, it's too late to do anything else now, we're stuck with this, and
I guess everyone's going to be stuffing the phy chip's configuration into
the ethernet device's node from now on. :(

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
       [not found]         ` <20140406112655.GP7528-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2014-04-06 12:04           ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2014-04-06 12:04 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Hubert Chaumette,
	Anatolij Gustschin,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Apr 06, 2014 at 12:26:55PM +0100, Russell King - ARM Linux wrote:
> Ergh.  So much for "DT describes the hardware, not the software
> implementation."
> 
> commit 954c396756e3d31985f7bc6a414a988a4736a7d0
> Author: Sean Cross <xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
> Date:   Wed Aug 21 01:46:12 2013 +0000
> 
>     net/phy: micrel: Add OF configuration support for ksz9021
> 
>     Some boards require custom PHY configuration, for example due to trace
>     length differences.  Add the ability to configure these registers in
>     order to get the PHY to function on boards that need it.
> 
>     Because PHYs are auto-detected based on MDIO device IDs, allow PHY
>     configuration to be specified in the parent Ethernet device node if no
>     PHY device node is present.
> 
> If we were describing the hardware, we'd create a node for the phy and put
> the phy specific properties in there, and reference it from the ethernet
> driver, and have some way to look up the phy node when we automatically
> discover the phy.

This is exactly how new style devices work, like allwinner case below.

  arch/arm/boot/dts/sun4i-a10-a1000.dts
  drivers/net/ethernet/allwinner/sun4i-emac.c

> 
> Well, it's too late to do anything else now, we're stuck with this, and
> I guess everyone's going to be stuffing the phy chip's configuration into
> the ethernet device's node from now on. :(

Let's take a look at ksz9021_config_init().

	if (!of_node && dev->parent->of_node)
		of_node = dev->parent->of_node;

It's a stepping back in case that the phy device has no of_node
attached.  So for phy devices that are initiated from device tree like
allwinner case above, they will just work in the sane way.

Shawn

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-06 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1395421687-12934-1-git-send-email-hchaumette@adeneo-embedded.com>
     [not found] ` <20140402220125.4e203cd2@crub>
     [not found]   ` <1396533947.25686.22.camel@EMBLYSD005.adetelgroup.com>
     [not found]     ` <20140406110635.GA24260@dragon>
2014-04-06 11:26       ` [PATCH] ARM: i.MX6: update KSZ9031 phy fixup Russell King - ARM Linux
     [not found]         ` <20140406112655.GP7528-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2014-04-06 12:04           ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).