[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+vNU0ETp7f+kGx3eDtsfhf_wVoAtrKqeZidFLKSEujDmFG6Q@mail.gmail.com>
Date: Tue, 6 Dec 2022 09:54:31 -0800
From: Tim Harvey <tharvey@...eworks.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Marek BehĂșn <kabel@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>
Subject: Re: [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for
internal PHY ports
On Mon, Dec 5, 2022 at 11:49 AM Vladimir Oltean <vladimir.oltean@....com> wrote:
>
> The ethernet-controller dt-schema, mostly pushed forward by Linux, has
> the "internal" PHY mode for denoting MAC connections to an internal PHY.
>
> U-Boot may provide device tree blobs where this phy-mode is specified,
> so make the Linux driver accept them.
>
> It appears that the current behavior with phy-mode = "internal" was
> introduced when mv88e6xxx started reporting supported_interfaces to
> phylink. Prior to that, I don't think it would have any issues accepting
> this phy-mode.
>
> Fixes: d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")
> Link: https://lore.kernel.org/linux-arm-kernel/20221205172709.kglithpbhdbsakvd@skbuf/T/
> Reported-by: Tim Harvey <tharvey@...eworks.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index ccfa4751d3b7..ba4fff8690aa 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -833,10 +833,13 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
>
> chip->info->ops->phylink_get_caps(chip, port, config);
>
> - /* Internal ports need GMII for PHYLIB */
> - if (mv88e6xxx_phy_is_internal(ds, port))
> + if (mv88e6xxx_phy_is_internal(ds, port)) {
> + __set_bit(PHY_INTERFACE_MODE_INTERNAL,
> + config->supported_interfaces);
> + /* Internal ports with no phy-mode need GMII for PHYLIB */
> __set_bit(PHY_INTERFACE_MODE_GMII,
> config->supported_interfaces);
> + }
> }
>
> static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
> --
> 2.34.1
>
Thanks,
This allows me to update the dt of the imx6q-gw5904 to make the
internal mdio phy's less ambiguous.
Tested-By: Tim Harvey <tharvey@...eworks.com> # imx6q-gw904.dts
Best Regards,
Tim
Powered by blists - more mailing lists