Commit 84d656a2836021c3707172707245ba3d87bd54c8
Committed by
Scott Wood
1 parent
5dec286b82
Exists in
v2017.01-smarct4x
and in
34 other branches
mtd: vf610_nfc: use in-band bad block table
Use in-band bad block table (NAND_BBT_NO_OOB) which allows to use the full OOB for hardare ECC purposes. Since there is no ECC correction on the OOB it is also safer to use in-band area to store the bad block table marker. Signed-off-by: Stefan Agner <stefan@agner.ch>
Showing 1 changed file with 2 additions and 27 deletions Side-by-side Diff
drivers/mtd/nand/vf610_nfc.c
... | ... | @@ -155,29 +155,6 @@ |
155 | 155 | #define mtd_to_nfc(_mtd) \ |
156 | 156 | (struct vf610_nfc *)((struct nand_chip *)_mtd->priv)->priv |
157 | 157 | |
158 | -static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; | |
159 | -static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; | |
160 | - | |
161 | -static struct nand_bbt_descr bbt_main_descr = { | |
162 | - .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | | |
163 | - NAND_BBT_2BIT | NAND_BBT_VERSION, | |
164 | - .offs = 11, | |
165 | - .len = 4, | |
166 | - .veroffs = 15, | |
167 | - .maxblocks = 4, | |
168 | - .pattern = bbt_pattern, | |
169 | -}; | |
170 | - | |
171 | -static struct nand_bbt_descr bbt_mirror_descr = { | |
172 | - .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | | |
173 | - NAND_BBT_2BIT | NAND_BBT_VERSION, | |
174 | - .offs = 11, | |
175 | - .len = 4, | |
176 | - .veroffs = 15, | |
177 | - .maxblocks = 4, | |
178 | - .pattern = mirror_pattern, | |
179 | -}; | |
180 | - | |
181 | 158 | static struct nand_ecclayout vf610_nfc_ecc45 = { |
182 | 159 | .eccbytes = 45, |
183 | 160 | .eccpos = {19, 20, 21, 22, 23, |
... | ... | @@ -624,10 +601,8 @@ |
624 | 601 | |
625 | 602 | /* Bad block options. */ |
626 | 603 | if (cfg.flash_bbt) |
627 | - chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_CREATE; | |
628 | - | |
629 | - chip->bbt_td = &bbt_main_descr; | |
630 | - chip->bbt_md = &bbt_mirror_descr; | |
604 | + chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB | | |
605 | + NAND_BBT_CREATE; | |
631 | 606 | |
632 | 607 | /* Set configuration register. */ |
633 | 608 | vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_ADDR_AUTO_INCR_BIT); |