linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
@ 2014-03-21 17:08 Hubert Chaumette
  2014-03-21 21:23 ` Eric Bénard
  2014-04-02 20:01 ` Anatolij Gustschin
  0 siblings, 2 replies; 13+ messages in thread
From: Hubert Chaumette @ 2014-03-21 17:08 UTC (permalink / raw)
  To: linux-arm-kernel

Update KSZ9031RN phy fixup for Congatec conga-QEVAL and conga-QMX6 combo :
set RGMII GTX_CLK and RX_CLK pad skew to +0.96ns.

Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com>
---
 arch/arm/mach-imx/mach-imx6q.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 76e5db4..db307c2 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -77,6 +77,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
 	mmd_write_reg(dev, 2, 5, 0);
 	mmd_write_reg(dev, 2, 8, 0x003ff);
 
+	/* For Congatec conga-QMX6 board */
+	mmd_write_reg(dev, 0x02, 0x06, 0xffff);
+
 	return 0;
 }
 
-- 
1.9.0

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-03-21 17:08 [PATCH] ARM: i.MX6: update KSZ9031 phy fixup Hubert Chaumette
@ 2014-03-21 21:23 ` Eric Bénard
  2014-03-24 15:30   ` CHAUMETTE Hubert
  2014-04-02 20:01 ` Anatolij Gustschin
  1 sibling, 1 reply; 13+ messages in thread
From: Eric Bénard @ 2014-03-21 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hubert,

Le Fri, 21 Mar 2014 18:08:07 +0100,
Hubert Chaumette <hchaumette@adeneo-embedded.com> a ?crit :

> 
> Update KSZ9031RN phy fixup for Congatec conga-QEVAL and conga-QMX6 combo :
> set RGMII GTX_CLK and RX_CLK pad skew to +0.96ns.
> 
> Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com>
> ---
>  arch/arm/mach-imx/mach-imx6q.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index 76e5db4..db307c2 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -77,6 +77,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
>  	mmd_write_reg(dev, 2, 5, 0);
>  	mmd_write_reg(dev, 2, 8, 0x003ff);
>  
> +	/* For Congatec conga-QMX6 board */
> +	mmd_write_reg(dev, 0x02, 0x06, 0xffff);
> +
>  	return 0;
>  }
>  
that's board specific (the needed delay depends on the routing delay on
the PCB), so this should not go in a generic file.

Eric

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-03-21 21:23 ` Eric Bénard
@ 2014-03-24 15:30   ` CHAUMETTE Hubert
  2014-03-24 15:41     ` Eric Bénard
  0 siblings, 1 reply; 13+ messages in thread
From: CHAUMETTE Hubert @ 2014-03-24 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eric,

----- Original Message -----
> From: "Eric B?nard" <eric@eukrea.com>
> To: "Hubert Chaumette" <hchaumette@adeneo-embedded.com>
> Cc: linux-arm-kernel at lists.infradead.org, linux at arm.linux.org.uk, "shawn guo" <shawn.guo@linaro.org>,
> linux-kernel at vger.kernel.org, kernel at pengutronix.de
> Sent: Friday, March 21, 2014 10:23:20 PM
> Subject: Re: [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
> 
> Hi Hubert,
> 
> Le Fri, 21 Mar 2014 18:08:07 +0100,
> Hubert Chaumette <hchaumette@adeneo-embedded.com> a ?crit :
> 
> > 
> > Update KSZ9031RN phy fixup for Congatec conga-QEVAL and conga-QMX6 combo :
> > set RGMII GTX_CLK and RX_CLK pad skew to +0.96ns.
> > 
> > Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com>
> > ---
> >  arch/arm/mach-imx/mach-imx6q.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm/mach-imx/mach-imx6q.c
> > b/arch/arm/mach-imx/mach-imx6q.c
> > index 76e5db4..db307c2 100644
> > --- a/arch/arm/mach-imx/mach-imx6q.c
> > +++ b/arch/arm/mach-imx/mach-imx6q.c
> > @@ -77,6 +77,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
> >          mmd_write_reg(dev, 2, 5, 0);
> >          mmd_write_reg(dev, 2, 8, 0x003ff);
> >  
> > +        /* For Congatec conga-QMX6 board */
> > +        mmd_write_reg(dev, 0x02, 0x06, 0xffff);
> > +
> >          return 0;
> >  }
> >  
> that's board specific (the needed delay depends on the routing delay on
> the PCB), so this should not go in a generic file.
> 
> Eric
> 

I admit it may need to be in a separate function, but this file already contains
board-specific fixups (for imx6q sabrelite, Data Modul eDM-QMX6).

Anyway, do you have any suggestion for the location I should put it ?

Regards,

Hubert

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-03-24 15:30   ` CHAUMETTE Hubert
@ 2014-03-24 15:41     ` Eric Bénard
  2014-04-02 13:14       ` Shawn Guo
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Bénard @ 2014-03-24 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hubert,

Le Mon, 24 Mar 2014 16:30:49 +0100 (CET),
CHAUMETTE Hubert <hchaumette@adeneo-embedded.com> a ?crit :
> > From: "Eric B?nard" <eric@eukrea.com>
> > that's board specific (the needed delay depends on the routing delay on
> > the PCB), so this should not go in a generic file.
> > 
> > Eric
> > 
> 
> I admit it may need to be in a separate function, but this file already contains
> board-specific fixups (for imx6q sabrelite, Data Modul eDM-QMX6).
> 
true but that's not a reason to add more ;-)

> Anyway, do you have any suggestion for the location I should put it ?
> 
no idea at the moment, I simply used your patch to bring this issue on
the ML as we recently needed to patch the default values for testing
mainline kernel on a custom boards.

Eric

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-03-24 15:41     ` Eric Bénard
@ 2014-04-02 13:14       ` Shawn Guo
  2014-04-02 13:38         ` Eric Bénard
  0 siblings, 1 reply; 13+ messages in thread
From: Shawn Guo @ 2014-04-02 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 24, 2014 at 04:41:41PM +0100, Eric B?nard wrote:
> Hi Hubert,
> 
> Le Mon, 24 Mar 2014 16:30:49 +0100 (CET),
> CHAUMETTE Hubert <hchaumette@adeneo-embedded.com> a ?crit :
> > > From: "Eric B?nard" <eric@eukrea.com>
> > > that's board specific (the needed delay depends on the routing delay on
> > > the PCB), so this should not go in a generic file.
> > > 
> > > Eric
> > > 
> > 
> > I admit it may need to be in a separate function, but this file already contains
> > board-specific fixups (for imx6q sabrelite, Data Modul eDM-QMX6).
> > 
> true but that's not a reason to add more ;-)
> 
> > Anyway, do you have any suggestion for the location I should put it ?
> > 
> no idea at the moment, I simply used your patch to bring this issue on
> the ML as we recently needed to patch the default values for testing
> mainline kernel on a custom boards.

Hmm, can such board-specific fixups be pushed down to bootloader?

Shawn

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-02 13:14       ` Shawn Guo
@ 2014-04-02 13:38         ` Eric Bénard
  2014-04-02 14:14           ` Ben Dooks
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Bénard @ 2014-04-02 13:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Shawn,

Le Wed, 2 Apr 2014 21:14:08 +0800,
Shawn Guo <shawn.guo@linaro.org> a ?crit :

> 
> On Mon, Mar 24, 2014 at 04:41:41PM +0100, Eric B?nard wrote:
> > Hi Hubert,
> > 
> > Le Mon, 24 Mar 2014 16:30:49 +0100 (CET),
> > CHAUMETTE Hubert <hchaumette@adeneo-embedded.com> a ?crit :
> > > > From: "Eric B?nard" <eric@eukrea.com>
> > > > that's board specific (the needed delay depends on the routing delay on
> > > > the PCB), so this should not go in a generic file.
> > > > 
> > > > Eric
> > > > 
> > > 
> > > I admit it may need to be in a separate function, but this file already contains
> > > board-specific fixups (for imx6q sabrelite, Data Modul eDM-QMX6).
> > > 
> > true but that's not a reason to add more ;-)
> > 
> > > Anyway, do you have any suggestion for the location I should put it ?
> > > 
> > no idea at the moment, I simply used your patch to bring this issue on
> > the ML as we recently needed to patch the default values for testing
> > mainline kernel on a custom boards.
> 
> Hmm, can such board-specific fixups be pushed down to bootloader?
> 
that won't work if the kernel reset the PHY.

Eric

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-02 13:38         ` Eric Bénard
@ 2014-04-02 14:14           ` Ben Dooks
  0 siblings, 0 replies; 13+ messages in thread
From: Ben Dooks @ 2014-04-02 14:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/04/14 14:38, Eric B?nard wrote:
> Hi Shawn,
>
> Le Wed, 2 Apr 2014 21:14:08 +0800,
> Shawn Guo <shawn.guo@linaro.org> a ?crit :
>
>>
>> On Mon, Mar 24, 2014 at 04:41:41PM +0100, Eric B?nard wrote:
>>> Hi Hubert,
>>>
>>> Le Mon, 24 Mar 2014 16:30:49 +0100 (CET),
>>> CHAUMETTE Hubert <hchaumette@adeneo-embedded.com> a ?crit :
>>>>> From: "Eric B?nard" <eric@eukrea.com>
>>>>> that's board specific (the needed delay depends on the routing delay on
>>>>> the PCB), so this should not go in a generic file.
>>>>>
>>>>> Eric
>>>>>
>>>>
>>>> I admit it may need to be in a separate function, but this file already contains
>>>> board-specific fixups (for imx6q sabrelite, Data Modul eDM-QMX6).
>>>>
>>> true but that's not a reason to add more ;-)
>>>
>>>> Anyway, do you have any suggestion for the location I should put it ?
>>>>
>>> no idea at the moment, I simply used your patch to bring this issue on
>>> the ML as we recently needed to patch the default values for testing
>>> mainline kernel on a custom boards.
>>
>> Hmm, can such board-specific fixups be pushed down to bootloader?
>>
> that won't work if the kernel reset the PHY.

If it is in device-tree, then you can add it to the phy node.

For earlier Micrel Phys we have a LED mode setting on initialisaion.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-03-21 17:08 [PATCH] ARM: i.MX6: update KSZ9031 phy fixup Hubert Chaumette
  2014-03-21 21:23 ` Eric Bénard
@ 2014-04-02 20:01 ` Anatolij Gustschin
  2014-04-03 14:05   ` Hubert Chaumette
  1 sibling, 1 reply; 13+ messages in thread
From: Anatolij Gustschin @ 2014-04-02 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 21 Mar 2014 18:08:07 +0100
Hubert Chaumette <hchaumette@adeneo-embedded.com> wrote:

> Update KSZ9031RN phy fixup for Congatec conga-QEVAL and conga-QMX6 combo :
> set RGMII GTX_CLK and RX_CLK pad skew to +0.96ns.
> 
> Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com>
> ---
>  arch/arm/mach-imx/mach-imx6q.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index 76e5db4..db307c2 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -77,6 +77,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
>  	mmd_write_reg(dev, 2, 5, 0);
>  	mmd_write_reg(dev, 2, 8, 0x003ff);
>  
> +	/* For Congatec conga-QMX6 board */
> +	mmd_write_reg(dev, 0x02, 0x06, 0xffff);

The patch sets TX Data Pad Skew TXD0-TXD3 but the commit message states
that it sets GTX/RX CLK pad skew. The GTX/RX CLK pad skew is already
set to +0.96ns by writing 0x003ff to the register 8.

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 have a patch for setting ksz9031rn GTX/RX CLK pad skew in a similar
way over device tree and plan to submit it when the net-next merge
window for v3.16 opens.

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-02 20:01 ` Anatolij Gustschin
@ 2014-04-03 14:05   ` Hubert Chaumette
  2014-04-03 14:56     ` Anatolij Gustschin
  2014-04-06 11:06     ` Shawn Guo
  0 siblings, 2 replies; 13+ messages in thread
From: Hubert Chaumette @ 2014-04-03 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

Le mercredi 02 avril 2014 ? 22:01 +0200, Anatolij Gustschin a ?crit :
> On Fri, 21 Mar 2014 18:08:07 +0100
> Hubert Chaumette <hchaumette@adeneo-embedded.com> wrote:
> 
> > Update KSZ9031RN phy fixup for Congatec conga-QEVAL and conga-QMX6 combo :
> > set RGMII GTX_CLK and RX_CLK pad skew to +0.96ns.
> > 
> > Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com>
> > ---
> >  arch/arm/mach-imx/mach-imx6q.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> > index 76e5db4..db307c2 100644
> > --- a/arch/arm/mach-imx/mach-imx6q.c
> > +++ b/arch/arm/mach-imx/mach-imx6q.c
> > @@ -77,6 +77,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
> >  	mmd_write_reg(dev, 2, 5, 0);
> >  	mmd_write_reg(dev, 2, 8, 0x003ff);
> >  
> > +	/* For Congatec conga-QMX6 board */
> > +	mmd_write_reg(dev, 0x02, 0x06, 0xffff);
> 
> The patch sets TX Data Pad Skew TXD0-TXD3 but the commit message states
> that it sets GTX/RX CLK pad skew. The GTX/RX CLK pad skew is already
> set to +0.96ns by writing 0x003ff to the register 8.

Indeed, the message should be "set RGMII TXD0 to TXD3 output pad skew to
+0.48ns".

> 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().

> I have a patch for setting ksz9031rn GTX/RX CLK pad skew in a similar
> way over device tree and plan to submit it when the net-next merge
> window for v3.16 opens.

So, you have already implemented the ksz9031 binding ?

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-03 14:05   ` Hubert Chaumette
@ 2014-04-03 14:56     ` Anatolij Gustschin
  2014-04-06 11:06     ` Shawn Guo
  1 sibling, 0 replies; 13+ messages in thread
From: Anatolij Gustschin @ 2014-04-03 14:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 03 Apr 2014 16:05:47 +0200
Hubert Chaumette <hchaumette@adeneo-embedded.com> wrote:
...
> > 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().

Probably because nobody cared to use it.

> > I have a patch for setting ksz9031rn GTX/RX CLK pad skew in a similar
> > way over device tree and plan to submit it when the net-next merge
> > window for v3.16 opens.
> 
> So, you have already implemented the ksz9031 binding ?

Partially (for GTX/RX CLK). I'm attaching a patch that I currently have.
For ksz9031rn in my DTS fec node I used:

	/* ksz9031rn: min 0, max 1860, step 60 */
        rxc-skew-ps = <1620>;
        txc-skew-ps = <1620>;

Unfortunately I'm short on time and won't be able to implement other
pad skew settings in the near future, so please fill free to extend
and push the patch.

Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-imx6-configure-ksz90x1rn-PHY-pad-skew-settings-o.patch
Type: text/x-patch
Size: 6002 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140403/f898a40d/attachment.bin>

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-03 14:05   ` Hubert Chaumette
  2014-04-03 14:56     ` Anatolij Gustschin
@ 2014-04-06 11:06     ` Shawn Guo
  2014-04-06 11:26       ` Russell King - ARM Linux
  1 sibling, 1 reply; 13+ messages in thread
From: Shawn Guo @ 2014-04-06 11:06 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Shawn

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-06 11:06     ` Shawn Guo
@ 2014-04-06 11:26       ` Russell King - ARM Linux
  2014-04-06 12:04         ` Shawn Guo
  0 siblings, 1 reply; 13+ messages in thread
From: Russell King - ARM Linux @ 2014-04-06 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

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@kosagi.com>
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.

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

* [PATCH] ARM: i.MX6: update KSZ9031 phy fixup
  2014-04-06 11:26       ` Russell King - ARM Linux
@ 2014-04-06 12:04         ` Shawn Guo
  0 siblings, 0 replies; 13+ messages in thread
From: Shawn Guo @ 2014-04-06 12:04 UTC (permalink / raw)
  To: linux-arm-kernel

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@kosagi.com>
> 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

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

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-21 17:08 [PATCH] ARM: i.MX6: update KSZ9031 phy fixup Hubert Chaumette
2014-03-21 21:23 ` Eric Bénard
2014-03-24 15:30   ` CHAUMETTE Hubert
2014-03-24 15:41     ` Eric Bénard
2014-04-02 13:14       ` Shawn Guo
2014-04-02 13:38         ` Eric Bénard
2014-04-02 14:14           ` Ben Dooks
2014-04-02 20:01 ` Anatolij Gustschin
2014-04-03 14:05   ` Hubert Chaumette
2014-04-03 14:56     ` Anatolij Gustschin
2014-04-06 11:06     ` Shawn Guo
2014-04-06 11:26       ` Russell King - ARM Linux
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).