mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-18 01:58:56 +00:00
v1.0.3
This commit is contained in:
@@ -65,12 +65,21 @@ static s32 get_good_blocks_for_spl(struct mtd_dev *mtd, u32 *spl_blocks,
|
||||
ulong offset;
|
||||
s32 i, blkidx, ret = 0, cnt = 0;
|
||||
u8 buf[2];
|
||||
struct aic_spinand *flash = (struct aic_spinand *)mtd->priv;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
spl_blocks[i] = SPL_INVALID_BLOCK_IDX;
|
||||
|
||||
for (i = 0; i < SPL_CANDIDATE_BLOCK_NUM; i++) {
|
||||
blkidx = spl_candidate_block_table[i];
|
||||
|
||||
/* For multi-plane device, don't use block 1 & 3, because
|
||||
* boot rom cannot read data from block 1 and 3
|
||||
*/
|
||||
if ((flash->info->planes_per_lun != 1) &&
|
||||
(blkidx == 1 || blkidx == 3))
|
||||
continue;
|
||||
|
||||
offset = mtd->erasesize * blkidx;
|
||||
if (mtd_block_isbad(mtd, offset)) {
|
||||
pr_err("Block %d is bad.\n", blkidx);
|
||||
|
||||
Reference in New Issue
Block a user