mbox series

[RESEND,v4,00/10] mtd: spinand: initial support of ecc engines

Message ID 20241001204444.917238-1-mikhail.kshevetskiy@iopsys.eu
Headers show
Series mtd: spinand: initial support of ecc engines | expand

Message

Mikhail Kshevetskiy Oct. 1, 2024, 8:44 p.m. UTC
This patch series:
 * sync spinand driver code with linux-6.10
 * sync spinand flash support with linux-6.10
 * add initial support of ecc engines

Up to now only software ecc is supported, but other engines can be add quite easily

Changes v2
 * update description of some patches

Changes v3:
 * split some patches to a smaller one for more easy checking/verification
 * sync spinand flash support with linux-6.10
 * add some ecc engine comments (taken from linux driver)
 * slightly change patch order

Changes v4:
 * avoid double increments of error counters

Mikhail Kshevetskiy (10):
  mtd: spinand: Use the spi-mem dirmap API
  mtd: spinand: Add a NAND page I/O request type
  mtd: spinand: add missed add missed MODULE_DEVICE_TABLE()
  mtd: spinand: simulate behavior of linux's function spinand_wait()
  mtd: spinand: more use of spinand_to_{something} helpers
  mtd: spinand: replace enable_ecc variable with disable_ecc and update
    corresponding logic
  mtd: spinand: minor refactoring
  mtd: spinand: more refactoring
  mtd: spinand: sync supported flashes with linux-6.10
  mtd: nand: add initial ecc engine support

 drivers/mtd/nand/Makefile             |   2 +-
 drivers/mtd/nand/core.c               | 130 +++++-
 drivers/mtd/nand/ecc.c                | 249 ++++++++++
 drivers/mtd/nand/spi/Makefile         |   4 +-
 drivers/mtd/nand/spi/alliancememory.c | 155 ++++++
 drivers/mtd/nand/spi/ato.c            |  84 ++++
 drivers/mtd/nand/spi/core.c           | 649 ++++++++++++++++----------
 drivers/mtd/nand/spi/esmt.c           |  16 +-
 drivers/mtd/nand/spi/foresee.c        |  97 ++++
 drivers/mtd/nand/spi/gigadevice.c     | 194 +++++++-
 drivers/mtd/nand/spi/macronix.c       |  32 +-
 drivers/mtd/nand/spi/micron.c         |   2 +-
 drivers/mtd/nand/spi/toshiba.c        |  43 +-
 drivers/mtd/nand/spi/winbond.c        |  67 ++-
 include/linux/mtd/nand.h              | 279 ++++++++++-
 include/linux/mtd/spinand.h           |  47 +-
 include/spi-mem.h                     |   2 +
 17 files changed, 1778 insertions(+), 274 deletions(-)
 create mode 100644 drivers/mtd/nand/ecc.c
 create mode 100644 drivers/mtd/nand/spi/alliancememory.c
 create mode 100644 drivers/mtd/nand/spi/ato.c
 create mode 100644 drivers/mtd/nand/spi/foresee.c

Comments

Simon Glass Oct. 9, 2024, 1:50 a.m. UTC | #1
Hi Mikhail,

On Tue, 1 Oct 2024 at 14:45, Mikhail Kshevetskiy
<mikhail.kshevetskiy@iopsys.eu> wrote:
>
> This patch series:
>  * sync spinand driver code with linux-6.10
>  * sync spinand flash support with linux-6.10
>  * add initial support of ecc engines
>
> Up to now only software ecc is supported, but other engines can be add quite easily

Is there a uclass for ECC?

>
> Changes v2
>  * update description of some patches
>
> Changes v3:
>  * split some patches to a smaller one for more easy checking/verification
>  * sync spinand flash support with linux-6.10
>  * add some ecc engine comments (taken from linux driver)
>  * slightly change patch order
>
> Changes v4:
>  * avoid double increments of error counters
>
> Mikhail Kshevetskiy (10):
>   mtd: spinand: Use the spi-mem dirmap API
>   mtd: spinand: Add a NAND page I/O request type
>   mtd: spinand: add missed add missed MODULE_DEVICE_TABLE()
>   mtd: spinand: simulate behavior of linux's function spinand_wait()
>   mtd: spinand: more use of spinand_to_{something} helpers
>   mtd: spinand: replace enable_ecc variable with disable_ecc and update
>     corresponding logic
>   mtd: spinand: minor refactoring
>   mtd: spinand: more refactoring
>   mtd: spinand: sync supported flashes with linux-6.10
>   mtd: nand: add initial ecc engine support
>
>  drivers/mtd/nand/Makefile             |   2 +-
>  drivers/mtd/nand/core.c               | 130 +++++-
>  drivers/mtd/nand/ecc.c                | 249 ++++++++++
>  drivers/mtd/nand/spi/Makefile         |   4 +-
>  drivers/mtd/nand/spi/alliancememory.c | 155 ++++++
>  drivers/mtd/nand/spi/ato.c            |  84 ++++
>  drivers/mtd/nand/spi/core.c           | 649 ++++++++++++++++----------
>  drivers/mtd/nand/spi/esmt.c           |  16 +-
>  drivers/mtd/nand/spi/foresee.c        |  97 ++++
>  drivers/mtd/nand/spi/gigadevice.c     | 194 +++++++-
>  drivers/mtd/nand/spi/macronix.c       |  32 +-
>  drivers/mtd/nand/spi/micron.c         |   2 +-
>  drivers/mtd/nand/spi/toshiba.c        |  43 +-
>  drivers/mtd/nand/spi/winbond.c        |  67 ++-
>  include/linux/mtd/nand.h              | 279 ++++++++++-
>  include/linux/mtd/spinand.h           |  47 +-
>  include/spi-mem.h                     |   2 +
>  17 files changed, 1778 insertions(+), 274 deletions(-)
>  create mode 100644 drivers/mtd/nand/ecc.c
>  create mode 100644 drivers/mtd/nand/spi/alliancememory.c
>  create mode 100644 drivers/mtd/nand/spi/ato.c
>  create mode 100644 drivers/mtd/nand/spi/foresee.c
>
> --
> 2.45.2
>

Regards,
Simon
Miquel Raynal Oct. 9, 2024, 8:11 a.m. UTC | #2
Hi Simon, Mikhail,

sjg@chromium.org wrote on Tue, 8 Oct 2024 19:50:59 -0600:

> Hi Mikhail,
> 
> On Tue, 1 Oct 2024 at 14:45, Mikhail Kshevetskiy
> <mikhail.kshevetskiy@iopsys.eu> wrote:
> >
> > This patch series:
> >  * sync spinand driver code with linux-6.10
> >  * sync spinand flash support with linux-6.10
> >  * add initial support of ecc engines
> >
> > Up to now only software ecc is supported, but other engines can be add quite easily  
> 
> Is there a uclass for ECC?

Not that I am aware of. Indeed maybe a uclass for these engines might
make sense (maybe UCLASS_ECC_ENGINE). The uclass for them might be
simple enough just to match devices with drivers and drivers and perhaps
expose the few callbacks needed (like init/prepare/finish/cleanup).
Then in the NAND layer when looking for a suitable device you could do
a research by class ID.

Thanks,
Miquèl
Mikhail Kshevetskiy Oct. 9, 2024, 8:18 a.m. UTC | #3
On 09.10.2024 04:50, Simon Glass wrote:
> Hi Mikhail,
>
> On Tue, 1 Oct 2024 at 14:45, Mikhail Kshevetskiy
> <mikhail.kshevetskiy@iopsys.eu> wrote:
>> This patch series:
>>  * sync spinand driver code with linux-6.10
>>  * sync spinand flash support with linux-6.10
>>  * add initial support of ecc engines
>>
>> Up to now only software ecc is supported, but other engines can be add quite easily
> Is there a uclass for ECC?
no uclass. Is it needed?
I tried to make the code similar to linux as much as possible
>
>> Changes v2
>>  * update description of some patches
>>
>> Changes v3:
>>  * split some patches to a smaller one for more easy checking/verification
>>  * sync spinand flash support with linux-6.10
>>  * add some ecc engine comments (taken from linux driver)
>>  * slightly change patch order
>>
>> Changes v4:
>>  * avoid double increments of error counters
>>
>> Mikhail Kshevetskiy (10):
>>   mtd: spinand: Use the spi-mem dirmap API
>>   mtd: spinand: Add a NAND page I/O request type
>>   mtd: spinand: add missed add missed MODULE_DEVICE_TABLE()
>>   mtd: spinand: simulate behavior of linux's function spinand_wait()
>>   mtd: spinand: more use of spinand_to_{something} helpers
>>   mtd: spinand: replace enable_ecc variable with disable_ecc and update
>>     corresponding logic
>>   mtd: spinand: minor refactoring
>>   mtd: spinand: more refactoring
>>   mtd: spinand: sync supported flashes with linux-6.10
>>   mtd: nand: add initial ecc engine support
>>
>>  drivers/mtd/nand/Makefile             |   2 +-
>>  drivers/mtd/nand/core.c               | 130 +++++-
>>  drivers/mtd/nand/ecc.c                | 249 ++++++++++
>>  drivers/mtd/nand/spi/Makefile         |   4 +-
>>  drivers/mtd/nand/spi/alliancememory.c | 155 ++++++
>>  drivers/mtd/nand/spi/ato.c            |  84 ++++
>>  drivers/mtd/nand/spi/core.c           | 649 ++++++++++++++++----------
>>  drivers/mtd/nand/spi/esmt.c           |  16 +-
>>  drivers/mtd/nand/spi/foresee.c        |  97 ++++
>>  drivers/mtd/nand/spi/gigadevice.c     | 194 +++++++-
>>  drivers/mtd/nand/spi/macronix.c       |  32 +-
>>  drivers/mtd/nand/spi/micron.c         |   2 +-
>>  drivers/mtd/nand/spi/toshiba.c        |  43 +-
>>  drivers/mtd/nand/spi/winbond.c        |  67 ++-
>>  include/linux/mtd/nand.h              | 279 ++++++++++-
>>  include/linux/mtd/spinand.h           |  47 +-
>>  include/spi-mem.h                     |   2 +
>>  17 files changed, 1778 insertions(+), 274 deletions(-)
>>  create mode 100644 drivers/mtd/nand/ecc.c
>>  create mode 100644 drivers/mtd/nand/spi/alliancememory.c
>>  create mode 100644 drivers/mtd/nand/spi/ato.c
>>  create mode 100644 drivers/mtd/nand/spi/foresee.c
>>
>> --
>> 2.45.2
>>
> Regards,
> Simon