Commit fd213b5b authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Boris Brezillon

mtd: nand: hynix: add support for 20nm NAND chips

According to the datasheet of the H27UCG8T2BTR the NAND Technology field
(6th byte of the "Device Identifier Description", bits 0-2) the
following values are possible:
- 0x0 = 48nm
- 0x1 = 41nm
- 0x2 = 32nm
- 0x3 = 26nm
- 0x4 = 20nm
- (all others are reserved)

Fix this by extending the mask for this field to allow detecting value
0x4 (20nm) as valid NAND technology.
Without this the detection of the ECC requirements fails, because the
code assumes that the device is a 48nm device (0x4 & 0x3 = 0x0) and
aborts with "Invalid ECC requirements" because it cannot map the "ECC
Level". Extending the mask makes the ECC requirement detection code
recognize this chip as <= 26nm and sets up the ECC step size and ECC
strength correctly.
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Fixes: 78f3482d ("mtd: nand: hynix: Rework NAND ID decoding to extract more information")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 3bff08df
...@@ -477,7 +477,7 @@ static void hynix_nand_extract_ecc_requirements(struct nand_chip *chip, ...@@ -477,7 +477,7 @@ static void hynix_nand_extract_ecc_requirements(struct nand_chip *chip,
* The ECC requirements field meaning depends on the * The ECC requirements field meaning depends on the
* NAND technology. * NAND technology.
*/ */
u8 nand_tech = chip->id.data[5] & 0x3; u8 nand_tech = chip->id.data[5] & 0x7;
if (nand_tech < 3) { if (nand_tech < 3) {
/* > 26nm, reference: H27UBG8T2A datasheet */ /* > 26nm, reference: H27UBG8T2A datasheet */
...@@ -533,7 +533,7 @@ static void hynix_nand_extract_scrambling_requirements(struct nand_chip *chip, ...@@ -533,7 +533,7 @@ static void hynix_nand_extract_scrambling_requirements(struct nand_chip *chip,
if (nand_tech > 0) if (nand_tech > 0)
chip->options |= NAND_NEED_SCRAMBLING; chip->options |= NAND_NEED_SCRAMBLING;
} else { } else {
nand_tech = chip->id.data[5] & 0x3; nand_tech = chip->id.data[5] & 0x7;
/* < 32nm */ /* < 32nm */
if (nand_tech > 2) if (nand_tech > 2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment