linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: "dianders@chromium.org" <dianders@chromium.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"swboyd@chromium.org" <swboyd@chromium.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"sdharia@codeaurora.org" <sdharia@codeaurora.org>,
	"dkota@codeaurora.org" <dkota@codeaurora.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"kramasub@codeaurora.org" <kramasub@codeaurora.org>,
	"girishm@codeaurora.org" <girishm@codeaurora.org>
Subject: Re: [PATCH] spi: spi-geni-qcom: Add SPI driver support for GENI based QUP
Date: Fri, 10 Aug 2018 18:43:20 +0000	[thread overview]
Message-ID: <1533926600.2283.358.camel@impinj.com> (raw)
In-Reply-To: <CAD=FV=V4miw3i+8EPZPpgWGaVJhHbb2OBVTz6_iP-pMVhZoBOQ@mail.gmail.com>

On Thu, 2018-08-09 at 12:37 -0700, Doug Anderson wrote:
> On Thu, Aug 9, 2018 at 11:24 AM, Trent Piepho <tpiepho@impinj.com> wrote:
> > 
> I think we're in agreement but perhaps there's a miscommunication here?
> 
> I'm saying that we _shouldn't_ put the max-speed of the master in the
> device tree.  The max speed for the IP block ought to be in code
> either in the clock driver or in the SPI driver based on the
> compatible string.

Yes, totally agree.

Usually the clock framework provides a clock to the SPI IP block at
some rate, or range of rates.  Based on that clock, the SPI IP block
has a max SPI clock, and the driver can calculate it.

We do have a concept of a SPI master max clock, but it's never needed
to be specified in the DT.

Consider userspace access via spidev.  The transfer asks for 100 MHz,
but the spi master driver can not possibly program that speed into
whatever register(s) control the spi clock.  The SPI core handles that
case of limiting a transfer to the master's max.

> ...as one argument _against_ putting a max-speed for the master in the
> device tree I'm saying that we can already specify a max-speed of each
> slave in the device tree.  The max speed of the slave should take into
> account whatever factors are specific to this board including trace
> lengths, noise, etc.  If we somehow did need to get a max speed in the
> device tree it seems like we could just adjust the max speed for the
> slave to be something lower.  In other words if you know a board has
> an sdm845 on it and you know that the SPI clock on sdm845 can't go
> over 50 MHz then it would make no sense to suggest that we should run
> the SPI clock for a device at 100 MHz.

What you might do is determine the slave can run at 100 MHz, in some
cases.  The board, traces, master, etc. can do it, in some cases.  But
it's also possible to change the clocking design or settings at a
higher level, which trickles down to the SPI master IP block having a
lower clock.  This is handled by the master max speed being less then
the slave's max speed.

The master max wouldn't be in the DT, since it's probably determined at
run time based on input clock to the master.  Based on the SoC core
clock, voltage, power mode, etc.

So you might have a DT with a slave at 100 MHz, even if in some cases
the master's max is less than 100 MHz.  It's ok to depend on the master
to be the limiting factor.

  reply	other threads:[~2018-08-10 18:43 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 21:34 [PATCH] spi: spi-geni-qcom: Add SPI driver support for GENI based QUP Girish Mahadevan
2018-05-03 23:38 ` Mark Brown
2018-05-07 21:40   ` Mahadevan, Girish
     [not found]   ` <0c26e96c-85ad-c2a2-9abd-33096d76008b@codeaurora.org>
2018-05-17  7:21     ` Mark Brown
2018-05-21 21:45       ` Mahadevan, Girish
2018-05-22 17:32         ` Mark Brown
2018-05-11 22:30 ` Stephen Boyd
2018-05-21 15:52   ` Mahadevan, Girish
2018-05-22 16:46     ` Stephen Boyd
2018-05-22 17:30       ` Mark Brown
2018-05-24 16:25         ` Mahadevan, Girish
2018-05-24 16:29           ` Mark Brown
     [not found]             ` <28d8ab5fdeb34e52eba7ca771a17bc06@codeaurora.org>
2018-08-03 12:18               ` dkota
2018-08-09 18:03                 ` Doug Anderson
2018-08-09 18:24                   ` Trent Piepho
2018-08-09 19:37                     ` Doug Anderson
2018-08-10 18:43                       ` Trent Piepho [this message]
2018-08-10 10:52                   ` Mark Brown
2018-08-10 15:40                     ` Doug Anderson
2018-08-10 16:13                       ` Mark Brown
2018-08-10 16:27                         ` Doug Anderson
2018-08-10 16:43                           ` Mark Brown
2018-08-10 16:47                             ` Doug Anderson
2018-08-10 16:29                         ` dkota
2018-08-10 16:46                           ` Mark Brown
2018-08-14  9:00                             ` dkota
2018-08-14 15:03                               ` Mark Brown
2018-08-17 10:36                                 ` dkota
2018-08-17 14:59                                   ` Mark Brown
2018-08-24 11:00                                     ` dkota
2018-08-10 16:49                           ` Doug Anderson
2018-08-10 17:55                           ` Trent Piepho
2018-06-08 23:34 ` Matthias Kaehlcke

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=1533926600.2283.358.camel@impinj.com \
    --to=tpiepho@impinj.com \
    --cc=broonie@kernel.org \
    --cc=dianders@chromium.org \
    --cc=dkota@codeaurora.org \
    --cc=girishm@codeaurora.org \
    --cc=kramasub@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=sdharia@codeaurora.org \
    --cc=swboyd@chromium.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).