* [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
@ 2011-12-12 10:09 Richard Zhao
2011-12-12 12:56 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Richard Zhao @ 2011-12-12 10:09 UTC (permalink / raw)
To: netdev
Cc: linux-arm-kernel, davem, shawn.guo, jgq516, eric.miao, patches,
Richard Zhao
For imx6q sabrelite board, set phy RGMII pad skew.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 112af9b..d3b4463 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1513,6 +1513,21 @@ static inline void fec_reset_phy(struct platform_device *pdev)
}
#endif /* CONFIG_OF */
+/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
+static int ksz9021rn_phy_fixup(struct phy_device *phydev)
+{
+ /* min rx data delay */
+ phy_write(phydev, 0x0b, 0x8105);
+ phy_write(phydev, 0x0c, 0x0000);
+
+ /* max rx/tx clock delay, min rx/tx control delay */
+ phy_write(phydev, 0x0b, 0x8104);
+ phy_write(phydev, 0x0c, 0xf0f0);
+ phy_write(phydev, 0x0b, 0x104);
+
+ return 0;
+}
+
static int __devinit
fec_probe(struct platform_device *pdev)
{
@@ -1597,6 +1612,10 @@ fec_probe(struct platform_device *pdev)
if (ret)
goto failed_init;
+ /* register the PHY board fixup (for Micrel KSZ9021RN) */
+ phy_register_fixup_for_uid(0x00221611, 0xfffffff0,
+ ksz9021rn_phy_fixup);
+
ret = fec_enet_mii_init(pdev);
if (ret)
goto failed_mii_init;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-12 10:09 [PATCH 1/1] net/fec: add KSZ9021RN phy fixup Richard Zhao
@ 2011-12-12 12:56 ` Fabio Estevam
2011-12-12 13:51 ` Richard Zhao
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2011-12-12 12:56 UTC (permalink / raw)
To: Richard Zhao
Cc: netdev, patches, jgq516, eric.miao, shawn.guo, davem,
linux-arm-kernel
On Mon, Dec 12, 2011 at 8:09 AM, Richard Zhao <richard.zhao@linaro.org> wrote:
> For imx6q sabrelite board, set phy RGMII pad skew.
>
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> ---
> drivers/net/ethernet/freescale/fec.c | 19 +++++++++++++++++++
> 1 files changed, 19 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> index 112af9b..d3b4463 100644
> --- a/drivers/net/ethernet/freescale/fec.c
> +++ b/drivers/net/ethernet/freescale/fec.c
> @@ -1513,6 +1513,21 @@ static inline void fec_reset_phy(struct platform_device *pdev)
> }
> #endif /* CONFIG_OF */
>
> +/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
> +static int ksz9021rn_phy_fixup(struct phy_device *phydev)
> +{
> + /* min rx data delay */
> + phy_write(phydev, 0x0b, 0x8105);
> + phy_write(phydev, 0x0c, 0x0000);
> +
> + /* max rx/tx clock delay, min rx/tx control delay */
> + phy_write(phydev, 0x0b, 0x8104);
> + phy_write(phydev, 0x0c, 0xf0f0);
> + phy_write(phydev, 0x0b, 0x104);
> +
> + return 0;
This should go to drivers/net/phy/micrel.c.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-12 12:56 ` Fabio Estevam
@ 2011-12-12 13:51 ` Richard Zhao
2011-12-12 14:42 ` Veli-Pekka Peltola
0 siblings, 1 reply; 9+ messages in thread
From: Richard Zhao @ 2011-12-12 13:51 UTC (permalink / raw)
To: Fabio Estevam
Cc: Richard Zhao, patches, netdev, jgq516, eric.miao, shawn.guo,
davem, linux-arm-kernel
On Mon, Dec 12, 2011 at 10:56:48AM -0200, Fabio Estevam wrote:
> On Mon, Dec 12, 2011 at 8:09 AM, Richard Zhao <richard.zhao@linaro.org> wrote:
> > For imx6q sabrelite board, set phy RGMII pad skew.
> >
> > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > ---
> > drivers/net/ethernet/freescale/fec.c | 19 +++++++++++++++++++
> > 1 files changed, 19 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> > index 112af9b..d3b4463 100644
> > --- a/drivers/net/ethernet/freescale/fec.c
> > +++ b/drivers/net/ethernet/freescale/fec.c
> > @@ -1513,6 +1513,21 @@ static inline void fec_reset_phy(struct platform_device *pdev)
> > }
> > #endif /* CONFIG_OF */
> >
> > +/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
> > +static int ksz9021rn_phy_fixup(struct phy_device *phydev)
> > +{
> > + /* min rx data delay */
> > + phy_write(phydev, 0x0b, 0x8105);
> > + phy_write(phydev, 0x0c, 0x0000);
> > +
> > + /* max rx/tx clock delay, min rx/tx control delay */
> > + phy_write(phydev, 0x0b, 0x8104);
> > + phy_write(phydev, 0x0c, 0xf0f0);
> > + phy_write(phydev, 0x0b, 0x104);
> > +
> > + return 0;
>
> This should go to drivers/net/phy/micrel.c.
Why? It's specific to fec.
Thanks
Richard
>
> Regards,
>
> Fabio Estevam
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-12 13:51 ` Richard Zhao
@ 2011-12-12 14:42 ` Veli-Pekka Peltola
2011-12-13 2:10 ` Richard Zhao
0 siblings, 1 reply; 9+ messages in thread
From: Veli-Pekka Peltola @ 2011-12-12 14:42 UTC (permalink / raw)
To: Richard Zhao
Cc: patches, netdev, jgq516, eric.miao, Richard Zhao, shawn.guo,
Fabio Estevam, davem, linux-arm-kernel
On 12/12/2011 03:51 PM, Richard Zhao wrote:
> On Mon, Dec 12, 2011 at 10:56:48AM -0200, Fabio Estevam wrote:
>> On Mon, Dec 12, 2011 at 8:09 AM, Richard Zhao<richard.zhao@linaro.org> wrote:
>>> For imx6q sabrelite board, set phy RGMII pad skew.
>>>
>>> Signed-off-by: Richard Zhao<richard.zhao@linaro.org>
>>> ---
>>> drivers/net/ethernet/freescale/fec.c | 19 +++++++++++++++++++
>>> 1 files changed, 19 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
>>> index 112af9b..d3b4463 100644
>>> --- a/drivers/net/ethernet/freescale/fec.c
>>> +++ b/drivers/net/ethernet/freescale/fec.c
>>> @@ -1513,6 +1513,21 @@ static inline void fec_reset_phy(struct platform_device *pdev)
>>> }
>>> #endif /* CONFIG_OF */
>>>
>>> +/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
>>> +static int ksz9021rn_phy_fixup(struct phy_device *phydev)
>>> +{
>>> + /* min rx data delay */
>>> + phy_write(phydev, 0x0b, 0x8105);
>>> + phy_write(phydev, 0x0c, 0x0000);
>>> +
>>> + /* max rx/tx clock delay, min rx/tx control delay */
>>> + phy_write(phydev, 0x0b, 0x8104);
>>> + phy_write(phydev, 0x0c, 0xf0f0);
>>> + phy_write(phydev, 0x0b, 0x104);
>>> +
>>> + return 0;
>>
>> This should go to drivers/net/phy/micrel.c.
> Why? It's specific to fec.
For me it seems to be a board specific and should be placed to the
machine file. Please include linux/micrel_phy.h and use proper defines
(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK).
--
Veli-Pekka Peltola
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-12 14:42 ` Veli-Pekka Peltola
@ 2011-12-13 2:10 ` Richard Zhao
2011-12-13 2:36 ` Shawn Guo
0 siblings, 1 reply; 9+ messages in thread
From: Richard Zhao @ 2011-12-13 2:10 UTC (permalink / raw)
To: Veli-Pekka Peltola, s.hauer, shawn.guo
Cc: Fabio Estevam, patches, netdev, jgq516, eric.miao, davem,
Richard Zhao, linux-arm-kernel
On Mon, Dec 12, 2011 at 04:42:07PM +0200, Veli-Pekka Peltola wrote:
> On 12/12/2011 03:51 PM, Richard Zhao wrote:
> >On Mon, Dec 12, 2011 at 10:56:48AM -0200, Fabio Estevam wrote:
> >>On Mon, Dec 12, 2011 at 8:09 AM, Richard Zhao<richard.zhao@linaro.org> wrote:
> >>>For imx6q sabrelite board, set phy RGMII pad skew.
> >>>
> >>>Signed-off-by: Richard Zhao<richard.zhao@linaro.org>
> >>>---
> >>> drivers/net/ethernet/freescale/fec.c | 19 +++++++++++++++++++
> >>> 1 files changed, 19 insertions(+), 0 deletions(-)
> >>>
> >>>diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> >>>index 112af9b..d3b4463 100644
> >>>--- a/drivers/net/ethernet/freescale/fec.c
> >>>+++ b/drivers/net/ethernet/freescale/fec.c
> >>>@@ -1513,6 +1513,21 @@ static inline void fec_reset_phy(struct platform_device *pdev)
> >>> }
> >>> #endif /* CONFIG_OF */
> >>>
> >>>+/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
> >>>+static int ksz9021rn_phy_fixup(struct phy_device *phydev)
> >>>+{
> >>>+ /* min rx data delay */
> >>>+ phy_write(phydev, 0x0b, 0x8105);
> >>>+ phy_write(phydev, 0x0c, 0x0000);
> >>>+
> >>>+ /* max rx/tx clock delay, min rx/tx control delay */
> >>>+ phy_write(phydev, 0x0b, 0x8104);
> >>>+ phy_write(phydev, 0x0c, 0xf0f0);
> >>>+ phy_write(phydev, 0x0b, 0x104);
> >>>+
> >>>+ return 0;
> >>
> >>This should go to drivers/net/phy/micrel.c.
> >Why? It's specific to fec.
>
> For me it seems to be a board specific and should be placed to the
> machine file.
By converting to DT, machine code's becoming common too. I feel hard to
find a place. Put it in imx6q_init_machine?
Sascha & Shawn, Could you give comments here?
> Please include linux/micrel_phy.h and use proper
> defines (PHY_ID_KSZ9021, MICREL_PHY_ID_MASK).
right. thanks.
Richard
>
> --
> Veli-Pekka Peltola
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-13 2:36 ` Shawn Guo
@ 2011-12-13 2:29 ` Jason Liu
2011-12-13 2:47 ` Shawn Guo
0 siblings, 1 reply; 9+ messages in thread
From: Jason Liu @ 2011-12-13 2:29 UTC (permalink / raw)
To: Shawn Guo
Cc: Richard Zhao, patches, netdev, s.hauer, jgq516, eric.miao,
Richard Zhao, Veli-Pekka Peltola, shawn.guo, Fabio Estevam, davem,
linux-arm-kernel
2011/12/13 Shawn Guo <shawn.guo@freescale.com>:
> On Tue, Dec 13, 2011 at 10:10:08AM +0800, Richard Zhao wrote:
>> By converting to DT, machine code's becoming common too. I feel hard to
>> find a place. Put it in imx6q_init_machine?
>>
>> Sascha & Shawn, Could you give comments here?
>>
> I see no problem to do that by checking board compatible string and
> do the setup for particular board.
Then, you may end up having more and more fix up in the fec driver
when all the platforms converted to DT,
which will put the fec driver into mess.
>
> --
> Regards,
> Shawn
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-13 2:10 ` Richard Zhao
@ 2011-12-13 2:36 ` Shawn Guo
2011-12-13 2:29 ` Jason Liu
0 siblings, 1 reply; 9+ messages in thread
From: Shawn Guo @ 2011-12-13 2:36 UTC (permalink / raw)
To: Richard Zhao
Cc: Veli-Pekka Peltola, s.hauer, shawn.guo, Fabio Estevam, patches,
netdev, jgq516, eric.miao, davem, Richard Zhao, linux-arm-kernel
On Tue, Dec 13, 2011 at 10:10:08AM +0800, Richard Zhao wrote:
> By converting to DT, machine code's becoming common too. I feel hard to
> find a place. Put it in imx6q_init_machine?
>
> Sascha & Shawn, Could you give comments here?
>
I see no problem to do that by checking board compatible string and
do the setup for particular board.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-13 2:29 ` Jason Liu
@ 2011-12-13 2:47 ` Shawn Guo
2011-12-13 8:28 ` Richard Zhao
0 siblings, 1 reply; 9+ messages in thread
From: Shawn Guo @ 2011-12-13 2:47 UTC (permalink / raw)
To: Jason Liu
Cc: Richard Zhao, patches, netdev, s.hauer, jgq516, eric.miao,
Richard Zhao, Veli-Pekka Peltola, shawn.guo, Fabio Estevam, davem,
linux-arm-kernel
On Tue, Dec 13, 2011 at 10:29:53AM +0800, Jason Liu wrote:
> 2011/12/13 Shawn Guo <shawn.guo@freescale.com>:
> > On Tue, Dec 13, 2011 at 10:10:08AM +0800, Richard Zhao wrote:
> >> By converting to DT, machine code's becoming common too. I feel hard to
> >> find a place. Put it in imx6q_init_machine?
> >>
> >> Sascha & Shawn, Could you give comments here?
> >>
> > I see no problem to do that by checking board compatible string and
> > do the setup for particular board.
>
> Then, you may end up having more and more fix up in the fec driver
> when all the platforms converted to DT,
> which will put the fec driver into mess.
>
I meant we do this in imx6q_init_machine().
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup
2011-12-13 2:47 ` Shawn Guo
@ 2011-12-13 8:28 ` Richard Zhao
0 siblings, 0 replies; 9+ messages in thread
From: Richard Zhao @ 2011-12-13 8:28 UTC (permalink / raw)
To: Shawn Guo
Cc: Jason Liu, patches, netdev, s.hauer, jgq516, eric.miao,
Richard Zhao, Veli-Pekka Peltola, shawn.guo, Fabio Estevam, davem,
linux-arm-kernel
On Tue, Dec 13, 2011 at 10:47:33AM +0800, Shawn Guo wrote:
> On Tue, Dec 13, 2011 at 10:29:53AM +0800, Jason Liu wrote:
> > 2011/12/13 Shawn Guo <shawn.guo@freescale.com>:
> > > On Tue, Dec 13, 2011 at 10:10:08AM +0800, Richard Zhao wrote:
> > >> By converting to DT, machine code's becoming common too. I feel hard to
> > >> find a place. Put it in imx6q_init_machine?
> > >>
> > >> Sascha & Shawn, Could you give comments here?
> > >>
> > > I see no problem to do that by checking board compatible string and
> > > do the setup for particular board.
> >
> > Then, you may end up having more and more fix up in the fec driver
> > when all the platforms converted to DT,
> > which will put the fec driver into mess.
> >
> I meant we do this in imx6q_init_machine().
all right. moved to machine code.
Thanks
Richard
>
> --
> Regards,
> Shawn
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-12-13 8:28 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 10:09 [PATCH 1/1] net/fec: add KSZ9021RN phy fixup Richard Zhao
2011-12-12 12:56 ` Fabio Estevam
2011-12-12 13:51 ` Richard Zhao
2011-12-12 14:42 ` Veli-Pekka Peltola
2011-12-13 2:10 ` Richard Zhao
2011-12-13 2:36 ` Shawn Guo
2011-12-13 2:29 ` Jason Liu
2011-12-13 2:47 ` Shawn Guo
2011-12-13 8:28 ` Richard Zhao
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).