lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210218155231.cftvlzjuweumxarv@mobilestation>
Date:   Thu, 18 Feb 2021 18:52:31 +0300
From:   Serge Semin <Sergey.Semin@...kalelectronics.ru>
To:     Rob Herring <robh@...nel.org>
CC:     Serge Semin <fancer.lancer@...il.com>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Jose Abreu <joabreu@...opsys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
        Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
        Vyacheslav Mitrofanov 
        <Vyacheslav.Mitrofanov@...kalelectronics.ru>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        <netdev@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 01/16] dt-bindings: net: dwmac: Add DW GMAC GPIOs
 properties

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@...kalelectronics.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ