NAND chip selects restricted to 2-5 when using HW 4BIT ECC.
  Using the platform device id to specify this is problematic
  at best and confusing at least.

  Let the platform data specify the actual chip select (2..5)
  This patch does not alter any behaviour if core_chipsel is
  not specified, so existing targets are unaffected.

Signed-off-by: Gary Thomas <[email protected]>
---
 arch/arm/mach-davinci/include/mach/nand.h    |    5 ++++-
 drivers/mtd/nand/davinci_nand.c              |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/include/mach/nand.h 
b/arch/arm/mach-davinci/include/mach/nand.h
index 0251510..2d71548 100644
--- a/arch/arm/mach-davinci/include/mach/nand.h
+++ b/arch/arm/mach-davinci/include/mach/nand.h
@@ -57,7 +57,10 @@ struct davinci_nand_pdata {          /* platform_data */
        uint32_t                mask_cle;
 
        /* for packages using two chipselects */
-       uint32_t                mask_chipsel;
+       uint32_t                mask_chipsel;
+
+       /* Old way using pdev->id is confusing */
+       uint32_t                core_chipsel;
 
        /* board's default static partition info */
        struct mtd_partition    *parts;
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 1f34951..2072da5 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -590,8 +590,10 @@ static int __init nand_davinci_probe(struct 
platform_device *pdev)
        info->ioaddr            = (uint32_t __force) vaddr;
 
        info->current_cs        = info->ioaddr;
-       info->core_chipsel      = pdev->id;
+       if (pdata->core_chipsel)
+               info->core_chipsel      = pdata->core_chipsel-2;
+       else
+               info->core_chipsel      = pdev->id;
        info->mask_chipsel      = pdata->mask_chipsel;
 
        /* use nandboot-capable ALE/CLE masks by default */
-- 
1.7.7.5

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to