devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keguang Zhang <keguang.zhang@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>
Subject: Re: [PATCH v2 3/4] net: stmmac: Add glue layer for Loongson-1 SoC
Date: Tue, 22 Aug 2023 17:47:38 +0800	[thread overview]
Message-ID: <CAJhJPsWVRJg7zNeXPDovkBM4pm7hD+RP21DRxt0726VXtzvCHw@mail.gmail.com> (raw)
In-Reply-To: <c3454ad9-1874-4301-b1b1-4f76886802fb@lunn.ch>

On Mon, Aug 21, 2023 at 3:04 AM Andrew Lunn <andrew@lunn.ch> wrote:
>
> > +static int ls1b_dwmac_syscon_init(struct plat_stmmacenet_data *plat)
> > +{
> > +     struct ls1x_dwmac *dwmac = plat->bsp_priv;
> > +     struct regmap_field **regmap_fields = dwmac->regmap_fields;
> > +
> > +     if (plat->bus_id) {
> > +             regmap_field_write(regmap_fields[GMAC1_USE_UART1], 1);
> > +             regmap_field_write(regmap_fields[GMAC1_USE_UART0], 1);
> > +
> > +             switch (plat->phy_interface) {
> > +             case PHY_INTERFACE_MODE_RGMII:
> > +                     regmap_field_write(regmap_fields[GMAC1_USE_TXCLK], 0);
> > +                     regmap_field_write(regmap_fields[GMAC1_USE_PWM23], 0);
> > +                     break;
>
> What about the other three RGMII modes? Plain rgmii is pretty unusual,
> rgmii-id is the most used.
>
According to the LS1B datasheet, only RGMII and MII are supported.
And I can confirm that MII mode does work for LS1B.

> > +             case PHY_INTERFACE_MODE_MII:
> > +                     regmap_field_write(regmap_fields[GMAC1_USE_TXCLK], 1);
> > +                     regmap_field_write(regmap_fields[GMAC1_USE_PWM23], 1);
> > +                     break;
> > +             default:
> > +                     dev_err(dwmac->dev, "Unsupported PHY mode %u\n",
> > +                             plat->phy_interface);
> > +                     return -EOPNOTSUPP;
> > +             }
> > +
> > +             regmap_field_write(regmap_fields[GMAC1_SHUT], 0);
> > +     } else {
> > +             switch (plat->phy_interface) {
> > +             case PHY_INTERFACE_MODE_RGMII:
> > +                     regmap_field_write(regmap_fields[GMAC0_USE_TXCLK], 0);
> > +                     regmap_field_write(regmap_fields[GMAC0_USE_PWM01], 0);
> > +                     break;
>
> same here.
>
>      Andrew



-- 
Best regards,

Keguang Zhang

  reply	other threads:[~2023-08-22  9:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 11:13 [PATCH v2 0/4] Move Loongson1 MAC arch-code to the driver dir Keguang Zhang
2023-08-16 11:13 ` [PATCH v2 1/4] dt-bindings: mfd: syscon: Add compatibles for Loongson-1 syscon Keguang Zhang
2023-08-19 14:23   ` Krzysztof Kozlowski
2023-08-21 11:00     ` Keguang Zhang
2023-08-21 12:06       ` Krzysztof Kozlowski
2023-08-16 11:13 ` [PATCH v2 2/4] dt-bindings: net: Add Loongson-1 DWMAC glue layer Keguang Zhang
2023-08-19 14:26   ` Krzysztof Kozlowski
2023-08-21 13:26     ` Keguang Zhang
2023-08-16 11:13 ` [PATCH v2 3/4] net: stmmac: Add glue layer for Loongson-1 SoC Keguang Zhang
2023-08-19 19:05   ` Simon Horman
2023-08-21 13:27     ` Keguang Zhang
2023-08-20 19:04   ` Andrew Lunn
2023-08-22  9:47     ` Keguang Zhang [this message]
2023-08-22  9:49       ` Keguang Zhang
2023-08-22 15:21         ` Andrew Lunn
2023-08-22 15:20       ` Andrew Lunn
2023-08-23  2:47         ` Keguang Zhang
2023-08-23  3:46           ` Andrew Lunn
2023-08-23  4:40             ` Keguang Zhang
2023-08-16 11:13 ` [PATCH v2 4/4] MAINTAINERS: Update MIPS/LOONGSON1 entry Keguang Zhang

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=CAJhJPsWVRJg7zNeXPDovkBM4pm7hD+RP21DRxt0726VXtzvCHw@mail.gmail.com \
    --to=keguang.zhang@gmail.com \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=robh+dt@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).