Hi Marco, Marco Felsch <m.felsch@xxxxxxxxxxxxxx> wrote on Wed, 14 Aug 2019 10:22:32 +0200: > The MT29F1G01AAADD is a single die, SLC based SPI NAND. It has a > capacity of 1Gb and supports 4-bit ECC. The datasheet can be found [1]. > > Unfortunatly the linked device is marked as EoL, but I will expect that > the MT29F1G01AAADDH4-ITX behaves the same way. > > [1] https://datasheet.octopart.com/ \ > MT29F1G01AAADDH4-IT:D-Micron-datasheet-11572380.pdf > > Cc: Peter Pan <peterpandong@xxxxxxxxxx> > Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx> > --- > drivers/mtd/nand/spi/micron.c | 68 +++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c > index 7d7b1f7fcf71..9d63450afc69 100644 > --- a/drivers/mtd/nand/spi/micron.c > +++ b/drivers/mtd/nand/spi/micron.c > @@ -34,6 +34,18 @@ static SPINAND_OP_VARIANTS(update_cache_variants, > SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), > SPINAND_PROG_LOAD(false, 0, NULL, 0)); > > +static SPINAND_OP_VARIANTS(read_cache_variants_mt29f1g01aaadd, > + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), > + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), > + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), > + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); > + > +static SPINAND_OP_VARIANTS(write_cache_variants_mt29f1g01aaadd, > + SPINAND_PROG_LOAD(true, 0, NULL, 0)); > + > +static SPINAND_OP_VARIANTS(update_cache_variants_mt29f1g01aaadd, > + SPINAND_PROG_LOAD(false, 0, NULL, 0)); > + > static int mt29f2g01abagd_ooblayout_ecc(struct mtd_info *mtd, int section, > struct mtd_oob_region *region) > { > @@ -90,6 +102,52 @@ static int mt29f2g01abagd_ecc_get_status(struct spinand_device *spinand, > return -EINVAL; > } > > +static int mt29f1g01aaadd_ooblayout_ecc(struct mtd_info *mtd, int section, > + struct mtd_oob_region *region) > +{ > + if (section > 3) > + return -ERANGE; > + > + region->offset = (section * 0x10) + 8; Any reason to use hex here? ^ If not I would prefer decimal numbers. Otherwise looks fine. Thanks, Miquèl ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/