ARM: LPC32XX: NAND related updates
[linux-2.6.34-lpc32xx.git] / arch / arm / mach-lpc32xx / ea3250.c
index e2ffd36..00ecc9c 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/amba/clcd.h>
 #include <linux/amba/pl022.h>
 #include <linux/amba/mmci.h>
+#include <mtd/mtd-abi.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -56,6 +57,7 @@
 #define        LCD_CS_GPIO     LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 4)
 #define        LCD_RS_GPIO     LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 5)
 #define        BKL_POW_GPIO    LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 14)
+#define        SSEL0_GPIO5     LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5)
 
 /*
  * LCD controller functions
@@ -235,6 +237,7 @@ static int __init ea3250_spi_devices_register(void)
 }
 arch_initcall(ea3250_spi_devices_register);
 
+#if defined (CONFIG_FB_ARMCLCD)
 /*
  * LCDC AMBA Driver Board Functions
  */
@@ -253,7 +256,7 @@ static struct clcd_panel conn_lcd_panel = {
                 .right_margin   = 10,
                 .upper_margin   = 2,
                 .lower_margin   = 2,
-                .hsync_len      = 2,
+                .hsync_len      = 3,
                 .vsync_len      = 2,
                 .sync           = 0,
                 .vmode          = FB_VMODE_NONINTERLACED,
@@ -310,6 +313,11 @@ static int lpc32xx_clcd_setup(struct clcd_fb *fb)
         fb->fb.fix.smem_len = PANEL_SIZE;
         fb->panel = &conn_lcd_panel;
 
+       if (gpio_request(SSEL0_GPIO5, "Unused GPIO5 input"))
+               return -EIO;
+       if(gpio_direction_input(SSEL0_GPIO5))
+               return -EIO;
+
         /* Configure LCDC RS GPIO pin */
         if (gpio_request(LCD_RS_GPIO, "LCDC RS"))
                 return -EIO;
@@ -529,6 +537,7 @@ struct amba_device lpc32xx_clcd_device = {
         .dma_mask                       = ~0,
         .irq                            = {IRQ_LPC32XX_LCD, NO_IRQ},
 };
+#endif
 
 /*
  * SPI LCDC Driver Probe function
@@ -575,7 +584,9 @@ void __init ea3250_spi_lcdc_drv_init(void)
 /* AMBA based devices list */
 static struct amba_device *amba_devs[] __initdata = {
        &lpc32xx_ssp0_device,
+#if defined (CONFIG_FB_ARMCLCD)
        &lpc32xx_clcd_device,
+#endif
 };
 
 /*
@@ -592,7 +603,7 @@ static int __init ea3250_amba_devices_register(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-       
+
        return 0;
 }
 device_initcall_sync(ea3250_amba_devices_register);
@@ -610,17 +621,18 @@ static int nandwp_enable(int enable)
 
         return 1;
 }
-#define BLK_SIZE (1024 * 128)
+#define BLK_SIZE (2048 * 64)
 static struct mtd_partition __initdata ea3250_nand_partition[] = {
         {
                 .name   = "ea3250-boot",
                 .offset = 0,
-                .size   = (BLK_SIZE * 7)
+                .size   = (BLK_SIZE * 4),
+               .mask_flags   = MTD_WRITEABLE,
         },
         {
-                .name   = "ea3250-ubt-prms",
+                .name   = "ea3250-uboot",
                 .offset = MTDPART_OFS_APPEND,
-                .size   = (BLK_SIZE * 1)
+                .size   = (BLK_SIZE * 6)
         },
         {
                 .name   = "ea3250-kernel",
@@ -628,11 +640,6 @@ static struct mtd_partition __initdata ea3250_nand_partition[] = {
                 .size   = (BLK_SIZE * 32)
         },
         {
-                .name   = "ea3250-rootfs",
-                .offset = MTDPART_OFS_APPEND,
-                .size   = (BLK_SIZE * 40)
-        },
-        {
                 .name   = "ea3250-jffs2",
                 .offset = MTDPART_OFS_APPEND,
                 .size   = MTDPART_SIZ_FULL
@@ -643,7 +650,7 @@ static struct mtd_partition * __init ea3250_nand_partitions(int size, int *num_p
         *num_partitions = ARRAY_SIZE(ea3250_nand_partition);
         return ea3250_nand_partition;
 }
-struct lpc32XX_nand_cfg lpc32xx_nandcfg =
+struct lpc32XX_nand_cfg __initdata lpc32xx_nandcfg =
 {
         .wdr_clks               = 14,
         .wwidth                 = 260000000,
@@ -675,11 +682,16 @@ static struct resource slc_nand_resources[] = {
         },
 
 };
-static struct platform_device lpc32xx_slc_nand_device = {
+
+static u64 lpc32xx_slc_dma_mask = 0xffffffffUL;
+static struct platform_device __initdata lpc32xx_slc_nand_device = {
         .name           = "lpc32xx-nand",
         .id             = 0,
         .dev            = {
                                 .platform_data  = &lpc32xx_nandcfg,
+                                .dma_mask    = &lpc32xx_slc_dma_mask,
+                                .coherent_dma_mask = ~0UL,
+
         },
         .num_resources  = ARRAY_SIZE(slc_nand_resources),
         .resource       = slc_nand_resources,
@@ -843,7 +855,7 @@ void __init ea3250_board_init(void)
 
        /* Register SPI driver */
        ea3250_spi_lcdc_drv_init();
-       
+
        /* Test clock needed for UDA1380 initial init */
        __raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
                        LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN,