aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-27 14:05:26 -0400
committerThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-29 09:06:49 -0400
commit8be834f76291fdcc0614cb84926c6910b9f2ecbc (patch)
treec982bac1ebe520e7f6c17291887ff8b1c2219180
parent19676ff0a64af9d75d48f17cb67bee8110f6ffbf (diff)
[MTD] NAND Fix platform structure and NDFC driver
The platform structure was lacking an oobinfo field. The NDFC driver had some remains from another tree. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/mtd/nand/ndfc.c6
-rw-r--r--include/linux/mtd/nand.h4
-rw-r--r--include/linux/mtd/ndfc.h3
3 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 4d70dd16cf5d..5790d630faed 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -20,7 +20,6 @@
20#include <linux/mtd/nand_ecc.h> 20#include <linux/mtd/nand_ecc.h>
21#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
22#include <linux/mtd/ndfc.h> 22#include <linux/mtd/ndfc.h>
23#include <linux/mtd/ubi.h>
24#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
25#include <linux/platform_device.h> 24#include <linux/platform_device.h>
26 25
@@ -169,14 +168,13 @@ static void ndfc_chip_init(struct ndfc_nand_mtd *mtd)
169 chip->ecc.mode = NAND_ECC_HW; 168 chip->ecc.mode = NAND_ECC_HW;
170 chip->ecc.size = 256; 169 chip->ecc.size = 256;
171 chip->ecc.bytes = 3; 170 chip->ecc.bytes = 3;
172 chip->autooob = mtd->pl_chip->autooob; 171 chip->autooob = mtd->pl_chip->oobinfo;
173 mtd->mtd.priv = chip; 172 mtd->mtd.priv = chip;
174 mtd->mtd.owner = THIS_MODULE; 173 mtd->mtd.owner = THIS_MODULE;
175} 174}
176 175
177static int ndfc_chip_probe(struct platform_device *pdev) 176static int ndfc_chip_probe(struct platform_device *pdev)
178{ 177{
179 int rc;
180 struct platform_nand_chip *nc = pdev->dev.platform_data; 178 struct platform_nand_chip *nc = pdev->dev.platform_data;
181 struct ndfc_chip_settings *settings = nc->priv; 179 struct ndfc_chip_settings *settings = nc->priv;
182 struct ndfc_controller *ndfc = &ndfc_ctrl; 180 struct ndfc_controller *ndfc = &ndfc_ctrl;
@@ -235,7 +233,7 @@ static int ndfc_nand_probe(struct platform_device *pdev)
235 struct ndfc_controller_settings *settings = nc->priv; 233 struct ndfc_controller_settings *settings = nc->priv;
236 struct resource *res = pdev->resource; 234 struct resource *res = pdev->resource;
237 struct ndfc_controller *ndfc = &ndfc_ctrl; 235 struct ndfc_controller *ndfc = &ndfc_ctrl;
238 unsigned long long phys = NDFC_PHYSADDR_OFFS | res->start; 236 unsigned long long phys = setting->erpn | res->start;
239 237
240 ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1); 238 ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1);
241 if (!ndfc->ndfcbase) { 239 if (!ndfc->ndfcbase) {
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 1a749ba6130f..fd46bcf52281 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -518,10 +518,11 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
518 * 518 *
519 * @nr_chips: max. number of chips to scan for 519 * @nr_chips: max. number of chips to scan for
520 * @chip_offs: chip number offset 520 * @chip_offs: chip number offset
521 * @nr_partitions: number of partitions pointed to be partitoons (or zero) 521 * @nr_partitions: number of partitions pointed to by partitions (or zero)
522 * @partitions: mtd partition list 522 * @partitions: mtd partition list
523 * @chip_delay: R/B delay value in us 523 * @chip_delay: R/B delay value in us
524 * @options: Option flags, e.g. 16bit buswidth 524 * @options: Option flags, e.g. 16bit buswidth
525 * @oobinfo: oob info structure (ecc placement)
525 * @priv: hardware controller specific settings 526 * @priv: hardware controller specific settings
526 */ 527 */
527struct platform_nand_chip { 528struct platform_nand_chip {
@@ -529,6 +530,7 @@ struct platform_nand_chip {
529 int chip_offset; 530 int chip_offset;
530 int nr_partitions; 531 int nr_partitions;
531 struct mtd_partition *partitions; 532 struct mtd_partition *partitions;
533 struct nand_oobinfo *oobinfo;
532 int chip_delay; 534 int chip_delay;
533 unsigned int options; 535 unsigned int options;
534 void *priv; 536 void *priv;
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h
index 31d61f07d768..d0558a982628 100644
--- a/include/linux/mtd/ndfc.h
+++ b/include/linux/mtd/ndfc.h
@@ -56,7 +56,8 @@
56#define NDFC_MAX_BANKS 4 56#define NDFC_MAX_BANKS 4
57 57
58struct ndfc_controller_settings { 58struct ndfc_controller_settings {
59 uint32_t ccr_settings; 59 uint32_t ccr_settings;
60 uint64_t ndfc_erpn;
60}; 61};
61 62
62struct ndfc_chip_settings { 63struct ndfc_chip_settings {