linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <mwalle@kernel.org>
To: Bough Chen <haibo.chen@nxp.com>
Cc: broonie@kernel.org, Han Xu <han.xu@nxp.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	linux-spi@vger.kernel.org, yogeshgaur.83@gmail.com
Subject: Re: [PATCH 4/5] spi: spi-nxp-fspi: add function to select sample clock source for flash reading
Date: Thu, 14 Dec 2023 09:56:47 +0100	[thread overview]
Message-ID: <1995188744e94699d0372d2c24010ab2@kernel.org> (raw)
In-Reply-To: <DB7PR04MB4010E0C19722CBAA2FD668E5908CA@DB7PR04MB4010.eurprd04.prod.outlook.com>

Hi,

>> > From: Haibo Chen <haibo.chen@nxp.com>
>> >
>> > fspi define four mode for sample clock source selection.
>> >
>> > Here is the list of modes:
>> > mode 0: Dummy Read strobe generated by FlexSPI Controller and loopback
>> > internally mode 1: Dummy Read strobe generated by FlexSPI Controller
>> > and loopback from DQS pad mode 2: Reserved mode 3: Flash provided Read
>> > strobe and input from DQS pad
>> >
>> > In default, fspi use mode 0 after reset.
>> > For 8-8-8-DTR mode, need to use mode 3, otherwise 8-8-8-DTR read
>> > always get incorrect data.
>> 
>> I'd say this is board dependant, right? If you now hardcode 8d8d8d to 
>> always use
>> mode 3. I'm not sure how a board which doesn't have the DQS connected 
>> to the
>> flash can change this to another mode again. Looks like we'd need a 
>> (DT)
>> property which tells you if there is actually a DQS line connected to 
>> the flash.
> 
> Currently we distinguish through SoC chip, not board. Like patch5.
> If SoC contain the DQS, but the board do not connect it to flash 
> device, then this is a real issue.

See below, there are alternatives to the DQS pin.

But it really is frequency dependent. I'd bet you can use mode 0
with a slow frequency in 8d8d8d mode. I.e. the LS1028ARM will always
refer you to mode 3 if you want to archive "the highest frequency".

> But I think if user use one octal flash device which support dtr mode, 
> they should
> connect this DQS pad if want to work in DTR mode.
> If forget to connect the DQS pad, they can limit the tx/rx buswidth to 
> 4 or 1 in dts.
> 
> Anyway, add a DT property seems better.
> 
> DQS is a must requirement for octal dtr mode, if detect no DQS, we can 
> also disable the DTR mode support.

I don't think this is true in general. I haven't checked with the FSPI
controller. But DQS is used for higher frequencies which isn't 
necessarily
related to DTR.

Also, there are other methods, like manual calibration of the delay 
lines
on the I/Os. There was once a patchset to add that calibration for a TI 
(?)
controller, but it was never merged. I've seen the fspi also supports
some DLL configuration and some kind of data learning feature. As far as
I understand that, these are all alternatives. I.e.
  (1) don't use high frequencies
  (2) use DQS (driven by the flash)
  (3) manually/automatically set the DLL

> Will add in next version.
> 
>> Btw you don't check buswidth, so you'll enable that mode for any DTR 
>> mode.
> 
> Seems current spi-nor code only support one DTR mode, that is 8d-8d-8d.

Yes. But that doesn't mean the spi controller should assume that. If you
don't want to support any other mode, you should probably check that in
your .supports_op() callback.

-michael

  reply	other threads:[~2023-12-14  8:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  9:13 [PATCH 1/5] spi: spi-nxp-fspi: enable runtime pm for fspi haibo.chen
2023-12-13  9:13 ` [PATCH 2/5] spi: spi-nxp-fspi: change the default lut index haibo.chen
2023-12-13 16:24   ` Michael Walle
2023-12-14  2:10     ` Bough Chen
2023-12-14  3:04   ` Adam Ford
2023-12-14  4:00     ` Bough Chen
2023-12-13  9:13 ` [PATCH 3/5] spi: spi-nxp-fspi: add DTR mode support haibo.chen
2023-12-13 16:53   ` Michael Walle
2023-12-14  3:09     ` Bough Chen
2023-12-14  9:45       ` Michael Walle
2023-12-13  9:13 ` [PATCH 4/5] spi: spi-nxp-fspi: add function to select sample clock source for flash reading haibo.chen
2023-12-13 17:21   ` Michael Walle
2023-12-14  7:54     ` Bough Chen
2023-12-14  8:56       ` Michael Walle [this message]
2023-12-13  9:13 ` [PATCH 5/5] spi: spi-nxp-fspi: Add quirk to disable DTR support haibo.chen

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=1995188744e94699d0372d2c24010ab2@kernel.org \
    --to=mwalle@kernel.org \
    --cc=broonie@kernel.org \
    --cc=haibo.chen@nxp.com \
    --cc=han.xu@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-spi@vger.kernel.org \
    --cc=yogeshgaur.83@gmail.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;
as well as URLs for NNTP newsgroup(s).