From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctZLO-0007HZ-7Y for linux-mtd@lists.infradead.org; Thu, 30 Mar 2017 12:38:28 +0000 Received: by mail-wr0-x243.google.com with SMTP id u18so11766370wrc.0 for ; Thu, 30 Mar 2017 05:38:03 -0700 (PDT) Subject: Re: [PATCH v4 4/9] nand: spi: add basic blocks for infrastructure To: Peter Pan , boris.brezillon@free-electrons.com, richard@nod.at, computersforpeace@gmail.com, thomas.petazzoni@free-electrons.com, marex@denx.de, cyrille.pitchen@atmel.com, linux-mtd@lists.infradead.org References: <1490262226-29092-1-git-send-email-peterpandong@micron.com> <1490262226-29092-5-git-send-email-peterpandong@micron.com> Cc: peterpansjtu@gmail.com, linshunquan1@hisilicon.com From: Arnaud Mouiche Message-ID: <30ff4192-26d8-0046-0fa7-ab04d662c52a@gmail.com> Date: Thu, 30 Mar 2017 14:38:00 +0200 MIME-Version: 1.0 In-Reply-To: <1490262226-29092-5-git-send-email-peterpandong@micron.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 23/03/2017 10:43, Peter Pan wrote: > This is the first commit for spi nand framkework. > This commit is to add add basic building blocks > for the SPI NAND infrastructure. > > Signed-off-by: Peter Pan > --- > drivers/mtd/nand/Kconfig | 1 + > drivers/mtd/nand/Makefile | 1 + > drivers/mtd/nand/spi/Kconfig | 5 + > drivers/mtd/nand/spi/Makefile | 2 + > drivers/mtd/nand/spi/core.c | 464 ++++++++++++++++++++++++++++++++++++ > drivers/mtd/nand/spi/manufactures.c | 24 ++ > include/linux/mtd/spinand.h | 270 +++++++++++++++++++++ > 7 files changed, 767 insertions(+) > create mode 100644 drivers/mtd/nand/spi/Kconfig > create mode 100644 drivers/mtd/nand/spi/Makefile > create mode 100644 drivers/mtd/nand/spi/core.c > create mode 100644 drivers/mtd/nand/spi/manufactures.c > create mode 100644 include/linux/mtd/spinand.h [...] > diff --git a/drivers/mtd/nand/spi/manufactures.c b/drivers/mtd/nand/spi/manufactures.c > new file mode 100644 > index 0000000..7e0b42d > --- /dev/null > +++ b/drivers/mtd/nand/spi/manufactures.c > @@ -0,0 +1,24 @@ > +/** > + * > + * Copyright (c) 2009-2017 Micron Technology, Inc. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * as published by the Free Software Foundation; either version 2 > + * of the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > + > +#include > +#include > + > +struct spinand_manufacturer spinand_manufacturer_end = {0x0, "Unknown", NULL}; > + > +struct spinand_manufacturer *spinand_manufacturers[] = { > + &spinand_manufacturer_end, > +}; *const* struct spinand_manufacturer *spinand_manufacturers[] ? > +EXPORT_SYMBOL(spinand_manufacturers); > diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h > new file mode 100644 > index 0000000..44748b4 > --- /dev/null > +++ b/include/linux/mtd/spinand.h > @@ -0,0 +1,270 @@ > +/** > + * > + * Copyright (c) 2009-2017 Micron Technology, Inc. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * as published by the Free Software Foundation; either version 2 > + * of the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > +#ifndef __LINUX_MTD_SPINAND_H > +#define __LINUX_MTD_SPINAND_H > + > +#include > +#include > +#include > + [...] > + > +enum spinand_ecc_mode { > + SPINAND_ECC_ONDIE, > + SPINAND_ECC_HW, > +}; > + > +struct spinand_ecc_engine { > + enum spinand_ecc_mode mode; > + u32 strength; > + u32 steps; > + struct spinand_ecc_engine_ops *ops; const struct spinand_ecc_engine_ops ?