linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/5] spi: add support for octal mode
@ 2019-01-15 10:05 Yogesh Narayan Gaur
  2019-01-15 10:05 ` [PATCH v7 1/5] mtd: spi-nor: add opcodes for octal Read/Write commands Yogesh Narayan Gaur
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Yogesh Narayan Gaur @ 2019-01-15 10:05 UTC (permalink / raw)
  To: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree
  Cc: tudor.ambarus, robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel,
	Yogesh Narayan Gaur

Add support for octal mode IO data transfer.
Micron flash, mt35xu512aba, supports octal mode data transfer and
NXP FlexSPI controller supports 8 data lines for data transfer (Rx/Tx).

Patch series
* Add parsing logic for m25p80.c device file.
* Add opcodes for octal I/O commands in spi-nor framework, Read and Write proto for (1-1-8/1-8-8) mode.
  Opcodes are added as per octal data IO commands required for mt35xu512aba flash.
* Add mode bit required for octal mode in nxp-fspi driver [1].
* Define binding property 'spi-rx/tx-bus-width' for LX2160ARDB target [1].

Tested on LX2160ARDB target with nxp-fspi driver, below are
Read performance number of 1-1-1 and 1-1-8 read protocol.

 root@lxxx:~# cat /proc/mtd
 dev:    size   erasesize  name
 mtd0: 04000000 00001000 "spi0.0"
 mtd1: 04000000 00001000 "spi0.1"
 root@lxxx:~# time mtd_debug read /dev/mtd0 0x0 0x1000000 0read
 Copied 16777216 bytes from address 0x00000000 in flash to 0read

 real    0m2.792s
 user    0m0.000s
 sys     0m2.790s
 root@lxxx:~# time mtd_debug read /dev/mtd1 0x0 0x1000000 0read
 Copied 16777216 bytes from address 0x00000000 in flash to 0read

 real    0m0.441s
 user    0m0.000s
 sys     0m0.440s
 root@ls1012ardb:~#

 Flash device MTD0 configured in 1-1-1 protocol.
 Flash device MTD1 configured in 1-1-8 protocol.

[1] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=86130

Changes for v7:
- Rebase on top of SPI tree
  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/
  branch: for-next
- Drop below patches from series as these have already been applied.
  'spi-add-support-for-octal-mode-I-O-data-transfer.patch' and
  'spi-spi-mem-add-support-for-octal-mode-I-O-data-tran.patch'
- Add r-o-b tag of Tudor Ambarus for
  patch 'mtd-spi-nor-add-opcodes-for-octal-Read-Write-command.patch'
Changes for v6:
- Correct S-o-b tag with full author name as 'Yogesh Narayan Gaur'.
- Rebase on top of v4.20-rc5.
Changes for v5:
- Modified string 'octo' as 'octal' in all patches.
Changes for v4:
- Rebase on top of v4.20-rc2.
- Modify octo entries enum value in spi.h.
Changes for v3:
- Add octo mode support in spi_setup().
- Rename all patches with 'octal' string modified as 'octo'.
Changes for v2:
- Incorporated review comments of Boris and Vignesh.

Yogesh Narayan Gaur (5):
  mtd: spi-nor: add opcodes for octal Read/Write commands
  mtd: spi-nor: add octal read flag for flash mt35xu512aba
  mtd: m25p80: add support of octal mode I/O transfer
  spi: nxp-fspi: add octal mode flag bit for octal support
  arm64: dts: lx2160a: update fspi node

 .../boot/dts/freescale/fsl-lx2160a-rdb.dts    |  4 ++++
 drivers/mtd/devices/m25p80.c                  |  9 ++++++++-
 drivers/mtd/spi-nor/spi-nor.c                 | 19 ++++++++++++++++---
 drivers/spi/spi-nxp-fspi.c                    |  4 ++--
 include/linux/mtd/spi-nor.h                   | 16 ++++++++++++----
 5 files changed, 42 insertions(+), 10 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v7 1/5] mtd: spi-nor: add opcodes for octal Read/Write commands
  2019-01-15 10:05 [PATCH v7 0/5] spi: add support for octal mode Yogesh Narayan Gaur
@ 2019-01-15 10:05 ` Yogesh Narayan Gaur
  2019-01-19 15:42   ` [v7,1/5] " Boris Brezillon
  2019-01-15 10:05 ` [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba Yogesh Narayan Gaur
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Yogesh Narayan Gaur @ 2019-01-15 10:05 UTC (permalink / raw)
  To: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree
  Cc: tudor.ambarus, robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel,
	Yogesh Narayan Gaur

- Add opcodes for octal I/O commands
  * Read  : 1-1-8 and 1-8-8 protocol
  * Write : 1-1-8 and 1-8-8 protocol
  * opcodes for 4-byte address mode command

- Entry of macros in _convert_3to4_xxx function

- Add flag SPI_NOR_OCTAL_READ specifying flash support octal read
  commands. This flag is required for flashes which didn't provides
  support for auto detection of Octal mode capabilities i.e. not
  seems to support newer JESD216C standard.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 16 ++++++++++++++--
 include/linux/mtd/spi-nor.h   | 16 ++++++++++++----
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 6e13bbd1aaa5..872d70722672 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -68,7 +68,7 @@ enum spi_nor_read_command_index {
 	SNOR_CMD_READ_4_4_4,
 	SNOR_CMD_READ_1_4_4_DTR,
 
-	/* Octo SPI */
+	/* Octal SPI */
 	SNOR_CMD_READ_1_1_8,
 	SNOR_CMD_READ_1_8_8,
 	SNOR_CMD_READ_8_8_8,
@@ -85,7 +85,7 @@ enum spi_nor_pp_command_index {
 	SNOR_CMD_PP_1_4_4,
 	SNOR_CMD_PP_4_4_4,
 
-	/* Octo SPI */
+	/* Octal SPI */
 	SNOR_CMD_PP_1_1_8,
 	SNOR_CMD_PP_1_8_8,
 	SNOR_CMD_PP_8_8_8,
@@ -278,6 +278,7 @@ struct flash_info {
 #define NO_CHIP_ERASE		BIT(12) /* Chip does not support chip erase */
 #define SPI_NOR_SKIP_SFDP	BIT(13)	/* Skip parsing of SFDP tables */
 #define USE_CLSR		BIT(14)	/* use CLSR command */
+#define SPI_NOR_OCTAL_READ	BIT(15)	/* Flash supports Octal Read */
 
 	/* Part specific fixup hooks. */
 	const struct spi_nor_fixups *fixups;
@@ -398,6 +399,8 @@ static u8 spi_nor_convert_3to4_read(u8 opcode)
 		{ SPINOR_OP_READ_1_2_2,	SPINOR_OP_READ_1_2_2_4B },
 		{ SPINOR_OP_READ_1_1_4,	SPINOR_OP_READ_1_1_4_4B },
 		{ SPINOR_OP_READ_1_4_4,	SPINOR_OP_READ_1_4_4_4B },
+		{ SPINOR_OP_READ_1_1_8,	SPINOR_OP_READ_1_1_8_4B },
+		{ SPINOR_OP_READ_1_8_8,	SPINOR_OP_READ_1_8_8_4B },
 
 		{ SPINOR_OP_READ_1_1_1_DTR,	SPINOR_OP_READ_1_1_1_DTR_4B },
 		{ SPINOR_OP_READ_1_2_2_DTR,	SPINOR_OP_READ_1_2_2_DTR_4B },
@@ -414,6 +417,8 @@ static u8 spi_nor_convert_3to4_program(u8 opcode)
 		{ SPINOR_OP_PP,		SPINOR_OP_PP_4B },
 		{ SPINOR_OP_PP_1_1_4,	SPINOR_OP_PP_1_1_4_4B },
 		{ SPINOR_OP_PP_1_4_4,	SPINOR_OP_PP_1_4_4_4B },
+		{ SPINOR_OP_PP_1_1_8,	SPINOR_OP_PP_1_1_8_4B },
+		{ SPINOR_OP_PP_1_8_8,	SPINOR_OP_PP_1_8_8_4B },
 	};
 
 	return spi_nor_convert_opcode(opcode, spi_nor_3to4_program,
@@ -3591,6 +3596,13 @@ static int spi_nor_init_params(struct spi_nor *nor,
 					  SNOR_PROTO_1_1_4);
 	}
 
+	if (info->flags & SPI_NOR_OCTAL_READ) {
+		params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8;
+		spi_nor_set_read_settings(&params->reads[SNOR_CMD_READ_1_1_8],
+					  0, 8, SPINOR_OP_READ_1_1_8,
+					  SNOR_PROTO_1_1_8);
+	}
+
 	/* Page Program settings. */
 	params->hwcaps.mask |= SNOR_HWCAPS_PP;
 	spi_nor_set_pp_settings(&params->page_programs[SNOR_CMD_PP],
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index fa2d89e38e40..2353af8bac99 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -46,9 +46,13 @@
 #define SPINOR_OP_READ_1_2_2	0xbb	/* Read data bytes (Dual I/O SPI) */
 #define SPINOR_OP_READ_1_1_4	0x6b	/* Read data bytes (Quad Output SPI) */
 #define SPINOR_OP_READ_1_4_4	0xeb	/* Read data bytes (Quad I/O SPI) */
+#define SPINOR_OP_READ_1_1_8	0x8b	/* Read data bytes (Octal Output SPI) */
+#define SPINOR_OP_READ_1_8_8	0xcb	/* Read data bytes (Octal I/O SPI) */
 #define SPINOR_OP_PP		0x02	/* Page program (up to 256 bytes) */
 #define SPINOR_OP_PP_1_1_4	0x32	/* Quad page program */
 #define SPINOR_OP_PP_1_4_4	0x38	/* Quad page program */
+#define SPINOR_OP_PP_1_1_8	0x82	/* Octal page program */
+#define SPINOR_OP_PP_1_8_8	0xc2	/* Octal page program */
 #define SPINOR_OP_BE_4K		0x20	/* Erase 4KiB block */
 #define SPINOR_OP_BE_4K_PMC	0xd7	/* Erase 4KiB block on PMC chips */
 #define SPINOR_OP_BE_32K	0x52	/* Erase 32KiB block */
@@ -69,9 +73,13 @@
 #define SPINOR_OP_READ_1_2_2_4B	0xbc	/* Read data bytes (Dual I/O SPI) */
 #define SPINOR_OP_READ_1_1_4_4B	0x6c	/* Read data bytes (Quad Output SPI) */
 #define SPINOR_OP_READ_1_4_4_4B	0xec	/* Read data bytes (Quad I/O SPI) */
+#define SPINOR_OP_READ_1_1_8_4B	0x7c	/* Read data bytes (Octal Output SPI) */
+#define SPINOR_OP_READ_1_8_8_4B	0xcc	/* Read data bytes (Octal I/O SPI) */
 #define SPINOR_OP_PP_4B		0x12	/* Page program (up to 256 bytes) */
 #define SPINOR_OP_PP_1_1_4_4B	0x34	/* Quad page program */
 #define SPINOR_OP_PP_1_4_4_4B	0x3e	/* Quad page program */
+#define SPINOR_OP_PP_1_1_8_4B	0x84	/* Octal page program */
+#define SPINOR_OP_PP_1_8_8_4B	0x8e	/* Octal page program */
 #define SPINOR_OP_BE_4K_4B	0x21	/* Erase 4KiB block */
 #define SPINOR_OP_BE_32K_4B	0x5c	/* Erase 32KiB block */
 #define SPINOR_OP_SE_4B		0xdc	/* Sector erase (usually 64KiB) */
@@ -458,7 +466,7 @@ struct spi_nor_hwcaps {
 /*
  *(Fast) Read capabilities.
  * MUST be ordered by priority: the higher bit position, the higher priority.
- * As a matter of performances, it is relevant to use Octo SPI protocols first,
+ * As a matter of performances, it is relevant to use Octal SPI protocols first,
  * then Quad SPI protocols before Dual SPI protocols, Fast Read and lastly
  * (Slow) Read.
  */
@@ -479,7 +487,7 @@ struct spi_nor_hwcaps {
 #define SNOR_HWCAPS_READ_4_4_4		BIT(9)
 #define SNOR_HWCAPS_READ_1_4_4_DTR	BIT(10)
 
-#define SNOR_HWCPAS_READ_OCTO		GENMASK(14, 11)
+#define SNOR_HWCPAS_READ_OCTAL		GENMASK(14, 11)
 #define SNOR_HWCAPS_READ_1_1_8		BIT(11)
 #define SNOR_HWCAPS_READ_1_8_8		BIT(12)
 #define SNOR_HWCAPS_READ_8_8_8		BIT(13)
@@ -488,7 +496,7 @@ struct spi_nor_hwcaps {
 /*
  * Page Program capabilities.
  * MUST be ordered by priority: the higher bit position, the higher priority.
- * Like (Fast) Read capabilities, Octo/Quad SPI protocols are preferred to the
+ * Like (Fast) Read capabilities, Octal/Quad SPI protocols are preferred to the
  * legacy SPI 1-1-1 protocol.
  * Note that Dual Page Programs are not supported because there is no existing
  * JEDEC/SFDP standard to define them. Also at this moment no SPI flash memory
@@ -502,7 +510,7 @@ struct spi_nor_hwcaps {
 #define SNOR_HWCAPS_PP_1_4_4	BIT(18)
 #define SNOR_HWCAPS_PP_4_4_4	BIT(19)
 
-#define SNOR_HWCAPS_PP_OCTO	GENMASK(22, 20)
+#define SNOR_HWCAPS_PP_OCTAL	GENMASK(22, 20)
 #define SNOR_HWCAPS_PP_1_1_8	BIT(20)
 #define SNOR_HWCAPS_PP_1_8_8	BIT(21)
 #define SNOR_HWCAPS_PP_8_8_8	BIT(22)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba
  2019-01-15 10:05 [PATCH v7 0/5] spi: add support for octal mode Yogesh Narayan Gaur
  2019-01-15 10:05 ` [PATCH v7 1/5] mtd: spi-nor: add opcodes for octal Read/Write commands Yogesh Narayan Gaur
@ 2019-01-15 10:05 ` Yogesh Narayan Gaur
  2019-01-16  6:19   ` Tudor.Ambarus
  2019-01-19 15:42   ` [v7,2/5] " Boris Brezillon
  2019-01-15 10:05 ` [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer Yogesh Narayan Gaur
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 14+ messages in thread
From: Yogesh Narayan Gaur @ 2019-01-15 10:05 UTC (permalink / raw)
  To: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree
  Cc: tudor.ambarus, robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel,
	Yogesh Narayan Gaur

Add octal read flag for flash mt35xu512aba.
This flash, mt35xu512aba, is only complaint to SFDP JESD216B and does
not seem to support newer JESD216C standard that provides auto
detection of Octal mode capabilities and opcodes. Therefore, this
capability is manually added using new SPI_NOR_OCTAL_READ flag.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 872d70722672..53a3bcc6a55b 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1877,7 +1877,8 @@ static const struct flash_info spi_nor_ids[] = {
 	/* Micron */
 	{
 		"mt35xu512aba", INFO(0x2c5b1a, 0, 128 * 1024, 512,
-			SECT_4K | USE_FSR | SPI_NOR_4B_OPCODES)
+			SECT_4K | USE_FSR | SPI_NOR_OCTAL_READ |
+			SPI_NOR_4B_OPCODES)
 	},
 
 	/* PMC */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer
  2019-01-15 10:05 [PATCH v7 0/5] spi: add support for octal mode Yogesh Narayan Gaur
  2019-01-15 10:05 ` [PATCH v7 1/5] mtd: spi-nor: add opcodes for octal Read/Write commands Yogesh Narayan Gaur
  2019-01-15 10:05 ` [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba Yogesh Narayan Gaur
@ 2019-01-15 10:05 ` Yogesh Narayan Gaur
  2019-01-17  7:16   ` Tudor.Ambarus
  2019-01-19 15:41   ` [v7,3/5] " Boris Brezillon
  2019-01-15 10:05 ` [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support Yogesh Narayan Gaur
  2019-01-15 10:05 ` [PATCH v7 5/5] arm64: dts: lx2160a: update fspi node Yogesh Narayan Gaur
  4 siblings, 2 replies; 14+ messages in thread
From: Yogesh Narayan Gaur @ 2019-01-15 10:05 UTC (permalink / raw)
  To: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree
  Cc: tudor.ambarus, robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel,
	Yogesh Narayan Gaur

Add support for octal mode I/O data transfer based on the controller (spi)
mode.
Assign hw-capability mask bits for octal transfer.

Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
---
 drivers/mtd/devices/m25p80.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index c4a1d04b8c80..651bab6d4e31 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -195,7 +195,14 @@ static int m25p_probe(struct spi_mem *spimem)
 	spi_mem_set_drvdata(spimem, flash);
 	flash->spimem = spimem;
 
-	if (spi->mode & SPI_RX_QUAD) {
+	if (spi->mode & SPI_RX_OCTAL) {
+		hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8;
+
+		if (spi->mode & SPI_TX_OCTAL)
+			hwcaps.mask |= (SNOR_HWCAPS_READ_1_8_8 |
+					SNOR_HWCAPS_PP_1_1_8 |
+					SNOR_HWCAPS_PP_1_8_8);
+	} else if (spi->mode & SPI_RX_QUAD) {
 		hwcaps.mask |= SNOR_HWCAPS_READ_1_1_4;
 
 		if (spi->mode & SPI_TX_QUAD)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support
  2019-01-15 10:05 [PATCH v7 0/5] spi: add support for octal mode Yogesh Narayan Gaur
                   ` (2 preceding siblings ...)
  2019-01-15 10:05 ` [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer Yogesh Narayan Gaur
@ 2019-01-15 10:05 ` Yogesh Narayan Gaur
  2019-01-28 12:26   ` Mark Brown
  2019-01-15 10:05 ` [PATCH v7 5/5] arm64: dts: lx2160a: update fspi node Yogesh Narayan Gaur
  4 siblings, 1 reply; 14+ messages in thread
From: Yogesh Narayan Gaur @ 2019-01-15 10:05 UTC (permalink / raw)
  To: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree
  Cc: tudor.ambarus, robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel,
	Yogesh Narayan Gaur

Add octal mode flags for octal I/O data transfer support.
NXP FlexSPI controller supports 8 lines Rx/Tx data transfer.

Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
---
 drivers/spi/spi-nxp-fspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index e23ad9ef028e..adc3c0e14f38 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -952,8 +952,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 	if (!ctlr)
 		return -ENOMEM;
 
-	ctlr->mode_bits = SPI_RX_DUAL | SPI_RX_QUAD |
-			  SPI_TX_DUAL | SPI_TX_QUAD;
+	ctlr->mode_bits = SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL |
+			  SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL;
 
 	f = spi_controller_get_devdata(ctlr);
 	f->dev = dev;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 5/5] arm64: dts: lx2160a: update fspi node
  2019-01-15 10:05 [PATCH v7 0/5] spi: add support for octal mode Yogesh Narayan Gaur
                   ` (3 preceding siblings ...)
  2019-01-15 10:05 ` [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support Yogesh Narayan Gaur
@ 2019-01-15 10:05 ` Yogesh Narayan Gaur
  2019-02-01  3:51   ` Shawn Guo
  4 siblings, 1 reply; 14+ messages in thread
From: Yogesh Narayan Gaur @ 2019-01-15 10:05 UTC (permalink / raw)
  To: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree
  Cc: tudor.ambarus, robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel,
	Yogesh Narayan Gaur

Flash mt35xu512aba connected to FlexSPI controller supports
1-1-8/1-8-8 protocol.
Added flag spi-rx-bus-width and spi-tx-bus-width with values as
8 and 8 respectively for both flashes connected at CS0 and CS1.

Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
---
Changes for v6:
- Correct S-o-b tag with full author name as 'Yogesh Narayan Gaur'.
Changes for v5:
- None
Changes for v4:
- None
Changes for v3:
- None
Changes for v2:
- None
---
 arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts
index 70658946fbbe..9df37b159415 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts
@@ -60,6 +60,8 @@
 		m25p,fast-read;
 		spi-max-frequency = <50000000>;
 		reg = <0>;
+		spi-rx-bus-width = <8>;
+		spi-tx-bus-width = <8>;
 	};
 
 	mt35xu512aba1: flash@1 {
@@ -69,6 +71,8 @@
 		m25p,fast-read;
 		spi-max-frequency = <50000000>;
 		reg = <1>;
+		spi-rx-bus-width = <8>;
+		spi-tx-bus-width = <8>;
 	};
 };
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba
  2019-01-15 10:05 ` [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba Yogesh Narayan Gaur
@ 2019-01-16  6:19   ` Tudor.Ambarus
  2019-01-19 15:42   ` [v7,2/5] " Boris Brezillon
  1 sibling, 0 replies; 14+ messages in thread
From: Tudor.Ambarus @ 2019-01-16  6:19 UTC (permalink / raw)
  To: yogeshnarayan.gaur, linux-mtd, boris.brezillon, broonie,
	marek.vasut, vigneshr, linux-spi, devicetree
  Cc: robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel



On 01/15/2019 12:05 PM, Yogesh Narayan Gaur wrote:
> Add octal read flag for flash mt35xu512aba.
> This flash, mt35xu512aba, is only complaint to SFDP JESD216B and does
> not seem to support newer JESD216C standard that provides auto
> detection of Octal mode capabilities and opcodes. Therefore, this
> capability is manually added using new SPI_NOR_OCTAL_READ flag.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/mtd/spi-nor/spi-nor.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 872d70722672..53a3bcc6a55b 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -1877,7 +1877,8 @@ static const struct flash_info spi_nor_ids[] = {
>  	/* Micron */
>  	{
>  		"mt35xu512aba", INFO(0x2c5b1a, 0, 128 * 1024, 512,
> -			SECT_4K | USE_FSR | SPI_NOR_4B_OPCODES)
> +			SECT_4K | USE_FSR | SPI_NOR_OCTAL_READ |
> +			SPI_NOR_4B_OPCODES)
>  	},
>  
>  	/* PMC */
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer
  2019-01-15 10:05 ` [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer Yogesh Narayan Gaur
@ 2019-01-17  7:16   ` Tudor.Ambarus
  2019-01-19 15:41   ` [v7,3/5] " Boris Brezillon
  1 sibling, 0 replies; 14+ messages in thread
From: Tudor.Ambarus @ 2019-01-17  7:16 UTC (permalink / raw)
  To: yogeshnarayan.gaur, linux-mtd, boris.brezillon, broonie,
	marek.vasut, vigneshr, linux-spi, devicetree
  Cc: robh, mark.rutland, shawnguo, linux-arm-kernel,
	computersforpeace, frieder.schrempf, linux-kernel



On 01/15/2019 12:05 PM, Yogesh Narayan Gaur wrote:
> Add support for octal mode I/O data transfer based on the controller (spi)
> mode.
> Assign hw-capability mask bits for octal transfer.
> 
> Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/mtd/devices/m25p80.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index c4a1d04b8c80..651bab6d4e31 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -195,7 +195,14 @@ static int m25p_probe(struct spi_mem *spimem)
>  	spi_mem_set_drvdata(spimem, flash);
>  	flash->spimem = spimem;
>  
> -	if (spi->mode & SPI_RX_QUAD) {
> +	if (spi->mode & SPI_RX_OCTAL) {
> +		hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8;
> +
> +		if (spi->mode & SPI_TX_OCTAL)
> +			hwcaps.mask |= (SNOR_HWCAPS_READ_1_8_8 |
> +					SNOR_HWCAPS_PP_1_1_8 |
> +					SNOR_HWCAPS_PP_1_8_8);
> +	} else if (spi->mode & SPI_RX_QUAD) {
>  		hwcaps.mask |= SNOR_HWCAPS_READ_1_1_4;
>  
>  		if (spi->mode & SPI_TX_QUAD)
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v7,3/5] mtd: m25p80: add support of octal mode I/O transfer
  2019-01-15 10:05 ` [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer Yogesh Narayan Gaur
  2019-01-17  7:16   ` Tudor.Ambarus
@ 2019-01-19 15:41   ` Boris Brezillon
  1 sibling, 0 replies; 14+ messages in thread
From: Boris Brezillon @ 2019-01-19 15:41 UTC (permalink / raw)
  To: Yogesh Narayan Gaur, linux-mtd, boris.brezillon, broonie,
	marek.vasut, vigneshr, linux-spi, devicetree
  Cc: Boris Brezillon, mark.rutland, robh, tudor.ambarus, linux-kernel,
	frieder.schrempf, computersforpeace, shawnguo, linux-arm-kernel

On Tue, 2019-01-15 at 10:05:22 UTC, Yogesh Narayan Gaur wrote:
> Add support for octal mode I/O data transfer based on the controller (spi)
> mode.
> Assign hw-capability mask bits for octal transfer.
> 
> Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Applied to http://git.infradead.org/linux-mtd.git spi-nor/next, thanks.

Boris

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v7,2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba
  2019-01-15 10:05 ` [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba Yogesh Narayan Gaur
  2019-01-16  6:19   ` Tudor.Ambarus
@ 2019-01-19 15:42   ` Boris Brezillon
  1 sibling, 0 replies; 14+ messages in thread
From: Boris Brezillon @ 2019-01-19 15:42 UTC (permalink / raw)
  To: Yogesh Narayan Gaur, linux-mtd, boris.brezillon, broonie,
	marek.vasut, vigneshr, linux-spi, devicetree
  Cc: Boris Brezillon, mark.rutland, robh, tudor.ambarus, linux-kernel,
	frieder.schrempf, computersforpeace, shawnguo, linux-arm-kernel

On Tue, 2019-01-15 at 10:05:16 UTC, Yogesh Narayan Gaur wrote:
> Add octal read flag for flash mt35xu512aba.
> This flash, mt35xu512aba, is only complaint to SFDP JESD216B and does
> not seem to support newer JESD216C standard that provides auto
> detection of Octal mode capabilities and opcodes. Therefore, this
> capability is manually added using new SPI_NOR_OCTAL_READ flag.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Applied to http://git.infradead.org/linux-mtd.git spi-nor/next, thanks.

Boris

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v7,1/5] mtd: spi-nor: add opcodes for octal Read/Write commands
  2019-01-15 10:05 ` [PATCH v7 1/5] mtd: spi-nor: add opcodes for octal Read/Write commands Yogesh Narayan Gaur
@ 2019-01-19 15:42   ` Boris Brezillon
  0 siblings, 0 replies; 14+ messages in thread
From: Boris Brezillon @ 2019-01-19 15:42 UTC (permalink / raw)
  To: Yogesh Narayan Gaur, linux-mtd, boris.brezillon, broonie,
	marek.vasut, vigneshr, linux-spi, devicetree
  Cc: Boris Brezillon, mark.rutland, robh, tudor.ambarus, linux-kernel,
	frieder.schrempf, computersforpeace, shawnguo, linux-arm-kernel

On Tue, 2019-01-15 at 10:05:10 UTC, Yogesh Narayan Gaur wrote:
> - Add opcodes for octal I/O commands
>   * Read  : 1-1-8 and 1-8-8 protocol
>   * Write : 1-1-8 and 1-8-8 protocol
>   * opcodes for 4-byte address mode command
> 
> - Entry of macros in _convert_3to4_xxx function
> 
> - Add flag SPI_NOR_OCTAL_READ specifying flash support octal read
>   commands. This flag is required for flashes which didn't provides
>   support for auto detection of Octal mode capabilities i.e. not
>   seems to support newer JESD216C standard.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Applied to http://git.infradead.org/linux-mtd.git spi-nor/next, thanks.

Boris

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support
  2019-01-15 10:05 ` [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support Yogesh Narayan Gaur
@ 2019-01-28 12:26   ` Mark Brown
  2019-01-28 12:30     ` Mark Brown
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2019-01-28 12:26 UTC (permalink / raw)
  To: Yogesh Narayan Gaur
  Cc: linux-mtd, boris.brezillon, marek.vasut, vigneshr, linux-spi,
	devicetree, tudor.ambarus, robh, mark.rutland, shawnguo,
	linux-arm-kernel, computersforpeace, frieder.schrempf,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

On Tue, Jan 15, 2019 at 10:05:29AM +0000, Yogesh Narayan Gaur wrote:

> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> index e23ad9ef028e..adc3c0e14f38 100644
> --- a/drivers/spi/spi-nxp-fspi.c
> +++ b/drivers/spi/spi-nxp-fspi.c
> @@ -952,8 +952,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)

This does not apply against current code, the above file is not present
upstream.  Please do not submit patches to out of tree code upstream.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support
  2019-01-28 12:26   ` Mark Brown
@ 2019-01-28 12:30     ` Mark Brown
  0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2019-01-28 12:30 UTC (permalink / raw)
  To: Yogesh Narayan Gaur
  Cc: linux-mtd, boris.brezillon, marek.vasut, vigneshr, linux-spi,
	devicetree, tudor.ambarus, robh, mark.rutland, shawnguo,
	linux-arm-kernel, computersforpeace, frieder.schrempf,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

On Mon, Jan 28, 2019 at 12:26:31PM +0000, Mark Brown wrote:
> On Tue, Jan 15, 2019 at 10:05:29AM +0000, Yogesh Narayan Gaur wrote:

> > diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> > index e23ad9ef028e..adc3c0e14f38 100644
> > --- a/drivers/spi/spi-nxp-fspi.c
> > +++ b/drivers/spi/spi-nxp-fspi.c
> > @@ -952,8 +952,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)

> This does not apply against current code, the above file is not present
> upstream.  Please do not submit patches to out of tree code upstream.

So it turns out your other series was adding that driver.  Please if
you're doing this make sure you call out any interdependencies in either
the patch itself or the cover letter, if you're sending separate patch
serieses you should expect them to be handled separately.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 5/5] arm64: dts: lx2160a: update fspi node
  2019-01-15 10:05 ` [PATCH v7 5/5] arm64: dts: lx2160a: update fspi node Yogesh Narayan Gaur
@ 2019-02-01  3:51   ` Shawn Guo
  0 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2019-02-01  3:51 UTC (permalink / raw)
  To: Yogesh Narayan Gaur
  Cc: linux-mtd, boris.brezillon, broonie, marek.vasut, vigneshr,
	linux-spi, devicetree, mark.rutland, robh, tudor.ambarus,
	linux-kernel, frieder.schrempf, computersforpeace,
	linux-arm-kernel

On Tue, Jan 15, 2019 at 10:05:35AM +0000, Yogesh Narayan Gaur wrote:
> Flash mt35xu512aba connected to FlexSPI controller supports
> 1-1-8/1-8-8 protocol.
> Added flag spi-rx-bus-width and spi-tx-bus-width with values as
> 8 and 8 respectively for both flashes connected at CS0 and CS1.
> 
> Signed-off-by: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-02-01  3:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 10:05 [PATCH v7 0/5] spi: add support for octal mode Yogesh Narayan Gaur
2019-01-15 10:05 ` [PATCH v7 1/5] mtd: spi-nor: add opcodes for octal Read/Write commands Yogesh Narayan Gaur
2019-01-19 15:42   ` [v7,1/5] " Boris Brezillon
2019-01-15 10:05 ` [PATCH v7 2/5] mtd: spi-nor: add octal read flag for flash mt35xu512aba Yogesh Narayan Gaur
2019-01-16  6:19   ` Tudor.Ambarus
2019-01-19 15:42   ` [v7,2/5] " Boris Brezillon
2019-01-15 10:05 ` [PATCH v7 3/5] mtd: m25p80: add support of octal mode I/O transfer Yogesh Narayan Gaur
2019-01-17  7:16   ` Tudor.Ambarus
2019-01-19 15:41   ` [v7,3/5] " Boris Brezillon
2019-01-15 10:05 ` [PATCH v7 4/5] spi: nxp-fspi: add octal mode flag bit for octal support Yogesh Narayan Gaur
2019-01-28 12:26   ` Mark Brown
2019-01-28 12:30     ` Mark Brown
2019-01-15 10:05 ` [PATCH v7 5/5] arm64: dts: lx2160a: update fspi node Yogesh Narayan Gaur
2019-02-01  3:51   ` Shawn Guo

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).