From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbcDAQlS (ORCPT ); Fri, 1 Apr 2016 12:41:18 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:59164 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbcDAQlQ (ORCPT ); Fri, 1 Apr 2016 12:41:16 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Fri, 01 Apr 2016 09:38:04 -0700 From: Stefan Agner To: Boris Brezillon Cc: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Richard Weinberger , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ralf Baechle , linux-mips@linux-mips.org, Nicolas Ferre , Jean-Christophe Plagniol-Villard , Alexandre Belloni , Wenyou Yang , Josh Wu , Ezequiel Garcia , Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Kyungmin Park , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, punnaiah choudary kalluri , Priit Laes , Kamal Dasu , bcm-kernel-feedback-list@broadcom.com, linux-api@vger.kernel.org, Harvey Hunt , Archit Taneja , Han Xu , Huang Shijie Subject: Re: [PATCH v5 45/50] mtd: nand: vf610: switch to mtd_ooblayout_ops In-Reply-To: <1459354505-32551-46-git-send-email-boris.brezillon@free-electrons.com> References: <1459354505-32551-1-git-send-email-boris.brezillon@free-electrons.com> <1459354505-32551-46-git-send-email-boris.brezillon@free-electrons.com> Message-ID: <93c11b0392cdbcd64c3760e8fe7f6549@agner.ch> User-Agent: Roundcube Webmail/1.1.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-03-30 09:15, Boris Brezillon wrote: > Implementing the mtd_ooblayout_ops interface is the new way of exposing > ECC/OOB layout to MTD users. I think I sent this already in the last revision: Tested-by: Stefan Agner Acked-by: Stefan Agner -- Stefan > > Signed-off-by: Boris Brezillon > --- > drivers/mtd/nand/vf610_nfc.c | 34 ++++------------------------------ > 1 file changed, 4 insertions(+), 30 deletions(-) > > diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c > index 293feb1..da34de1 100644 > --- a/drivers/mtd/nand/vf610_nfc.c > +++ b/drivers/mtd/nand/vf610_nfc.c > @@ -175,34 +175,6 @@ static inline struct vf610_nfc *mtd_to_nfc(struct > mtd_info *mtd) > return container_of(mtd_to_nand(mtd), struct vf610_nfc, chip); > } > > -static struct nand_ecclayout vf610_nfc_ecc45 = { > - .eccbytes = 45, > - .eccpos = {19, 20, 21, 22, 23, > - 24, 25, 26, 27, 28, 29, 30, 31, > - 32, 33, 34, 35, 36, 37, 38, 39, > - 40, 41, 42, 43, 44, 45, 46, 47, > - 48, 49, 50, 51, 52, 53, 54, 55, > - 56, 57, 58, 59, 60, 61, 62, 63}, > - .oobfree = { > - {.offset = 2, > - .length = 17} } > -}; > - > -static struct nand_ecclayout vf610_nfc_ecc60 = { > - .eccbytes = 60, > - .eccpos = { 4, 5, 6, 7, 8, 9, 10, 11, > - 12, 13, 14, 15, 16, 17, 18, 19, > - 20, 21, 22, 23, 24, 25, 26, 27, > - 28, 29, 30, 31, 32, 33, 34, 35, > - 36, 37, 38, 39, 40, 41, 42, 43, > - 44, 45, 46, 47, 48, 49, 50, 51, > - 52, 53, 54, 55, 56, 57, 58, 59, > - 60, 61, 62, 63 }, > - .oobfree = { > - {.offset = 2, > - .length = 2} } > -}; > - > static inline u32 vf610_nfc_read(struct vf610_nfc *nfc, uint reg) > { > return readl(nfc->regs + reg); > @@ -781,14 +753,16 @@ static int vf610_nfc_probe(struct platform_device *pdev) > if (mtd->oobsize > 64) > mtd->oobsize = 64; > > + /* > + * mtd->ecclayout is not specified here because we're using the > + * default large page ECC layout defined in NAND core. > + */ > if (chip->ecc.strength == 32) { > nfc->ecc_mode = ECC_60_BYTE; > chip->ecc.bytes = 60; > - chip->ecc.layout = &vf610_nfc_ecc60; > } else if (chip->ecc.strength == 24) { > nfc->ecc_mode = ECC_45_BYTE; > chip->ecc.bytes = 45; > - chip->ecc.layout = &vf610_nfc_ecc45; > } else { > dev_err(nfc->dev, "Unsupported ECC strength\n"); > err = -ENXIO; From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Agner Subject: Re: [PATCH v5 45/50] mtd: nand: vf610: switch to mtd_ooblayout_ops Date: Fri, 01 Apr 2016 09:38:04 -0700 Message-ID: <93c11b0392cdbcd64c3760e8fe7f6549@agner.ch> References: <1459354505-32551-1-git-send-email-boris.brezillon@free-electrons.com> <1459354505-32551-46-git-send-email-boris.brezillon@free-electrons.com> Reply-To: stefan-XLVq0VzYD2Y@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org In-Reply-To: <1459354505-32551-46-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Boris Brezillon Cc: David Woodhouse , Brian Norris , linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Richard Weinberger , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Ralf Baechle , linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org, Nicolas Ferre , Jean-Christophe Plagniol-Villard , Alexandre Belloni , Wenyou Yang , Josh Wu , Ezequiel Garcia , Maxime Ripard , Chen-Yu Tsai , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Kyungmi List-Id: linux-api@vger.kernel.org On 2016-03-30 09:15, Boris Brezillon wrote: > Implementing the mtd_ooblayout_ops interface is the new way of exposing > ECC/OOB layout to MTD users. I think I sent this already in the last revision: Tested-by: Stefan Agner Acked-by: Stefan Agner -- Stefan > > Signed-off-by: Boris Brezillon > --- > drivers/mtd/nand/vf610_nfc.c | 34 ++++------------------------------ > 1 file changed, 4 insertions(+), 30 deletions(-) > > diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c > index 293feb1..da34de1 100644 > --- a/drivers/mtd/nand/vf610_nfc.c > +++ b/drivers/mtd/nand/vf610_nfc.c > @@ -175,34 +175,6 @@ static inline struct vf610_nfc *mtd_to_nfc(struct > mtd_info *mtd) > return container_of(mtd_to_nand(mtd), struct vf610_nfc, chip); > } > > -static struct nand_ecclayout vf610_nfc_ecc45 = { > - .eccbytes = 45, > - .eccpos = {19, 20, 21, 22, 23, > - 24, 25, 26, 27, 28, 29, 30, 31, > - 32, 33, 34, 35, 36, 37, 38, 39, > - 40, 41, 42, 43, 44, 45, 46, 47, > - 48, 49, 50, 51, 52, 53, 54, 55, > - 56, 57, 58, 59, 60, 61, 62, 63}, > - .oobfree = { > - {.offset = 2, > - .length = 17} } > -}; > - > -static struct nand_ecclayout vf610_nfc_ecc60 = { > - .eccbytes = 60, > - .eccpos = { 4, 5, 6, 7, 8, 9, 10, 11, > - 12, 13, 14, 15, 16, 17, 18, 19, > - 20, 21, 22, 23, 24, 25, 26, 27, > - 28, 29, 30, 31, 32, 33, 34, 35, > - 36, 37, 38, 39, 40, 41, 42, 43, > - 44, 45, 46, 47, 48, 49, 50, 51, > - 52, 53, 54, 55, 56, 57, 58, 59, > - 60, 61, 62, 63 }, > - .oobfree = { > - {.offset = 2, > - .length = 2} } > -}; > - > static inline u32 vf610_nfc_read(struct vf610_nfc *nfc, uint reg) > { > return readl(nfc->regs + reg); > @@ -781,14 +753,16 @@ static int vf610_nfc_probe(struct platform_device *pdev) > if (mtd->oobsize > 64) > mtd->oobsize = 64; > > + /* > + * mtd->ecclayout is not specified here because we're using the > + * default large page ECC layout defined in NAND core. > + */ > if (chip->ecc.strength == 32) { > nfc->ecc_mode = ECC_60_BYTE; > chip->ecc.bytes = 60; > - chip->ecc.layout = &vf610_nfc_ecc60; > } else if (chip->ecc.strength == 24) { > nfc->ecc_mode = ECC_45_BYTE; > chip->ecc.bytes = 45; > - chip->ecc.layout = &vf610_nfc_ecc45; > } else { > dev_err(nfc->dev, "Unsupported ECC strength\n"); > err = -ENXIO; From mboxrd@z Thu Jan 1 00:00:00 1970 From: stefan@agner.ch (Stefan Agner) Date: Fri, 01 Apr 2016 09:38:04 -0700 Subject: [PATCH v5 45/50] mtd: nand: vf610: switch to mtd_ooblayout_ops In-Reply-To: <1459354505-32551-46-git-send-email-boris.brezillon@free-electrons.com> References: <1459354505-32551-1-git-send-email-boris.brezillon@free-electrons.com> <1459354505-32551-46-git-send-email-boris.brezillon@free-electrons.com> Message-ID: <93c11b0392cdbcd64c3760e8fe7f6549@agner.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 2016-03-30 09:15, Boris Brezillon wrote: > Implementing the mtd_ooblayout_ops interface is the new way of exposing > ECC/OOB layout to MTD users. I think I sent this already in the last revision: Tested-by: Stefan Agner Acked-by: Stefan Agner -- Stefan > > Signed-off-by: Boris Brezillon > --- > drivers/mtd/nand/vf610_nfc.c | 34 ++++------------------------------ > 1 file changed, 4 insertions(+), 30 deletions(-) > > diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c > index 293feb1..da34de1 100644 > --- a/drivers/mtd/nand/vf610_nfc.c > +++ b/drivers/mtd/nand/vf610_nfc.c > @@ -175,34 +175,6 @@ static inline struct vf610_nfc *mtd_to_nfc(struct > mtd_info *mtd) > return container_of(mtd_to_nand(mtd), struct vf610_nfc, chip); > } > > -static struct nand_ecclayout vf610_nfc_ecc45 = { > - .eccbytes = 45, > - .eccpos = {19, 20, 21, 22, 23, > - 24, 25, 26, 27, 28, 29, 30, 31, > - 32, 33, 34, 35, 36, 37, 38, 39, > - 40, 41, 42, 43, 44, 45, 46, 47, > - 48, 49, 50, 51, 52, 53, 54, 55, > - 56, 57, 58, 59, 60, 61, 62, 63}, > - .oobfree = { > - {.offset = 2, > - .length = 17} } > -}; > - > -static struct nand_ecclayout vf610_nfc_ecc60 = { > - .eccbytes = 60, > - .eccpos = { 4, 5, 6, 7, 8, 9, 10, 11, > - 12, 13, 14, 15, 16, 17, 18, 19, > - 20, 21, 22, 23, 24, 25, 26, 27, > - 28, 29, 30, 31, 32, 33, 34, 35, > - 36, 37, 38, 39, 40, 41, 42, 43, > - 44, 45, 46, 47, 48, 49, 50, 51, > - 52, 53, 54, 55, 56, 57, 58, 59, > - 60, 61, 62, 63 }, > - .oobfree = { > - {.offset = 2, > - .length = 2} } > -}; > - > static inline u32 vf610_nfc_read(struct vf610_nfc *nfc, uint reg) > { > return readl(nfc->regs + reg); > @@ -781,14 +753,16 @@ static int vf610_nfc_probe(struct platform_device *pdev) > if (mtd->oobsize > 64) > mtd->oobsize = 64; > > + /* > + * mtd->ecclayout is not specified here because we're using the > + * default large page ECC layout defined in NAND core. > + */ > if (chip->ecc.strength == 32) { > nfc->ecc_mode = ECC_60_BYTE; > chip->ecc.bytes = 60; > - chip->ecc.layout = &vf610_nfc_ecc60; > } else if (chip->ecc.strength == 24) { > nfc->ecc_mode = ECC_45_BYTE; > chip->ecc.bytes = 45; > - chip->ecc.layout = &vf610_nfc_ecc45; > } else { > dev_err(nfc->dev, "Unsupported ECC strength\n"); > err = -ENXIO;