[MTD] NAND Fix platform structure and NDFC driver

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 29 09:59:01 EDT 2006


Commit:     8be834f76291fdcc0614cb84926c6910b9f2ecbc
Parent:     19676ff0a64af9d75d48f17cb67bee8110f6ffbf
Author:     Thomas Gleixner <tglx at cruncher.tec.linutronix.de>
AuthorDate: Sat May 27 20:05:26 2006 +0200
Commit:     Thomas Gleixner <tglx at cruncher.tec.linutronix.de>
CommitDate: Mon May 29 15:06:49 2006 +0200

    [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 at linutronix.de>

 drivers/mtd/nand/ndfc.c  |    6 ++----
 include/linux/mtd/nand.h |    4 +++-
 include/linux/mtd/ndfc.h |    3 ++-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 4d70dd1..5790d63 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -20,7 +20,6 @@ #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/ndfc.h>
-#include <linux/mtd/ubi.h>
 #include <linux/mtd/mtd.h>
 #include <linux/platform_device.h>
 
@@ -169,14 +168,13 @@ static void ndfc_chip_init(struct ndfc_n
 	chip->ecc.mode = NAND_ECC_HW;
 	chip->ecc.size = 256;
 	chip->ecc.bytes = 3;
-	chip->autooob = mtd->pl_chip->autooob;
+	chip->autooob = mtd->pl_chip->oobinfo;
 	mtd->mtd.priv = chip;
 	mtd->mtd.owner = THIS_MODULE;
 }
 
 static int ndfc_chip_probe(struct platform_device *pdev)
 {
-	int rc;
 	struct platform_nand_chip *nc = pdev->dev.platform_data;
 	struct ndfc_chip_settings *settings = nc->priv;
 	struct ndfc_controller *ndfc = &ndfc_ctrl;
@@ -235,7 +233,7 @@ static int ndfc_nand_probe(struct platfo
 	struct ndfc_controller_settings *settings = nc->priv;
 	struct resource *res = pdev->resource;
 	struct ndfc_controller *ndfc = &ndfc_ctrl;
-	unsigned long long phys = NDFC_PHYSADDR_OFFS | res->start;
+	unsigned long long phys = setting->erpn | res->start;
 
 	ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1);
 	if (!ndfc->ndfcbase) {
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 1a749ba..fd46bcf 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -518,10 +518,11 @@ #define NAND_LARGE_BADBLOCK_POS		0
  *
  * @nr_chips:		max. number of chips to scan for
  * @chip_offs:		chip number offset
- * @nr_partitions:	number of partitions pointed to be partitoons (or zero)
+ * @nr_partitions:	number of partitions pointed to by partitions (or zero)
  * @partitions:		mtd partition list
  * @chip_delay:		R/B delay value in us
  * @options:		Option flags, e.g. 16bit buswidth
+ * @oobinfo:		oob info structure (ecc placement)
  * @priv:		hardware controller specific settings
  */
 struct platform_nand_chip {
@@ -529,6 +530,7 @@ struct platform_nand_chip {
 	int			chip_offset;
 	int			nr_partitions;
 	struct mtd_partition	*partitions;
+	struct nand_oobinfo	*oobinfo;
 	int			chip_delay;
 	unsigned int		options;
 	void			*priv;
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h
index 31d61f0..d0558a9 100644
--- a/include/linux/mtd/ndfc.h
+++ b/include/linux/mtd/ndfc.h
@@ -56,7 +56,8 @@ #define NDFC_BxCFG_SZ_16BIT	0x08000000 /
 #define NDFC_MAX_BANKS		4
 
 struct ndfc_controller_settings {
-	uint32_t		ccr_settings;
+	uint32_t	ccr_settings;
+	uint64_t	ndfc_erpn;
 };
 
 struct ndfc_chip_settings {



More information about the linux-mtd-cvs mailing list