[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aMmFlClUOkFG3TyH@lizhi-Precision-Tower-5810>
Date: Tue, 16 Sep 2025 11:43:16 -0400
From: Frank Li <Frank.li@....com>
To: Haibo Chen <haibo.chen@....com>
Cc: Han Xu <han.xu@....com>, Yogesh Gaur <yogeshgaur.83@...il.com>,
Mark Brown <broonie@...nel.org>, linux-spi@...r.kernel.org,
imx@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] spi: spi-nxp-fspi: Add OCT-DTR mode support
On Tue, Sep 16, 2025 at 03:56:44PM +0800, Haibo Chen wrote:
> Add OCT-DTR mode support in default, since flexspi do not supports
> swapping bytes on a 16 bit boundary in OCT-DTR mode, so mark swap16
> as false.
>
> lx2160a do not support DQS, so add a quirk to disable DTR mode for this
> platform.
>
> Signed-off-by: Haibo Chen <haibo.chen@....com>
> ---
> drivers/spi/spi-nxp-fspi.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> index 15b094e8e892f0b61c1f320bba897fa1f588be91..389cb20872db6d9653a146eac7182b9a4574496b 100644
> --- a/drivers/spi/spi-nxp-fspi.c
> +++ b/drivers/spi/spi-nxp-fspi.c
> @@ -330,6 +330,8 @@
>
> /* Access flash memory using IP bus only */
> #define FSPI_QUIRK_USE_IP_ONLY BIT(0)
> +/* Disable DTR */
> +#define FSPI_QUIRK_DISABLE_DTR BIT(1)
>
> struct nxp_fspi_devtype_data {
> unsigned int rxfifo;
> @@ -344,7 +346,7 @@ static struct nxp_fspi_devtype_data lx2160a_data = {
> .rxfifo = SZ_512, /* (64 * 64 bits) */
> .txfifo = SZ_1K, /* (128 * 64 bits) */
> .ahb_buf_size = SZ_2K, /* (256 * 64 bits) */
> - .quirks = 0,
> + .quirks = FSPI_QUIRK_DISABLE_DTR,
> .lut_num = 32,
> .little_endian = true, /* little-endian */
> };
> @@ -1236,6 +1238,13 @@ static const struct spi_controller_mem_ops nxp_fspi_mem_ops = {
> };
>
> static const struct spi_controller_mem_caps nxp_fspi_mem_caps = {
> + .dtr = true,
> + .swap16 = false,
> + .per_op_freq = true,
> +};
> +
> +static const struct spi_controller_mem_caps nxp_fspi_mem_caps_quirks = {
> + .dtr = false,
> .per_op_freq = true,
> };
>
> @@ -1351,7 +1360,12 @@ static int nxp_fspi_probe(struct platform_device *pdev)
> ctlr->bus_num = -1;
> ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT;
> ctlr->mem_ops = &nxp_fspi_mem_ops;
> - ctlr->mem_caps = &nxp_fspi_mem_caps;
> +
> + if (f->devtype_data->quirks & FSPI_QUIRK_DISABLE_DTR)
> + ctlr->mem_caps = &nxp_fspi_mem_caps_quirks;
the name 'nxp_fspi_mem_caps_quirks' is too general.
nxp_fspi_mem_caps_disable_dtr?
Frank
> + else
> + ctlr->mem_caps = &nxp_fspi_mem_caps;
> +
> ctlr->dev.of_node = np;
>
> ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f);
>
> --
> 2.34.1
>
Powered by blists - more mailing lists