[PATCH 0/3] Add fixups for two-plane serial NAND flash

Cheng Ming Lin posted 3 patches 1 year, 5 months ago
There is a newer version of this series
drivers/mtd/nand/spi/core.c     |  7 +++++
drivers/mtd/nand/spi/macronix.c | 51 +++++++++++++++++++++++++++++----
include/linux/mtd/spinand.h     | 17 +++++++++++
3 files changed, 69 insertions(+), 6 deletions(-)
[PATCH 0/3] Add fixups for two-plane serial NAND flash
Posted by Cheng Ming Lin 1 year, 5 months ago
From: Cheng Ming Lin <chengminglin@mxic.com.tw>

Macronix serial NAND flash with a two-plane structure
requires insertion of Plane Select bit into the column
address during the write_to_cache operation.

Additionally, for MX35{U,F}2G14AC, insertion of Plane
Select bit into the column address is required during
the read_from_cache operation.

In spinand.h, add struct spi_nand_fixups as SPI NAND
fixup hooks.

In macronix.c, add fixup functions and update ID table.

In core.c, add an if statement to determine whether to
insert the Plane Select bit for the column address.

These flashes have been validated on Xilinx zynq-picozed
board which included Macronix SPI Host.

Cheng Ming Lin (3):
  include/linux/mtd/spinand.h: Add fixups for spinand
  mtd: spinand: macronix: Fixups for PLANE_SELECT_BIT
  mtd: spinand: Insert Plane Select bit for the column address

 drivers/mtd/nand/spi/core.c     |  7 +++++
 drivers/mtd/nand/spi/macronix.c | 51 +++++++++++++++++++++++++++++----
 include/linux/mtd/spinand.h     | 17 +++++++++++
 3 files changed, 69 insertions(+), 6 deletions(-)

-- 
2.25.1
Re: [PATCH 0/3] Add fixups for two-plane serial NAND flash
Posted by Miquel Raynal 1 year, 5 months ago
Hi Cheng,

linchengming884@gmail.com wrote on Wed, 10 Jul 2024 09:15:38 +0800:

> From: Cheng Ming Lin <chengminglin@mxic.com.tw>
> 
> Macronix serial NAND flash with a two-plane structure
> requires insertion of Plane Select bit into the column
> address during the write_to_cache operation.
> 
> Additionally, for MX35{U,F}2G14AC, insertion of Plane
> Select bit into the column address is required during
> the read_from_cache operation.
> 
> In spinand.h, add struct spi_nand_fixups as SPI NAND
> fixup hooks.
> 
> In macronix.c, add fixup functions and update ID table.
> 
> In core.c, add an if statement to determine whether to
> insert the Plane Select bit for the column address.
> 
> These flashes have been validated on Xilinx zynq-picozed
> board which included Macronix SPI Host.
> 
> Cheng Ming Lin (3):
>   include/linux/mtd/spinand.h: Add fixups for spinand
>   mtd: spinand: macronix: Fixups for PLANE_SELECT_BIT
>   mtd: spinand: Insert Plane Select bit for the column address

I believe patches 1 and 3 should be squashed and come before patch 2.

In general in your code, please avoid camelCase.

Finally, I am not convinced yet by this implementation, I don't know
what to propose yet, but I am not particularly in favor of adding such
hooks. Can you point to a datasheet (url and page) where I could get
more information?

> 
>  drivers/mtd/nand/spi/core.c     |  7 +++++
>  drivers/mtd/nand/spi/macronix.c | 51 +++++++++++++++++++++++++++++----
>  include/linux/mtd/spinand.h     | 17 +++++++++++
>  3 files changed, 69 insertions(+), 6 deletions(-)
> 


Thanks,
Miquèl