aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/sh_flctl.c
diff options
context:
space:
mode:
authorBastian Hecht <hechtb@googlemail.com>2012-05-14 08:14:42 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-07-06 13:17:03 -0400
commitaa32d1f0601ac2f5f69520175b8d2cea42caa025 (patch)
tree1af0988ca731f7c669d636b37086ea1042553f7e /drivers/mtd/nand/sh_flctl.c
parent3c7ea4eccfd2e209ba666d217a2993b8a084a429 (diff)
mtd: sh_flctl: Use different OOB layout
The flctl hardware has changed and a new OOB layout must be adapted for 2KiB page size NAND chips when using hardware ECC. The related bit fields ECCPOS[0-2] are gone — the bits are marked as reserved now in the datasheet. As there are no official users of the hardware ECC so far, they are completely removed. Signed-off-by: Bastian Hecht <hechtb@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/sh_flctl.c')
-rw-r--r--drivers/mtd/nand/sh_flctl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index c835b136e7cb..b3666be0ccfc 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -44,11 +44,17 @@ static struct nand_ecclayout flctl_4secc_oob_16 = {
44}; 44};
45 45
46static struct nand_ecclayout flctl_4secc_oob_64 = { 46static struct nand_ecclayout flctl_4secc_oob_64 = {
47 .eccbytes = 10, 47 .eccbytes = 4 * 10,
48 .eccpos = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57}, 48 .eccpos = {
49 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
50 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
51 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
52 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 },
49 .oobfree = { 53 .oobfree = {
50 {.offset = 60, 54 {.offset = 2, .length = 4},
51 . length = 4} }, 55 {.offset = 16, .length = 6},
56 {.offset = 32, .length = 6},
57 {.offset = 48, .length = 6} },
52}; 58};
53 59
54static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; 60static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
@@ -62,7 +68,7 @@ static struct nand_bbt_descr flctl_4secc_smallpage = {
62 68
63static struct nand_bbt_descr flctl_4secc_largepage = { 69static struct nand_bbt_descr flctl_4secc_largepage = {
64 .options = NAND_BBT_SCAN2NDPAGE, 70 .options = NAND_BBT_SCAN2NDPAGE,
65 .offs = 58, 71 .offs = 0,
66 .len = 2, 72 .len = 2,
67 .pattern = scan_ff_pattern, 73 .pattern = scan_ff_pattern,
68}; 74};
@@ -832,7 +838,7 @@ static int flctl_chip_init_tail(struct mtd_info *mtd)
832 chip->ecc.mode = NAND_ECC_HW; 838 chip->ecc.mode = NAND_ECC_HW;
833 839
834 /* 4 symbols ECC enabled */ 840 /* 4 symbols ECC enabled */
835 flctl->flcmncr_base |= _4ECCEN | ECCPOS2 | ECCPOS_02; 841 flctl->flcmncr_base |= _4ECCEN;
836 } else { 842 } else {
837 chip->ecc.mode = NAND_ECC_SOFT; 843 chip->ecc.mode = NAND_ECC_SOFT;
838 } 844 }