netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
To: Rob Herring <robh@kernel.org>
Cc: Serge Semin <fancer.lancer@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Vyacheslav Mitrofanov 
	<Vyacheslav.Mitrofanov@baikalelectronics.ru>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	<netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 01/16] dt-bindings: net: dwmac: Add DW GMAC GPIOs properties
Date: Thu, 18 Feb 2021 18:52:31 +0300	[thread overview]
Message-ID: <20210218155231.cftvlzjuweumxarv@mobilestation> (raw)
In-Reply-To: <20210210222805.upoioue7uc6cat2v@mobilestation>

On Thu, Feb 11, 2021 at 01:28:06AM +0300, Serge Semin wrote:
> On Tue, Feb 09, 2021 at 05:13:52PM -0600, Rob Herring wrote:
> > On Mon, Feb 08, 2021 at 05:08:05PM +0300, Serge Semin wrote:
> > > Synopsys DesignWare Ethernet controllers can be synthesized with
> > > General-Purpose IOs support. GPIOs can work either as inputs or as outputs
> > > thus belong to the gpi_i and gpo_o ports respectively. The ports width
> > > (number of possible inputs/outputs) and the configuration registers layout
> > > depend on the IP-core version. For instance, DW GMAC can have from 0 to 4
> > > GPIs and from 0 to 4 GPOs, while DW xGMAC have a wider ports width up to
> > > 16 pins of each one.
> > > 
> > > So the DW MAC DT-node can be equipped with "ngpios" property, which can't
> > > have a value greater than 32, standard GPIO-related properties like
> > > "gpio-controller" and "#gpio-cells", and, if GPIs are supposed to be
> > > detected, IRQ-controller related properties.
> > > 
> > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > ---
> > >  .../devicetree/bindings/net/snps,dwmac.yaml     | 17 +++++++++++++++++
> > >  1 file changed, 17 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > index bdc437b14878..fcca23d3727e 100644
> > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > @@ -110,6 +110,23 @@ properties:
> > >    reset-names:
> > >      const: stmmaceth
> > >  
> > > +  ngpios:
> > > +    description:
> > > +      Total number of GPIOs the MAC supports. The property shall include both
> > > +      the GPI and GPO ports width.
> > > +    minimum: 1
> > > +    maximum: 32
> > 
> 

> > Does the driver actually need this? I'd omit it if just to validate 
> > consumers are in range.
> 
> I can't say for all possible DW MAC IP-cores (I've got manuals for
> GMAC and xGMAC only), but at least DW GMAC can't have more than four
> GPIs and four GPOs, while XGMACs can be synthesized with up to 16
> each. That's why I've set the upper boundary here as 32. But the
> driver uses the ngpios property do determine the total number GPIOs
> the core has been synthesized. Th number of GPIs and GPOs will be
> auto-detected then (by writing-reading to-from the GPI type field of
> the GPIO control register).
> 
> > 
> > Are GPI and GPO counts independent? If so, this isn't really sufficient.
> 
> Yeap, they are independent. What do you suggest then? Define some
> vendor-specific properties like snps,ngpis and snps,ngpos? If so then
> they seem more generic than vendor-specific, because the separated
> GPI and GPO space isn't an unique feature of the DW MAC GPIOs. Do we
> need to create a generic version of such properties then? (That much
> more changes then introduced here. We'd need to fix the dt-schema tool
> too then.)
> 
> -Sergey

Rob, any comment on my questions above? As the kernel is in
merge-window now, I just hope this part won't get pushed back in the
emails log out of your sight.

-Sergey

> 
> > 
> > Rob

  reply	other threads:[~2021-02-18 17:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 14:08 [PATCH 00/16] net: stmmac: Add DW MAC GPIOs and Baikal-T1 GMAC support Serge Semin
2021-02-08 14:08 ` [PATCH 01/16] dt-bindings: net: dwmac: Add DW GMAC GPIOs properties Serge Semin
2021-02-09 23:13   ` Rob Herring
2021-02-10 22:28     ` Serge Semin
2021-02-18 15:52       ` Serge Semin [this message]
2021-02-08 14:08 ` [PATCH 02/16] dt-bindings: net: Add Baikal-T1 GMAC bindings Serge Semin
2021-02-09 23:24   ` Rob Herring
2021-02-08 14:08 ` [PATCH 03/16] net: stmmac: Introduce MAC core cleanup method Serge Semin
2021-02-08 14:08 ` [PATCH 04/16] net: stmmac: Introduce DMA " Serge Semin
2021-02-08 14:08 ` [PATCH 05/16] net: stmmac: Introduce MAC IRQs enable/disable methods Serge Semin
2021-02-08 14:08 ` [PATCH 06/16] net: stmmac: Extend DMA IRQs enable/disable interface Serge Semin
2021-02-08 14:08 ` [PATCH 07/16] net: stmmac: Introduce MTL IRQs enable/disable methods Serge Semin
2021-02-08 14:08 ` [PATCH 08/16] net: stmmac: Introduce Safety Feature " Serge Semin
2021-02-08 14:08 ` [PATCH 09/16] net: stmmac: Disable MMC IRQs in the generic IRQs disable method Serge Semin
2021-02-08 14:08 ` [PATCH 10/16] net: stmmac: Convert STMMAC_DOWN flag to STMMAC_UP Serge Semin
2021-02-08 14:08 ` [PATCH 11/16] net: stmmac: Add STMMAC state getter Serge Semin
2021-02-08 14:08 ` [PATCH 12/16] net: stmmac: Introduce NIC software reset function Serge Semin
2021-02-08 14:08 ` [PATCH 13/16] net: stmmac: Request IRQs at device probe stage Serge Semin
2021-02-08 14:08 ` [PATCH 14/16] net: stmmac: Add Generic DW MAC GPIO port driver Serge Semin
2021-02-08 14:08 ` [PATCH 15/16] net: stmmac: Add DW GMAC GPIOs support Serge Semin
2021-02-08 14:08 ` [PATCH 16/16] net: stmmac: Add DW MAC IPs of 3.72a/3.73a/3.74a versions Serge Semin
2021-02-08 19:36 ` [PATCH 00/16] net: stmmac: Add DW MAC GPIOs and Baikal-T1 GMAC support Andrew Lunn
2021-02-09 11:16   ` Serge Semin
2021-02-09 14:11     ` Andrew Lunn
2021-02-10 18:00       ` Serge Semin

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=20210218155231.cftvlzjuweumxarv@mobilestation \
    --to=sergey.semin@baikalelectronics.ru \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Vyacheslav.Mitrofanov@baikalelectronics.ru \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.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=peppe.cavallaro@st.com \
    --cc=robh@kernel.org \
    /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).