From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Mark Brown <broonie@kernel.org>,
Masahisa Kojima <masahisa.kojima@linaro.org>,
Jassi Brar <jaswinder.singh@linaro.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode
Date: Fri, 28 Jul 2023 11:44:16 +0300 [thread overview]
Message-ID: <ZMN/4F4TZZtt8B/b@hades> (raw)
In-Reply-To: <CAMj1kXH_4OEY58Nb9yGHTDvjfouJHKNVhReo0mMdD_aGWW_WGQ@mail.gmail.com>
Hi Ard, Mark
On Fri, Jul 28, 2023 at 07:45:44AM +0200, Ard Biesheuvel wrote:
> (cc Masahisa)
>
> On Thu, 27 Jul 2023 at 23:52, Mark Brown <broonie@kernel.org> wrote:
> >
> > As documented in acd7aaf51b20 ("netsec: ignore 'phy-mode' device
> > property on ACPI systems") the SocioNext SynQuacer platform ships with
> > firmware defining the PHY mode as RGMII even though the physical
> > configuration of the PHY is for TX and RX commits. Since
> > bbc4d71d63549bc ("net: phy: realtek: fix rtl8211e rx/tx delay config")
> > this has caused misconfiguration of the PHY, rendering the network
> > unusable.
> >
> > This was worked around for ACPI by ignoring the phy-mode property but
> > the system is also used with DT. Since the firmware used with DT is the
> > same (the firmware interface is selectable in the firmware
> > configuration) and the firmware configures the PHY prior to running the
> > OS we can use the same workaround.
> >
>
> Wouldn't this break SynQuacers booting with firmware that lacks a
> network driver? (I.e., u-boot?)
>
U-Boot does support the network interface (sni-netsec.c) but I'll have to
check what that code does wrt to the PHY config. Since the interface works
I am assuming some config is done properly.
> I am not sure why, but quite some effort has gone into porting u-boot
> to this SoC as well.
It was mostly an effort to prove the box is SystemReady-IR compliant. On
top of that it was (back then) one of the few available platforms with an
RPMB interface and OP-TEE support, so it was used for demonstrating storing
EFI variables there.
Regards
/Ilias
>
>
> > Limit this to the SynQuacer, though practically speaking this is the
> > only currently known system using this device.
> >
> > Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver")
> > Signed-off-by: Mark Brown <broonie@kernel.org>
> > ---
> > drivers/net/ethernet/socionext/netsec.c | 18 ++++++++++++++----
> > 1 file changed, 14 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
> > index 2d7347b71c41..ae4d336efaa4 100644
> > --- a/drivers/net/ethernet/socionext/netsec.c
> > +++ b/drivers/net/ethernet/socionext/netsec.c
> > @@ -1845,10 +1845,20 @@ static int netsec_of_probe(struct platform_device *pdev,
> > {
> > int err;
> >
> > - err = of_get_phy_mode(pdev->dev.of_node, &priv->phy_interface);
> > - if (err) {
> > - dev_err(&pdev->dev, "missing required property 'phy-mode'\n");
> > - return err;
> > + if (of_machine_is_compatible("socionext,developer-box")) {
> > + /*
> > + * SynQuacer reports RGMII but is physically
> > + * configured with TX and RX delays, since the
> > + * firwmare configures the PHY prior to boot just
> > + * ignore the configuration.
> > + */
> > + priv->phy_interface = PHY_INTERFACE_MODE_NA;
> > + } else {
> > + err = of_get_phy_mode(pdev->dev.of_node, &priv->phy_interface);
> > + if (err) {
> > + dev_err(&pdev->dev, "missing required property 'phy-mode'\n");
> > + return err;
> > + }
> > }
> >
> > priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
> >
> > ---
> > base-commit: 6eaae198076080886b9e7d57f4ae06fa782f90ef
> > change-id: 20230727-synquacer-net-e241f34baceb
> >
> > Best regards,
> > --
> > Mark Brown <broonie@kernel.org>
> >
next prev parent reply other threads:[~2023-07-28 8:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 21:52 [PATCH] net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode Mark Brown
2023-07-28 5:45 ` Ard Biesheuvel
2023-07-28 8:41 ` Andrew Lunn
2023-07-28 11:43 ` Mark Brown
2023-07-28 12:35 ` Masahisa Kojima
2023-07-28 17:07 ` Andrew Lunn
2023-07-28 17:11 ` Mark Brown
2023-07-31 2:12 ` Masahisa Kojima
2023-07-28 8:44 ` Ilias Apalodimas [this message]
2023-07-28 9:02 ` Andrew Lunn
2023-07-28 11:14 ` Mark Brown
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=ZMN/4F4TZZtt8B/b@hades \
--to=ilias.apalodimas@linaro.org \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jaswinder.singh@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahisa.kojima@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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