public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
@ 2023-10-21 15:02 Chukun Pan
  2023-10-23  7:54 ` Miquel Raynal
  0 siblings, 1 reply; 7+ messages in thread
From: Chukun Pan @ 2023-10-21 15:02 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
	Chukun Pan

The Toshiba TH58NYG3S0HBAI4 is detected with 128 byte OOB while the flash
has 256 bytes OOB. This adds a static NAND ID entry to correct this.

Tested on Arcadyan AW1000 flashed with OpenWrt.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 drivers/mtd/nand/raw/nand_ids.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c
index 650351c62af6..2b871dfd1d09 100644
--- a/drivers/mtd/nand/raw/nand_ids.c
+++ b/drivers/mtd/nand/raw/nand_ids.c
@@ -58,6 +58,9 @@ struct nand_flash_dev nand_flash_ids[] = {
 		{ .id = {0xad, 0xde, 0x14, 0xa7, 0x42, 0x4a} },
 		  SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664,
 		  NAND_ECC_INFO(40, SZ_1K) },
+	{"TH58NYG3S0HBAI4 8G 1.8V 8-bit",
+		{ .id = {0x98, 0xa3, 0x91, 0x26, 0x76} },
+		  SZ_4K, SZ_1K, SZ_256K, 0, 4, 256, NAND_ECC_INFO(8, SZ_512) },
 	{"TH58NVG2S3HBAI4 4G 3.3V 8-bit",
 		{ .id = {0x98, 0xdc, 0x91, 0x15, 0x76} },
 		  SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) },
-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
  2023-10-21 15:02 [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash Chukun Pan
@ 2023-10-23  7:54 ` Miquel Raynal
  2023-10-29  7:20   ` Chukun Pan
  0 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2023-10-23  7:54 UTC (permalink / raw)
  To: Chukun Pan
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel

Hi Chukun,

amadeus@jmu.edu.cn wrote on Sat, 21 Oct 2023 23:02:12 +0800:

> The Toshiba TH58NYG3S0HBAI4 is detected with 128 byte OOB while the flash
> has 256 bytes OOB. This adds a static NAND ID entry to correct this.

Any way you can detect this and fix the parameter page at run time
instead?

> Tested on Arcadyan AW1000 flashed with OpenWrt.
> 
> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  drivers/mtd/nand/raw/nand_ids.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c
> index 650351c62af6..2b871dfd1d09 100644
> --- a/drivers/mtd/nand/raw/nand_ids.c
> +++ b/drivers/mtd/nand/raw/nand_ids.c
> @@ -58,6 +58,9 @@ struct nand_flash_dev nand_flash_ids[] = {
>  		{ .id = {0xad, 0xde, 0x14, 0xa7, 0x42, 0x4a} },
>  		  SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664,
>  		  NAND_ECC_INFO(40, SZ_1K) },
> +	{"TH58NYG3S0HBAI4 8G 1.8V 8-bit",
> +		{ .id = {0x98, 0xa3, 0x91, 0x26, 0x76} },
> +		  SZ_4K, SZ_1K, SZ_256K, 0, 4, 256, NAND_ECC_INFO(8, SZ_512) },
>  	{"TH58NVG2S3HBAI4 4G 3.3V 8-bit",
>  		{ .id = {0x98, 0xdc, 0x91, 0x15, 0x76} },
>  		  SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) },


Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
  2023-10-23  7:54 ` Miquel Raynal
@ 2023-10-29  7:20   ` Chukun Pan
  2023-10-29 13:48     ` Miquel Raynal
  0 siblings, 1 reply; 7+ messages in thread
From: Chukun Pan @ 2023-10-29  7:20 UTC (permalink / raw)
  To: miquel.raynal; +Cc: linux-kernel, linux-mtd, richard, vigneshr, Chukun Pan

Hi Miquel,

> Any way you can detect this and fix the parameter page at run time
> instead?

Sorry but I don't know, I know very little about this.

Thanks,
Chukun

-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
  2023-10-29  7:20   ` Chukun Pan
@ 2023-10-29 13:48     ` Miquel Raynal
  2023-11-14 12:30       ` Chukun Pan
  0 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2023-10-29 13:48 UTC (permalink / raw)
  To: Chukun Pan; +Cc: linux-kernel, linux-mtd, richard, vigneshr

Hi Chukun,

amadeus@jmu.edu.cn wrote on Sun, 29 Oct 2023 15:20:05 +0800:

> Hi Miquel,
> 
> > Any way you can detect this and fix the parameter page at run time
> > instead?  
> 
> Sorry but I don't know, I know very little about this.
> 
> Thanks,
> Chukun
> 

It's more like a request than a question. Please fix the parameter page
at run time by registering a ->.fixup_onfi_param_page() hook in
Toshiba's nand_manufacturer_ops structure.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
  2023-10-29 13:48     ` Miquel Raynal
@ 2023-11-14 12:30       ` Chukun Pan
  2023-11-15 14:00         ` Chukun Pan
  2023-11-16 15:46         ` Miquel Raynal
  0 siblings, 2 replies; 7+ messages in thread
From: Chukun Pan @ 2023-11-14 12:30 UTC (permalink / raw)
  To: miquel.raynal; +Cc: amadeus, linux-kernel, linux-mtd, richard, vigneshr

Hi Miquel,

> It's more like a request than a question. Please fix the parameter page
> at run time by registering a ->.fixup_onfi_param_page() hook in
> Toshiba's nand_manufacturer_ops structure.

Sorry for the late reply. This flash is not ONFI compliant NAND,
so onfi fixup can't work. Datasheet available at:
https://europe.kioxia.com/content/dam/kioxia/newidr/productinfo/datasheet/201910/DST_TH58NYG3S0HBAI4-TDE_EN_31565.pdf

Thanks,
Chukun

-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
  2023-11-14 12:30       ` Chukun Pan
@ 2023-11-15 14:00         ` Chukun Pan
  2023-11-16 15:46         ` Miquel Raynal
  1 sibling, 0 replies; 7+ messages in thread
From: Chukun Pan @ 2023-11-15 14:00 UTC (permalink / raw)
  To: miquel.raynal; +Cc: linux-kernel, linux-mtd, richard, vigneshr, Chukun Pan

However, the NAND ID of this flash is {0x98, 0xa3, 0x91, 0x26},
the last ID bytes is missing. Maybe this patch should be put in
OpenWrt as a hack.

Thanks,
Chukun

-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
  2023-11-14 12:30       ` Chukun Pan
  2023-11-15 14:00         ` Chukun Pan
@ 2023-11-16 15:46         ` Miquel Raynal
  1 sibling, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2023-11-16 15:46 UTC (permalink / raw)
  To: Chukun Pan; +Cc: linux-kernel, linux-mtd, richard, vigneshr

Hi Chukun,

amadeus@jmu.edu.cn wrote on Tue, 14 Nov 2023 20:30:08 +0800:

> Hi Miquel,
> 
> > It's more like a request than a question. Please fix the parameter page
> > at run time by registering a ->.fixup_onfi_param_page() hook in
> > Toshiba's nand_manufacturer_ops structure.  
> 
> Sorry for the late reply. This flash is not ONFI compliant NAND,
> so onfi fixup can't work. Datasheet available at:
> https://europe.kioxia.com/content/dam/kioxia/newidr/productinfo/datasheet/201910/DST_TH58NYG3S0HBAI4-TDE_EN_31565.pdf

You said in your commit log that this flash was detected with a smaller
(or bigger, I don't remember) OOB size than it really has. This number
comes from somewhere? Is it an existing ID? Is it an auto-discovery
mechanism?

If it's an ID then why not adding a new entry. Otherwise you can I
guess make some changes in the device geometry in the manufacturer init
operation as well if the fixup-onfi hook does no apply.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2023-11-16 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-21 15:02 [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash Chukun Pan
2023-10-23  7:54 ` Miquel Raynal
2023-10-29  7:20   ` Chukun Pan
2023-10-29 13:48     ` Miquel Raynal
2023-11-14 12:30       ` Chukun Pan
2023-11-15 14:00         ` Chukun Pan
2023-11-16 15:46         ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox