diff options
Diffstat (limited to 'drivers/mtd/nand/sharpsl.c')
-rw-r--r-- | drivers/mtd/nand/sharpsl.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 88b5b5b40b43..6def3d33b060 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2004 Richard Purdie | 4 | * Copyright (C) 2004 Richard Purdie |
5 | * | 5 | * |
6 | * $Id: sharpsl.c,v 1.4 2005/01/23 11:09:19 rpurdie Exp $ | 6 | * $Id: sharpsl.c,v 1.6 2005/11/03 11:36:42 rpurdie Exp $ |
7 | * | 7 | * |
8 | * Based on Sharp's NAND driver sharp_sl.c | 8 | * Based on Sharp's NAND driver sharp_sl.c |
9 | * | 9 | * |
@@ -115,6 +115,23 @@ static struct nand_bbt_descr sharpsl_bbt = { | |||
115 | .pattern = scan_ff_pattern | 115 | .pattern = scan_ff_pattern |
116 | }; | 116 | }; |
117 | 117 | ||
118 | static struct nand_bbt_descr sharpsl_akita_bbt = { | ||
119 | .options = 0, | ||
120 | .offs = 4, | ||
121 | .len = 1, | ||
122 | .pattern = scan_ff_pattern | ||
123 | }; | ||
124 | |||
125 | static struct nand_oobinfo akita_oobinfo = { | ||
126 | .useecc = MTD_NANDECC_AUTOPLACE, | ||
127 | .eccbytes = 24, | ||
128 | .eccpos = { | ||
129 | 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, | ||
130 | 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, | ||
131 | 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, | ||
132 | .oobfree = { {0x08, 0x09} } | ||
133 | }; | ||
134 | |||
118 | static int | 135 | static int |
119 | sharpsl_nand_dev_ready(struct mtd_info* mtd) | 136 | sharpsl_nand_dev_ready(struct mtd_info* mtd) |
120 | { | 137 | { |
@@ -194,10 +211,14 @@ sharpsl_nand_init(void) | |||
194 | this->chip_delay = 15; | 211 | this->chip_delay = 15; |
195 | /* set eccmode using hardware ECC */ | 212 | /* set eccmode using hardware ECC */ |
196 | this->eccmode = NAND_ECC_HW3_256; | 213 | this->eccmode = NAND_ECC_HW3_256; |
214 | this->badblock_pattern = &sharpsl_bbt; | ||
215 | if (machine_is_akita() || machine_is_borzoi()) { | ||
216 | this->badblock_pattern = &sharpsl_akita_bbt; | ||
217 | this->autooob = &akita_oobinfo; | ||
218 | } | ||
197 | this->enable_hwecc = sharpsl_nand_enable_hwecc; | 219 | this->enable_hwecc = sharpsl_nand_enable_hwecc; |
198 | this->calculate_ecc = sharpsl_nand_calculate_ecc; | 220 | this->calculate_ecc = sharpsl_nand_calculate_ecc; |
199 | this->correct_data = nand_correct_data; | 221 | this->correct_data = nand_correct_data; |
200 | this->badblock_pattern = &sharpsl_bbt; | ||
201 | 222 | ||
202 | /* Scan to find existence of the device */ | 223 | /* Scan to find existence of the device */ |
203 | err=nand_scan(sharpsl_mtd,1); | 224 | err=nand_scan(sharpsl_mtd,1); |
@@ -230,7 +251,7 @@ sharpsl_nand_init(void) | |||
230 | } | 251 | } |
231 | } | 252 | } |
232 | 253 | ||
233 | if (machine_is_husky() || machine_is_borzoi()) { | 254 | if (machine_is_husky() || machine_is_borzoi() || machine_is_akita()) { |
234 | /* Need to use small eraseblock size for backward compatibility */ | 255 | /* Need to use small eraseblock size for backward compatibility */ |
235 | sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; | 256 | sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; |
236 | } | 257 | } |