Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195899
b: refs/heads/master
c: 93edbad
h: refs/heads/master
i:
  195897: 673d59c
  195895: c50369f
v: v3
  • Loading branch information
Maxim Levitsky authored and David Woodhouse committed Feb 26, 2010
1 parent 6b39a8a commit 5537bb1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 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: 5e81e88a4c140586d9212999cea683bcd66a15c6
refs/heads/master: 93edbad69b0491d794c2ec86bcc65c69eac676e3
8 changes: 7 additions & 1 deletion trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
static int nand_check_wp(struct mtd_info *mtd)
{
struct nand_chip *chip = mtd->priv;

/* broken xD cards report WP despite being writable */
if (chip->options & NAND_BROKEN_XD)
return 0;

/* Check the WP bit */
chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
return (chip->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1;
Expand Down Expand Up @@ -3175,7 +3180,8 @@ int nand_scan_tail(struct mtd_info *mtd)

/* Fill in remaining MTD driver data */
mtd->type = MTD_NANDFLASH;
mtd->flags = MTD_CAP_NANDFLASH;
mtd->flags = (chip->options & NAND_ROM) ? MTD_CAP_ROM :
MTD_CAP_NANDFLASH;
mtd->erase = nand_erase;
mtd->point = NULL;
mtd->unpoint = NULL;
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ typedef enum {
/* Chip does not allow subpage writes */
#define NAND_NO_SUBPAGE_WRITE 0x00000200

/* Device is one of 'new' xD cards that expose fake nand command set */
#define NAND_BROKEN_XD 0x00000400

/* Device behaves just like nand, but is readonly */
#define NAND_ROM 0x00000800

/* Options valid for Samsung large page devices */
#define NAND_SAMSUNG_LP_OPTIONS \
(NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
Expand Down

0 comments on commit 5537bb1

Please sign in to comment.