Skip to content

Commit 0f67557

Browse files
BoughChenbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c07f270 commit 0f67557

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

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
};
@@ -1231,6 +1233,13 @@ static const struct spi_controller_mem_ops nxp_fspi_mem_ops = {
12311233
};
12321234

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

@@ -1346,7 +1355,12 @@ static int nxp_fspi_probe(struct platform_device *pdev)
13461355
ctlr->bus_num = -1;
13471356
ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT;
13481357
ctlr->mem_ops = &nxp_fspi_mem_ops;
1349-
ctlr->mem_caps = &nxp_fspi_mem_caps;
1358+
1359+
if (f->devtype_data->quirks & FSPI_QUIRK_DISABLE_DTR)
1360+
ctlr->mem_caps = &nxp_fspi_mem_caps_disable_dtr;
1361+
else
1362+
ctlr->mem_caps = &nxp_fspi_mem_caps;
1363+
13501364
ctlr->dev.of_node = np;
13511365

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

0 commit comments

Comments
 (0)