[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <31c94125-06e3-4459-9688-d371fcc87b2a@opensynergy.com>
Date: Thu, 1 Feb 2024 18:26:32 +0100
From: Harald Mommer <harald.mommer@...nsynergy.com>
To: Haixu Cui <quic_haixcui@...cinc.com>, virtio-dev@...ts.oasis-open.org,
Mark Brown <broonie@...nel.org>, Viresh Kumar <viresh.kumar@...aro.org>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: quic_ztu@...cinc.com, Matti Moell <Matti.Moell@...nsynergy.com>,
Mikhail Golubev <Mikhail.Golubev@...nsynergy.com>
Subject: Re: [virtio-dev] Re: [RFC PATCH v2 3/3] SPI: Add virtio SPI driver
(V10 draft specification).
Hello Haixu,
Thanks. This was a hard one. I knew that I did the delay settingsmost
probably somewhat wrong but I had no idea that I did it so wrong.
Reworked, made a new function for this, currently testing. Added the
link to the place where your E-Mail is stored
https://lore.kernel.org/all/6171c1c3-55ba-4f74-ae60-764820cf1caf@quicinc.com/
as a comment to the source code and hope this will survive the reviews.
Another option would be to add the diagram + the explanations below as
quoted here as comment to the code. Whether 30+ lines of comments would
survive the reviews I don't know.
Just to say nothing in the code making live hard for people trying to
understand the code is something I would like to avoid.
Regards
Harald
On 30.01.24 04:21, Haixu Cui wrote:
> . . . . . . . . . .
> Delay + A + + B + + C + D + E + F + A +
> . . . . . . . . . .
> ___. . . . . . .___.___. .
> CS# |___.______.____.____.___.___| . |___._____________
> . . . . . . . . . .
> . . . . . . . . . .
> SCLK__.___.___NNN_____NNN__.___.___.___.___.___.___NNN_______
>
>
> NOTE: 1st transfer has two words, the delay betweent these two words
> are 'B' in the diagram.
>
> A => struct spi_device -> cs_setup
> B => max{struct spi_transfer -> word_delay,
> struct spi_device -> word_delay}
> Note: spi_device and spi_transfer both have word_delay, Linux
> choose the bigger one, refer to _spi_xfer_word_delay_update
> function
> C => struct spi_transfer -> delay
> D => struct spi_device -> cs_hold
> E => struct spi_device -> cs_inactive
> F => struct spi_transfer -> cs_change_delay
>
> So the corresponding relationship:
> A <===> cs_setup_ns (after CS asserted)
> B <===> word_delay_ns (no matter with CS)
> C+D <===> cs_delay_hold_ns (before CS deasserted)
> E+F <===> cs_change_delay_inactive_ns (after CS deasserted, these two
> values also recommend in Linux driver to be added up)
Powered by blists - more mailing lists