From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXoHo-00005w-NN for barebox@lists.infradead.org; Fri, 14 Dec 2018 14:17:57 +0000 From: Sascha Hauer Date: Fri, 14 Dec 2018 15:17:18 +0100 Message-Id: <20181214141730.26181-12-s.hauer@pengutronix.de> In-Reply-To: <20181214141730.26181-1-s.hauer@pengutronix.de> References: <20181214141730.26181-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 11/23] mtd: nand: omap: set eccbytes correctly To: Barebox List The total number of ecc bytes per page must be provided to the nand core. This patch fixes this for bch8_hw and bch8_hw_romcode. Signed-off-by: Sascha Hauer --- drivers/mtd/nand/nand_omap_gpmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index d64ae41e7a..58ba95cb48 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -765,6 +765,7 @@ static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo, omap_oobinfo.oobfree->offset = offset; oinfo->nand.ecc.steps = minfo->writesize / oinfo->nand.ecc.size; oinfo->nand.ecc.total = oinfo->nand.ecc.steps * oinfo->nand.ecc.bytes; + omap_oobinfo.eccbytes = oinfo->nand.ecc.total; omap_oobinfo.oobfree->length = minfo->oobsize - offset - omap_oobinfo.eccbytes; @@ -779,6 +780,9 @@ static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo, oinfo->nand.ecc.strength = BCH8_MAX_ERROR; nand->ecc.read_page = omap_gpmc_read_page_bch_rom_mode; omap_oobinfo.oobfree->length = 0; + oinfo->nand.ecc.steps = minfo->writesize / oinfo->nand.ecc.size; + oinfo->nand.ecc.total = oinfo->nand.ecc.steps * oinfo->nand.ecc.bytes; + omap_oobinfo.eccbytes = oinfo->nand.ecc.total; j = 0; for (i = 2; i < 58; i++) omap_oobinfo.eccpos[j++] = i; -- 2.19.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox