From 8ca0f654c578252f23e8e45a0c6871a5bd3edea7 Mon Sep 17 00:00:00 2001 From: Raphael Poggi Date: Tue, 15 Jul 2014 11:16:40 +0200 Subject: mtd: atmel_nand: add SOFT_BCH support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To use soft ecc with nand with 8k page, we need the BCH support. This commit adds the possibilty for atmel_nand to enable SOFT_BCH. Signed-off-by: Raphaƫl Poggi Signed-off-by: Sascha Hauer --- drivers/mtd/nand/atmel_nand.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/mtd/nand/atmel_nand.c') diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 2e9f61f119..3161e89f6e 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -1164,6 +1164,11 @@ static int __init atmel_nand_probe(struct device_d *dev) nand_chip->chip_delay = 20; /* 20us command delay time */ + if (IS_ENABLED(CONFIG_NAND_ECC_BCH) && + pdata->ecc_mode == NAND_ECC_SOFT_BCH) { + nand_chip->ecc.mode = NAND_ECC_SOFT_BCH; + } + if (host->board->bus_width_16) { /* 16-bit bus width */ nand_chip->options |= NAND_BUSWIDTH_16; nand_chip->read_buf = atmel_read_buf16; -- cgit v1.2.3