linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Philippe Schenker <philippe.schenker@toradex.com>
To: "o.rempel@pengutronix.de" <o.rempel@pengutronix.de>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"andrew@lunn.ch" <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"linux-imx@nxp.com" <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"david@protonic.nl" <david@protonic.nl>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031
Date: Wed, 3 Feb 2021 10:24:04 +0000	[thread overview]
Message-ID: <6688cc451a9307d9210976a9c422c70f6089f526.camel@toradex.com> (raw)
In-Reply-To: <20210203091857.16936-2-o.rempel@pengutronix.de>

On Wed, 2021-02-03 at 10:18 +0100, Oleksij Rempel wrote:
> Starting with:
> 
>     bcf3440c6dd7 ("net: phy: micrel: add phy-mode support for the
> KSZ9031 PHY")
> 
> the micrel phy driver started respecting phy-mode for the KSZ9031 PHY.
> At least with kernel v5.8 configuration provided by this fixup was
> overwritten by the micrel driver.
> 
> This fixup was providing following configuration:
> 
> RX path: 2.58ns delay
>     rx -0.42 (left shift) + rx_clk  +0.96ns (right shift) =
>         1,38 + 1,2 internal RX delay = 2.58ns
> TX path: 0.96ns delay
>     tx (no delay) + tx_clk 0.96ns (right shift) = 0.96ns
> 
> This configuration is outside of the recommended RGMII clock skew
> delays
> and about in the middle of: rgmii-idrx and rgmii-id
> 
> Since most embedded systems do not have enough place to introduce
> significant clock skew, rgmii-id is the way to go.
> 
> In case this patch breaks network functionality on your system, build
> kernel with enabled MICREL_PHY. If it is still not working then try
> following device tree options:
> 1. Set (or change) phy-mode in DT to:
>    phy-mode = "rgmii-id";
>    This actives internal delay for both RX and TX.
> 1. Set (or change) phy-mode in DT to:
>    phy-mode = "rgmii-idrx";
>    This actives internal delay for RX only.
> 3. Use following DT properties:
>    phy-mode = "rgmii";
>    txen-skew-psec = <0>;
>    rxdv-skew-psec = <0>;
>    rxd0-skew-psec = <0>;
>    rxd1-skew-psec = <0>;
>    rxd2-skew-psec = <0>;
>    rxd3-skew-psec = <0>;
>    rxc-skew-psec = <1860>;
>    txc-skew-psec = <1860>;
>    This activates the internal delays for RX and TX, with the value as
>    the fixup that is removed in this patch.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

For Toradex Boards:

Acked-by: Philippe Schenker <philippe.schenker@toradex.com>

> ---
>  arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
>  arch/arm/mach-imx/mach-imx6q.c          | 23 -----------------------
>  2 files changed, 1 insertion(+), 24 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> index fa2307d8ce86..c713ac03b3b9 100644
> --- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> +++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> @@ -112,7 +112,7 @@ flash: m25p80@0 {
>  &fec {
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_enet>;
> -       phy-mode = "rgmii";
> +       phy-mode = "rgmii-id";
>         phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
>         phy-supply = <&vgen2_1v2_eth>;
>         status = "okay";
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-
> imx6q.c
> index 703998ebb52e..78205f90da27 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device
> *phydev)
>         return 0;
>  }
>  
> -static void mmd_write_reg(struct phy_device *dev, int device, int
> reg, int val)
> -{
> -       phy_write(dev, 0x0d, device);
> -       phy_write(dev, 0x0e, reg);
> -       phy_write(dev, 0x0d, (1 << 14) | device);
> -       phy_write(dev, 0x0e, val);
> -}
> -
> -static int ksz9031rn_phy_fixup(struct phy_device *dev)
> -{
> -       /*
> -        * min rx data delay, max rx/tx clock delay,
> -        * min rx/tx control delay
> -        */
> -       mmd_write_reg(dev, 2, 4, 0);
> -       mmd_write_reg(dev, 2, 5, 0);
> -       mmd_write_reg(dev, 2, 8, 0x003ff);
> -
> -       return 0;
> -}
> -
>  /*
>   * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
>   * as they are used for slots1-7 PERST#
> @@ -152,8 +131,6 @@ static void __init imx6q_enet_phy_init(void)
>         if (IS_BUILTIN(CONFIG_PHYLIB)) {
>                 phy_register_fixup_for_uid(PHY_ID_KSZ9021,
> MICREL_PHY_ID_MASK,
>                                 ksz9021rn_phy_fixup);
> -               phy_register_fixup_for_uid(PHY_ID_KSZ9031,
> MICREL_PHY_ID_MASK,
> -                               ksz9031rn_phy_fixup);
>                 phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
>                                 ar8031_phy_fixup);
>                 phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,

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

  reply	other threads:[~2021-02-03 10:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  9:18 [PATCH v1 0/7] remove different PHY fixups Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031 Oleksij Rempel
2021-02-03 10:24   ` Philippe Schenker [this message]
2021-02-03  9:18 ` [PATCH v1 2/7] ARM i.MX6q: remove TX clock delay of ar8031_phy_fixup() Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 3/7] ARM i.MX6q: remove hand crafted PHY power up in ar8035_phy_fixup() Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 4/7] ARM i.MX6q: remove clk-out fixup for the Atheros AR8031 and AR8035 PHYs Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup Oleksij Rempel
2021-02-03  9:56   ` Russell King - ARM Linux admin
2021-02-08  9:20     ` Oleksij Rempel
2021-02-08 14:21       ` Russell King - ARM Linux admin
2021-02-03  9:18 ` [PATCH v1 6/7] ARM: imx6sx: remove Atheros AR8031 PHY fixup Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 7/7] ARM: imx7d: " Oleksij Rempel
2021-02-03  9:28 ` [PATCH v1 0/7] remove different PHY fixups 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=6688cc451a9307d9210976a9c422c70f6089f526.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 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).