aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-21 15:47:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-21 15:47:05 -0400
commit69b26c7ad00fd5b6129400725e2ffb95134a0e1b (patch)
tree1986375f189313cc5a32560663c635e9110588c9
parentddb0c5a689c857bb13a42d9a3f0a7604497b3a29 (diff)
parentcfe3fdadb16162327773ef01a575a32000b8c7f4 (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: mtd: nand: Fix probe of Samsung NAND chips mtd: nand: Fix regression in BBM detection pxa3xx: fix ns2cycle equation
-rw-r--r--drivers/mtd/nand/nand_base.c11
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c2
2 files changed, 5 insertions, 8 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index a3c7473dd409..d551ddd9537a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2866,6 +2866,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
2866 */ 2866 */
2867 if (id_data[0] == id_data[6] && id_data[1] == id_data[7] && 2867 if (id_data[0] == id_data[6] && id_data[1] == id_data[7] &&
2868 id_data[0] == NAND_MFR_SAMSUNG && 2868 id_data[0] == NAND_MFR_SAMSUNG &&
2869 (chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
2869 id_data[5] != 0x00) { 2870 id_data[5] != 0x00) {
2870 /* Calc pagesize */ 2871 /* Calc pagesize */
2871 mtd->writesize = 2048 << (extid & 0x03); 2872 mtd->writesize = 2048 << (extid & 0x03);
@@ -2934,14 +2935,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
2934 chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 32 - 1; 2935 chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 32 - 1;
2935 2936
2936 /* Set the bad block position */ 2937 /* Set the bad block position */
2937 if (!(busw & NAND_BUSWIDTH_16) && (*maf_id == NAND_MFR_STMICRO || 2938 if (mtd->writesize > 512 || (busw & NAND_BUSWIDTH_16))
2938 (*maf_id == NAND_MFR_SAMSUNG &&
2939 mtd->writesize == 512) ||
2940 *maf_id == NAND_MFR_AMD))
2941 chip->badblockpos = NAND_SMALL_BADBLOCK_POS;
2942 else
2943 chip->badblockpos = NAND_LARGE_BADBLOCK_POS; 2939 chip->badblockpos = NAND_LARGE_BADBLOCK_POS;
2944 2940 else
2941 chip->badblockpos = NAND_SMALL_BADBLOCK_POS;
2945 2942
2946 /* Get chip options, preserve non chip based options */ 2943 /* Get chip options, preserve non chip based options */
2947 chip->options &= ~NAND_CHIPOPTIONS_MSK; 2944 chip->options &= ~NAND_CHIPOPTIONS_MSK;
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index e02fa4f0e3c9..4d89f3780207 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -363,7 +363,7 @@ static struct pxa3xx_nand_flash *builtin_flash_types[] = {
363#define tAR_NDTR1(r) (((r) >> 0) & 0xf) 363#define tAR_NDTR1(r) (((r) >> 0) & 0xf)
364 364
365/* convert nano-seconds to nand flash controller clock cycles */ 365/* convert nano-seconds to nand flash controller clock cycles */
366#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) - 1) 366#define ns2cycle(ns, clk) (int)((ns) * (clk / 1000000) / 1000)
367 367
368/* convert nand flash controller clock cycles to nano-seconds */ 368/* convert nand flash controller clock cycles to nano-seconds */
369#define cycle2ns(c, clk) ((((c) + 1) * 1000000 + clk / 500) / (clk / 1000)) 369#define cycle2ns(c, clk) ((((c) + 1) * 1000000 + clk / 500) / (clk / 1000))