Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153814
b: refs/heads/master
c: 8c3e843
h: refs/heads/master
v: v3
  • Loading branch information
Andy Green authored and Ben Dooks committed May 30, 2009
1 parent e901233 commit 7cee444
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 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: 3db72151aa4c246f8bdb8b3501972e1f1b32fe0d
refs/heads/master: 8c3e843d56f74889f3ff32202e82e3bc16d0d552
34 changes: 25 additions & 9 deletions trunk/drivers/mtd/nand/s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,21 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,

if (set->disable_ecc)
chip->ecc.mode = NAND_ECC_NONE;

switch (chip->ecc.mode) {
case NAND_ECC_NONE:
dev_info(info->device, "NAND ECC disabled\n");
break;
case NAND_ECC_SOFT:
dev_info(info->device, "NAND soft ECC\n");
break;
case NAND_ECC_HW:
dev_info(info->device, "NAND hardware ECC\n");
break;
default:
dev_info(info->device, "NAND ECC UNKNOWN\n");
break;
}
}

/**
Expand All @@ -840,18 +855,19 @@ static void s3c2410_nand_update_chip(struct s3c2410_nand_info *info,
dev_dbg(info->device, "chip %p => page shift %d\n",
chip, chip->page_shift);

if (hardware_ecc) {
if (chip->ecc.mode != NAND_ECC_HW)
return;

/* change the behaviour depending on wether we are using
* the large or small page nand device */

if (chip->page_shift > 10) {
chip->ecc.size = 256;
chip->ecc.bytes = 3;
} else {
chip->ecc.size = 512;
chip->ecc.bytes = 3;
chip->ecc.layout = &nand_hw_eccoob;
}
if (chip->page_shift > 10) {
chip->ecc.size = 256;
chip->ecc.bytes = 3;
} else {
chip->ecc.size = 512;
chip->ecc.bytes = 3;
chip->ecc.layout = &nand_hw_eccoob;
}
}

Expand Down

0 comments on commit 7cee444

Please sign in to comment.