aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-07-21 02:59:16 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-07-21 03:01:16 -0400
commitd0d5864676dbccfb1337864a0ae6ce97e6342678 (patch)
tree7caa674ec05a1797054cd4304f0a047b6dacddd6 /drivers/mtd
parent6534e6809e6c9d48114b537afe03bee3fd33bf01 (diff)
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
Merge tag 'v3.16-rc6' into MTD development branch
Linux 3.16-rc6
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c43
-rw-r--r--drivers/mtd/devices/elm.c2
-rw-r--r--drivers/mtd/nand/nand_base.c6
-rw-r--r--drivers/mtd/ubi/fastmap.c4
4 files changed, 51 insertions, 4 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index e4ec355704a6..a7543ba3e190 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -52,6 +52,11 @@
52/* Atmel chips */ 52/* Atmel chips */
53#define AT49BV640D 0x02de 53#define AT49BV640D 0x02de
54#define AT49BV640DT 0x02db 54#define AT49BV640DT 0x02db
55/* Sharp chips */
56#define LH28F640BFHE_PTTL90 0x00b0
57#define LH28F640BFHE_PBTL90 0x00b1
58#define LH28F640BFHE_PTTL70A 0x00b2
59#define LH28F640BFHE_PBTL70A 0x00b3
55 60
56static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); 61static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
57static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 62static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
@@ -258,6 +263,36 @@ static void fixup_st_m28w320cb(struct mtd_info *mtd)
258 (cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e; 263 (cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e;
259}; 264};
260 265
266static int is_LH28F640BF(struct cfi_private *cfi)
267{
268 /* Sharp LH28F640BF Family */
269 if (cfi->mfr == CFI_MFR_SHARP && (
270 cfi->id == LH28F640BFHE_PTTL90 || cfi->id == LH28F640BFHE_PBTL90 ||
271 cfi->id == LH28F640BFHE_PTTL70A || cfi->id == LH28F640BFHE_PBTL70A))
272 return 1;
273 return 0;
274}
275
276static void fixup_LH28F640BF(struct mtd_info *mtd)
277{
278 struct map_info *map = mtd->priv;
279 struct cfi_private *cfi = map->fldrv_priv;
280 struct cfi_pri_intelext *extp = cfi->cmdset_priv;
281
282 /* Reset the Partition Configuration Register on LH28F640BF
283 * to a single partition (PCR = 0x000): PCR is embedded into A0-A15. */
284 if (is_LH28F640BF(cfi)) {
285 printk(KERN_INFO "Reset Partition Config. Register: 1 Partition of 4 planes\n");
286 map_write(map, CMD(0x60), 0);
287 map_write(map, CMD(0x04), 0);
288
289 /* We have set one single partition thus
290 * Simultaneous Operations are not allowed */
291 printk(KERN_INFO "cfi_cmdset_0001: Simultaneous Operations disabled\n");
292 extp->FeatureSupport &= ~512;
293 }
294}
295
261static void fixup_use_point(struct mtd_info *mtd) 296static void fixup_use_point(struct mtd_info *mtd)
262{ 297{
263 struct map_info *map = mtd->priv; 298 struct map_info *map = mtd->priv;
@@ -309,6 +344,8 @@ static struct cfi_fixup cfi_fixup_table[] = {
309 { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct }, 344 { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct },
310 { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb }, 345 { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb },
311 { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock }, 346 { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock },
347 { CFI_MFR_SHARP, CFI_ID_ANY, fixup_unlock_powerup_lock },
348 { CFI_MFR_SHARP, CFI_ID_ANY, fixup_LH28F640BF },
312 { 0, 0, NULL } 349 { 0, 0, NULL }
313}; 350};
314 351
@@ -1649,6 +1686,12 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
1649 initial_adr = adr; 1686 initial_adr = adr;
1650 cmd_adr = adr & ~(wbufsize-1); 1687 cmd_adr = adr & ~(wbufsize-1);
1651 1688
1689 /* Sharp LH28F640BF chips need the first address for the
1690 * Page Buffer Program command. See Table 5 of
1691 * LH28F320BF, LH28F640BF, LH28F128BF Series (Appendix FUM00701) */
1692 if (is_LH28F640BF(cfi))
1693 cmd_adr = adr;
1694
1652 /* Let's determine this according to the interleave only once */ 1695 /* Let's determine this according to the interleave only once */
1653 write_cmd = (cfi->cfiq->P_ID != P_ID_INTEL_PERFORMANCE) ? CMD(0xe8) : CMD(0xe9); 1696 write_cmd = (cfi->cfiq->P_ID != P_ID_INTEL_PERFORMANCE) ? CMD(0xe8) : CMD(0xe9);
1654 1697
diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index 7df86948e6d4..b4f61c7fc161 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info)
475 ELM_SYNDROME_FRAGMENT_1 + offset); 475 ELM_SYNDROME_FRAGMENT_1 + offset);
476 regs->elm_syndrome_fragment_0[i] = elm_read_reg(info, 476 regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,
477 ELM_SYNDROME_FRAGMENT_0 + offset); 477 ELM_SYNDROME_FRAGMENT_0 + offset);
478 break;
478 default: 479 default:
479 return -EINVAL; 480 return -EINVAL;
480 } 481 }
@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info)
520 regs->elm_syndrome_fragment_1[i]); 521 regs->elm_syndrome_fragment_1[i]);
521 elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset, 522 elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,
522 regs->elm_syndrome_fragment_0[i]); 523 regs->elm_syndrome_fragment_0[i]);
524 break;
523 default: 525 default:
524 return -EINVAL; 526 return -EINVAL;
525 } 527 }
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 0c505dd1f522..d8cdf06343fb 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -4064,8 +4064,10 @@ int nand_scan_tail(struct mtd_info *mtd)
4064 ecc->layout->oobavail += ecc->layout->oobfree[i].length; 4064 ecc->layout->oobavail += ecc->layout->oobfree[i].length;
4065 mtd->oobavail = ecc->layout->oobavail; 4065 mtd->oobavail = ecc->layout->oobavail;
4066 4066
4067 /* ECC sanity check: warn noisily if it's too weak */ 4067 /* ECC sanity check: warn if it's too weak */
4068 WARN_ON(!nand_ecc_strength_good(mtd)); 4068 if (!nand_ecc_strength_good(mtd))
4069 pr_warn("WARNING: %s: the ECC used on your system is too weak compared to the one required by the NAND chip\n",
4070 mtd->name);
4069 4071
4070 /* 4072 /*
4071 * Set the number of read / write steps for one page depending on ECC 4073 * Set the number of read / write steps for one page depending on ECC
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index b04e7d059888..0431b46d9fd9 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -125,7 +125,7 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
125 parent = *p; 125 parent = *p;
126 av = rb_entry(parent, struct ubi_ainf_volume, rb); 126 av = rb_entry(parent, struct ubi_ainf_volume, rb);
127 127
128 if (vol_id < av->vol_id) 128 if (vol_id > av->vol_id)
129 p = &(*p)->rb_left; 129 p = &(*p)->rb_left;
130 else 130 else
131 p = &(*p)->rb_right; 131 p = &(*p)->rb_right;
@@ -423,7 +423,7 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai,
423 pnum, err); 423 pnum, err);
424 ret = err > 0 ? UBI_BAD_FASTMAP : err; 424 ret = err > 0 ? UBI_BAD_FASTMAP : err;
425 goto out; 425 goto out;
426 } else if (ret == UBI_IO_BITFLIPS) 426 } else if (err == UBI_IO_BITFLIPS)
427 scrub = 1; 427 scrub = 1;
428 428
429 /* 429 /*