Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274751
b: refs/heads/master
c: 5fb1549
h: refs/heads/master
i:
  274749: 2a2fff1
  274747: 4bd90e0
  274743: d90d36d
  274735: cfd4614
  274719: 8d837a7
  274687: aec2d0b
v: v3
  • Loading branch information
Brian Norris authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 4f6c634 commit be1ed37
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0dc552951dcbb2b28a8a2ffb5fa966613e8c025
refs/heads/master: 5fb1549dfc40f3b589dae560ea21535cdc5f64e0
10 changes: 5 additions & 5 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
struct nand_chip *chip = mtd->priv;
u16 bad;

if (chip->options & NAND_BBT_SCANLASTPAGE)
if (chip->bbt_options & NAND_BBT_SCANLASTPAGE)
ofs += mtd->erasesize - mtd->writesize;

page = (int)(ofs >> chip->page_shift) & chip->pagemask;
Expand Down Expand Up @@ -396,7 +396,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
uint8_t buf[2] = { 0, 0 };
int block, ret, i = 0;

if (chip->options & NAND_BBT_SCANLASTPAGE)
if (chip->bbt_options & NAND_BBT_SCANLASTPAGE)
ofs += mtd->erasesize - mtd->writesize;

/* Get block number */
Expand Down Expand Up @@ -426,7 +426,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)

i++;
ofs += mtd->writesize;
} while (!ret && (chip->options & NAND_BBT_SCAN2NDPAGE) &&
} while (!ret && (chip->bbt_options & NAND_BBT_SCAN2NDPAGE) &&
i < 2);

nand_release_device(mtd);
Expand Down Expand Up @@ -3117,15 +3117,15 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
if ((chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
(*maf_id == NAND_MFR_SAMSUNG ||
*maf_id == NAND_MFR_HYNIX))
chip->options |= NAND_BBT_SCANLASTPAGE;
chip->bbt_options |= NAND_BBT_SCANLASTPAGE;
else if ((!(chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
(*maf_id == NAND_MFR_SAMSUNG ||
*maf_id == NAND_MFR_HYNIX ||
*maf_id == NAND_MFR_TOSHIBA ||
*maf_id == NAND_MFR_AMD)) ||
(mtd->writesize == 2048 &&
*maf_id == NAND_MFR_MICRON))
chip->options |= NAND_BBT_SCAN2NDPAGE;
chip->bbt_options |= NAND_BBT_SCAN2NDPAGE;

/* Check for AND chips with 4 page planes */
if (chip->options & NAND_4PAGE_ARRAY)
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
from = (loff_t)startblock << (this->bbt_erase_shift - 1);
}

if (this->options & NAND_BBT_SCANLASTPAGE)
if (this->bbt_options & NAND_BBT_SCANLASTPAGE)
from += mtd->erasesize - (mtd->writesize * len);

for (i = startblock; i < numblocks;) {
Expand Down Expand Up @@ -1301,7 +1301,6 @@ static struct nand_bbt_descr bbt_mirror_no_bbt_descr = {
.pattern = mirror_pattern
};

#define BBT_SCAN_OPTIONS (NAND_BBT_SCANLASTPAGE | NAND_BBT_SCAN2NDPAGE)
/**
* nand_create_default_bbt_descr - [Internal] Creates a BBT descriptor structure
* @this: NAND chip to create descriptor for
Expand All @@ -1324,7 +1323,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this)
printk(KERN_ERR "nand_create_default_bbt_descr: Out of memory\n");
return -ENOMEM;
}
bd->options = this->options & BBT_SCAN_OPTIONS;
bd->options = this->bbt_options;
bd->offs = this->badblockpos;
bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1;
bd->pattern = scan_ff_pattern;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ struct nand_buffers {
* @options: [BOARDSPECIFIC] various chip options. They can partly
* be set to inform nand_scan about special functionality.
* See the defines for further explanation.
* @bbt_options: [INTERN] bad block specific options. All options used
* here must come from bbm.h. By default, these options
* will be copied to the appropriate nand_bbt_descr's.
* @badblockpos: [INTERN] position of the bad block marker in the oob
* area.
* @badblockbits: [INTERN] number of bits to left-shift the bad block
Expand Down Expand Up @@ -509,6 +512,7 @@ struct nand_chip {

int chip_delay;
unsigned int options;
unsigned int bbt_options;

int page_shift;
int phys_erase_shift;
Expand Down

0 comments on commit be1ed37

Please sign in to comment.