public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F
@ 2018-06-24 22:44 Chris Packham
  2018-06-24 22:44 ` [PATCH v6 1/6] mtd: rawnand: marvell: Handle on-die ECC Chris Packham
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Chris Packham @ 2018-06-24 22:44 UTC (permalink / raw)
  To: miquel.raynal, boris.brezillon, dwmw2, computersforpeace,
	linux-mtd
  Cc: linux-kernel, Chris Packham

Hi,

I'm looking at adding support for the Micron MT29F1G08ABAFAWP-ITE:F chip
to one of our boards which uses the Marvell NFCv2 controller.

This particular chip is a bit odd in that the datasheet states support
for ONFI 1.0 but the revision number field is 00 00. It also is marked
ABAFA but reports internally as ABAGA. Finally it has internal 8-bit ECC
which cannot be disabled.

The existing test in micron_supports_on_die_ecc() determines that on-die
ECC is supported but not mandatory but I know for this chip it is
mandatory despite what set_features returns.

In order for this to work I need to set nand-ecc-mode = "on-die" in my
dts. Ideally I'd like it to be automatic based on what the hardware can
support but that may be asking too much at the moment.

Here's a dump of the parameter page from the chip I have

00000000: 4f 4e 46 49 00 00 18 00 3f 00 00 00 00 00 00 00 ONFI....?.......
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000020: 4d 49 43 52 4f 4e 20 20 20 20 20 20 4d 54 32 39  MICRON MT29
00000030: 46 31 47 30 38 41 42 41 47 41 57 50 20 20 20 20  F1G08ABAGAWP    
00000040: 2c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ,...............
00000050: 00 08 00 00 80 00 00 02 00 00 20 00 40 00 00 00  ..........  .@...
00000060: 00 04 00 00 01 22 01 14 00 01 05 08 00 00 04 00 ....."..........
00000070: 08 01 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000080: 08 3f 00 3f 00 58 02 10 27 46 00 64 00 00 00 00 .?.?.X..'F.d....
00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000a0: 00 00 00 00 01 00 00 00 00 02 04 80 01 81 04 03 ................
000000b0: 02 01 1e 90 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 85 a6 ................

Series changes in v3:
- No longer RFC
- dropped "mtd: rawnand: micron: add ONFI_FEATURE_ON_DIE_ECC to supported
  features" which Boris has already picked up
- dropped "mtd: rawnand: marvell: Support page size of 2048 with 8-bit ECC"
  since I can't test it.

Series changes in v4:
- based on top of http://patchwork.ozlabs.org/patch/932006/

Series changes in v5:
- address review comments from Boris on patches 5 and 6

Series changes in v6:
- Update commit message on 6/6

Chris Packham (6):
  mtd: rawnand: marvell: Handle on-die ECC
  mtd: rawnand: add manufacturer fixup for ONFI parameter page
  mtd: rawnand: add defines for ONFI version bits
  mtd: rawnand: micron: add fixup for ONFI revision
  mtd: rawnand: micron: support 8/512 on-die ECC
  mtd: rawnand: micron: detect forced on-die ECC

 drivers/mtd/nand/raw/marvell_nand.c |   1 +
 drivers/mtd/nand/raw/nand_base.c    |  14 +--
 drivers/mtd/nand/raw/nand_micron.c  | 129 +++++++++++++++++++++++-----
 include/linux/mtd/rawnand.h         |  14 +++
 4 files changed, 131 insertions(+), 27 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F
@ 2018-07-09 15:54 Bean Huo (beanhuo)
  2018-07-09 16:31 ` Boris Brezillon
  0 siblings, 1 reply; 19+ messages in thread
From: Bean Huo (beanhuo) @ 2018-07-09 15:54 UTC (permalink / raw)
  To: Boris Brezillon, Chris Packham
  Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	miquel.raynal@bootlin.com, computersforpeace@gmail.com,
	dwmw2@infradead.org

Hi, Boris and Chris

>>
>> I see 2 solutions to this problem:
>> 1/ Bean provides us a solution to reliably detect when ECC can be
>>    de-actived and when it can't
>> 2/ We only ever expose 64 bytes of OOB to the user and consider that
>>    ECC can be disabled, even if it can't in reality
>>
>
>After reading the doc again, I forgot one thing you can try before deciding to
>go for option #2.
>
>8th bit in byte 5 of READID's result encodes whether the on-die ECC state
>(enabled or not). I remember we had a discussion with Bean where he told us
>this was a runtime status reflecting the on-die ECC state, which is crazy, since
>READID might return different values depending on the NAND state, and most
>of the code in the core assumes READID provides a fixed ID that encodes the
>chip characteristics/capabilities, not its state.
>
>Anyway, if this bit is actually reflecting the on-die ECC state and on-die
>cannot be disabled on your chip, it should stay at 1 even after you have sent
>the SET_FEATURES(DISABLE_ECC) command. Let's hope this works as I expect,
>otherwise we're back to option #2 until Bean suggest something else.

MT29F1G08ABAFAWP-ITE:F is Micron 70s SLC NAND with on-die ECC.
If the bit7 in the byte 5 of READID default is 1(ECC Enabled), it is true on-die ECC
Cannot be disabled by SET Feature command.
In case sending Set Feature command, you can check previous command is success or not by
Get Feature or check this bit7 in byte 5 of READID later.

To check if this device supports on-die ECC or not, you can use inter ECC level (bit 0 and bit1 in byte 5 of READID)  
http://lists.infradead.org/pipermail/linux-mtd/2017-April/073370.html

//beanhuo


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F
@ 2018-07-10 11:40 Bean Huo (beanhuo)
  2018-07-10 12:17 ` Boris Brezillon
  0 siblings, 1 reply; 19+ messages in thread
From: Bean Huo (beanhuo) @ 2018-07-10 11:40 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Chris Packham, linux-kernel@vger.kernel.org,
	linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com,
	computersforpeace@gmail.com, dwmw2@infradead.org

Hi,  Boris
>>
>> Okay, I think we already had this discussion, but I'm asking it again.
>> What are the possible values for that field and what do they mean?
>
>Still, it's not clear to me what "Internal ECC level" means. It seems that NAND
>chips having on-die ECC have this field set to 10b (0x2), 00b seems to be
>reserved for "no on-die ECC", but what are 01b and 11b reserved for?
>

That position identifies the part as having Internal ECC capability.  
The 01b and 11b are reserved for future definition.  Bit 7 of READ ID Byte 4 identifies the
device as an ECC OFF 0x0 or ECC ON 0x1.

>> Also, is it even used to encode the fact that the NAND has on-die ECC
>> on all your NANDs? We already had the problem of incompatible ID
>> schemes, so I wouldn't be surprised if that was the case here, hence
>> my initial suggestion to base the detection on the model name.
>
>I'd really need to have an answer on that one to take a decision. Also, I
>couldn't find a datasheet for an IT (without E) version of the
>MT29F1G08ABAFAWP part. Does it exist, or can we assume
>MT29F1G08ABAFAWP chips always come with forcibly enabled on-die ECC?

MT29F1G08ABAFAWP comes in ECC ON only.  We didn’t develop a
MT29F1G08ABAFAWP ECC OFF version.  Bit 7 of READ ID Byte 4 identifies the
device as an ECC OFF 0x0 or ECC ON 0x1.


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F
@ 2018-07-10 12:24 Bean Huo (beanhuo)
  2018-07-10 12:44 ` Miquel Raynal
  0 siblings, 1 reply; 19+ messages in thread
From: Bean Huo (beanhuo) @ 2018-07-10 12:24 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Chris Packham, linux-kernel@vger.kernel.org,
	linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com,
	computersforpeace@gmail.com, dwmw2@infradead.org

Hi, Boris
>>
>
>Okay. Can you have a look at the patches I sent an let me know if I do the
>right thing?

I am doing today. And will back to you I could give some advice.


I encounter one question as below when I reply the email of linux-mtd, but If I reply other mail list 
Such as scsi mail list, mmc mail list, no any problem. Do you know why? 


Your mail to 'linux-mtd' with the subject

    Re: [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F

Is being held until the list moderator can review it for approval.

The reason it is being held:

    Message has a suspicious header

Either the message will get posted to the list, or you will receive notification of the moderator's decision.  If you would like to cancel this posting, please visit the following URL:

    http://lists.infradead.org/mailman/confirm/linux-mtd/1a28f9a4069a0bbcadfb6b2a170c01dd8b962d0a


//beanhuo

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

end of thread, other threads:[~2018-07-10 12:44 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-24 22:44 [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F Chris Packham
2018-06-24 22:44 ` [PATCH v6 1/6] mtd: rawnand: marvell: Handle on-die ECC Chris Packham
2018-06-24 22:44 ` [PATCH v6 2/6] mtd: rawnand: add manufacturer fixup for ONFI parameter page Chris Packham
2018-06-24 22:44 ` [PATCH v6 3/6] mtd: rawnand: add defines for ONFI version bits Chris Packham
2018-06-24 22:44 ` [PATCH v6 4/6] mtd: rawnand: micron: add fixup for ONFI revision Chris Packham
2018-06-24 22:44 ` [PATCH v6 5/6] mtd: rawnand: micron: support 8/512 on-die ECC Chris Packham
2018-07-06 17:37   ` Boris Brezillon
2018-06-24 22:44 ` [PATCH v6 6/6] mtd: rawnand: micron: detect forced " Chris Packham
2018-06-25 12:32 ` [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F Miquel Raynal
2018-07-06 19:27 ` Boris Brezillon
2018-07-06 21:37   ` Boris Brezillon
2018-07-08 23:56     ` Chris Packham
  -- strict thread matches above, loose matches on Subject: below --
2018-07-09 15:54 Bean Huo (beanhuo)
2018-07-09 16:31 ` Boris Brezillon
2018-07-09 18:41   ` Boris Brezillon
2018-07-10 11:40 Bean Huo (beanhuo)
2018-07-10 12:17 ` Boris Brezillon
2018-07-10 12:24 Bean Huo (beanhuo)
2018-07-10 12:44 ` Miquel Raynal

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