public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: "Stefan Mätje" <stefan.maetje@esd.eu>
Cc: Jagan Teki <jagan@amarulasolutions.com>, u-boot@lists.denx.de
Subject: Re: [PATCH 1/1] Fix wrong QSPI clock calculation for AM4372
Date: Mon, 29 Nov 2021 22:58:41 -0500	[thread overview]
Message-ID: <20211130035841.GV24579@bill-the-cat> (raw)
In-Reply-To: <20211130000656.1837826-2-stefan.maetje@esd.eu>

[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

On Tue, Nov 30, 2021 at 01:06:56AM +0100, Stefan Mätje wrote:

> On AM4372 the SPI_GCLK input gets its clock from the PRCM module which
> divides the PER_CLKOUTM2 frequency (192MHz) by a fixed factor of 4.
> See AM437x Reference Manual in section 27 QSPI >> 27.2 Integration.
> 
> The QSPI_FCLK therefore needs to take this factor into account and
> becomes (192000000 / 4).
> 
> Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
> ---
>  drivers/spi/ti_qspi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c
> index 664b9cad79..bccdeeaf82 100644
> --- a/drivers/spi/ti_qspi.c
> +++ b/drivers/spi/ti_qspi.c
> @@ -25,7 +25,8 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  /* ti qpsi register bit masks */
>  #define QSPI_TIMEOUT                    2000000
> -#define QSPI_FCLK			192000000
> +/* AM4372: QSPI gets SPI_GCLK from PRCM unit as PER_CLKOUTM2 divided by 4. */
> +#define QSPI_FCLK                       (192000000 / 4)
>  #define QSPI_DRA7XX_FCLK                76800000
>  #define QSPI_WLEN_MAX_BITS		128
>  #define QSPI_WLEN_MAX_BYTES		(QSPI_WLEN_MAX_BITS >> 3)

How is this treated in the kernel?  Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2021-11-30  3:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  0:06 [PATCH 0/1] Provide a fix for wrong QSPI clock calculation on AM4372 Stefan Mätje
2021-11-30  0:06 ` [PATCH 1/1] Fix wrong QSPI clock calculation for AM4372 Stefan Mätje
2021-11-30  3:58   ` Tom Rini [this message]
2021-11-30 12:14     ` Stefan Mätje
2021-11-30 12:51       ` Tom Rini
2022-01-17 18:36   ` Tom Rini

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=20211130035841.GV24579@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=jagan@amarulasolutions.com \
    --cc=stefan.maetje@esd.eu \
    --cc=u-boot@lists.denx.de \
    /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