Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 243f37cb authored by Chris Packham's avatar Chris Packham Committed by Miquel Raynal
Browse files

mtd: rawnand: micron: add fixup for ONFI revision



Some Micron NAND chips (MT29F1G08ABAFAWP-ITE:F) report 00 00 for the
revision number field of the ONFI parameter page. Rather than rejecting
these outright assume ONFI version 1.0 if the revision number is 00 00.

Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 872b71ff
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -290,6 +290,19 @@ static int micron_nand_init(struct nand_chip *chip)
	return 0;
}

static void micron_fixup_onfi_param_page(struct nand_chip *chip,
					 struct nand_onfi_params *p)
{
	/*
	 * MT29F1G08ABAFAWP-ITE:F and possibly others report 00 00 for the
	 * revision number field of the ONFI parameter page. Assume ONFI
	 * version 1.0 if the revision number is 00 00.
	 */
	if (le16_to_cpu(p->revision) == 0)
		p->revision = cpu_to_le16(ONFI_VERSION_1_0);
}

const struct nand_manufacturer_ops micron_nand_manuf_ops = {
	.init = micron_nand_init,
	.fixup_onfi_param_page = micron_fixup_onfi_param_page,
};