Re: [PATCH] ARM: mach-imx6q: add ksz9131rn_phy_fixup

From: Philippe Schenker
Date: Fri Mar 06 2020 - 11:30:42 EST


On Fri, 2020-03-06 at 14:38 +0100, Andrew Lunn wrote:
> > > It probably does not even need that. Just
> > >
> > > phy-mode = <rgmii-txid>
> >
> > Looks to me like this isn't supported by the Micrel PHY driver or am
> > I missing something?
>
> Ah, you are correct. It just has:
>
> if (of_node) {
> ksz9021_load_values_from_of(phydev, of_node,
> MII_KSZPHY_CLK_CONTROL_PAD_SKEW,
> "txen-skew-ps", "txc-skew-ps",
> "rxdv-skew-ps", "rxc-skew-ps");
> ksz9021_load_values_from_of(phydev, of_node,
> MII_KSZPHY_RX_DATA_PAD_SKEW,
> "rxd0-skew-ps", "rxd1-skew-ps",
> "rxd2-skew-ps", "rxd3-skew-ps");
> ksz9021_load_values_from_of(phydev, of_node,
> MII_KSZPHY_TX_DATA_PAD_SKEW,
> "txd0-skew-ps", "txd1-skew-ps",
> "txd2-skew-ps", "txd3-skew-ps");
> }
>
> and no support for phydev->interface.
>
> At minimum, you should use these DT properties, not a platform fixup.

As I said, I still think it is a good idea to have similar solutions at
the same place, especially for a successor PHY.

I also see the downsides so I'll go with your proposed solution.

Thanks everyone for the discussion!

Philippe
>
> If you want to, you can add support for rgmii-id, etc. There are five
> modes you need to support:
>
> PHY_INTERFACE_MODE_NA,
> PHY_INTERFACE_MODE_RGMII,
> PHY_INTERFACE_MODE_RGMII_ID,
> PHY_INTERFACE_MODE_RGMII_RXID,
> PHY_INTERFACE_MODE_RGMII_TXID,
>
> NA means "don't touch". Leave the RGMII delays alone, as configured by
> hardware default, strapping, bootloader, etc.
>
> Andrew