From 1bd3e2a823e196c6f8752be87fa2379c27df2ee1 Mon Sep 17 00:00:00 2001 From: "Wu, Josh" Date: Fri, 23 Aug 2013 15:09:05 +0800 Subject: [PATCH 1/2] mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PMECC use BCH algorithm to correct error. In BCH algorithm, the primitive polynomial value is GF(2^13) for 512-bytes sector size. And it is GF(2^14) for 1024-bytes sector size. This patch will choose correct degree of the remainders (13 or 14) for different sector size. Tested in AT91SAM9X5-EK with MLC nand flash. More detail can be refered to section 5.4.1 of: AT91SAM ARM-based Embedded MPU Application Note Signed-off-by: Josh Wu Signed-off-by: Andreas Bießmann --- drivers/mtd/nand/atmel_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 96aca00ebc..da83f06e47 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -827,7 +827,8 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand, switch (mtd->writesize) { case 2048: case 4096: - host->pmecc_degree = PMECC_GF_DIMENSION_13; + host->pmecc_degree = (sector_size == 512) ? + PMECC_GF_DIMENSION_13 : PMECC_GF_DIMENSION_14; host->pmecc_cw_len = (1 << host->pmecc_degree) - 1; host->pmecc_sector_number = mtd->writesize / sector_size; host->pmecc_bytes_per_sector = pmecc_get_ecc_bytes( From 27871e6b519ccd933bd91c879241995c272fef3b Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Wed, 28 Aug 2013 14:36:56 +0000 Subject: [PATCH 2/2] ARM: atmel: sama5d3: drop unused CONFIG_NET_MULTI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop unused CONFIG_NET_MULTI Signed-off-by: Bo Shen Signed-off-by: Andreas Bießmann --- include/configs/sama5d3xek.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index 409919898e..76fa500edd 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -130,7 +130,6 @@ /* Ethernet Hardware */ #define CONFIG_MACB #define CONFIG_RMII -#define CONFIG_NET_MULTI #define CONFIG_NET_RETRY_COUNT 20 #define CONFIG_MACB_SEARCH_PHY #define CONFIG_RGMII