| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * NAND family Bad Block Management (BBM) header file |
|---|
| 3 | 4 | * - Bad Block Table (BBT) implementation |
|---|
| .. | .. |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * Copyright © 2000-2005 |
|---|
| 9 | 10 | * Thomas Gleixner <tglx@linuxtronix.de> |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 12 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 13 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 14 | | - * (at your option) any later version. |
|---|
| 15 | | - * |
|---|
| 16 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 17 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 19 | | - * GNU General Public License for more details. |
|---|
| 20 | | - * |
|---|
| 21 | | - * You should have received a copy of the GNU General Public License |
|---|
| 22 | | - * along with this program; if not, write to the Free Software |
|---|
| 23 | | - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 24 | | - * |
|---|
| 25 | 11 | */ |
|---|
| 26 | 12 | #ifndef __LINUX_MTD_BBM_H |
|---|
| 27 | 13 | #define __LINUX_MTD_BBM_H |
|---|
| .. | .. |
|---|
| 93 | 79 | #define NAND_BBT_WRITE 0x00002000 |
|---|
| 94 | 80 | /* Read and write back block contents when writing bbt */ |
|---|
| 95 | 81 | #define NAND_BBT_SAVECONTENT 0x00004000 |
|---|
| 96 | | -/* Search good / bad pattern on the first and the second page */ |
|---|
| 97 | | -#define NAND_BBT_SCAN2NDPAGE 0x00008000 |
|---|
| 98 | | -/* Search good / bad pattern on the last page of the eraseblock */ |
|---|
| 99 | | -#define NAND_BBT_SCANLASTPAGE 0x00010000 |
|---|
| 82 | + |
|---|
| 100 | 83 | /* |
|---|
| 101 | 84 | * Use a flash based bad block table. By default, OOB identifier is saved in |
|---|
| 102 | 85 | * OOB area. This option is passed to the default bad block table function. |
|---|
| .. | .. |
|---|
| 115 | 98 | |
|---|
| 116 | 99 | /* |
|---|
| 117 | 100 | * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr |
|---|
| 118 | | - * was allocated dynamicaly and must be freed in nand_release(). Has no meaning |
|---|
| 101 | + * was allocated dynamicaly and must be freed in nand_cleanup(). Has no meaning |
|---|
| 119 | 102 | * in nand_chip.bbt_options. |
|---|
| 120 | 103 | */ |
|---|
| 121 | 104 | #define NAND_BBT_DYNAMICSTRUCT 0x80000000 |
|---|
| 122 | 105 | |
|---|
| 123 | 106 | /* The maximum number of blocks to scan for a bbt */ |
|---|
| 124 | 107 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
|---|
| 125 | | - |
|---|
| 126 | | -/* |
|---|
| 127 | | - * Constants for oob configuration |
|---|
| 128 | | - */ |
|---|
| 129 | | -#define NAND_SMALL_BADBLOCK_POS 5 |
|---|
| 130 | | -#define NAND_LARGE_BADBLOCK_POS 0 |
|---|
| 131 | | -#define ONENAND_BADBLOCK_POS 0 |
|---|
| 132 | 108 | |
|---|
| 133 | 109 | /* |
|---|
| 134 | 110 | * Bad block scanning errors |
|---|
| .. | .. |
|---|
| 140 | 116 | /** |
|---|
| 141 | 117 | * struct bbm_info - [GENERIC] Bad Block Table data structure |
|---|
| 142 | 118 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
|---|
| 143 | | - * @badblockpos: [INTERN] position of the bad block marker in the oob area |
|---|
| 144 | 119 | * @options: options for this descriptor |
|---|
| 145 | 120 | * @bbt: [INTERN] bad block table pointer |
|---|
| 146 | 121 | * @isbad_bbt: function to determine if a block is bad |
|---|
| .. | .. |
|---|
| 150 | 125 | */ |
|---|
| 151 | 126 | struct bbm_info { |
|---|
| 152 | 127 | int bbt_erase_shift; |
|---|
| 153 | | - int badblockpos; |
|---|
| 154 | 128 | int options; |
|---|
| 155 | 129 | |
|---|
| 156 | 130 | uint8_t *bbt; |
|---|