[PATCH v2] mtd/nand: Spansion S30MLxxxP support
Artem Bityutskiy
dedekind1 at gmail.com
Mon Aug 30 03:56:24 EDT 2010
Hi,
On Thu, 2010-08-19 at 08:11 -0700, Brian Norris wrote:
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index a3c7473..8bdcf64 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2899,6 +2899,18 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
> mtd->writesize = type->pagesize;
> mtd->oobsize = mtd->writesize / 32;
> busw = type->options & NAND_BUSWIDTH_16;
> +
> + /*
> + * Check for Spansion/AMD ID + repeating 5th, 6th byte since
> + * some Spansion chips have erasesize that conflicts with size
> + * listed in nand_ids table
> + * Data sheet (5 byte ID): Spansion S30ML-P ORNAND (p.39)
> + */
> + if (*maf_id == NAND_MFR_AMD && id_data[4] != 0x00 &&
> + id_data[5] == 0x00 && id_data[6] == 0x00 &&
> + id_data[7] == 0x00 && mtd->writesize == 512)
> + mtd->erasesize = (128 * 1024) << ((id_data[3] & 0x03)
> + << 1);
IMO, it is untidy to move just this little << 1 piece to another line.
I've amended this part and made it look like:
mtd->erasesize = (128 * 1024);
mtd->erasesize <<= ((id_data[3] & 0x03) << 1);
instead, if you do not mind, and pushed to l2-mtd-2.6.git / master,
thanks!
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd
mailing list