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] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 26 Jan 2020 20:23:58 +0000
From:   Chris Packham <Chris.Packham@...iedtelesis.co.nz>
To:     "robh+dt@...nel.org" <robh+dt@...nel.org>
CC:     "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: spi: Document binding for generic SPI
 multiplexer

On Thu, 2020-01-23 at 07:51 -0600, Rob Herring wrote:
> On Wed, Jan 22, 2020 at 7:24 PM Chris Packham
> <chris.packham@...iedtelesis.co.nz> wrote:
> > 
> > Add binding documentation for the spi-mux driver. This allows a generic
> > multiplexer to be used to provide access to multiple SPI devices.
> > 
> > Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
> > ---
> > 
> > Notes:
> >     Changes in v2:
> >     - update license
> >     - make dt_binding_check clean
> 
> Sure about that?
> 

I was when I wrote that, but now I think I need to consult my spell
book.

It appears the incantation I should be using is

  make ARCH=arm defconfig
  make ARCH=arm dt_binding_check \
     DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/spi-mux.yaml

I can see the simple failures (not sure how I missed them). But one
that remains is:

Warning (spi_bus_bridge): /example-0/spi/spi-mux@0: node name for SPI
buses should be 'spi'

I could fix that by having

 spi {
    spi@0 {
       compatible = "spi-mux";
    };
 };

Is that what we want? Or should I be adding awareness of spi-muxes to
dtc?

> > 
> >  .../devicetree/bindings/spi/spi-mux.yaml      | 84 +++++++++++++++++++
> >  1 file changed, 84 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-mux.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-mux.yaml b/Documentation/devicetree/bindings/spi/spi-mux.yaml
> > new file mode 100644
> > index 000000000000..4bdb31e2257e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-mux.yaml
> > @@ -0,0 +1,84 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/spi/spi-mux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Generic SPI Multiplexer
> > +
> > +description: |
> > +  This binding describes a SPI bus multiplexer to route the SPI chip select
> > +  signals. This can be used when you need more devices than the SPI controller
> > +  has chip selects available. An example setup is shown in ASCII art; the actual
> > +  setting of the multiplexer to a channel needs to be done by a specific SPI mux
> > +  driver.
> > +
> > +        MOSI /--------------------------------+--------+--------+--------\
> > +        MISO |/------------------------------+|-------+|-------+|-------\|
> > +         SCL ||/----------------------------+||------+||------+||------\||
> > +             |||                            |||      |||      |||      |||
> > +      +------------+                        |||      |||      |||      |||
> > +      | SoC  |||   |                      +-+++-+  +-+++-+  +-+++-+  +-+++-+
> > +      |      |||   |                      | dev |  | dev |  | dev |  | dev |
> > +      |   +--+++-+ | CS-X  +------+\      +--+--+  +--+--+  +--+--+  +--+--+
> > +      |   | SPI  +-|-------+ Mux  |\\   CS-0 |        |        |        |
> > +      |   +------+ |       +--+---+\\\-------/   CS-1 |        |        |
> > +      |            |          |    \\\----------------/   CS-2 |        |
> > +      |   +------+ |          |     \\-------------------------/   CS-3 |
> > +      |   | ?    +-|----------/      \----------------------------------/
> > +      |   +------+ |
> > +      +------------+
> > +
> > +allOf:
> > +  - $ref: "/schemas/spi/spi-controller.yaml#"
> > +
> > +maintainers:
> > +  - Chris Packham <chris.packham@...iedtelesis.co.nz>
> > +
> > +properties:
> > +  compatible:
> > +    const: spi-mux
> > +
> > +  mux-controls:
> > +    maxItems: 1
> > +
> > +required:
> > +   - compatible
> > +   - reg
> > +   - spi-max-frequency
> > +   - mux-controls
> > +
> > +examples:
> > +   - |
> > +     mux: mux-controller {
> > +       compatible = "gpio-mux";
> > +       #mux-control-cells = <0>;
> > +
> > +       mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
> > +     };
> > +
> > +     spi {
> > +       spi-mux@0 {
> > +         compatible = "spi-mux";
> > +         #address-cells = <1>;
> > +         #size-cells = <0>;
> > +         reg = <0>;
> > +         spi-max-frequency = <100000000>;
> > +
> > +         mux-controls = <&mux>
> 
> Missing semicolon.
> 
> > +
> > +         spi-flash@0 {
> > +           compatible = "jedec,spi-nor";
> > +           #address-cells = <1>;
> > +           #size-cells = <1>;
> > +           reg = <0>;
> > +           spi-max-frequency = <40000000>;
> > +         };
> > +
> > +         spi-device@1 {
> > +           compatible = "lineartechnology,ltc2488";
> > +           reg = <1>;
> > +           spi-max-frequency = <10000000>;
> > +         };
> > +       };
> > +     };
> > --
> > 2.25.0
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ