From: Michal Simek <michal.simek@amd.com>
To: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>,
u-boot@lists.denx.de
Cc: tudor.ambarus@linaro.org, j-humphreys@ti.com, marex@denx.de,
jagan@amarulasolutions.com, vigneshr@ti.com, u-kumar1@ti.com,
trini@konsulko.com, seanga2@gmail.com, caleb.connolly@linaro.org,
sjg@chromium.org, william.zhang@broadcom.com,
stefan_b@posteo.net, quentin.schulz@cherry.de,
Takahiro.Kuwano@infineon.com, p-mantena@ti.com, git@amd.com,
Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Subject: Re: [PATCH] spi: cadence_qspi: Set tshsl_ns to at least one sclk_ns
Date: Tue, 8 Jul 2025 15:07:09 +0200 [thread overview]
Message-ID: <98275d4d-0644-4fc8-9ff6-8d5b8622fd9f@amd.com> (raw)
In-Reply-To: <20250702065717.3871435-1-venkatesh.abbarapu@amd.com>
On 7/2/25 08:57, Venkatesh Yadav Abbarapu wrote:
> tshsl_ns is the clock delay for chip select deassert. This is the delay in
> master reference clocks for the length that the master mode chip select
> outputs are de-asserted between transactions.
>
> The minimum delay is always SCLK period to ensure the chip select is never
> re-asserted within one SCLK period.
>
> That is why tshsl_ns delay should be at least one sclk_ns value. If it is
> less than sclk_ns, set it equal to sclk_ns.
>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
> ---
> drivers/spi/cadence_qspi_apb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/spi/cadence_qspi_apb.c b/drivers/spi/cadence_qspi_apb.c
> index 65fb2d8f9fb..4696c09f754 100644
> --- a/drivers/spi/cadence_qspi_apb.c
> +++ b/drivers/spi/cadence_qspi_apb.c
> @@ -303,6 +303,10 @@ void cadence_qspi_apb_delay(void *reg_base,
> tshsl_ns -= sclk_ns + ref_clk_ns;
> if (tchsh_ns >= sclk_ns + 3 * ref_clk_ns)
> tchsh_ns -= sclk_ns + 3 * ref_clk_ns;
> +
> + if (tshsl_ns < sclk_ns)
> + tshsl_ns = sclk_ns;
> +
> tshsl = DIV_ROUND_UP(tshsl_ns, ref_clk_ns);
> tchsh = DIV_ROUND_UP(tchsh_ns, ref_clk_ns);
> tslch = DIV_ROUND_UP(tslch_ns, ref_clk_ns);
Applied.
M
next prev parent reply other threads:[~2025-07-08 13:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 6:57 [PATCH] spi: cadence_qspi: Set tshsl_ns to at least one sclk_ns Venkatesh Yadav Abbarapu
2025-07-08 13:07 ` Michal Simek [this message]
2025-07-10 20:30 ` Prasanth Mantena
2025-07-11 15:12 ` Abbarapu, Venkatesh
2025-07-14 5:37 ` Prasanth Mantena
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=98275d4d-0644-4fc8-9ff6-8d5b8622fd9f@amd.com \
--to=michal.simek@amd.com \
--cc=Takahiro.Kuwano@infineon.com \
--cc=ashok.reddy.soma@amd.com \
--cc=caleb.connolly@linaro.org \
--cc=git@amd.com \
--cc=j-humphreys@ti.com \
--cc=jagan@amarulasolutions.com \
--cc=marex@denx.de \
--cc=p-mantena@ti.com \
--cc=quentin.schulz@cherry.de \
--cc=seanga2@gmail.com \
--cc=sjg@chromium.org \
--cc=stefan_b@posteo.net \
--cc=trini@konsulko.com \
--cc=tudor.ambarus@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=u-kumar1@ti.com \
--cc=venkatesh.abbarapu@amd.com \
--cc=vigneshr@ti.com \
--cc=william.zhang@broadcom.com \
/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