From: Tomer Maimon <tmaimon77@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: alexandre.torgue@foss.st.com, tali.perry1@gmail.com,
edumazet@google.com, krzysztof.kozlowski+dt@linaro.org,
linux-stm32@st-md-mailman.stormreply.com,
benjaminfair@google.com, openbmc@lists.ozlabs.org,
joabreu@synopsys.com, joel@jms.id.au,
devicetree@vger.kernel.org, j.neuschaefer@gmx.net,
robh+dt@kernel.org, peppe.cavallaro@st.com,
linux-arm-kernel@lists.infradead.org, avifishman70@gmail.com,
venture@google.com, linux-kernel@vger.kernel.org,
mcoquelin.stm32@gmail.com, netdev@vger.kernel.org,
davem@davemloft.net
Subject: Re: [PATCH v1 2/2] net: stmmac: Add NPCM support
Date: Mon, 27 Nov 2023 17:19:15 +0200 [thread overview]
Message-ID: <CAP6Zq1ijfMSPjk1vPwDM2B+r_vAH3DShhSu_jr8xJyUkTQY89w@mail.gmail.com> (raw)
In-Reply-To: <CAP6Zq1jw9uLP_FQGR8=p3Y2NTP6XcNtzkJQ0dm3+xVNE1SpsVg@mail.gmail.com>
Hi Andrew,
I took a look at the xpcs driver and the stmmac driver and it doesn't
cover NPCM use.
in the NPCM case the stmmac ID=0x37 therefore the driver is linked to DWMAC1000
https://elixir.bootlin.com/linux/v6.7-rc2/source/drivers/net/ethernet/stmicro/stmmac/hwif.c#L139
to enable the xpcs, the stmmac should support xgmac or gmac4 and in
the NPCM is support only gmac.
https://elixir.bootlin.com/linux/v6.7-rc2/source/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c#L555
https://elixir.bootlin.com/linux/v6.7-rc2/source/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c#L573
and the most important thing is that the XPCS is handled through an
indirect register access and not through MDIO. the MDIO is connected
to the external PHY and not to the XPCS.
In that case, I think the best way to handle the XPCS is through the
NPCM glue layer, what do you think?
Thanks,
Tomer
On Thu, 23 Nov 2023 at 15:50, Tomer Maimon <tmaimon77@gmail.com> wrote:
>
> Hi Andrew,
>
> On Wed, 22 Nov 2023 at 20:45, Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Wed, Nov 22, 2023 at 07:50:57PM +0200, Tomer Maimon wrote:
> > > Hi Andrew,
> > >
> > > Thanks for your comments
> > >
> > > On Tue, 21 Nov 2023 at 18:42, Andrew Lunn <andrew@lunn.ch> wrote:
> > > >
> > > > > +void npcm_dwmac_pcs_init(struct npcm_dwmac *dwmac, struct device *dev,
> > > > > + struct plat_stmmacenet_data *plat_dat)
> > > > > +{
> > > > > + u16 val;
> > > > > +
> > > > > + iowrite16((u16)(SR_MII_CTRL >> 9), dwmac->reg + IND_AC_BA_REG);
> > > > > + val = ioread16(dwmac->reg + PCS_SR_MII_CTRL_REG);
> > > > > + val |= PCS_RST;
> > > > > + iowrite16(val, dwmac->reg + PCS_SR_MII_CTRL_REG);
> > > > > +
> > > > > + while (val & PCS_RST)
> > > > > + val = ioread16(dwmac->reg + PCS_SR_MII_CTRL_REG);
> > > > > +
> > > > > + val &= ~(PCS_AN_ENABLE);
> > > > > + iowrite16(val, dwmac->reg + PCS_SR_MII_CTRL_REG);
> > > > > +}
> > > >
> > > > Is this a licensed PCS implementation? Or home grown? If its been
> > > > licensed from somebody, it maybe should live in driver/net/pcs, so
> > > > others can reuse it when they license the same core.
> >
> > > we are using DWC PCS, I don't see support for DWC PCS and I am not
> > > sure it is supposed to be supported at /drivers/net/pcs
> >
> > I've not followed the naming used by Synopsys. Is DWC PCS the same as
> > XPCS? Does Synopsys have multiple PCS implementations?
> >
> > > I do see a patch set to support DWC PCS but I don't think it answers my needs
> > > https://patchwork.ozlabs.org/project/netdev/patch/1559674736-2190-3-git-send-email-weifeng.voon@intel.com/
> >
> > I _think_ this patch eventually got turned into
> > driver/net/pcs/pcs-xpcs.c
> >
> > What exactly does it not do for you?
> Thanks for pointing me to Synopsys (DWC) PCS in pcs-xpcs.c I need to
> check if the driver follows all our SGMII needs
> >
> > Andrew
>
> Best regards,
>
> Tomer
next prev parent reply other threads:[~2023-11-27 15:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 15:17 [PATCH v1 0/2] net: stmmac: add NPCM dwmac support Tomer Maimon
2023-11-21 15:17 ` [PATCH v1 1/2] dt-bindings: net: Add support NPCM dwmac Tomer Maimon
2023-11-21 17:21 ` Krzysztof Kozlowski
2023-11-21 15:17 ` [PATCH v1 2/2] net: stmmac: Add NPCM support Tomer Maimon
2023-11-21 15:45 ` Russell King (Oracle)
2023-11-22 17:23 ` Tomer Maimon
2023-11-27 15:58 ` Russell King (Oracle)
2023-11-30 17:15 ` Tomer Maimon
2023-11-21 16:00 ` Andrew Lunn
2023-11-22 17:50 ` Tomer Maimon
2023-11-22 18:45 ` Andrew Lunn
2023-11-23 13:50 ` Tomer Maimon
2023-11-27 15:19 ` Tomer Maimon [this message]
2023-11-28 23:31 ` Andrew Lunn
2023-11-30 17:17 ` Tomer Maimon
2023-11-30 17:26 ` Andrew Lunn
2023-11-30 18:25 ` Tomer Maimon
2023-11-30 19:59 ` Serge Semin
2023-11-30 20:34 ` [Linux-stm32] " Maxime Chevallier
2023-12-01 16:25 ` Serge Semin
2023-11-22 2:11 ` kernel test robot
2023-11-22 4:45 ` kernel test robot
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=CAP6Zq1ijfMSPjk1vPwDM2B+r_vAH3DShhSu_jr8xJyUkTQY89w@mail.gmail.com \
--to=tmaimon77@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=j.neuschaefer@gmx.net \
--cc=joabreu@synopsys.com \
--cc=joel@jms.id.au \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=peppe.cavallaro@st.com \
--cc=robh+dt@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=venture@google.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;
as well as URLs for NNTP newsgroup(s).