diff options
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/Kconfig | 6 | ||||
-rw-r--r-- | drivers/mtd/nand/at91_nand.c | 5 | ||||
-rw-r--r-- | drivers/mtd/nand/diskonchip.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/edb7312.c | 10 | ||||
-rw-r--r-- | drivers/mtd/nand/excite_nandflash.c | 1 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 14 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_ids.c | 1 | ||||
-rw-r--r-- | drivers/mtd/nand/ndfc.c | 8 |
8 files changed, 30 insertions, 17 deletions
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index f1d60b6f048e..df25cabb0481 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -134,10 +134,10 @@ config MTD_NAND_S3C2410_HWECC | |||
134 | 134 | ||
135 | config MTD_NAND_NDFC | 135 | config MTD_NAND_NDFC |
136 | tristate "NDFC NanD Flash Controller" | 136 | tristate "NDFC NanD Flash Controller" |
137 | depends on 44x | 137 | depends on 4xx |
138 | select MTD_NAND_ECC_SMC | 138 | select MTD_NAND_ECC_SMC |
139 | help | 139 | help |
140 | NDFC Nand Flash Controllers are integrated in EP44x SoCs | 140 | NDFC Nand Flash Controllers are integrated in IBM/AMCC's 4xx SoCs |
141 | 141 | ||
142 | config MTD_NAND_S3C2410_CLKSTOP | 142 | config MTD_NAND_S3C2410_CLKSTOP |
143 | bool "S3C2410 NAND IDLE clock stop" | 143 | bool "S3C2410 NAND IDLE clock stop" |
@@ -237,7 +237,7 @@ config MTD_NAND_CAFE | |||
237 | select REED_SOLOMON | 237 | select REED_SOLOMON |
238 | select REED_SOLOMON_DEC16 | 238 | select REED_SOLOMON_DEC16 |
239 | help | 239 | help |
240 | Use NAND flash attached to the CAFÉ chip designed for the $100 | 240 | Use NAND flash attached to the CAFÉ chip designed for the OLPC |
241 | laptop. | 241 | laptop. |
242 | 242 | ||
243 | config MTD_NAND_CS553X | 243 | config MTD_NAND_CS553X |
diff --git a/drivers/mtd/nand/at91_nand.c b/drivers/mtd/nand/at91_nand.c index 512e999177f7..b2a5672df6e0 100644 --- a/drivers/mtd/nand/at91_nand.c +++ b/drivers/mtd/nand/at91_nand.c | |||
@@ -128,7 +128,10 @@ static int __init at91_nand_probe(struct platform_device *pdev) | |||
128 | nand_chip->IO_ADDR_R = host->io_base; | 128 | nand_chip->IO_ADDR_R = host->io_base; |
129 | nand_chip->IO_ADDR_W = host->io_base; | 129 | nand_chip->IO_ADDR_W = host->io_base; |
130 | nand_chip->cmd_ctrl = at91_nand_cmd_ctrl; | 130 | nand_chip->cmd_ctrl = at91_nand_cmd_ctrl; |
131 | nand_chip->dev_ready = at91_nand_device_ready; | 131 | |
132 | if (host->board->rdy_pin) | ||
133 | nand_chip->dev_ready = at91_nand_device_ready; | ||
134 | |||
132 | nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */ | 135 | nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */ |
133 | nand_chip->chip_delay = 20; /* 20us command delay time */ | 136 | nand_chip->chip_delay = 20; /* 20us command delay time */ |
134 | 137 | ||
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index e96259f22cca..ab9f5c5db38d 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c | |||
@@ -56,8 +56,6 @@ static unsigned long __initdata doc_locations[] = { | |||
56 | #endif /* CONFIG_MTD_DOCPROBE_HIGH */ | 56 | #endif /* CONFIG_MTD_DOCPROBE_HIGH */ |
57 | #elif defined(__PPC__) | 57 | #elif defined(__PPC__) |
58 | 0xe4000000, | 58 | 0xe4000000, |
59 | #elif defined(CONFIG_MOMENCO_OCELOT_G) | ||
60 | 0xff000000, | ||
61 | #else | 59 | #else |
62 | #warning Unknown architecture for DiskOnChip. No default probe locations defined | 60 | #warning Unknown architecture for DiskOnChip. No default probe locations defined |
63 | #endif | 61 | #endif |
diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c index 1daf8231aaef..0146cdc48039 100644 --- a/drivers/mtd/nand/edb7312.c +++ b/drivers/mtd/nand/edb7312.c | |||
@@ -74,7 +74,7 @@ static struct mtd_partition partition_info[] = { | |||
74 | /* | 74 | /* |
75 | * hardware specific access to control-lines | 75 | * hardware specific access to control-lines |
76 | * | 76 | * |
77 | * NAND_NCE: bit 0 -> bit 7 | 77 | * NAND_NCE: bit 0 -> bit 6 (bit 7 = 1) |
78 | * NAND_CLE: bit 1 -> bit 4 | 78 | * NAND_CLE: bit 1 -> bit 4 |
79 | * NAND_ALE: bit 2 -> bit 5 | 79 | * NAND_ALE: bit 2 -> bit 5 |
80 | */ | 80 | */ |
@@ -83,12 +83,12 @@ static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) | |||
83 | struct nand_chip *chip = mtd->priv; | 83 | struct nand_chip *chip = mtd->priv; |
84 | 84 | ||
85 | if (ctrl & NAND_CTRL_CHANGE) { | 85 | if (ctrl & NAND_CTRL_CHANGE) { |
86 | unsigned char bits; | 86 | unsigned char bits = 0x80; |
87 | 87 | ||
88 | bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3; | 88 | bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3; |
89 | bits = (ctrl & NAND_NCE) << 7; | 89 | bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40; |
90 | 90 | ||
91 | clps_writeb((clps_readb(ep7312_pxdr) & 0xB0) | 0x10, | 91 | clps_writeb((clps_readb(ep7312_pxdr) & 0xF0) | bits, |
92 | ep7312_pxdr); | 92 | ep7312_pxdr); |
93 | } | 93 | } |
94 | if (cmd != NAND_CMD_NONE) | 94 | if (cmd != NAND_CMD_NONE) |
diff --git a/drivers/mtd/nand/excite_nandflash.c b/drivers/mtd/nand/excite_nandflash.c index 7e9afc4c7757..bed87290decc 100644 --- a/drivers/mtd/nand/excite_nandflash.c +++ b/drivers/mtd/nand/excite_nandflash.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | #include <linux/err.h> | 29 | #include <linux/err.h> |
30 | #include <linux/kernel.h> | ||
31 | 30 | ||
32 | #include <linux/mtd/mtd.h> | 31 | #include <linux/mtd/mtd.h> |
33 | #include <linux/mtd/nand.h> | 32 | #include <linux/mtd/nand.h> |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 7e68203fe1ba..d5691212058d 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Basic support for AG-AND chips is provided. | 7 | * Basic support for AG-AND chips is provided. |
8 | * | 8 | * |
9 | * Additional technical information is available on | 9 | * Additional technical information is available on |
10 | * http://www.linux-mtd.infradead.org/tech/nand.html | 10 | * http://www.linux-mtd.infradead.org/doc/nand.html |
11 | * | 11 | * |
12 | * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) | 12 | * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) |
13 | * 2002-2006 Thomas Gleixner (tglx@linutronix.de) | 13 | * 2002-2006 Thomas Gleixner (tglx@linutronix.de) |
@@ -24,6 +24,7 @@ | |||
24 | * if we have HW ecc support. | 24 | * if we have HW ecc support. |
25 | * The AG-AND chips have nice features for speed improvement, | 25 | * The AG-AND chips have nice features for speed improvement, |
26 | * which are not supported yet. Read / program 4 pages in one go. | 26 | * which are not supported yet. Read / program 4 pages in one go. |
27 | * BBT table is not serialized, has to be fixed | ||
27 | * | 28 | * |
28 | * This program is free software; you can redistribute it and/or modify | 29 | * This program is free software; you can redistribute it and/or modify |
29 | * it under the terms of the GNU General Public License version 2 as | 30 | * it under the terms of the GNU General Public License version 2 as |
@@ -360,6 +361,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
360 | /* We write two bytes, so we dont have to mess with 16 bit | 361 | /* We write two bytes, so we dont have to mess with 16 bit |
361 | * access | 362 | * access |
362 | */ | 363 | */ |
364 | nand_get_device(chip, mtd, FL_WRITING); | ||
363 | ofs += mtd->oobsize; | 365 | ofs += mtd->oobsize; |
364 | chip->ops.len = chip->ops.ooblen = 2; | 366 | chip->ops.len = chip->ops.ooblen = 2; |
365 | chip->ops.datbuf = NULL; | 367 | chip->ops.datbuf = NULL; |
@@ -367,9 +369,11 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
367 | chip->ops.ooboffs = chip->badblockpos & ~0x01; | 369 | chip->ops.ooboffs = chip->badblockpos & ~0x01; |
368 | 370 | ||
369 | ret = nand_do_write_oob(mtd, ofs, &chip->ops); | 371 | ret = nand_do_write_oob(mtd, ofs, &chip->ops); |
372 | nand_release_device(mtd); | ||
370 | } | 373 | } |
371 | if (!ret) | 374 | if (!ret) |
372 | mtd->ecc_stats.badblocks++; | 375 | mtd->ecc_stats.badblocks++; |
376 | |||
373 | return ret; | 377 | return ret; |
374 | } | 378 | } |
375 | 379 | ||
@@ -768,7 +772,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
768 | uint8_t *p = buf; | 772 | uint8_t *p = buf; |
769 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 773 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
770 | uint8_t *ecc_code = chip->buffers->ecccode; | 774 | uint8_t *ecc_code = chip->buffers->ecccode; |
771 | int *eccpos = chip->ecc.layout->eccpos; | 775 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
772 | 776 | ||
773 | chip->ecc.read_page_raw(mtd, chip, buf); | 777 | chip->ecc.read_page_raw(mtd, chip, buf); |
774 | 778 | ||
@@ -810,7 +814,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
810 | uint8_t *p = buf; | 814 | uint8_t *p = buf; |
811 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 815 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
812 | uint8_t *ecc_code = chip->buffers->ecccode; | 816 | uint8_t *ecc_code = chip->buffers->ecccode; |
813 | int *eccpos = chip->ecc.layout->eccpos; | 817 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
814 | 818 | ||
815 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { | 819 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { |
816 | chip->ecc.hwctl(mtd, NAND_ECC_READ); | 820 | chip->ecc.hwctl(mtd, NAND_ECC_READ); |
@@ -1416,7 +1420,7 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
1416 | int eccsteps = chip->ecc.steps; | 1420 | int eccsteps = chip->ecc.steps; |
1417 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 1421 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
1418 | const uint8_t *p = buf; | 1422 | const uint8_t *p = buf; |
1419 | int *eccpos = chip->ecc.layout->eccpos; | 1423 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
1420 | 1424 | ||
1421 | /* Software ecc calculation */ | 1425 | /* Software ecc calculation */ |
1422 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) | 1426 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) |
@@ -1442,7 +1446,7 @@ static void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
1442 | int eccsteps = chip->ecc.steps; | 1446 | int eccsteps = chip->ecc.steps; |
1443 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 1447 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
1444 | const uint8_t *p = buf; | 1448 | const uint8_t *p = buf; |
1445 | int *eccpos = chip->ecc.layout->eccpos; | 1449 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
1446 | 1450 | ||
1447 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { | 1451 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { |
1448 | chip->ecc.hwctl(mtd, NAND_ECC_WRITE); | 1452 | chip->ecc.hwctl(mtd, NAND_ECC_WRITE); |
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c index 2fc674a190cf..a3e3ab0185d5 100644 --- a/drivers/mtd/nand/nand_ids.c +++ b/drivers/mtd/nand/nand_ids.c | |||
@@ -141,6 +141,7 @@ struct nand_manufacturers nand_manuf_ids[] = { | |||
141 | {NAND_MFR_STMICRO, "ST Micro"}, | 141 | {NAND_MFR_STMICRO, "ST Micro"}, |
142 | {NAND_MFR_HYNIX, "Hynix"}, | 142 | {NAND_MFR_HYNIX, "Hynix"}, |
143 | {NAND_MFR_MICRON, "Micron"}, | 143 | {NAND_MFR_MICRON, "Micron"}, |
144 | {NAND_MFR_AMD, "AMD"}, | ||
144 | {0x0, "Unknown"} | 145 | {0x0, "Unknown"} |
145 | }; | 146 | }; |
146 | 147 | ||
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c index fd7a8d5ba29a..1c0e89f00e8d 100644 --- a/drivers/mtd/nand/ndfc.c +++ b/drivers/mtd/nand/ndfc.c | |||
@@ -24,7 +24,11 @@ | |||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | 25 | ||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #ifdef CONFIG_40x | ||
28 | #include <asm/ibm405.h> | ||
29 | #else | ||
27 | #include <asm/ibm44x.h> | 30 | #include <asm/ibm44x.h> |
31 | #endif | ||
28 | 32 | ||
29 | struct ndfc_nand_mtd { | 33 | struct ndfc_nand_mtd { |
30 | struct mtd_info mtd; | 34 | struct mtd_info mtd; |
@@ -230,7 +234,11 @@ static int ndfc_nand_probe(struct platform_device *pdev) | |||
230 | struct ndfc_controller *ndfc = &ndfc_ctrl; | 234 | struct ndfc_controller *ndfc = &ndfc_ctrl; |
231 | unsigned long long phys = settings->ndfc_erpn | res->start; | 235 | unsigned long long phys = settings->ndfc_erpn | res->start; |
232 | 236 | ||
237 | #ifndef CONFIG_PHYS_64BIT | ||
238 | ndfc->ndfcbase = ioremap((phys_addr_t)phys, res->end - res->start + 1); | ||
239 | #else | ||
233 | ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1); | 240 | ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1); |
241 | #endif | ||
234 | if (!ndfc->ndfcbase) { | 242 | if (!ndfc->ndfcbase) { |
235 | printk(KERN_ERR "NDFC: ioremap failed\n"); | 243 | printk(KERN_ERR "NDFC: ioremap failed\n"); |
236 | return -EIO; | 244 | return -EIO; |