Skip to content

Commit ea98deb

Browse files
committed
spi: spi-nxp-fspi: Add OCT-DTR mode support
JIRA: https://issues.redhat.com/browse/RHEL-104570 commit 0f67557 Author: Haibo Chen <haibo.chen@nxp.com> Date: Wed Sep 17 15:27:10 2025 +0800 spi: spi-nxp-fspi: Add OCT-DTR mode support 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@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20250917-flexspi-ddr-v2-5-bb9fe2a01889@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Mattijs Korpershoek <mkorpershoek@redhat.com>
1 parent a9f3ac6 commit ea98deb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/spi/spi-nxp-fspi.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@
330330

331331
/* Access flash memory using IP bus only */
332332
#define FSPI_QUIRK_USE_IP_ONLY BIT(0)
333+
/* Disable DTR */
334+
#define FSPI_QUIRK_DISABLE_DTR BIT(1)
333335

334336
struct nxp_fspi_devtype_data {
335337
unsigned int rxfifo;
@@ -344,7 +346,7 @@ static struct nxp_fspi_devtype_data lx2160a_data = {
344346
.rxfifo = SZ_512, /* (64 * 64 bits) */
345347
.txfifo = SZ_1K, /* (128 * 64 bits) */
346348
.ahb_buf_size = SZ_2K, /* (256 * 64 bits) */
347-
.quirks = 0,
349+
.quirks = FSPI_QUIRK_DISABLE_DTR,
348350
.lut_num = 32,
349351
.little_endian = true, /* little-endian */
350352
};
@@ -1232,6 +1234,13 @@ static const struct spi_controller_mem_ops nxp_fspi_mem_ops = {
12321234
};
12331235

12341236
static const struct spi_controller_mem_caps nxp_fspi_mem_caps = {
1237+
.dtr = true,
1238+
.swap16 = false,
1239+
.per_op_freq = true,
1240+
};
1241+
1242+
static const struct spi_controller_mem_caps nxp_fspi_mem_caps_disable_dtr = {
1243+
.dtr = false,
12351244
.per_op_freq = true,
12361245
};
12371246

@@ -1347,7 +1356,12 @@ static int nxp_fspi_probe(struct platform_device *pdev)
13471356
ctlr->bus_num = -1;
13481357
ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT;
13491358
ctlr->mem_ops = &nxp_fspi_mem_ops;
1350-
ctlr->mem_caps = &nxp_fspi_mem_caps;
1359+
1360+
if (f->devtype_data->quirks & FSPI_QUIRK_DISABLE_DTR)
1361+
ctlr->mem_caps = &nxp_fspi_mem_caps_disable_dtr;
1362+
else
1363+
ctlr->mem_caps = &nxp_fspi_mem_caps;
1364+
13511365
ctlr->dev.of_node = np;
13521366

13531367
ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f);

0 commit comments

Comments
 (0)