Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360347
b: refs/heads/master
c: c3e4b99
h: refs/heads/master
i:
  360345: e2f56f2
  360343: 49e4921
v: v3
  • Loading branch information
Philip Avinash authored and Artem Bityutskiy committed Feb 4, 2013
1 parent e4dd30a commit 15602a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8459f21ed48fc366ad49ce9828f6bbb1cfac9a9
refs/heads/master: c3e4b995e47e8f72297779852907f6d3ecd75139
12 changes: 8 additions & 4 deletions trunk/drivers/mtd/nand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@

#define OMAP24XX_DMA_GPMC 4

#define BCH8_MAX_ERROR 8 /* upto 8 bit correctable */
#define BCH4_MAX_ERROR 4 /* upto 4 bit correctable */

/* oob info generated runtime depending on ecc algorithm and layout selected */
static struct nand_ecclayout omap_oobinfo;
/* Define some generic bad / good block scan pattern which are used
Expand Down Expand Up @@ -1041,7 +1044,7 @@ static void omap3_enable_hwecc_bch(struct mtd_info *mtd, int mode)
struct nand_chip *chip = mtd->priv;
u32 val;

nerrors = (info->nand.ecc.bytes == 13) ? 8 : 4;
nerrors = info->nand.ecc.strength;
dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;
nsectors = 1;
/*
Expand Down Expand Up @@ -1218,13 +1221,14 @@ static int omap3_init_bch(struct mtd_info *mtd, int ecc_opt)
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
#ifdef CONFIG_MTD_NAND_OMAP_BCH8
const int hw_errors = 8;
const int hw_errors = BCH8_MAX_ERROR;
#else
const int hw_errors = 4;
const int hw_errors = BCH4_MAX_ERROR;
#endif
info->bch = NULL;

max_errors = (ecc_opt == OMAP_ECC_BCH8_CODE_HW) ? 8 : 4;
max_errors = (ecc_opt == OMAP_ECC_BCH8_CODE_HW) ?
BCH8_MAX_ERROR : BCH4_MAX_ERROR;
if (max_errors != hw_errors) {
pr_err("cannot configure %d-bit BCH ecc, only %d-bit supported",
max_errors, hw_errors);
Expand Down

0 comments on commit 15602a9

Please sign in to comment.