Re: [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-11-17 Thread Peter Pan
Hi Boris,

On Thu, Nov 17, 2016 at 3:56 PM, Boris Brezillon
 wrote:
> Hi Peter,
>
> On Thu, 17 Nov 2016 14:26:37 +0800
> Peter Pan  wrote:
>
>> Hi Boris,
>>
>> On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
>>  wrote:
>> > Hi,
>> >
>> > This series is aiming at providing a generic NAND layer to share code
>> > between different NAND based devices.
>> >
>> > We currently have 3 different interfaces to interact with NANDs:
>> > - Raw NANDs
>> > - OneNANDs
>> > - SPI NANDs
>> >
>> > Apart from the way these NAND devices are accessed they have a lot
>> > in common, like the way the memory is organized, or their constraints.
>> > This is usually a good sign that some work should be done to factorize
>> > the code.
>> >
>> > This work has been started by Peter who wanted to re-use the BBT
>> > code for its SPI-NAND driver. But I think we can push it further
>> > other stuff (the software ECC implementation, or the way offsets are
>> > converted to block/page number).
>> >
>> > Peter, can you please review/test this version, and if possible, post
>> > the code you've done to support SPI NANDs.
>> >
>>
>> I already finished review and test work. The BBT works well after I applied
>> my modification which I already sent to your by email. I tried to build a new
>> BBT on a new NAND and then mark one block to bad. Both works well.
>> My test platform is Xilinx Zed board.
>
> Thanks a lot for testing and reviewing this series. I'll address your
> comments and send a new version soon.
>
> My plan is to have it in -next just after 4.10-rc1 is released, in order
> to detect bugs early.
>
>>
>> I will try to rebase my SPI NAND patch on your patch and send it out.
>> It will take me some time because I'm quite busy with other company affairs.
>
> I'd be happy to review this part.

Looking forward for your reviewing! Your comments are really needed!

Thanks,
Peter Pan


Re: [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-11-17 Thread Peter Pan
Hi Boris,

On Thu, Nov 17, 2016 at 3:56 PM, Boris Brezillon
 wrote:
> Hi Peter,
>
> On Thu, 17 Nov 2016 14:26:37 +0800
> Peter Pan  wrote:
>
>> Hi Boris,
>>
>> On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
>>  wrote:
>> > Hi,
>> >
>> > This series is aiming at providing a generic NAND layer to share code
>> > between different NAND based devices.
>> >
>> > We currently have 3 different interfaces to interact with NANDs:
>> > - Raw NANDs
>> > - OneNANDs
>> > - SPI NANDs
>> >
>> > Apart from the way these NAND devices are accessed they have a lot
>> > in common, like the way the memory is organized, or their constraints.
>> > This is usually a good sign that some work should be done to factorize
>> > the code.
>> >
>> > This work has been started by Peter who wanted to re-use the BBT
>> > code for its SPI-NAND driver. But I think we can push it further
>> > other stuff (the software ECC implementation, or the way offsets are
>> > converted to block/page number).
>> >
>> > Peter, can you please review/test this version, and if possible, post
>> > the code you've done to support SPI NANDs.
>> >
>>
>> I already finished review and test work. The BBT works well after I applied
>> my modification which I already sent to your by email. I tried to build a new
>> BBT on a new NAND and then mark one block to bad. Both works well.
>> My test platform is Xilinx Zed board.
>
> Thanks a lot for testing and reviewing this series. I'll address your
> comments and send a new version soon.
>
> My plan is to have it in -next just after 4.10-rc1 is released, in order
> to detect bugs early.
>
>>
>> I will try to rebase my SPI NAND patch on your patch and send it out.
>> It will take me some time because I'm quite busy with other company affairs.
>
> I'd be happy to review this part.

Looking forward for your reviewing! Your comments are really needed!

Thanks,
Peter Pan


Re: [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-11-16 Thread Boris Brezillon
Hi Peter,

On Thu, 17 Nov 2016 14:26:37 +0800
Peter Pan  wrote:

> Hi Boris,
> 
> On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
>  wrote:
> > Hi,
> >
> > This series is aiming at providing a generic NAND layer to share code
> > between different NAND based devices.
> >
> > We currently have 3 different interfaces to interact with NANDs:
> > - Raw NANDs
> > - OneNANDs
> > - SPI NANDs
> >
> > Apart from the way these NAND devices are accessed they have a lot
> > in common, like the way the memory is organized, or their constraints.
> > This is usually a good sign that some work should be done to factorize
> > the code.
> >
> > This work has been started by Peter who wanted to re-use the BBT
> > code for its SPI-NAND driver. But I think we can push it further
> > other stuff (the software ECC implementation, or the way offsets are
> > converted to block/page number).
> >
> > Peter, can you please review/test this version, and if possible, post
> > the code you've done to support SPI NANDs.
> >  
> 
> I already finished review and test work. The BBT works well after I applied
> my modification which I already sent to your by email. I tried to build a new
> BBT on a new NAND and then mark one block to bad. Both works well.
> My test platform is Xilinx Zed board.

Thanks a lot for testing and reviewing this series. I'll address your
comments and send a new version soon.

My plan is to have it in -next just after 4.10-rc1 is released, in order
to detect bugs early.

> 
> I will try to rebase my SPI NAND patch on your patch and send it out.
> It will take me some time because I'm quite busy with other company affairs.

I'd be happy to review this part.

Regards,

Boris


Re: [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-11-16 Thread Boris Brezillon
Hi Peter,

On Thu, 17 Nov 2016 14:26:37 +0800
Peter Pan  wrote:

> Hi Boris,
> 
> On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
>  wrote:
> > Hi,
> >
> > This series is aiming at providing a generic NAND layer to share code
> > between different NAND based devices.
> >
> > We currently have 3 different interfaces to interact with NANDs:
> > - Raw NANDs
> > - OneNANDs
> > - SPI NANDs
> >
> > Apart from the way these NAND devices are accessed they have a lot
> > in common, like the way the memory is organized, or their constraints.
> > This is usually a good sign that some work should be done to factorize
> > the code.
> >
> > This work has been started by Peter who wanted to re-use the BBT
> > code for its SPI-NAND driver. But I think we can push it further
> > other stuff (the software ECC implementation, or the way offsets are
> > converted to block/page number).
> >
> > Peter, can you please review/test this version, and if possible, post
> > the code you've done to support SPI NANDs.
> >  
> 
> I already finished review and test work. The BBT works well after I applied
> my modification which I already sent to your by email. I tried to build a new
> BBT on a new NAND and then mark one block to bad. Both works well.
> My test platform is Xilinx Zed board.

Thanks a lot for testing and reviewing this series. I'll address your
comments and send a new version soon.

My plan is to have it in -next just after 4.10-rc1 is released, in order
to detect bugs early.

> 
> I will try to rebase my SPI NAND patch on your patch and send it out.
> It will take me some time because I'm quite busy with other company affairs.

I'd be happy to review this part.

Regards,

Boris


Re: [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-11-16 Thread Peter Pan
Hi Boris,

On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
 wrote:
> Hi,
>
> This series is aiming at providing a generic NAND layer to share code
> between different NAND based devices.
>
> We currently have 3 different interfaces to interact with NANDs:
> - Raw NANDs
> - OneNANDs
> - SPI NANDs
>
> Apart from the way these NAND devices are accessed they have a lot
> in common, like the way the memory is organized, or their constraints.
> This is usually a good sign that some work should be done to factorize
> the code.
>
> This work has been started by Peter who wanted to re-use the BBT
> code for its SPI-NAND driver. But I think we can push it further
> other stuff (the software ECC implementation, or the way offsets are
> converted to block/page number).
>
> Peter, can you please review/test this version, and if possible, post
> the code you've done to support SPI NANDs.
>

I already finished review and test work. The BBT works well after I applied
my modification which I already sent to your by email. I tried to build a new
BBT on a new NAND and then mark one block to bad. Both works well.
My test platform is Xilinx Zed board.

I will try to rebase my SPI NAND patch on your patch and send it out.
It will take me some time because I'm quite busy with other company affairs.


Thanks,
Peter Pan


Re: [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-11-16 Thread Peter Pan
Hi Boris,

On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
 wrote:
> Hi,
>
> This series is aiming at providing a generic NAND layer to share code
> between different NAND based devices.
>
> We currently have 3 different interfaces to interact with NANDs:
> - Raw NANDs
> - OneNANDs
> - SPI NANDs
>
> Apart from the way these NAND devices are accessed they have a lot
> in common, like the way the memory is organized, or their constraints.
> This is usually a good sign that some work should be done to factorize
> the code.
>
> This work has been started by Peter who wanted to re-use the BBT
> code for its SPI-NAND driver. But I think we can push it further
> other stuff (the software ECC implementation, or the way offsets are
> converted to block/page number).
>
> Peter, can you please review/test this version, and if possible, post
> the code you've done to support SPI NANDs.
>

I already finished review and test work. The BBT works well after I applied
my modification which I already sent to your by email. I tried to build a new
BBT on a new NAND and then mark one block to bad. Both works well.
My test platform is Xilinx Zed board.

I will try to rebase my SPI NAND patch on your patch and send it out.
It will take me some time because I'm quite busy with other company affairs.


Thanks,
Peter Pan


[PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-10-16 Thread Boris Brezillon
Hi,

This series is aiming at providing a generic NAND layer to share code
between different NAND based devices.

We currently have 3 different interfaces to interact with NANDs:
- Raw NANDs
- OneNANDs
- SPI NANDs

Apart from the way these NAND devices are accessed they have a lot
in common, like the way the memory is organized, or their constraints.
This is usually a good sign that some work should be done to factorize
the code.

This work has been started by Peter who wanted to re-use the BBT
code for its SPI-NAND driver. But I think we can push it further
other stuff (the software ECC implementation, or the way offsets are
converted to block/page number).

Peter, can you please review/test this version, and if possible, post
the code you've done to support SPI NANDs.

Thanks,

Boris

Changes since v1:
- use the 'raw' prefix instead of 'rawnand'
- fix a few coding style issues and typos

Boris Brezillon (7):
  mtd: nand: Rename nand.h into rawnand.h
  mtd: nand: move raw NAND related code to the raw/ subdir
  mtd: nand: add a nand.h file to expose basic NAND stuff
  mtd: nand: raw: prefix conflicting names with nandc instead of nand
  mtd: nand: raw: create struct rawnand_device
  mtd: nand: raw: make BBT code more generic
  mtd: nand: move BBT code to drivers/mtd/nand/

 Documentation/DocBook/mtdnand.tmpl |   12 +-
 arch/arm/mach-davinci/board-da850-evm.c|2 +-
 arch/arm/mach-davinci/board-dm355-evm.c|2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c|2 +-
 arch/arm/mach-davinci/board-dm365-evm.c|2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c   |2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c   |2 +-
 arch/arm/mach-davinci/board-sffsdr.c   |2 +-
 arch/arm/mach-dove/dove-db-setup.c |2 +-
 arch/arm/mach-ep93xx/snappercl15.c |6 +-
 arch/arm/mach-ep93xx/ts72xx.c  |6 +-
 arch/arm/mach-imx/mach-qong.c  |4 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c   |4 +-
 arch/arm/mach-mmp/aspenite.c   |2 +-
 arch/arm/mach-omap1/board-fsample.c|2 +-
 arch/arm/mach-omap1/board-h2.c |2 +-
 arch/arm/mach-omap1/board-h3.c |2 +-
 arch/arm/mach-omap1/board-nand.c   |4 +-
 arch/arm/mach-omap1/board-perseus2.c   |2 +-
 arch/arm/mach-omap2/gpmc-nand.c|2 +-
 arch/arm/mach-orion5x/db88f5281-setup.c|2 +-
 arch/arm/mach-orion5x/kurobox_pro-setup.c  |2 +-
 arch/arm/mach-orion5x/ts209-setup.c|2 +-
 arch/arm/mach-orion5x/ts78xx-setup.c   |8 +-
 arch/arm/mach-pxa/balloon3.c   |4 +-
 arch/arm/mach-pxa/em-x270.c|4 +-
 arch/arm/mach-pxa/eseries.c|2 +-
 arch/arm/mach-pxa/palmtx.c |4 +-
 arch/arm/mach-pxa/tosa.c   |2 +-
 arch/arm/mach-s3c24xx/common-smdk.c|2 +-
 arch/arm/mach-s3c24xx/mach-anubis.c|2 +-
 arch/arm/mach-s3c24xx/mach-at2440evb.c |2 +-
 arch/arm/mach-s3c24xx/mach-bast.c  |2 +-
 arch/arm/mach-s3c24xx/mach-gta02.c |2 +-
 arch/arm/mach-s3c24xx/mach-jive.c  |2 +-
 arch/arm/mach-s3c24xx/mach-mini2440.c  |2 +-
 arch/arm/mach-s3c24xx/mach-osiris.c|2 +-
 arch/arm/mach-s3c24xx/mach-qt2410.c|2 +-
 arch/arm/mach-s3c24xx/mach-rx3715.c|2 +-
 arch/arm/mach-s3c24xx/mach-vstms.c |2 +-
 arch/blackfin/mach-bf537/boards/dnp5370.c  |2 +-
 arch/blackfin/mach-bf537/boards/stamp.c|4 +-
 arch/blackfin/mach-bf561/boards/acvilon.c  |4 +-
 arch/cris/arch-v32/drivers/mach-a3/nandflash.c |6 +-
 arch/cris/arch-v32/drivers/mach-fs/nandflash.c |6 +-
 arch/mips/alchemy/devboards/db1200.c   |4 +-
 arch/mips/alchemy/devboards/db1300.c   |4 +-
 arch/mips/alchemy/devboards/db1550.c   |4 +-
 arch/mips/include/asm/mach-jz4740/jz4740_nand.h|2 +-
 arch/mips/jz4740/board-qi_lb60.c   |2 +-
 arch/mips/netlogic/xlr/platform-flash.c|2 +-
 arch/mips/pnx833x/common/platform.c|4 +-
 arch/mips/rb532/devices.c  |4 +-
 arch/sh/boards/mach-migor/setup.c  |4 +-
 drivers/mtd/inftlcore.c|2 +-
 drivers/mtd/nand/Kconfig   |  572 +---
 drivers/mtd/nand/Makefile  |   63 +-
 drivers/mtd/nand/{nand_bbt.c => bbt.c} |  616 -
 drivers/mtd/nand/raw/Kconfig   |  573 
 

[PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type

2016-10-16 Thread Boris Brezillon
Hi,

This series is aiming at providing a generic NAND layer to share code
between different NAND based devices.

We currently have 3 different interfaces to interact with NANDs:
- Raw NANDs
- OneNANDs
- SPI NANDs

Apart from the way these NAND devices are accessed they have a lot
in common, like the way the memory is organized, or their constraints.
This is usually a good sign that some work should be done to factorize
the code.

This work has been started by Peter who wanted to re-use the BBT
code for its SPI-NAND driver. But I think we can push it further
other stuff (the software ECC implementation, or the way offsets are
converted to block/page number).

Peter, can you please review/test this version, and if possible, post
the code you've done to support SPI NANDs.

Thanks,

Boris

Changes since v1:
- use the 'raw' prefix instead of 'rawnand'
- fix a few coding style issues and typos

Boris Brezillon (7):
  mtd: nand: Rename nand.h into rawnand.h
  mtd: nand: move raw NAND related code to the raw/ subdir
  mtd: nand: add a nand.h file to expose basic NAND stuff
  mtd: nand: raw: prefix conflicting names with nandc instead of nand
  mtd: nand: raw: create struct rawnand_device
  mtd: nand: raw: make BBT code more generic
  mtd: nand: move BBT code to drivers/mtd/nand/

 Documentation/DocBook/mtdnand.tmpl |   12 +-
 arch/arm/mach-davinci/board-da850-evm.c|2 +-
 arch/arm/mach-davinci/board-dm355-evm.c|2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c|2 +-
 arch/arm/mach-davinci/board-dm365-evm.c|2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c   |2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c   |2 +-
 arch/arm/mach-davinci/board-sffsdr.c   |2 +-
 arch/arm/mach-dove/dove-db-setup.c |2 +-
 arch/arm/mach-ep93xx/snappercl15.c |6 +-
 arch/arm/mach-ep93xx/ts72xx.c  |6 +-
 arch/arm/mach-imx/mach-qong.c  |4 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c   |4 +-
 arch/arm/mach-mmp/aspenite.c   |2 +-
 arch/arm/mach-omap1/board-fsample.c|2 +-
 arch/arm/mach-omap1/board-h2.c |2 +-
 arch/arm/mach-omap1/board-h3.c |2 +-
 arch/arm/mach-omap1/board-nand.c   |4 +-
 arch/arm/mach-omap1/board-perseus2.c   |2 +-
 arch/arm/mach-omap2/gpmc-nand.c|2 +-
 arch/arm/mach-orion5x/db88f5281-setup.c|2 +-
 arch/arm/mach-orion5x/kurobox_pro-setup.c  |2 +-
 arch/arm/mach-orion5x/ts209-setup.c|2 +-
 arch/arm/mach-orion5x/ts78xx-setup.c   |8 +-
 arch/arm/mach-pxa/balloon3.c   |4 +-
 arch/arm/mach-pxa/em-x270.c|4 +-
 arch/arm/mach-pxa/eseries.c|2 +-
 arch/arm/mach-pxa/palmtx.c |4 +-
 arch/arm/mach-pxa/tosa.c   |2 +-
 arch/arm/mach-s3c24xx/common-smdk.c|2 +-
 arch/arm/mach-s3c24xx/mach-anubis.c|2 +-
 arch/arm/mach-s3c24xx/mach-at2440evb.c |2 +-
 arch/arm/mach-s3c24xx/mach-bast.c  |2 +-
 arch/arm/mach-s3c24xx/mach-gta02.c |2 +-
 arch/arm/mach-s3c24xx/mach-jive.c  |2 +-
 arch/arm/mach-s3c24xx/mach-mini2440.c  |2 +-
 arch/arm/mach-s3c24xx/mach-osiris.c|2 +-
 arch/arm/mach-s3c24xx/mach-qt2410.c|2 +-
 arch/arm/mach-s3c24xx/mach-rx3715.c|2 +-
 arch/arm/mach-s3c24xx/mach-vstms.c |2 +-
 arch/blackfin/mach-bf537/boards/dnp5370.c  |2 +-
 arch/blackfin/mach-bf537/boards/stamp.c|4 +-
 arch/blackfin/mach-bf561/boards/acvilon.c  |4 +-
 arch/cris/arch-v32/drivers/mach-a3/nandflash.c |6 +-
 arch/cris/arch-v32/drivers/mach-fs/nandflash.c |6 +-
 arch/mips/alchemy/devboards/db1200.c   |4 +-
 arch/mips/alchemy/devboards/db1300.c   |4 +-
 arch/mips/alchemy/devboards/db1550.c   |4 +-
 arch/mips/include/asm/mach-jz4740/jz4740_nand.h|2 +-
 arch/mips/jz4740/board-qi_lb60.c   |2 +-
 arch/mips/netlogic/xlr/platform-flash.c|2 +-
 arch/mips/pnx833x/common/platform.c|4 +-
 arch/mips/rb532/devices.c  |4 +-
 arch/sh/boards/mach-migor/setup.c  |4 +-
 drivers/mtd/inftlcore.c|2 +-
 drivers/mtd/nand/Kconfig   |  572 +---
 drivers/mtd/nand/Makefile  |   63 +-
 drivers/mtd/nand/{nand_bbt.c => bbt.c} |  616 -
 drivers/mtd/nand/raw/Kconfig   |  573