ARM: OMAP2+: nand: Unify initialization functions
authorAfzal Mohammed <afzal@ti.com>
Wed, 29 Feb 2012 12:41:56 +0000 (18:11 +0530)
committerPhilip, Avinash <avinashphilip@ti.com>
Thu, 8 Mar 2012 11:55:43 +0000 (17:25 +0530)
Unify the two existing nand initialization functions

This makes gpmc migration to driver easier

From now on, platforms has to call omap_nand_init
to initialize platform nand structures, it's fields.
They have the liberty of directly updating platform
specific nand data also instead of calling it.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/common-board-devices.c
arch/arm/mach-omap2/common-board-devices.h

index d81ea7fa75ef6f59425d1f44c05af46a6ea339d0..0a00ce6fea2598f3540574917a81321c0beb5e5e 100644 (file)
@@ -59,6 +59,7 @@
 
 #include "mux.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
 #define OMAP_DM9000_GPIO_IRQ   25
@@ -646,8 +647,9 @@ static void __init devkit8000_init(void)
 
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
-                            ARRAY_SIZE(devkit8000_nand_partitions));
+       omap_nand_init(devkit8000_nand_partitions,
+               ARRAY_SIZE(devkit8000_nand_partitions), GPMC_CS_NUM + 1,
+               NAND_BUSWIDTH_16, NULL);
 
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index c34f56588284bfe00deff8c0ca6d19d36245395d..f17ae3ded1fc8ebfad7ae56d7a9f7d5784dc3fa9 100644 (file)
@@ -51,6 +51,7 @@
 #include "mux.h"
 #include "hsmmc.h"
 #include "pm.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
 /*
@@ -538,8 +539,9 @@ static void __init omap3_beagle_init(void)
 
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
-                            ARRAY_SIZE(omap3beagle_nand_partitions));
+       omap_nand_init(omap3beagle_nand_partitions,
+               ARRAY_SIZE(omap3beagle_nand_partitions), GPMC_CS_NUM + 1,
+               NAND_BUSWIDTH_16, NULL);
 
        /* Ensure msecure is mux'd to be able to set the RTC. */
        omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH);
index 18cd340f9b7bfb232937404167ed53993676de89..f55922ec68d6d68f2eaf2518cc137fa6337495e0 100644 (file)
@@ -51,6 +51,7 @@
 
 #include "mux.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
 #include <asm/setup.h>
@@ -366,8 +367,9 @@ static void __init omap3_touchbook_init(void)
        omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
-                            ARRAY_SIZE(omap3touchbook_nand_partitions));
+       omap_nand_init(omap3touchbook_nand_partitions,
+               ARRAY_SIZE(omap3touchbook_nand_partitions), GPMC_CS_NUM + 1,
+               NAND_BUSWIDTH_16, NULL);
 
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index 60a61ea759bf4262b3fd7e529650bf91a0118157..d5619c505af136b00e17132e321388a3afd0eab0 100644 (file)
@@ -57,6 +57,7 @@
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
 #define OVERO_GPIO_BT_XGATE    15
@@ -510,8 +511,8 @@ static void __init overo_init(void)
        omap_serial_init();
        omap_sdrc_init(mt46h32m32lf6_sdrc_params,
                                  mt46h32m32lf6_sdrc_params);
-       omap_nand_flash_init(0, overo_nand_partitions,
-                            ARRAY_SIZE(overo_nand_partitions));
+       omap_nand_init(overo_nand_partitions,
+               ARRAY_SIZE(overo_nand_partitions), GPMC_CS_NUM + 1, 0, NULL);
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
index f23a601af8eb10ff9a27fd63b1728f4437da9373..52931923806d7c1956c112d1283369b439f9809f 100644 (file)
@@ -91,24 +91,3 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 {
 }
 #endif
-
-#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
-static struct omap_nand_platform_data nand_data;
-
-void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
-                                int nr_parts)
-{
-       nand_data.cs = GPMC_CS_NUM + 1;
-       nand_data.parts = parts;
-       nand_data.nr_parts = nr_parts;
-       nand_data.devsize = options;
-
-       if (gpmc_nand_init(&nand_data) < 0)
-               printk(KERN_ERR "Unable to register NAND device\n");
-}
-#else
-void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
-                                int nr_parts)
-{
-}
-#endif
index a0b4a42836ab9f7a29f1757ee410e37a237af00c..72bb41b3fd254382ce23a5759ba607a7f7777f1f 100644 (file)
@@ -10,6 +10,5 @@ struct ads7846_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
                       struct ads7846_platform_data *board_pdata);
-void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */