Commit 8be834f7 authored by Thomas Gleixner's avatar Thomas Gleixner

[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: default avatarThomas Gleixner <tglx@linutronix.de>
parent 19676ff0
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/mtd/nand_ecc.h> #include <linux/mtd/nand_ecc.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/ndfc.h> #include <linux/mtd/ndfc.h>
#include <linux/mtd/ubi.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -169,14 +168,13 @@ static void ndfc_chip_init(struct ndfc_nand_mtd *mtd) ...@@ -169,14 +168,13 @@ static void ndfc_chip_init(struct ndfc_nand_mtd *mtd)
chip->ecc.mode = NAND_ECC_HW; chip->ecc.mode = NAND_ECC_HW;
chip->ecc.size = 256; chip->ecc.size = 256;
chip->ecc.bytes = 3; chip->ecc.bytes = 3;
chip->autooob = mtd->pl_chip->autooob; chip->autooob = mtd->pl_chip->oobinfo;
mtd->mtd.priv = chip; mtd->mtd.priv = chip;
mtd->mtd.owner = THIS_MODULE; mtd->mtd.owner = THIS_MODULE;
} }
static int ndfc_chip_probe(struct platform_device *pdev) static int ndfc_chip_probe(struct platform_device *pdev)
{ {
int rc;
struct platform_nand_chip *nc = pdev->dev.platform_data; struct platform_nand_chip *nc = pdev->dev.platform_data;
struct ndfc_chip_settings *settings = nc->priv; struct ndfc_chip_settings *settings = nc->priv;
struct ndfc_controller *ndfc = &ndfc_ctrl; struct ndfc_controller *ndfc = &ndfc_ctrl;
...@@ -235,7 +233,7 @@ static int ndfc_nand_probe(struct platform_device *pdev) ...@@ -235,7 +233,7 @@ static int ndfc_nand_probe(struct platform_device *pdev)
struct ndfc_controller_settings *settings = nc->priv; struct ndfc_controller_settings *settings = nc->priv;
struct resource *res = pdev->resource; struct resource *res = pdev->resource;
struct ndfc_controller *ndfc = &ndfc_ctrl; 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); ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1);
if (!ndfc->ndfcbase) { if (!ndfc->ndfcbase) {
......
...@@ -518,10 +518,11 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, ...@@ -518,10 +518,11 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
* *
* @nr_chips: max. number of chips to scan for * @nr_chips: max. number of chips to scan for
* @chip_offs: chip number offset * @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 * @partitions: mtd partition list
* @chip_delay: R/B delay value in us * @chip_delay: R/B delay value in us
* @options: Option flags, e.g. 16bit buswidth * @options: Option flags, e.g. 16bit buswidth
* @oobinfo: oob info structure (ecc placement)
* @priv: hardware controller specific settings * @priv: hardware controller specific settings
*/ */
struct platform_nand_chip { struct platform_nand_chip {
...@@ -529,6 +530,7 @@ struct platform_nand_chip { ...@@ -529,6 +530,7 @@ struct platform_nand_chip {
int chip_offset; int chip_offset;
int nr_partitions; int nr_partitions;
struct mtd_partition *partitions; struct mtd_partition *partitions;
struct nand_oobinfo *oobinfo;
int chip_delay; int chip_delay;
unsigned int options; unsigned int options;
void *priv; void *priv;
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
struct ndfc_controller_settings { struct ndfc_controller_settings {
uint32_t ccr_settings; uint32_t ccr_settings;
uint64_t ndfc_erpn;
}; };
struct ndfc_chip_settings { struct ndfc_chip_settings {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment