omap3630: nand: fix device size to work in polled mode
authorSukumar Ghorai <s-ghorai@ti.com>
Fri, 28 Jan 2011 10:12:03 +0000 (15:42 +0530)
committerTony Lindgren <tony@atomide.com>
Thu, 17 Feb 2011 23:32:52 +0000 (15:32 -0800)
zoom3 and 3630-sdp having the x16 nand device.
This patch configure gpmc as x16 and select the currect function in driver
for polled mode (without prefetch enable) transfer.

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-flash.c
arch/arm/mach-omap2/board-flash.h
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-zoom.c
arch/arm/mach-omap2/gpmc-nand.c
drivers/mtd/nand/omap2.c

index 31085883199eb78ea506aa3bb44aa547bb82d0bd..4a37c70e38b096b3dad9b8d4333c0f81057acab1 100644 (file)
@@ -812,7 +812,7 @@ static void __init omap_3430sdp_init(void)
        omap_serial_init();
        usb_musb_init(&musb_board_data);
        board_smc91x_init();
-       board_flash_init(sdp_flash_partitions, chip_sel_3430);
+       board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
        sdp3430_display_init();
        enable_board_wakeup_source();
        usb_ehci_init(&ehci_pdata);
index 16538757291a656ea77f798cbadad652bdecd1e7..8d1c4358ecf9388e71e7b87e5ae01f850e4ff0a6 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/platform_device.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
+#include <linux/mtd/nand.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -208,7 +209,7 @@ static void __init omap_sdp_init(void)
        zoom_peripherals_init();
        zoom_display_init();
        board_smc91x_init();
-       board_flash_init(sdp_flash_partitions, chip_sel_sdp);
+       board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
        enable_board_wakeup_source();
        usb_ehci_init(&ehci_pdata);
 }
index fd38c05bb47fdff9f718b0d960c7c06ec78c3db3..f6b72533c089a12ceae19d6c45cf19156a5ac100 100644 (file)
@@ -139,11 +139,13 @@ static struct omap_nand_platform_data board_nand_data = {
 };
 
 void
-__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
+__init board_nand_init(struct mtd_partition *nand_parts,
+                       u8 nr_parts, u8 cs, int nand_type)
 {
        board_nand_data.cs              = cs;
        board_nand_data.parts           = nand_parts;
-       board_nand_data.nr_parts                = nr_parts;
+       board_nand_data.nr_parts        = nr_parts;
+       board_nand_data.devsize         = nand_type;
 
        gpmc_nand_init(&board_nand_data);
 }
@@ -194,7 +196,7 @@ unmap:
  * @return - void.
  */
 void board_flash_init(struct flash_partitions partition_info[],
-                                       char chip_sel_board[][GPMC_CS_NUM])
+                       char chip_sel_board[][GPMC_CS_NUM], int nand_type)
 {
        u8              cs = 0;
        u8              norcs = GPMC_CS_NUM + 1;
@@ -250,5 +252,5 @@ void board_flash_init(struct flash_partitions partition_info[],
                                "in GPMC\n");
        else
                board_nand_init(partition_info[2].parts,
-                               partition_info[2].nr_parts, nandcs);
+                       partition_info[2].nr_parts, nandcs, nand_type);
 }
index 69befe00dd2fcaeef1b9e5f268e7dcc6a6aaad54..c240a3f8d163b7958f83b721347eb2390db41e3e 100644 (file)
@@ -25,6 +25,6 @@ struct flash_partitions {
 };
 
 extern void board_flash_init(struct flash_partitions [],
-                               char chip_sel[][GPMC_CS_NUM]);
+                               char chip_sel[][GPMC_CS_NUM], int nand_type);
 extern void board_nand_init(struct mtd_partition *nand_parts,
-                                       u8 nr_parts, u8 cs);
+                                       u8 nr_parts, u8 cs, int nand_type);
index d8eb2cb7cbc7d9463502dd6a832ab226ab90aa68..a3fae5697a72b8aba7aed7d85cf60786f952b4c5 100644 (file)
@@ -433,7 +433,7 @@ static void __init omap_ldp_init(void)
        omap_serial_init();
        usb_musb_init(&musb_board_data);
        board_nand_init(ldp_nand_partitions,
-               ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS);
+               ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
 
        omap2_hsmmc_init(mmc);
        /* link regulators to MMC adapters */
index 85d4170f30ab981237d21098cc5d65a3da3d48dd..7e3f1595d77b178bbe1826b6c48eace79e55f0ff 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/input.h>
 #include <linux/gpio.h>
 #include <linux/i2c/twl.h>
+#include <linux/mtd/nand.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -124,8 +125,8 @@ static void __init omap_zoom_init(void)
                usb_ehci_init(&ehci_pdata);
        }
 
-       board_nand_init(zoom_nand_partitions,
-                       ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
+       board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
+                                               ZOOM_NAND_CS, NAND_BUSWIDTH_16);
        zoom_debugboard_init();
        zoom_peripherals_init();
        zoom_display_init();
index 2bb29c1607023f608e1e8e9fd55be811ac3c3efc..c1791d08ae56a5a45847bfd8064213cfe36a6345 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/mtd/nand.h>
 
 #include <asm/mach/flash.h>
 
@@ -69,8 +70,10 @@ static int omap2_nand_gpmc_retime(void)
        t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
 
        /* Configure GPMC */
-       gpmc_cs_configure(gpmc_nand_data->cs,
-                               GPMC_CONFIG_DEV_SIZE, gpmc_nand_data->devsize);
+       if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
+               gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
+       else
+               gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
        gpmc_cs_configure(gpmc_nand_data->cs,
                        GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
        err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
index 15682ec8530ed008f8f3f8ddbd16e577306a6407..7c04cd6fb7aab492b36e36d7cd90a48b9765a22d 100644 (file)
@@ -804,7 +804,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
        info->mtd.name          = dev_name(&pdev->dev);
        info->mtd.owner         = THIS_MODULE;
 
-       info->nand.options      |= pdata->devsize ? NAND_BUSWIDTH_16 : 0;
+       info->nand.options      = pdata->devsize;
        info->nand.options      |= NAND_SKIP_BBTSCAN;
 
        /* NAND write protect off */