Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407163

Re: [PATCH] devicetree - document using aliases to set spi bus number.

From Rob Herring <robh@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] devicetree - document using aliases to set spi bus number.
Date 2016-05-25 20:50 +0200
Message-ID <rCM2t-4mV-3@gated-at.bofh.it> (permalink)
References <rCnGO-5K5-11@gated-at.bofh.it> <rCoCR-6jw-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 06:41:41PM +0100, Mark Rutland wrote:
> On Tue, May 24, 2016 at 06:39:20PM +0200, Christer Weinigel wrote:
> > Document how to use devicetree aliases to assign a stable
> > bus number to a spi bus.
> > 
> > Signed-off-by: Christer Weinigel <christer@weinigel.se>
> > 
> > ---
> > 
> > Trivial documentation change.
> > 
> > Not having used devicetree that much it was surprisingly hard to
> > figure out how to assign a stable bus number to a spi bus.  Add a
> > simple example that shows how to do that.
> > 
> > Mark Cced as the SPI maintainer.  Or should trivial documentation
> > fixes like this be addressed to someone else?
> > 
> >   /Christer
> > 
> >  Documentation/devicetree/bindings/spi/spi-bus.txt | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
> > index 42d5954..c35c4c2 100644
> > --- a/Documentation/devicetree/bindings/spi/spi-bus.txt
> > +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
> > @@ -94,3 +94,13 @@ SPI example for an MPC5200 SPI bus:
> >  			reg = <1>;
> >  		};
> >  	};
> > +
> > +Normally SPI buses are assigned dynamic bus numbers starting at 32766
> > +and counting downwards.  It is possible to assign the bus number
> > +statically using devicetee aliases.  For example, on the MPC5200 the
> > +"spi@f00" device above is connected to the "soc" bus.  To set its
> > +bus_num to 1 add an aliases entry like this:
> 
> As Mark Brown pointed out, this is very Linux-specific (at least in the
> wording of the above).
> 
> Generally, aliases are there to match _physical_ identifiers (e.g. to
> match physical labels for UART0, UART1, and on).

While there may be some correlation to physical identifiers, the reality 
is aliases are used for mapping to Linux numbering. Their primary use 
has been to avoid breaking existing userspace and kernel command lines 
when converting to DT. The reality is that matters on very few platforms 
and can be solved in other ways for new platforms. For serial port 
console, that means using stdout-path for example. 

For SPI, I think we should use "label" which reflects a name that is 
defined by the h/w design and is meaningful to the user. Then perhaps 
the device becomes "/dev/spi/by-name/<label>/spidev.0" or simply 
"/dev/spidev-<label>.0".

Rob

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] devicetree - document using aliases to set spi bus number. Christer Weinigel <christer@weinigel.se> - 2016-05-24 18:50 +0200
  Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-24 19:30 +0200
    Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-24 20:20 +0200
      Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-24 20:40 +0200
        Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-24 21:00 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Rutland <mark.rutland@arm.com> - 2016-05-25 14:20 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 15:00 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 14:40 +0200
        Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 01:40 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 02:20 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus  number. Rob Herring <robh@kernel.org> - 2016-05-25 19:50 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 20:10 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 20:10 +0200
              Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 20:50 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-26 03:20 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus number. Rob Herring <robh@kernel.org> - 2016-05-26 03:50 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-26 04:00 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-26 12:20 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-26 13:00 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-26 20:50 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-26 23:10 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-27 18:50 +0200
  Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Rutland <mark.rutland@arm.com> - 2016-05-24 19:50 +0200
    Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-24 22:50 +0200
      Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Rutland <mark.rutland@arm.com> - 2016-05-25 11:30 +0200
        Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 12:40 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-25 13:30 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Rutland <mark.rutland@arm.com> - 2016-05-25 14:40 +0200
              Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 15:10 +0200
        Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 17:40 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Rutland <mark.rutland@arm.com> - 2016-05-25 18:10 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 18:30 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 20:10 +0200
          Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 20:00 +0200
            Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 20:50 +0200
              Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-27 20:40 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Christer Weinigel <christer@weinigel.se> - 2016-05-28 23:00 +0200
                Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-30 18:20 +0200
    Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 17:30 +0200
      Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Rutland <mark.rutland@arm.com> - 2016-05-25 18:10 +0200
        Re: [PATCH] devicetree - document using aliases to set spi bus number. Frank Rowand <frowand.list@gmail.com> - 2016-05-25 18:40 +0200
    Re: [PATCH] devicetree - document using aliases to set spi bus  number. Mark Brown <broonie@kernel.org> - 2016-05-25 20:50 +0200
    Re: [PATCH] devicetree - document using aliases to set spi bus  number. Rob Herring <robh@kernel.org> - 2016-05-25 20:50 +0200
      Re: [PATCH] devicetree - document using aliases to set spi bus number. Geert Uytterhoeven <geert@linux-m68k.org> - 2016-05-26 10:30 +0200

csiph-web