1
0

mtd: rawnand: add defines for ONFI version bits

Add defines for the ONFI version bits and use them in
nand_flash_detect_onfi().

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Este cometimento está contido em:
Chris Packham
2018-06-25 10:44:45 +12:00
cometido por Miquel Raynal
ascendente 00ce4e039a
cometimento 872b71ff08
2 ficheiros modificados com 16 adições e 5 eliminações

Ver ficheiro

@@ -5174,15 +5174,15 @@ static int nand_flash_detect_onfi(struct nand_chip *chip)
/* Check version */
val = le16_to_cpu(p->revision);
if (val & (1 << 5))
if (val & ONFI_VERSION_2_3)
chip->parameters.onfi.version = 23;
else if (val & (1 << 4))
else if (val & ONFI_VERSION_2_2)
chip->parameters.onfi.version = 22;
else if (val & (1 << 3))
else if (val & ONFI_VERSION_2_1)
chip->parameters.onfi.version = 21;
else if (val & (1 << 2))
else if (val & ONFI_VERSION_2_0)
chip->parameters.onfi.version = 20;
else if (val & (1 << 1))
else if (val & ONFI_VERSION_1_0)
chip->parameters.onfi.version = 10;
if (!chip->parameters.onfi.version) {