linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Geert Uytterhoeven
	<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Maxime Ripard <mripard-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Yoshihiro Shimoda
	<yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"open list:MEDIA DRIVERS FOR RENESAS - FCP"
	<linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 1/2] spi: dt-bindings: spi-controller: Fix #address-cells for slave mode
Date: Wed, 4 Mar 2020 13:50:41 +0100	[thread overview]
Message-ID: <CAMuHMdUBTVZGNtdc0dhUz5d+P2_Fr89MvBCz8=9oQK1EOi7s2w@mail.gmail.com> (raw)
In-Reply-To: <CAL_JsqL+9Tcqm_bsorRwqvWZyJXAZmJhXb=EmJ+nZ44kCFp6Kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Rob,

On Tue, Mar 3, 2020 at 10:05 PM Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Tue, Mar 3, 2020 at 3:45 AM Geert Uytterhoeven
> <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> wrote:
> > Currently, the DT bindings for an SPI controller specify that
> > "#address-cells" must be fixed to one.  However, that applies to an SPI
> > controller in master mode only.  When running in SPI slave mode,
> > "#address-cells" should be zero.
> >
> > Fix this making the value of "#address-cells" dependent on the presence
> > of "spi-slave".
> >
> > Fixes: 0a1b929356830257 ("spi: Add YAML schemas for the generic SPI options")
> > Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> > Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
> > ---
> > v2:
> >   - Use "enum: [0, 1]" instead of min/max limit,
> >   - use "- spi-slave" instead of "[ spi-slave ]".
> >
> > As of dtc commit 403cc79f06a135ae ("checks: Update SPI bus check for
> > 'spi-slave'") and Linux commit c2e7075ca8303631 ("scripts/dtc: Update to
> > upstream version v1.4.7-57-gf267e674d145"), dtc knows about SPI slave.
> >
> > However, when using "#address-cells = <0>" with W=1:
> >
> >     Warning (avoid_unnecessary_addr_size): /soc/spi@e6e10000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
>
> What was the point in having #address-cells in the first place for
> slaves?

I don't know, commit a8830cb19cfea04e ("spi: Document DT bindings for
SPI controllers in slave mode") doesn't require any #address-cells for
slave mode.

Perhaps because node_addr_cells() in dtc defaults to 2?
Or because of_bus_n_addr_cells() walks up the parent chain and thus
defaults to the first found parent value?

> Seems like we should make it mutually exclusive with 'spi-slave'.

Sounds like a good idea. How to express that in yaml?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2020-03-04 12:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03  9:45 [PATCH v2 0/2] spi: dt-bindings: spi-controller: Slave mode fixes Geert Uytterhoeven
     [not found] ` <20200303094522.23180-1-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2020-03-03  9:45   ` [PATCH v2 1/2] spi: dt-bindings: spi-controller: Fix #address-cells for slave mode Geert Uytterhoeven
     [not found]     ` <20200303094522.23180-2-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2020-03-03 21:05       ` Rob Herring
     [not found]         ` <CAL_JsqL+9Tcqm_bsorRwqvWZyJXAZmJhXb=EmJ+nZ44kCFp6Kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-03-04 12:50           ` Geert Uytterhoeven [this message]
2020-03-04 15:12             ` Rob Herring
2020-03-03  9:45   ` [PATCH v2 2/2] spi: dt-bindings: spi-controller: Fix spi-[rt]x-bus-width " Geert Uytterhoeven

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='CAMuHMdUBTVZGNtdc0dhUz5d+P2_Fr89MvBCz8=9oQK1EOi7s2w@mail.gmail.com' \
    --to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
    --cc=linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mripard-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
    --subject='Re: [PATCH v2 1/2] spi: dt-bindings: spi-controller: Fix #address-cells for slave mode' \
    /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

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).