All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Schenker <philippe.schenker@toradex.com>
To: "linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-imx@nxp.com" <linux-imx@nxp.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"david@protonic.nl" <david@protonic.nl>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"o.rempel@pengutronix.de" <o.rempel@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>
Subject: Re: [PATCH v2] ARM: imx: allow to disable board specific PHY fixups
Date: Tue, 31 Mar 2020 08:06:06 +0000	[thread overview]
Message-ID: <159af8d57eff3ed93adff62b88adebd2a17c95b0.camel@toradex.com> (raw)
In-Reply-To: <20200330174114.GG25745@shell.armlinux.org.uk>

On Mon, 2020-03-30 at 18:41 +0100, Russell King - ARM Linux admin wrote:
> On Mon, Mar 30, 2020 at 10:33:03AM -0700, Florian Fainelli wrote:
> > 
> > On 3/29/2020 10:26 PM, Oleksij Rempel wrote:
> > > Hi Andrew,
> > > 
> > > On Sun, Mar 29, 2020 at 05:08:54PM +0200, Andrew Lunn wrote:
> > > > On Sun, Mar 29, 2020 at 01:04:57PM +0200, Oleksij Rempel wrote:
> > > > 
> > > > Hi Oleksij
> > > > 
> > > > > +config DEPRECATED_PHY_FIXUPS
> > > > > +	bool "Enable deprecated PHY fixups"
> > > > > +	default y
> > > > > +	---help---
> > > > > +	  In the early days it was common practice to configure
> > > > > PHYs by adding a
> > > > > +	  phy_register_fixup*() in the machine code. This
> > > > > practice turned out to
> > > > > +	  be potentially dangerous, because:
> > > > > +	  - it affects all PHYs in the system
> > > > > +	  - these register changes are usually not preserved
> > > > > during PHY reset
> > > > > +	    or suspend/resume cycle.
> > > > > +	  - it complicates debugging, since these configuration
> > > > > changes were not
> > > > > +	    done by the actual PHY driver.
> > > > > +	  This option allows to disable all fixups which are
> > > > > identified as
> > > > > +	  potentially harmful and give the developers a chance
> > > > > to implement the
> > > > > +	  proper configuration via the device tree (e.g.: phy-
> > > > > mode) and/or the
> > > > > +	  related PHY drivers.
> > > > 
> > > > This appears to be an IMX only problem. Everybody else seems to
> > > > of got
> > > > this right. There is no need to bother everybody with this new
> > > > option. Please put this in arch/arm/mach-mxs/Kconfig and have
> > > > IMX in
> > > > the name.
> > > 
> > > Actually, all fixups seems to do wring thing:
> > > arch/arm/mach-davinci/board-dm644x-evm.c:915:		phy_regi
> > > ster_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
> > > 
> > > Increased MII drive strength. Should be probably enabled by the
> > > PHY
> > > driver.
> > > 
> > > arch/arm/mach-imx/mach-imx6q.c:167:		phy_register_fix
> > > up_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
> > > arch/arm/mach-imx/mach-imx6q.c:169:		phy_register_fix
> > > up_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
> > > arch/arm/mach-imx/mach-imx6q.c:171:		phy_register_fix
> > > up_for_uid(PHY_ID_AR8031, 0xffffffef,
> > > arch/arm/mach-imx/mach-imx6q.c:173:		phy_register_fix
> > > up_for_uid(PHY_ID_AR8035, 0xffffffef,
> 
> As far as I'm concerned, the AR8035 fixup is there with good reason.
> It's not just "random" but is required to make the AR8035 usable with
> the iMX6 SoCs.  Not because of a board level thing, but because it's
> required for the AR8035 to be usable with an iMX6 SoC.
> 
> So, having it registered by the iMX6 SoC code is entirely logical and
> correct.
> 
> That's likely true of the AR8031 situation as well.
> 
> I can't speak for any of the others.

I can speak for the KSZ9031/KSZ9021 for those PHYs the fixup is solely
to add the TXC delay that, according to RGMII v1.3 spec should have been
done by hardware, and as i.MX6 as well as those PHYs do not have a
specific register to add that delay, the skew get set so the timing is
working somehow with the i.MX6 processor.

I'm fine when you want to remove those fixups. Please CC me because
we're relying on those at the moment. I would just put them into
devicetree.

Philippe

WARNING: multiple messages have this Message-ID (diff)
From: Philippe Schenker <philippe.schenker@toradex.com>
To: "linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"o.rempel@pengutronix.de" <o.rempel@pengutronix.de>,
	"linux-imx@nxp.com" <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"david@protonic.nl" <david@protonic.nl>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>
Subject: Re: [PATCH v2] ARM: imx: allow to disable board specific PHY fixups
Date: Tue, 31 Mar 2020 08:06:06 +0000	[thread overview]
Message-ID: <159af8d57eff3ed93adff62b88adebd2a17c95b0.camel@toradex.com> (raw)
In-Reply-To: <20200330174114.GG25745@shell.armlinux.org.uk>

On Mon, 2020-03-30 at 18:41 +0100, Russell King - ARM Linux admin wrote:
> On Mon, Mar 30, 2020 at 10:33:03AM -0700, Florian Fainelli wrote:
> > 
> > On 3/29/2020 10:26 PM, Oleksij Rempel wrote:
> > > Hi Andrew,
> > > 
> > > On Sun, Mar 29, 2020 at 05:08:54PM +0200, Andrew Lunn wrote:
> > > > On Sun, Mar 29, 2020 at 01:04:57PM +0200, Oleksij Rempel wrote:
> > > > 
> > > > Hi Oleksij
> > > > 
> > > > > +config DEPRECATED_PHY_FIXUPS
> > > > > +	bool "Enable deprecated PHY fixups"
> > > > > +	default y
> > > > > +	---help---
> > > > > +	  In the early days it was common practice to configure
> > > > > PHYs by adding a
> > > > > +	  phy_register_fixup*() in the machine code. This
> > > > > practice turned out to
> > > > > +	  be potentially dangerous, because:
> > > > > +	  - it affects all PHYs in the system
> > > > > +	  - these register changes are usually not preserved
> > > > > during PHY reset
> > > > > +	    or suspend/resume cycle.
> > > > > +	  - it complicates debugging, since these configuration
> > > > > changes were not
> > > > > +	    done by the actual PHY driver.
> > > > > +	  This option allows to disable all fixups which are
> > > > > identified as
> > > > > +	  potentially harmful and give the developers a chance
> > > > > to implement the
> > > > > +	  proper configuration via the device tree (e.g.: phy-
> > > > > mode) and/or the
> > > > > +	  related PHY drivers.
> > > > 
> > > > This appears to be an IMX only problem. Everybody else seems to
> > > > of got
> > > > this right. There is no need to bother everybody with this new
> > > > option. Please put this in arch/arm/mach-mxs/Kconfig and have
> > > > IMX in
> > > > the name.
> > > 
> > > Actually, all fixups seems to do wring thing:
> > > arch/arm/mach-davinci/board-dm644x-evm.c:915:		phy_regi
> > > ster_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
> > > 
> > > Increased MII drive strength. Should be probably enabled by the
> > > PHY
> > > driver.
> > > 
> > > arch/arm/mach-imx/mach-imx6q.c:167:		phy_register_fix
> > > up_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
> > > arch/arm/mach-imx/mach-imx6q.c:169:		phy_register_fix
> > > up_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
> > > arch/arm/mach-imx/mach-imx6q.c:171:		phy_register_fix
> > > up_for_uid(PHY_ID_AR8031, 0xffffffef,
> > > arch/arm/mach-imx/mach-imx6q.c:173:		phy_register_fix
> > > up_for_uid(PHY_ID_AR8035, 0xffffffef,
> 
> As far as I'm concerned, the AR8035 fixup is there with good reason.
> It's not just "random" but is required to make the AR8035 usable with
> the iMX6 SoCs.  Not because of a board level thing, but because it's
> required for the AR8035 to be usable with an iMX6 SoC.
> 
> So, having it registered by the iMX6 SoC code is entirely logical and
> correct.
> 
> That's likely true of the AR8031 situation as well.
> 
> I can't speak for any of the others.

I can speak for the KSZ9031/KSZ9021 for those PHYs the fixup is solely
to add the TXC delay that, according to RGMII v1.3 spec should have been
done by hardware, and as i.MX6 as well as those PHYs do not have a
specific register to add that delay, the skew get set so the timing is
working somehow with the i.MX6 processor.

I'm fine when you want to remove those fixups. Please CC me because
we're relying on those at the moment. I would just put them into
devicetree.

Philippe
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-03-31  8:06 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29 11:04 [PATCH v2] ARM: imx: allow to disable board specific PHY fixups Oleksij Rempel
2020-03-29 11:04 ` Oleksij Rempel
2020-03-29 15:08 ` Andrew Lunn
2020-03-29 15:08   ` Andrew Lunn
2020-03-30  5:26   ` Oleksij Rempel
2020-03-30  5:26     ` Oleksij Rempel
2020-03-30 17:33     ` Florian Fainelli
2020-03-30 17:33       ` Florian Fainelli
2020-03-30 17:41       ` Russell King - ARM Linux admin
2020-03-30 17:41         ` Russell King - ARM Linux admin
2020-03-31  7:47         ` Marc Kleine-Budde
2020-03-31  7:47           ` Marc Kleine-Budde
2020-03-31  7:54           ` Russell King - ARM Linux admin
2020-03-31  7:54             ` Russell King - ARM Linux admin
2020-03-31  8:00             ` Marc Kleine-Budde
2020-03-31  8:00               ` Marc Kleine-Budde
2020-03-31  8:19               ` Russell King - ARM Linux admin
2020-03-31  8:19                 ` Russell King - ARM Linux admin
2020-04-01  6:33                 ` Oleksij Rempel
2020-04-01  6:33                   ` Oleksij Rempel
2020-04-01 17:10                   ` Florian Fainelli
2020-04-01 17:10                     ` Florian Fainelli
2020-03-31  8:06         ` Philippe Schenker [this message]
2020-03-31  8:06           ` Philippe Schenker
2020-03-31  8:44         ` David Jander
2020-03-31  8:44           ` David Jander
2020-03-31  9:36           ` Russell King - ARM Linux admin
2020-03-31  9:36             ` Russell King - ARM Linux admin
2020-03-31 15:41             ` David Jander
2020-03-31 15:41               ` David Jander
2020-03-31 15:53               ` Russell King - ARM Linux admin
2020-03-31 15:53                 ` Russell King - ARM Linux admin
2020-03-31 12:54           ` Andrew Lunn
2020-03-31 12:54             ` Andrew Lunn
2020-03-31 15:15             ` Russell King - ARM Linux admin
2020-03-31 15:15               ` Russell King - ARM Linux admin
2020-03-31 15:40               ` Vladimir Oltean
2020-03-31 15:40                 ` Vladimir Oltean
2020-03-31 17:03           ` Russell King - ARM Linux admin
2020-03-31 17:03             ` Russell King - ARM Linux admin
2020-03-31 17:16             ` Oleksij Rempel
2020-03-31 17:16               ` Oleksij Rempel
2020-03-31 17:46               ` Russell King - ARM Linux admin
2020-03-31 17:46                 ` Russell King - ARM Linux admin
2020-03-31 13:45         ` Oleksij Rempel
2020-03-31 13:45           ` Oleksij Rempel
2020-03-31 14:08           ` Russell King - ARM Linux admin
2020-03-31 14:08             ` Russell King - ARM Linux admin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159af8d57eff3ed93adff62b88adebd2a17c95b0.camel@toradex.com \
    --to=philippe.schenker@toradex.com \
    --cc=andrew@lunn.ch \
    --cc=david@protonic.nl \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.