public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Jaime Liao <jaimeliao.tw@gmail.com>
Cc: linux-mtd@lists.infradead.org, tudor.ambarus@linaro.org,
	pratyush@kernel.org, miquel.raynal@bootlin.com,
	leoyu@mxic.com.tw, jaimeliao@mxic.com.tw
Subject: Re: [PATCH v6 5/7] spi: mxic: Add support for swapping byte
Date: Thu, 30 Nov 2023 10:11:39 +0100	[thread overview]
Message-ID: <eb145cfb0cf10330f5125f0c7d2224eb@walle.cc> (raw)
In-Reply-To: <20231130083854.55221-6-jaimeliao.tw@gmail.com>

Hi Jaime,

> Some SPI-NOR flash swap the bytes on a 16-bit boundary when
> configured in Octal DTR mode. It means data format D0 D1 D2 D3
> would be swapped to D1 D0 D3 D2. So that whether controller
> support swapping bytes should be checked before enable Octal
> DTR mode. Add swap byte support on a 16-bit boundary when
> configured in Octal DTR mode for Macronix xSPI host controller
> dirver.
> 
> Signed-off-by: JaimeLiao <jaimeliao@mxic.com.tw>
> ---
>  drivers/spi/spi-mxic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
> index 60c9f3048ac9..085c9037d6f5 100644
> --- a/drivers/spi/spi-mxic.c
> +++ b/drivers/spi/spi-mxic.c
> @@ -572,6 +572,7 @@ static const struct spi_controller_mem_ops 
> mxic_spi_mem_ops = {
> 
>  static const struct spi_controller_mem_caps mxic_spi_mem_caps = {
>  	.dtr = true,
> +	.dtr_swab16 = true,
>  	.ecc = true,
>  };

I'm confused. How can this swap the bytes depending on the flashes
requirements? I.e. the controller should look at the spi-mem operation
and either swap the bytes or it should leave them as is.

-michael


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2023-11-30  9:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30  8:38 [PATCH v6 0/7] Add octal DTR support for Macronix flash Jaime Liao
2023-11-30  8:38 ` [PATCH v6 1/7] mtd: spi-nor: add Octal " Jaime Liao
2023-11-30  8:38 ` [PATCH v6 2/7] spi: spi-mem: Allow specifying the byte order in DTR mode Jaime Liao
2023-11-30  8:38 ` [PATCH v6 3/7] mtd: spi-nor: core: " Jaime Liao
2023-11-30  8:38 ` [PATCH v6 4/7] mtd: spi-nor: sfdp: Get the 8D-8D-8D byte order from BFPT Jaime Liao
2023-11-30  8:38 ` [PATCH v6 5/7] spi: mxic: Add support for swapping byte Jaime Liao
2023-11-30  9:11   ` Michael Walle [this message]
2023-12-01  1:42     ` liao jaime
2023-12-01  8:25       ` Michael Walle
2023-12-04  6:44         ` liao jaime
2023-12-04  7:35           ` Tudor Ambarus
2023-12-07 12:39             ` Michael Walle
2023-12-12  7:44               ` liao jaime
2023-11-30  8:38 ` [PATCH v6 6/7] mtd: spi-nor: add support for Macronix Octal flash with RWW feature Jaime Liao
2023-11-30  8:38 ` [PATCH v6 7/7] mtd: spi-nor: add support for Macronix Octal flash Jaime Liao

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=eb145cfb0cf10330f5125f0c7d2224eb@walle.cc \
    --to=michael@walle.cc \
    --cc=jaimeliao.tw@gmail.com \
    --cc=jaimeliao@mxic.com.tw \
    --cc=leoyu@mxic.com.tw \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=tudor.ambarus@linaro.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