Loading drivers/mtd/nand/nand_base.c +7 −1 Original line number Original line Diff line number Diff line Loading @@ -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) static int nand_check_wp(struct mtd_info *mtd) { { struct nand_chip *chip = mtd->priv; 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 */ /* Check the WP bit */ chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); return (chip->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1; return (chip->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1; Loading Loading @@ -3175,7 +3180,8 @@ int nand_scan_tail(struct mtd_info *mtd) /* Fill in remaining MTD driver data */ /* Fill in remaining MTD driver data */ mtd->type = MTD_NANDFLASH; 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->erase = nand_erase; mtd->point = NULL; mtd->point = NULL; mtd->unpoint = NULL; mtd->unpoint = NULL; Loading include/linux/mtd/nand.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -182,6 +182,12 @@ typedef enum { /* Chip does not allow subpage writes */ /* Chip does not allow subpage writes */ #define NAND_NO_SUBPAGE_WRITE 0x00000200 #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 */ /* Options valid for Samsung large page devices */ #define NAND_SAMSUNG_LP_OPTIONS \ #define NAND_SAMSUNG_LP_OPTIONS \ (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) Loading Loading
drivers/mtd/nand/nand_base.c +7 −1 Original line number Original line Diff line number Diff line Loading @@ -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) static int nand_check_wp(struct mtd_info *mtd) { { struct nand_chip *chip = mtd->priv; 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 */ /* Check the WP bit */ chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); return (chip->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1; return (chip->read_byte(mtd) & NAND_STATUS_WP) ? 0 : 1; Loading Loading @@ -3175,7 +3180,8 @@ int nand_scan_tail(struct mtd_info *mtd) /* Fill in remaining MTD driver data */ /* Fill in remaining MTD driver data */ mtd->type = MTD_NANDFLASH; 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->erase = nand_erase; mtd->point = NULL; mtd->point = NULL; mtd->unpoint = NULL; mtd->unpoint = NULL; Loading
include/linux/mtd/nand.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -182,6 +182,12 @@ typedef enum { /* Chip does not allow subpage writes */ /* Chip does not allow subpage writes */ #define NAND_NO_SUBPAGE_WRITE 0x00000200 #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 */ /* Options valid for Samsung large page devices */ #define NAND_SAMSUNG_LP_OPTIONS \ #define NAND_SAMSUNG_LP_OPTIONS \ (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) Loading