mbox series

[v5,0/7] spi: add support for octal mode

Message ID 1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com (mailing list archive)
Headers show
Series spi: add support for octal mode | expand

Message

Yogesh Narayan Gaur Dec. 3, 2018, 8:39 a.m. UTC
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 support for octal mode flags and parsing of same in spi driver.
* Add parsing logic for spi-mem framework and 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 [1] flash.
* Add mode bit required for octal mode in nxp-fspi driver [2].
* Define binding property 'spi-rx/tx-bus-width' for LX2160ARDB target [2].

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=70384&state=*
[2] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=76402

Yogesh Gaur (7):
  spi: add support for octal mode I/O data transfer
  spi: spi-mem: add support for octal mode I/O data transfer
  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

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.

 drivers/mtd/devices/m25p80.c                      |  9 ++++++++-
 drivers/mtd/spi-nor/spi-nor.c                     | 19 ++++++++++++++++---
 drivers/spi/spi-mem.c                             |  9 ++++++++-
 drivers/spi/spi-nxp-fspi.c                        |  4 ++--
 drivers/spi/spi.c                                 | 12 ++++++++++--
 include/linux/mtd/spi-nor.h                       |  8 ++++++++
 include/linux/spi/spi.h                           |  4 +++-
 8 files changed, 59 insertions(+), 10 deletions(-)

Comments

Boris Brezillon Dec. 3, 2018, 9:19 a.m. UTC | #1
Hi Mark,

On Mon, 3 Dec 2018 08:39:00 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:

> 
> Yogesh Gaur (7):
>   spi: add support for octal mode I/O data transfer
>   spi: spi-mem: add support for octal mode I/O data transfer

Can you take those 2 patches in your tree for 4.21/5.0?

>   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

I'll queue these ones after 4.21-rc1/5.0-rc1 is out (which means
they'll appear in 4.22/5.1).

>   arm64: dts: lx2160a: update fspi node
Vignesh Raghavendra Dec. 5, 2018, 11:55 a.m. UTC | #2
Hi Boris,

On 03/12/18 2:49 PM, Boris Brezillon wrote:
> Hi Mark,
> 
> On Mon, 3 Dec 2018 08:39:00 +0000
> Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:
> 
>>
>> Yogesh Gaur (7):
>>   spi: add support for octal mode I/O data transfer
>>   spi: spi-mem: add support for octal mode I/O data transfer
> 
> Can you take those 2 patches in your tree for 4.21/5.0?
> 

>>   mtd: spi-nor: add opcodes for octal Read/Write commands
>>   mtd: spi-nor: add octal read flag for flash mt35xu512aba

Could you consider merging these two patches alone for v4.21?
These can be applied independent of other patches in the series and
would allow supporting OSPI flash at SPI NOR level with Cadence QSPI driver.

>>   mtd: m25p80: add support of octal mode I/O transfer
>>   spi: nxp-fspi: add octal mode flag bit for octal support
> 
> I'll queue these ones after 4.21-rc1/5.0-rc1 is out (which means
> they'll appear in 4.22/5.1).
> 
>>   arm64: dts: lx2160a: update fspi node
Boris Brezillon Dec. 5, 2018, 12:46 p.m. UTC | #3
On Wed, 5 Dec 2018 17:25:12 +0530
Vignesh R <vigneshr@ti.com> wrote:

> >>   mtd: spi-nor: add opcodes for octal Read/Write commands
> >>   mtd: spi-nor: add octal read flag for flash mt35xu512aba  
> 
> Could you consider merging these two patches alone for v4.21?
> These can be applied independent of other patches in the series and
> would allow supporting OSPI flash at SPI NOR level with Cadence QSPI driver.

Yep, I'll queue them to spi-nor/next.

> >>   spi: nxp-fspi: add octal mode flag bit for octal support  

Mark, I think you can pick this one too.
Mark Brown Dec. 5, 2018, 2:18 p.m. UTC | #4
On Wed, Dec 05, 2018 at 01:46:18PM +0100, Boris Brezillon wrote:
> Vignesh R <vigneshr@ti.com> wrote:

> > >>   spi: nxp-fspi: add octal mode flag bit for octal support  

> Mark, I think you can pick this one too.

I don't have this any more, it looked like this was stuck behind the
otehr MTD changes which seemed to have problems.  If someone could
resend?
Yogesh Narayan Gaur Dec. 6, 2018, 4:20 a.m. UTC | #5
Hi Boris,

> -----Original Message-----
> From: Boris Brezillon [mailto:boris.brezillon@bootlin.com]
> Sent: Wednesday, December 5, 2018 6:16 PM
> To: Vignesh R <vigneshr@ti.com>; broonie@kernel.org
> Cc: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>; linux-
> mtd@lists.infradead.org; marek.vasut@gmail.com; linux-spi@vger.kernel.org;
> devicetree@vger.kernel.org; robh@kernel.org; mark.rutland@arm.com;
> shawnguo@kernel.org; linux-arm-kernel@lists.infradead.org;
> computersforpeace@gmail.com; frieder.schrempf@exceet.de; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v5 0/7] spi: add support for octal mode
> 
> On Wed, 5 Dec 2018 17:25:12 +0530
> Vignesh R <vigneshr@ti.com> wrote:
> 
> > >>   mtd: spi-nor: add opcodes for octal Read/Write commands
> > >>   mtd: spi-nor: add octal read flag for flash mt35xu512aba
> >
> > Could you consider merging these two patches alone for v4.21?
> > These can be applied independent of other patches in the series and
> > would allow supporting OSPI flash at SPI NOR level with Cadence QSPI driver.
> 
> Yep, I'll queue them to spi-nor/next.
> 
> > >>   spi: nxp-fspi: add octal mode flag bit for octal support
> 
> Mark, I think you can pick this one too.

This patch is dependent on the series [1] which is yet to be applied by you, please apply.

--
Regards
Yogesh Gaur
[1] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=76402
Boris Brezillon Dec. 6, 2018, 6:45 a.m. UTC | #6
On Thu, 6 Dec 2018 04:20:26 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:

> Hi Boris,
> 
> > -----Original Message-----
> > From: Boris Brezillon [mailto:boris.brezillon@bootlin.com]
> > Sent: Wednesday, December 5, 2018 6:16 PM
> > To: Vignesh R <vigneshr@ti.com>; broonie@kernel.org
> > Cc: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>; linux-
> > mtd@lists.infradead.org; marek.vasut@gmail.com; linux-spi@vger.kernel.org;
> > devicetree@vger.kernel.org; robh@kernel.org; mark.rutland@arm.com;
> > shawnguo@kernel.org; linux-arm-kernel@lists.infradead.org;
> > computersforpeace@gmail.com; frieder.schrempf@exceet.de; linux-
> > kernel@vger.kernel.org
> > Subject: Re: [PATCH v5 0/7] spi: add support for octal mode
> > 
> > On Wed, 5 Dec 2018 17:25:12 +0530
> > Vignesh R <vigneshr@ti.com> wrote:
> >   
> > > >>   mtd: spi-nor: add opcodes for octal Read/Write commands
> > > >>   mtd: spi-nor: add octal read flag for flash mt35xu512aba  
> > >
> > > Could you consider merging these two patches alone for v4.21?
> > > These can be applied independent of other patches in the series and
> > > would allow supporting OSPI flash at SPI NOR level with Cadence QSPI driver.  
> > 
> > Yep, I'll queue them to spi-nor/next.
> >   
> > > >>   spi: nxp-fspi: add octal mode flag bit for octal support  
> > 
> > Mark, I think you can pick this one too.  
> 
> This patch is dependent on the series [1] which is yet to be applied by you, please apply.

By me? I can't apply SPI patches.
Yogesh Narayan Gaur Dec. 6, 2018, 6:49 a.m. UTC | #7
Hi Boris,

> -----Original Message-----
> From: Boris Brezillon [mailto:boris.brezillon@bootlin.com]
> Sent: Thursday, December 6, 2018 12:16 PM
> To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
> Cc: Vignesh R <vigneshr@ti.com>; broonie@kernel.org; linux-
> mtd@lists.infradead.org; marek.vasut@gmail.com; linux-spi@vger.kernel.org;
> devicetree@vger.kernel.org; robh@kernel.org; mark.rutland@arm.com;
> shawnguo@kernel.org; linux-arm-kernel@lists.infradead.org;
> computersforpeace@gmail.com; frieder.schrempf@exceet.de; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v5 0/7] spi: add support for octal mode
> 
> On Thu, 6 Dec 2018 04:20:26 +0000
> Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:
> 
> > Hi Boris,
> >
> > > -----Original Message-----
> > > From: Boris Brezillon [mailto:boris.brezillon@bootlin.com]
> > > Sent: Wednesday, December 5, 2018 6:16 PM
> > > To: Vignesh R <vigneshr@ti.com>; broonie@kernel.org
> > > Cc: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>; linux-
> > > mtd@lists.infradead.org; marek.vasut@gmail.com;
> > > linux-spi@vger.kernel.org; devicetree@vger.kernel.org;
> > > robh@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org;
> > > linux-arm-kernel@lists.infradead.org;
> > > computersforpeace@gmail.com; frieder.schrempf@exceet.de; linux-
> > > kernel@vger.kernel.org
> > > Subject: Re: [PATCH v5 0/7] spi: add support for octal mode
> > >
> > > On Wed, 5 Dec 2018 17:25:12 +0530
> > > Vignesh R <vigneshr@ti.com> wrote:
> > >
> > > > >>   mtd: spi-nor: add opcodes for octal Read/Write commands
> > > > >>   mtd: spi-nor: add octal read flag for flash mt35xu512aba
> > > >
> > > > Could you consider merging these two patches alone for v4.21?
> > > > These can be applied independent of other patches in the series
> > > > and would allow supporting OSPI flash at SPI NOR level with Cadence QSPI
> driver.
> > >
> > > Yep, I'll queue them to spi-nor/next.
> > >
> > > > >>   spi: nxp-fspi: add octal mode flag bit for octal support
> > >
> > > Mark, I think you can pick this one too.
> >
> > This patch is dependent on the series [1] which is yet to be applied by you,
> please apply.
> 
> By me? I can't apply SPI patches.

Sorry for ignorance. Did patches needs to be applied by Mark Brown, should I resend the patch series again?
Also can you please review the series [1] and add your Reviewed-by tag.

--
Regards
Yogesh Gaur

[1] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=76402
Mark Brown Dec. 6, 2018, 8:29 p.m. UTC | #8
On Thu, Dec 06, 2018 at 06:49:08AM +0000, Yogesh Narayan Gaur wrote:

> Sorry for ignorance. Did patches needs to be applied by Mark Brown, should I resend the patch series again?
> Also can you please review the series [1] and add your Reviewed-by tag.

As I said in my reply earlier today in the same thread:

| I don't have this any more, it looked like this was stuck behind the
| otehr MTD changes which seemed to have problems.  If someone could
| resend?

so please resend.
Yogesh Narayan Gaur Dec. 10, 2018, 4:13 a.m. UTC | #9
Hi Mark,

Patch has been resend [1], this patch is depends on the series of patch[2] and this series has been applied by Boris already.

[1] https://patchwork.ozlabs.org/patch/1010253/
[2] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=70384&state=*

--
Regards
Yogesh Gaur

> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: Friday, December 7, 2018 2:00 AM
> To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>; Vignesh R <vigneshr@ti.com>;
> linux-mtd@lists.infradead.org; marek.vasut@gmail.com; linux-
> spi@vger.kernel.org; devicetree@vger.kernel.org; robh@kernel.org;
> mark.rutland@arm.com; shawnguo@kernel.org; linux-arm-
> kernel@lists.infradead.org; computersforpeace@gmail.com;
> frieder.schrempf@exceet.de; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v5 0/7] spi: add support for octal mode
> 
> On Thu, Dec 06, 2018 at 06:49:08AM +0000, Yogesh Narayan Gaur wrote:
> 
> > Sorry for ignorance. Did patches needs to be applied by Mark Brown, should I
> resend the patch series again?
> > Also can you please review the series [1] and add your Reviewed-by tag.
> 
> As I said in my reply earlier today in the same thread:
> 
> | I don't have this any more, it looked like this was stuck behind the
> | otehr MTD changes which seemed to have problems.  If someone could
> | resend?
> 
> so please resend.
Boris Brezillon Dec. 10, 2018, 8:22 a.m. UTC | #10
Hi Yogesh,

On Mon, 10 Dec 2018 04:13:28 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:

> Hi Mark,
> 
> Patch has been resend [1], this patch is depends on the series of patch[2] and this series has been applied by Boris already.

You're still not asking the right person. Every patches touching
things in drivers/mtd/ should be taken by me (or another MTD
maintainer), and patches touching things in drivers/spi/ should be
taken by Mark. So, the patch you're pointing to should be applied by
me. Plus, I told you I would apply it after 4.21-rc1 because I don't
want to deal with the mtd -> spi dependency.

Please be patient.

Regards,

Boris
Yogesh Narayan Gaur Dec. 10, 2018, 8:39 a.m. UTC | #11
Hi Boris,

Sorry for confusion.

My intention was just to point to the correct patch number only. Earlier you have asked Mark to pick the patch [1] but that patch number was not correct.

[1] https://lkml.org/lkml/2018/12/5/758

--
Regards
Yogesh Gaur

> -----Original Message-----
> From: Boris Brezillon [mailto:boris.brezillon@bootlin.com]
> Sent: Monday, December 10, 2018 1:52 PM
> To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
> Cc: Mark Brown <broonie@kernel.org>; Vignesh R <vigneshr@ti.com>; linux-
> mtd@lists.infradead.org; marek.vasut@gmail.com; linux-spi@vger.kernel.org;
> devicetree@vger.kernel.org; robh@kernel.org; mark.rutland@arm.com;
> shawnguo@kernel.org; linux-arm-kernel@lists.infradead.org;
> computersforpeace@gmail.com; frieder.schrempf@exceet.de; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v5 0/7] spi: add support for octal mode
> 
> Hi Yogesh,
> 
> On Mon, 10 Dec 2018 04:13:28 +0000
> Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:
> 
> > Hi Mark,
> >
> > Patch has been resend [1], this patch is depends on the series of patch[2] and
> this series has been applied by Boris already.
> 
> You're still not asking the right person. Every patches touching things in
> drivers/mtd/ should be taken by me (or another MTD maintainer), and patches
> touching things in drivers/spi/ should be taken by Mark. So, the patch you're
> pointing to should be applied by me. Plus, I told you I would apply it after 4.21-
> rc1 because I don't want to deal with the mtd -> spi dependency.
> 
> Please be patient.
> 
> Regards,
> 
> Boris
Boris Brezillon Dec. 10, 2018, 8:50 a.m. UTC | #12
On Mon, 10 Dec 2018 08:39:20 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:

> Hi Boris,
> 
> Sorry for confusion.
> 
> My intention was just to point to the correct patch number only. Earlier you have asked Mark to pick the patch [1] but that patch number was not correct.

Look at the context in [1] (we have good reasons to reply inline instead
of top-posting). I asked Mark to pick "spi: nxp-fspi: add octal mode
flag bit for octal support", not the m25p80 changes. I was wrong
though, as the patch I pointed to depends on your nxp-fspi patchset
which as not been merged yet.

> 
> [1] https://lkml.org/lkml/2018/12/5/758
Mark Brown Dec. 10, 2018, 3:29 p.m. UTC | #13
On Mon, Dec 10, 2018 at 04:13:28AM +0000, Yogesh Narayan Gaur wrote:
> Hi Mark,

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns.  Doing this makes your messages much
easier to read and reply to.

> Patch has been resend [1], this patch is depends on the series of patch[2] and this series has been applied by Boris already.

> [1] https://patchwork.ozlabs.org/patch/1010253/

This appears to be an MTD patch?  The subject is "mtd: m25p80: add
support of octal mode I/O transfer".  MTD patches normally go via the
MTD tree which is maintained by a group of people including Boris but
not me.

Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.