[PATCH 1/2]: OMAP: SDP: Introducing 'board-sdp-flash.c' for flash init

2009-12-03 Thread Vimal Singh
>From 13d52884956a26f93826c443e2b8bd78615f74d6 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 26 Nov 2009 16:10:24 +0530
Subject: [PATCH] OMAP: SDP: Introducing 'board-sdp-flash.c' for flash init

This patch adds 'board-sdp-flash.c', which could be utilized
by boards similar to 3430SDP. (For ex: 2430sdp, 36030sdp).

This file does initialization for all three flash devices present
in SDP boards (NOR, NAND, OneNAND), by finding there 'cs' number
dynamically using switch setting information (S8: 1-4).
This also expects partition information from core board files (for
ex: board-3430sdp.c). Which allows to choose different default
partitions for different boards.

A new structure is created for this purpose: 'flash_partitions'
in 'mach/board-sdp.h'. This has two members:
1. struct mtd_partition *parts
2. int nr_parts

A board file is expected to fill this structure and pass it to
'sdp-flsash-init'. Partition information should be passed in
structure array of 'flash_partitions'. Partition information should
be passed in below sequence in array:
NOR
OneNAND
NAND

Signed-off-by: Vimal Singh 
---
 arch/arm/mach-omap2/board-sdp-flash.c|  246 ++
 arch/arm/mach-omap2/include/mach/board-sdp.h |   22 +++
 arch/arm/plat-omap/include/plat/gpmc.h   |2 +
 3 files changed, 270 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/include/mach/board-sdp.h

diff --git a/arch/arm/mach-omap2/board-sdp-flash.c
b/arch/arm/mach-omap2/board-sdp-flash.c
new file mode 100644
index 000..fbbcd0e
--- /dev/null
+++ b/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,246 @@
+/*
+ * board-sdp-flash.c
+ * Modified from mach-omap2/board-3430sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define REG_FPGA_REV   0x10
+#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
+#define MAX_SUPPORTED_GPMC_CONFIG  3
+
+#define DEBUG_BASE 0x0800 /* debug board */
+
+#define PDC_NOR1
+#define PDC_NAND   2
+#define PDC_ONENAND3
+#define DBG_MPDB   4
+
+/* various memory sizes */
+#define FLASH_SIZE_SDPV1   SZ_64M  /* NOR flash (64 Meg aligned) */
+#define FLASH_SIZE_SDPV2   SZ_128M /* NOR flash (256 Meg aligned) */
+
+/*
+ * SDP3430 V2 Board CS organization
+ * Different from SDP3430 V1. Now 4 switches used to specify CS
+ *
+ * See also the Switch S8 settings in the comments.
+ *
+ * REVISIT: Add support for 2430 SDP
+ */
+static const unsigned char chip_sel_sdp[][GPMC_CS_NUM] = {
+   {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8: */
+   {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
+   {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
+};
+
+static struct flash_platform_data sdp_nor_data = {
+   .map_name   = "cfi_probe",
+   .width  = 2,
+};
+
+static struct resource sdp_nor_resource = {
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device sdp_nor_device = {
+   .name   = "omapflash",
+   .id = 0,
+   .dev= {
+   .platform_data = &sdp_nor_data,
+   },
+   .num_resources  = 1,
+   .resource   = &sdp_nor_resource,
+};
+
+static void
+__init board_nor_init(struct flash_partitions sdp_nor_parts, u8 cs)
+{
+   int err;
+
+   sdp_nor_data.parts  = sdp_nor_parts.parts;
+   sdp_nor_data.nr_parts   = sdp_nor_parts.nr_parts;
+
+   /* Configure start address and size of NOR device */
+   if (omap_rev() >= OMAP3430_REV_ES1_0) {
+   err = gpmc_cs_request(cs, FLASH_SIZE_SDPV2 - 1,
+   (unsigned long *)&sdp_nor_resource.start);
+   sdp_nor_resource.end = sdp_nor_resource.start
+   + FLASH_SIZE_SDPV2 - 1;
+   } else {
+   err = gpmc_cs_request(cs, FLASH_SIZE_SDPV1 - 1,
+   (unsigned long *)&sdp_nor_resource.start);
+   sdp_nor_resource.end = sdp_nor_resource.start
+   + FLASH_SIZE_SDPV1 - 1;
+   }
+   if (err < 0) {
+   printk(KERN_ERR "NOR: Can't request GPMC CS\n");
+   return;
+   }
+   if (platform_device_register(&sdp_nor_device) < 0)
+   printk(KERN_ERR "Unable to register NOR device\n");
+}
+
+#if defined(C

[PATCH 0/2]OMAP:SDP: Add flash support for SDP boards

2009-12-03 Thread Vimal Singh
>From f48199dc44e1bf5f56aa981d20f35dc8ce1113bf Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 3 Dec 2009 18:35:37 +0530
Subject: [PATCH] OMAP:SDP: Add flash support for SDP boards

This patch series introduces 'board-sdp-flash.c', for flash devices init on SDP
boards.
'2nd' patch in the series gives an example of using 'gpmc-nand.c' and
'board-sdp-flash.c' by adding flash support to 3430SDP board.

Vimal Singh (2):
  OMAP: SDP: Introducing 'board-sdp-flash.c' for flash init
  OMAP3: Add support for flash on 3430SDP board

 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/board-3430sdp.c  |  111 
 arch/arm/mach-omap2/board-sdp-flash.c|  246 ++
 arch/arm/mach-omap2/include/mach/board-sdp.h |   22 +++
 arch/arm/plat-omap/include/plat/gpmc.h   |2 +
 5 files changed, 382 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/include/mach/board-sdp.h
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2]: Introducing 'gpmc-nand.c' for GPMC specific NAND init

2009-12-03 Thread Vimal Singh
>From fadc45cca4026d26d00a759efdc681303b0d3097 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Wed, 25 Nov 2009 18:23:15 +0530
Subject: [PATCH] Introducing 'gpmc-nand.c' for GPMC specific NAND init

Introducing 'gpmc-nand.c' for GPMC specific NAND init.
For example: GPMC timing parameters and all.
This patch also migrates gpmc related calls from 'nand/omap2.c'
to 'gpmc-nand.c'.

Signed-off-by: Vimal Singh 
---
 arch/arm/mach-omap2/Makefile   |3 +
 arch/arm/mach-omap2/gpmc-nand.c|  141 
 arch/arm/plat-omap/include/plat/nand.h |6 ++
 drivers/mtd/nand/omap2.c   |   26 +-
 4 files changed, 153 insertions(+), 23 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 59b0ccc..0dfe27a 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -103,5 +103,8 @@ obj-y   += usb-ehci.o
 onenand-$(CONFIG_MTD_ONENAND_OMAP2):= gpmc-onenand.o
 obj-y  += $(onenand-m) $(onenand-y)

+nand-$(CONFIG_MTD_NAND_OMAP2)  := gpmc-nand.o
+obj-y  += $(nand-m) $(nand-y)
+
 smc91x-$(CONFIG_SMC91X):= gpmc-smc91x.o
 obj-y  += $(smc91x-m) $(smc91x-y)
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
new file mode 100644
index 000..d92abdf
--- /dev/null
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -0,0 +1,141 @@
+/*
+ * gpmc-nand.c
+ *
+ * Copyright (C) 2009 Texas Instruments
+ * Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#define WR_RD_PIN_MONITORING   0x0060
+
+static struct omap_nand_platform_data *gpmc_nand_data;
+
+static struct resource gpmc_nand_resource = {
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device gpmc_nand_device = {
+   .name   = "omap2-nand",
+   .id = 0,
+   .num_resources  = 1,
+   .resource   = &gpmc_nand_resource,
+};
+
+static int omap2_nand_gpmc_config(int cs, void __iomem *nand_base)
+{
+   struct gpmc_timings t;
+   int err;
+
+   const int cs_rd_off = 36;
+   const int cs_wr_off = 36;
+   const int adv_on = 6;
+   const int adv_rd_off = 24;
+   const int adv_wr_off = 36;
+   const int oe_off = 48;
+   const int we_off = 30;
+   const int rd_cycle = 72;
+   const int wr_cycle = 72;
+   const int access = 54;
+   const int wr_data_mux_bus = 8;
+   const int wr_access = 30;
+
+   memset(&t, 0, sizeof(t));
+   t.sync_clk = 0;
+   t.cs_on = 0;
+   t.adv_on = gpmc_round_ns_to_ticks(adv_on);
+
+   /* Read */
+   t.adv_rd_off = gpmc_round_ns_to_ticks(adv_rd_off);
+   t.oe_on  = t.adv_on;
+   t.access = gpmc_round_ns_to_ticks(access);
+   t.oe_off = gpmc_round_ns_to_ticks(oe_off);
+   t.cs_rd_off = gpmc_round_ns_to_ticks(cs_rd_off);
+   t.rd_cycle  = gpmc_round_ns_to_ticks(rd_cycle);
+
+   /* Write */
+   t.adv_wr_off = gpmc_round_ns_to_ticks(adv_wr_off);
+   t.we_on  = t.oe_on;
+   if (cpu_is_omap34xx()) {
+   t.wr_data_mux_bus = gpmc_round_ns_to_ticks(wr_data_mux_bus);
+   t.wr_access = gpmc_round_ns_to_ticks(wr_access);
+   }
+   t.we_off = gpmc_round_ns_to_ticks(we_off);
+   t.cs_wr_off = gpmc_round_ns_to_ticks(cs_wr_off);
+   t.wr_cycle  = gpmc_round_ns_to_ticks(wr_cycle);
+
+   /* Configure GPMC */
+   gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
+   GPMC_CONFIG1_DEVICESIZE(gpmc_nand_data->devsize) |
+   GPMC_CONFIG1_DEVICETYPE_NAND);
+
+   err = gpmc_cs_set_timings(cs, &t);
+   if (err)
+   return err;
+
+   return 0;
+}
+
+static int gpmc_nand_setup(void __iomem *nand_base)
+{
+   struct device *dev = &gpmc_nand_device.dev;
+
+   /* Set timings in GPMC */
+   if (omap2_nand_gpmc_config(gpmc_nand_data->cs, nand_base) < 0) {
+   dev_err(dev, "Unable to set gpmc timings\n");
+   return -EINVAL;
+   }
+
+   return 0;
+}
+
+int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data)
+{
+   unsigned int val;
+   int err = 0;
+   struct device *dev = &gpmc_nand_device.dev;
+
+   gpmc_nand_data = _nand_data;
+   gpmc_nand_data->nand_setup = gpmc_nand_setup;
+   gpmc_nand_device.dev.platform_data = gpmc_nand_data;
+
+   err = gpmc_nand_setup((void __iomem *)&gpmc_nand_data->start);
+   if (err &l

[PATCH 1/2]: Correcting GPMC_CONFIG1_DEVICETYPE_NAND

2009-12-03 Thread Vimal Singh
>From efeeb1cfc592c827424b4c76b18150e801bdfbab Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Wed, 25 Nov 2009 17:47:46 +0530
Subject: [PATCH] Correcting GPMC_CONFIG1_DEVICETYPE_NAND

For NAND devices '2' should be used with GPMC_CONFIG1_DEVICETYPE
instead of '1'.

Signed-off-by: Vimal Singh 
---
 arch/arm/plat-omap/include/plat/gpmc.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/gpmc.h
b/arch/arm/plat-omap/include/plat/gpmc.h
index 696e0ca..e081338 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -45,7 +45,7 @@
 #define GPMC_CONFIG1_DEVICESIZE_16  GPMC_CONFIG1_DEVICESIZE(1)
 #define GPMC_CONFIG1_DEVICETYPE(val)((val & 3) << 10)
 #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
-#define GPMC_CONFIG1_DEVICETYPE_NANDGPMC_CONFIG1_DEVICETYPE(1)
+#define GPMC_CONFIG1_DEVICETYPE_NANDGPMC_CONFIG1_DEVICETYPE(2)
 #define GPMC_CONFIG1_MUXADDDATA (1 << 9)
 #define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
 #define GPMC_CONFIG1_FCLK_DIV(val)  (val & 3)
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2]OMAP: Introducing gpmc-nand.c

2009-12-03 Thread Vimal Singh
>From fadc45cca4026d26d00a759efdc681303b0d3097 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 3 Dec 2009 18:35:23 +0530
Subject: [PATCH] OMAP: Introducing gpmc-nand.c

This patch series introduces generic gpmc-nand.c for nand device
related gpmc init.

Vimal Singh (2):
  Correcting GPMC_CONFIG1_DEVICETYPE_NAND
  Introducing 'gpmc-nand.c' for GPMC specific NAND init

 arch/arm/mach-omap2/Makefile   |3 +
 arch/arm/mach-omap2/gpmc-nand.c|  141 
 arch/arm/plat-omap/include/plat/gpmc.h |2 +-
 arch/arm/plat-omap/include/plat/nand.h |6 ++
 drivers/mtd/nand/omap2.c   |   26 +-
 5 files changed, 154 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-12-02 Thread Vimal Singh
>> >> From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
>> >> From: Vimal Singh 
>> >> Date: Thu, 19 Nov 2009 19:28:11 +0530
>> >>
>> >> This patch series adds flash support for NAND (in sdp, zoom and ldp),
>> >> OneNAND and NOR (in sdp)
>> >>
>> >> Tested on Zoom2 and 3430SDP
>> >>
>> >> Vimal Singh (4):
>> >> [PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards
>> >> [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards
>> >> [PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
>> >> [PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig
>> >

I am going to re-post this patch series again and this time I have
divided this into 3 (for more convenience in reviewing) . Something
like this:

1st series:
This patch series will introduce generic gpmc-nand.c for nand device
related gpmc init.

2nd series:
This patch series will introduce 'board-sdp-flash.c', for flash
devices init on SDP
boards. And will give an example of using 'gpmc-nand.c' and
'board-sdp-flash.c' by
adding flash support to 3430SDP board.

3rd:
This series introduces 'board-zoom-flash.c' for NAND init in ZOOM boards.
Other patches will add NAND support for ZOOM2, ZOOM3 and LDP.

Tony,
Is it ok with you?

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-11-29 Thread Vimal Singh
On Mon, Nov 23, 2009 at 11:15 PM, Tony Lindgren  wrote:
> * Vimal Singh  [091119 00:52]:
>> On Wed, Nov 18, 2009 at 10:37 PM, Tony Lindgren  wrote:
>> > * Vimal Singh  [091118 06:38]:
>> >> Tony,
>> >>
>> >> On Fri, Nov 13, 2009 at 2:14 AM, Tony Lindgren  wrote:
>> >> > * Vimal Singh  [091110 02:08]:
>> >> >> From 6f535d7128ca392458dd0cb31d138cda84747c06 Mon Sep 17 00:00:00 2001
>> >> >> From: Vimal Singh 
>> >> >> Date: Tue, 10 Nov 2009 11:42:45 +0530
>> >> >> Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards
>> >>
>> >> [...]
>> >>
>> >> >> +static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, 
>> >> >> uint64_t len)
>> >> >> +{
>> >> >> +     int ret = 0;
>> >> >> +     int chipnr;
>> >> >> +     int status;
>> >> >> +     unsigned long page;
>> >> >> +     struct nand_chip *this = mtd->priv;
>> >> >> +     printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
>> >> >> +                     (int)ofs, (int)len);
>> >> >> +
>> >> >> +     /* select the NAND device */
>> >> >> +     chipnr = (int)(ofs >> this->chip_shift);
>> >> >> +     this->select_chip(mtd, chipnr);
>> >> >> +     /* check the WP bit */
>> >> >> +     this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
>> >> >> +     if ((this->read_byte(mtd) & 0x80) == 0) {
>> >> >> +             printk(KERN_ERR "nand_unlock: Device is write 
>> >> >> protected!\n");
>> >> >> +             ret = -EINVAL;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> +     if ((ofs & (mtd->writesize - 1)) != 0) {
>> >> >> +             printk(KERN_ERR "nand_unlock: Start address must be"
>> >> >> +                             "beginning of nand page!\n");
>> >> >> +             ret = -EINVAL;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> +     if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
>> >> >> +             printk(KERN_ERR "nand_unlock: Length must be a multiple 
>> >> >> of "
>> >> >> +                             "nand page size!\n");
>> >> >> +             ret = -EINVAL;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> +     /* submit address of first page to unlock */
>> >> >> +     page = (unsigned long)(ofs >> this->page_shift);
>> >> >> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK1, -1, page & this->pagemask);
>> >> >> +
>> >> >> +     /* submit ADDRESS of LAST page to unlock */
>> >> >> +     page += (unsigned long)((ofs + len) >> this->page_shift) ;
>> >> >> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK2, -1, page & this->pagemask);
>> >> >> +
>> >> >> +     /* call wait ready function */
>> >> >> +     status = this->waitfunc(mtd, this);
>> >> >> +     udelay(1000);
>> >> >> +     /* see if device thinks it succeeded */
>> >> >> +     if (status & 0x01) {
>> >> >> +             /* there was an error */
>> >> >> +             printk(KERN_ERR "nand_unlock: error status =0x%08x ", 
>> >> >> status);
>> >> >> +             ret = -EIO;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> + out:
>> >> >> +     /* de-select the NAND device */
>> >> >> +     this->select_chip(mtd, -1);
>> >> >> +     return ret;
>> >> >> +}
>> >> >
>> >> > Isn't the unlocking generic to the NAND device driver? Or is it somehow 
>> >> > board
>> >> > specific?
>> >>
>> >> Yes, zoom2 boards come up with whole NAND locked, whereas it is not
>> >> case for SDP boards.
>> >
>> > But the procedure sho

Re: [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-11-29 Thread Vimal Singh
On Mon, Nov 23, 2009 at 11:15 PM, Tony Lindgren  wrote:
> * Vimal Singh  [091119 00:52]:
>> On Wed, Nov 18, 2009 at 10:37 PM, Tony Lindgren  wrote:
>> > * Vimal Singh  [091118 06:38]:
>> >> Tony,
>> >>
>> >> On Fri, Nov 13, 2009 at 2:14 AM, Tony Lindgren  wrote:
>> >> > * Vimal Singh  [091110 02:08]:
>> >> >> From 6f535d7128ca392458dd0cb31d138cda84747c06 Mon Sep 17 00:00:00 2001
>> >> >> From: Vimal Singh 
>> >> >> Date: Tue, 10 Nov 2009 11:42:45 +0530
>> >> >> Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards
>> >>
>> >> [...]
>> >>
>> >> >> +static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, 
>> >> >> uint64_t len)
>> >> >> +{
>> >> >> +     int ret = 0;
>> >> >> +     int chipnr;
>> >> >> +     int status;
>> >> >> +     unsigned long page;
>> >> >> +     struct nand_chip *this = mtd->priv;
>> >> >> +     printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
>> >> >> +                     (int)ofs, (int)len);
>> >> >> +
>> >> >> +     /* select the NAND device */
>> >> >> +     chipnr = (int)(ofs >> this->chip_shift);
>> >> >> +     this->select_chip(mtd, chipnr);
>> >> >> +     /* check the WP bit */
>> >> >> +     this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
>> >> >> +     if ((this->read_byte(mtd) & 0x80) == 0) {
>> >> >> +             printk(KERN_ERR "nand_unlock: Device is write 
>> >> >> protected!\n");
>> >> >> +             ret = -EINVAL;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> +     if ((ofs & (mtd->writesize - 1)) != 0) {
>> >> >> +             printk(KERN_ERR "nand_unlock: Start address must be"
>> >> >> +                             "beginning of nand page!\n");
>> >> >> +             ret = -EINVAL;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> +     if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
>> >> >> +             printk(KERN_ERR "nand_unlock: Length must be a multiple 
>> >> >> of "
>> >> >> +                             "nand page size!\n");
>> >> >> +             ret = -EINVAL;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> +     /* submit address of first page to unlock */
>> >> >> +     page = (unsigned long)(ofs >> this->page_shift);
>> >> >> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK1, -1, page & this->pagemask);
>> >> >> +
>> >> >> +     /* submit ADDRESS of LAST page to unlock */
>> >> >> +     page += (unsigned long)((ofs + len) >> this->page_shift) ;
>> >> >> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK2, -1, page & this->pagemask);
>> >> >> +
>> >> >> +     /* call wait ready function */
>> >> >> +     status = this->waitfunc(mtd, this);
>> >> >> +     udelay(1000);
>> >> >> +     /* see if device thinks it succeeded */
>> >> >> +     if (status & 0x01) {
>> >> >> +             /* there was an error */
>> >> >> +             printk(KERN_ERR "nand_unlock: error status =0x%08x ", 
>> >> >> status);
>> >> >> +             ret = -EIO;
>> >> >> +             goto out;
>> >> >> +     }
>> >> >> +
>> >> >> + out:
>> >> >> +     /* de-select the NAND device */
>> >> >> +     this->select_chip(mtd, -1);
>> >> >> +     return ret;
>> >> >> +}
>> >> >
>> >> > Isn't the unlocking generic to the NAND device driver? Or is it somehow 
>> >> > board
>> >> > specific?
>> >>
>> >> Yes, zoom2 boards come up with whole NAND locked, whereas it is not
>> >> case for SDP boards.
>> >
>> > But the procedure sho

Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-24 Thread Vimal Singh
On Tue, Nov 24, 2009 at 8:36 PM, Artem Bityutskiy  wrote:
> On Thu, 2009-11-19 at 19:38 +0530, Vimal Singh wrote:
>> Here is the v6 of this patch series. I am cc'ing mtd list too this time.
>>
>>
>> From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
>> From: Vimal Singh 
>> Date: Thu, 19 Nov 2009 19:28:11 +0530
>>
>> This patch series adds flash support for NAND (in sdp, zoom and ldp),
>> OneNAND and NOR (in sdp)
>>
>> Tested on Zoom2 and 3430SDP
>>
>> Vimal Singh (4):
>> [PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards
>> [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards
>> [PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
>> [PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig
>
> Is it possible to separate the MTD and OMAP parts?

1st patch does migration of gpmc low level calls from omap2.c to gpmc-nand.c.
I am not sure how we can have separate patches for this.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards

2009-11-19 Thread Vimal Singh
On Thu, Nov 19, 2009 at 7:50 PM, Nishanth Menon  wrote:
> Vimal Singh had written, on 11/19/2009 08:16 AM, the following:
>>
>> From 43df1ee9e29d454100e59ee4902db157072b81b6 Mon Sep 17 00:00:00 2001
>> From: Vimal Singh 
>> Date: Thu, 19 Nov 2009 14:37:44 +0530
>> Subject: [PATCH] OMAP3: Add support for NAND on ZOOM/LDP boards
>>
>> Adding NAND support for ZOOM2/3 and LDP board.
>> I have tested it for ZOOM2 boards. Someone can verify it for LDP
>> and ZOOM3 boards, hopefully it should not have any problem.
>>
>> The size of the U-Boot environment partition was increased to 1.25MB.
>>
>> Vikram: Changed ldp name to zoom.
>>      Future boards will be called Zoom2/3/4 etc.
>>      LDP is a Zoom1. Somhow the LDP name got stuck to that.
>>
>> Signed-off-by: Vimal Singh 
>> Cc: Vikram Pandita 
>> Cc: Tony Lindgren 
>> ---
>>  arch/arm/mach-omap2/Makefile                 |    3 +
>>  arch/arm/mach-omap2/board-ldp.c              |    2 +
>>  arch/arm/mach-omap2/board-zoom-flash.c       |   92
>> ++
>>  arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +
>>  arch/arm/plat-omap/include/plat/board-zoom.h |   36 ++
>>  5 files changed, 135 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
>>  create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h
>>
>> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
>> index b0e5b46..c2ca76e 100644
>> --- a/arch/arm/mach-omap2/Makefile
>> +++ b/arch/arm/mach-omap2/Makefile
>> @@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)               +=
>> board-apollon.o
>>  obj-$(CONFIG_MACH_OMAP3_BEAGLE)                += board-omap3beagle.o \
>>                                           mmc-twl4030.o
>>  obj-$(CONFIG_MACH_OMAP_LDP)            += board-ldp.o \
>> +                                          board-zoom-flash.o \
>>                                           mmc-twl4030.o
>>  obj-$(CONFIG_MACH_OVERO)               += board-overo.o \
>>                                           mmc-twl4030.o
>> @@ -78,10 +79,12 @@ obj-$(CONFIG_MACH_NOKIA_RX51)               +=
>> board-rx51.o \
>>                                           board-rx51-peripherals.o \
>>                                           mmc-twl4030.o
>>  obj-$(CONFIG_MACH_OMAP_ZOOM2)          += board-zoom2.o \
>> +                                          board-zoom-flash.o \
>>                                           board-zoom-peripherals.o \
>>                                           mmc-twl4030.o \
>>                                           board-zoom-debugboard.o
>>  obj-$(CONFIG_MACH_OMAP_ZOOM3)          += board-zoom3.o \
>> +                                          board-zoom-flash.o \
>>                                           board-zoom-peripherals.o \
>>                                           mmc-twl4030.o \
>>                                           board-zoom-debugboard.o
>> diff --git a/arch/arm/mach-omap2/board-ldp.c
>> b/arch/arm/mach-omap2/board-ldp.c
>> index c062238..8aebdf9 100644
>> --- a/arch/arm/mach-omap2/board-ldp.c
>> +++ b/arch/arm/mach-omap2/board-ldp.c
>> @@ -42,6 +42,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>
>>  #include "mmc-twl4030.h"
>>
>> @@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
>>        ads7846_dev_init();
>>        omap_serial_init();
>>        usb_musb_init();
>> +       zoom_flash_init();
>>
>>        twl4030_mmc_init(mmc);
>>        /* link regulators to MMC adapters */
>> diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
>> b/arch/arm/mach-omap2/board-zoom-flash.c
>> new file mode 100644
>> index 000..1867d6a
>> --- /dev/null
>> +++ b/arch/arm/mach-omap2/board-zoom-flash.c
>> @@ -0,0 +1,92 @@
>> +/*
>> + * board-zoom-flash.c
>> + *
>> + * Copyright (C) 2008-09 Texas Instruments Inc.
>> + *
>> + * Modified from mach-omap2/board-2430sdp-flash.c
>> + * Author(s): Vimal Singh 
>> + *            Rohit Choraria 
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include 
>

Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Vimal Singh
On Thu, Nov 19, 2009 at 7:52 PM, Nishanth Menon  wrote:
> Vimal Singh had written, on 11/19/2009 08:11 AM, the following:
> [...]
>
>>>
>>> v4-v5:
>>> [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
>>> Implemented Tony's comments.
>>
>>  arch/arm/configs/omap_3430sdp_defconfig      |  140 +++
>>  arch/arm/configs/omap_zoom2_defconfig        |  344
>> +++---
>
> how about zoom3 and sdp3630?

I do not have these boards. Could someone test for these and drop a
patch for same?

>
>>  arch/arm/mach-omap2/Makefile                 |    8 +
>>  arch/arm/mach-omap2/board-2430sdp.c          |    2 +
>>  arch/arm/mach-omap2/board-3430sdp.c          |    2 +
>>  arch/arm/mach-omap2/board-ldp.c              |    2 +
>>  arch/arm/mach-omap2/board-sdp-flash.c        |  315
>> +++
>>  arch/arm/mach-omap2/board-zoom-flash.c       |   92 +++
>>  arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +
>>  arch/arm/mach-omap2/gpmc-nand.c              |  128 ++
>>  arch/arm/plat-omap/include/plat/board-sdp.h  |   15 ++
>>  arch/arm/plat-omap/include/plat/board-zoom.h |   36 +++
>>  arch/arm/plat-omap/include/plat/gpmc.h       |    4 +-
>>  arch/arm/plat-omap/include/plat/nand.h       |    6 +
>>  drivers/mtd/nand/omap2.c                     |   33 +--
>>  15 files changed, 969 insertions(+), 160 deletions(-)
>>  create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
>>  create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
>>  create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
>>  create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
>>  create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
> --
> Regards,
> Nishanth Menon
>



-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-19 Thread Vimal Singh
>From ac109bb5f47577b323673699a94f9b6a4a7e2431 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 19 Nov 2009 19:01:11 +0530
Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards

Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

This patch also implements Tony's comments on:
http://marc.info/?l=linux-omap&m=125787938923028&w=2

This is done by creating 'mach-omap2/gpmc-nand.c' file, to handle
GPMC related setups for the device driver.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.

Signed-off-by: Vimal Singh 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile|5 +
 arch/arm/mach-omap2/board-2430sdp.c |2 +
 arch/arm/mach-omap2/board-3430sdp.c |2 +
 arch/arm/mach-omap2/board-sdp-flash.c   |  315 +++
 arch/arm/mach-omap2/gpmc-nand.c |  128 +++
 arch/arm/plat-omap/include/plat/board-sdp.h |   15 ++
 arch/arm/plat-omap/include/plat/gpmc.h  |4 +-
 arch/arm/plat-omap/include/plat/nand.h  |6 +
 drivers/mtd/nand/omap2.c|   33 +--
 9 files changed, 488 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 59b0ccc..b0e5b46 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -69,6 +70,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-omap3evm.o \
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
@@ -105,3 +107,6 @@ obj-y   += $(onenand-m) 
$(onenand-y)

 smc91x-$(CONFIG_SMC91X):= gpmc-smc91x.o
 obj-y  += $(smc91x-m) $(smc91x-y)
+
+nand-$(CONFIG_MTD_NAND_OMAP2)  := gpmc-nand.o
+obj-y  += $(nand-m) $(nand-y)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c
b/arch/arm/mach-omap2/board-2430sdp.c
index db9374b..5676ab9 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include 
 #include 

+#include 
 #include "mmc-twl4030.h"

 #define SDP2430_CS0_BASE   0x0400
@@ -205,6 +206,7 @@ static void __init omap_2430sdp_init(void)
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
diff --git a/arch/arm/mach-omap2/board-3430sdp.c
b/arch/arm/mach-omap2/board-3430sdp.c
index 491364e..f2ed1ab 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#include 
 #include "sdram-qimonda-hyb18m512160af-6.h"
 #include "mmc-twl4030.h"

@@ -521,6 +522,7 @@ static void __init omap_3430sdp_init(void)
omap_serial_init();
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
 }
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c
b/arch/arm/mach-omap2/board-sdp-flash.c
new file mode 100644
index 000..e5fc309
--- /dev/null
+++ b/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,315 @@
+/*
+ * board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * Modified 

[PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig

2009-11-19 Thread Vimal Singh
>From cff30e52d3702c154310557145090b2375c870c3 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 19 Nov 2009 19:17:38 +0530
Subject: [PATCH] OMAP: 3430SDP: Enable NAND in defconfig

Enable NAND by default in 3430sdp_defconfig file.
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_3430sdp_defconfig |  140 +--
 1 files changed, 96 insertions(+), 44 deletions(-)

diff --git a/arch/arm/configs/omap_3430sdp_defconfig
b/arch/arm/configs/omap_3430sdp_defconfig
index 8482958..f1e79aa 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.31-rc9-omap1
-# Tue Sep 15 16:48:34 2009
+# Linux kernel version: 2.6.32-rc7
+# Thu Nov 19 19:15:31 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -17,6 +16,7 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
@@ -44,11 +44,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -58,8 +59,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-# CONFIG_SYSFS_DEPRECATED=y is not set
-# CONFIG_SYSFS_DEPRECATED_V2=y is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -90,16 +90,14 @@ CONFIG_SHMEM=y
 CONFIG_AIO=y

 #
-# Performance Counters
+# Kernel Performance Events And Counters
 #
 CONFIG_VM_EVENT_COUNTERS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
@@ -143,6 +141,7 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
@@ -157,6 +156,7 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -179,11 +179,13 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
 # CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_BCMRING is not set

 #
 # TI OMAP Implementations
@@ -212,6 +214,7 @@ CONFIG_OMAP_DM_TIMER=y
 CONFIG_OMAP_LL_DEBUG_UART1=y
 # CONFIG_OMAP_LL_DEBUG_UART2 is not set
 # CONFIG_OMAP_LL_DEBUG_UART3 is not set
+# CONFIG_OMAP_LL_DEBUG_NONE is not set
 # CONFIG_OMAP_PM_NONE is not set
 CONFIG_OMAP_PM_NOOP=y
 CONFIG_ARCH_OMAP34XX=y
@@ -224,10 +227,15 @@ CONFIG_ARCH_OMAP3430=y
 # CONFIG_MACH_OMAP_LDP is not set
 # CONFIG_MACH_OVERO is not set
 # CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3517EVM is not set
 # CONFIG_MACH_OMAP3_PANDORA is not set
 CONFIG_MACH_OMAP_3430SDP=y
 # CONFIG_MACH_NOKIA_RX51 is not set
 # CONFIG_MACH_OMAP_ZOOM2 is not set
+# CONFIG_MACH_OMAP_ZOOM3 is not set
+# CONFIG_MACH_CM_T35 is not set
+# CONFIG_MACH_IGEP0020 is not set
+# CONFIG_MACH_OMAP_3630SDP is not set

 #
 # Processor Type
@@ -237,7 +245,7 @@ CONFIG_CPU_32v6K=y
 CONFIG_CPU_V7=y
 CONFIG_CPU_32v7=y
 CONFIG_CPU_ABRT_EV7=y
-CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_CACHE_V7=y
 CONFIG_CPU_CACHE_VIPT=y
 CONFIG_CPU_COPY_V6=y
@@ -255,6 +263,7 @@ CONFIG_ARM_THUMB=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_BPREDICT_DISABLE is not set
 CONFIG_HAS_TLS_REG=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
 # CONFIG_ARM_ERRATA_430973 is not set
 # CONFIG_ARM_ERRATA_458693 is not set
 # CONFIG_ARM_ERRATA_460075 is not set
@@ -278,8 +287,11 @@ CONFIG_VMSPLIT_3G=y
 # CONFIG_VMSPLIT_2G is not set
 # CONFIG_VMSPLIT_1G is not set
 CONFIG_PAGE_OFFSET=0xC000
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
 CONFIG_HZ=128
+# CONFIG_THUMB2_KERNEL is not set
 CONFIG

[PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

2009-11-19 Thread Vimal Singh
>From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 19 Nov 2009 19:23:18 +0530
Subject: [PATCH] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

Enable NAND (and other necessary options too) and JFFS2
options by default in zoom2_defconfig file.
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_zoom2_defconfig |  344 -
 1 files changed, 250 insertions(+), 94 deletions(-)

diff --git a/arch/arm/configs/omap_zoom2_defconfig
b/arch/arm/configs/omap_zoom2_defconfig
index eef9362..8397d9e 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -1,15 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Fri Jun 12 17:25:46 2009
+# Linux kernel version: 2.6.32-rc7
+# Thu Nov 19 19:18:46 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -46,11 +44,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_GROUP_SCHED=y
@@ -59,8 +58,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-# CONFIG_SYSFS_DEPRECATED=y is not set
-# CONFIG_SYSFS_DEPRECATED_V2=y is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -77,7 +75,6 @@ CONFIG_UID16=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
@@ -90,18 +87,25 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
 # CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
@@ -114,7 +118,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-# CONFIG_LBD is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -135,19 +139,22 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,25 +163,27 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARC

[PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards

2009-11-19 Thread Vimal Singh
>From 43df1ee9e29d454100e59ee4902db157072b81b6 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 19 Nov 2009 14:37:44 +0530
Subject: [PATCH] OMAP3: Add support for NAND on ZOOM/LDP boards

Adding NAND support for ZOOM2/3 and LDP board.
I have tested it for ZOOM2 boards. Someone can verify it for LDP
and ZOOM3 boards, hopefully it should not have any problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
  Future boards will be called Zoom2/3/4 etc.
  LDP is a Zoom1. Somhow the LDP name got stuck to that.

Signed-off-by: Vimal Singh 
Cc: Vikram Pandita 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile |3 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-zoom-flash.c   |   92 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 ++
 5 files changed, 135 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b0e5b46..c2ca76e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += 
board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -78,10 +79,12 @@ obj-$(CONFIG_MACH_NOKIA_RX51)   += board-rx51.o 
\
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)  += board-zoom3.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c062238..8aebdf9 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "mmc-twl4030.h"

@@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
b/arch/arm/mach-omap2/board-zoom-flash.c
new file mode 100644
index 000..1867d6a
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,92 @@
+/*
+ * board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Vimal Singh 
+ *Rohit Choraria 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static struct mtd_partition zoom_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = "X-Loader-NAND",
+   .offset = 0,
+   .size   = 4 * (64 * 2048),  /* 512KB, 0x8 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = "U-Boot-NAND",
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 10 * (64 * 2048), /* 1.25MB, 0x14 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = "Boot Env-NAND",
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1c */
+   .size   = 2 * (64 * 2048),  /* 256KB, 0x4 */
+   },
+   {
+   .name   = "Kernel-NAND",

Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Vimal Singh
Sorry, forgot to append diffstat. Listing below this time.

On Thu, Nov 19, 2009 at 7:38 PM, Vimal Singh  wrote:
> Here is the v6 of this patch series. I am cc'ing mtd list too this time.
>
>
> From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
> From: Vimal Singh 
> Date: Thu, 19 Nov 2009 19:28:11 +0530
>
> This patch series adds flash support for NAND (in sdp, zoom and ldp),
> OneNAND and NOR (in sdp)
>
> Tested on Zoom2 and 3430SDP
>
> Vimal Singh (4):
> [PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards
> [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards
> [PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
> [PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig
>
>
> v6 :
> 1. Implemented Tony's comments on below threads:
>
> [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards
> http://marc.info/?l=linux-omap&m=125805845217778&w=2
>
> [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
> http://marc.info/?l=linux-omap&m=125805867318269&w=2
>
> [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module
> http://marc.info/?l=linux-omap&m=125787938923028&w=2
>
> 2. Creating 'mach-omap2/gpmc-nand.c' to handle GPMC related setups for
> the driver.
> 3. Removed all 'gpmc_cs_read_reg' and 'gpmc_cs_write_reg' calls from
> 'nand/omap2.c'
> 4. Corrected macro 'GPMC_CONFIG1_DEVICETYPE_NAND' for NAND
> 5. Removed 'nand unlock' routine in patch 2/4, will take this
> discussion to mtd list.
>
> v4-v5:
> [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
> Implemented Tony's comments.

 arch/arm/configs/omap_3430sdp_defconfig  |  140 +++
 arch/arm/configs/omap_zoom2_defconfig|  344 +++---
 arch/arm/mach-omap2/Makefile |8 +
 arch/arm/mach-omap2/board-2430sdp.c  |2 +
 arch/arm/mach-omap2/board-3430sdp.c  |2 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-sdp-flash.c|  315 +++
 arch/arm/mach-omap2/board-zoom-flash.c   |   92 +++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +
 arch/arm/mach-omap2/gpmc-nand.c  |  128 ++
 arch/arm/plat-omap/include/plat/board-sdp.h  |   15 ++
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 +++
 arch/arm/plat-omap/include/plat/gpmc.h   |4 +-
 arch/arm/plat-omap/include/plat/nand.h   |6 +
 drivers/mtd/nand/omap2.c |   33 +--
 15 files changed, 969 insertions(+), 160 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Vimal Singh
Here is the v6 of this patch series. I am cc'ing mtd list too this time.


>From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 19 Nov 2009 19:28:11 +0530

This patch series adds flash support for NAND (in sdp, zoom and ldp),
OneNAND and NOR (in sdp)

Tested on Zoom2 and 3430SDP

Vimal Singh (4):
[PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards
[PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards
[PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
[PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig


v6 :
1. Implemented Tony's comments on below threads:

[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards
http://marc.info/?l=linux-omap&m=125805845217778&w=2

[PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
http://marc.info/?l=linux-omap&m=125805867318269&w=2

[PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module
http://marc.info/?l=linux-omap&m=125787938923028&w=2

2. Creating 'mach-omap2/gpmc-nand.c' to handle GPMC related setups for
the driver.
3. Removed all 'gpmc_cs_read_reg' and 'gpmc_cs_write_reg' calls from
'nand/omap2.c'
4. Corrected macro 'GPMC_CONFIG1_DEVICETYPE_NAND' for NAND
5. Removed 'nand unlock' routine in patch 2/4, will take this
discussion to mtd list.

v4-v5:
[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
Implemented Tony's comments.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-11-19 Thread Vimal Singh
On Wed, Nov 18, 2009 at 10:37 PM, Tony Lindgren  wrote:
> * Vimal Singh  [091118 06:38]:
>> Tony,
>>
>> On Fri, Nov 13, 2009 at 2:14 AM, Tony Lindgren  wrote:
>> > * Vimal Singh  [091110 02:08]:
>> >> From 6f535d7128ca392458dd0cb31d138cda84747c06 Mon Sep 17 00:00:00 2001
>> >> From: Vimal Singh 
>> >> Date: Tue, 10 Nov 2009 11:42:45 +0530
>> >> Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards
>>
>> [...]
>>
>> >> +static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, 
>> >> uint64_t len)
>> >> +{
>> >> +     int ret = 0;
>> >> +     int chipnr;
>> >> +     int status;
>> >> +     unsigned long page;
>> >> +     struct nand_chip *this = mtd->priv;
>> >> +     printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
>> >> +                     (int)ofs, (int)len);
>> >> +
>> >> +     /* select the NAND device */
>> >> +     chipnr = (int)(ofs >> this->chip_shift);
>> >> +     this->select_chip(mtd, chipnr);
>> >> +     /* check the WP bit */
>> >> +     this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
>> >> +     if ((this->read_byte(mtd) & 0x80) == 0) {
>> >> +             printk(KERN_ERR "nand_unlock: Device is write 
>> >> protected!\n");
>> >> +             ret = -EINVAL;
>> >> +             goto out;
>> >> +     }
>> >> +
>> >> +     if ((ofs & (mtd->writesize - 1)) != 0) {
>> >> +             printk(KERN_ERR "nand_unlock: Start address must be"
>> >> +                             "beginning of nand page!\n");
>> >> +             ret = -EINVAL;
>> >> +             goto out;
>> >> +     }
>> >> +
>> >> +     if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
>> >> +             printk(KERN_ERR "nand_unlock: Length must be a multiple of "
>> >> +                             "nand page size!\n");
>> >> +             ret = -EINVAL;
>> >> +             goto out;
>> >> +     }
>> >> +
>> >> +     /* submit address of first page to unlock */
>> >> +     page = (unsigned long)(ofs >> this->page_shift);
>> >> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK1, -1, page & this->pagemask);
>> >> +
>> >> +     /* submit ADDRESS of LAST page to unlock */
>> >> +     page += (unsigned long)((ofs + len) >> this->page_shift) ;
>> >> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK2, -1, page & this->pagemask);
>> >> +
>> >> +     /* call wait ready function */
>> >> +     status = this->waitfunc(mtd, this);
>> >> +     udelay(1000);
>> >> +     /* see if device thinks it succeeded */
>> >> +     if (status & 0x01) {
>> >> +             /* there was an error */
>> >> +             printk(KERN_ERR "nand_unlock: error status =0x%08x ", 
>> >> status);
>> >> +             ret = -EIO;
>> >> +             goto out;
>> >> +     }
>> >> +
>> >> + out:
>> >> +     /* de-select the NAND device */
>> >> +     this->select_chip(mtd, -1);
>> >> +     return ret;
>> >> +}
>> >
>> > Isn't the unlocking generic to the NAND device driver? Or is it somehow 
>> > board
>> > specific?
>>
>> Yes, zoom2 boards come up with whole NAND locked, whereas it is not
>> case for SDP boards.
>
> But the procedure should be done under drivers/mtd I believe using some
> standard tools.

OK, I'll take this discussion to mtd mailing list. For now I'll remove
this from here.

>
>> >
>> >
>> >> +static struct mtd_partition ldp_nand_partitions[] = {
>> >> +     /* All the partition sizes are listed in terms of NAND block size */
>> >> +     {
>> >> +             .name           = "X-Loader-NAND",
>> >> +             .offset         = 0,
>> >> +             .size           = 4 * (64 * 2048),      /* 512KB, 0x8 */
>> >> +             .mask_flags     = MTD_WRITEABLE,        /* force read-only 
>> >> */
>> >> +     },
>> >> +     {
>> >> +             .name           = "U-Boot-NAND",
>> >> +   

Re: [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-19 Thread Vimal Singh
On Wed, Nov 18, 2009 at 10:33 PM, Tony Lindgren  wrote:
> * Vimal Singh  [091118 07:25]:
>> On Fri, Nov 13, 2009 at 2:10 AM, Tony Lindgren  wrote:
>> > * Vimal Singh  [091110 02:08]:
>> >> From 42f080e0915bbce1509fc8ab3773569fec0a44f1 Mon Sep 17 00:00:00 2001
>> >> From: Vimal Singh 
>> >> Date: Tue, 10 Nov 2009 11:39:39 +0530
>> >> Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards
>> >>
>>
>> [...]
>>
>> >> +     if (!(__raw_readw(fpga_map_addr + REG_FPGA_REV)))
>> >> +             /* we dont have an DEBUG FPGA??? */
>> >> +             /* Depend on #defines!! default to strata boot return param 
>> >> */
>> >> +             return 0x0;
>> >
>> > Should iounmap before returning, or goto unmap.
>>
>> will correct it in next version.
>>
>> >
>> >
>> >> +     /* S8-DIP-OFF = 1, S8-DIP-ON = 0 */
>> >> +     cs = __raw_readw(fpga_map_addr + REG_FPGA_DIP_SWITCH_INPUT2) & 0xf;
>> >> +
>> >> +     /* ES2.0 SDP's onwards 4 dip switches are provided for CS */
>> >> +     if (omap_rev() >= OMAP3430_REV_ES1_0)
>> >> +             /* change (S8-1:4=DS-2:0) to (S8-4:1=DS-2:0) */
>> >> +             cs = ((cs & 8) >> 3) | ((cs & 4) >> 1) |
>> >> +                     ((cs & 2) << 1) | ((cs & 1) << 3);
>> >> +     else
>> >> +             /* change (S8-1:3=DS-2:0) to (S8-3:1=DS-2:0) */
>> >> +             cs = ((cs & 4) >> 2) | (cs & 2) | ((cs & 1) << 2);
>> >> +
>> >> +     iounmap(fpga_map_addr);
>> >> +     return cs;
>> >> +}
>> >> +
>> >> +/**
>> >> + * sdp3430_flash_init - Identify devices connected to GPMC and register.
>> >> + *
>> >> + * @return - void.
>> >> + */
>> >> +void __init sdp_flash_init(void)
>> >> +{
>> >> +     u8              cs = 0;
>> >> +     u8              nandcs = GPMC_CS_NUM + 1;
>> >> +     u8              onenandcs = GPMC_CS_NUM + 1;
>> >> +     u8              idx;
>> >> +     unsigned char   *config_sel = NULL;
>> >> +
>> >> +     /* REVISIT: Is this return correct idx for 2430 SDP?
>> >> +      * for which cs configuration matches for 2430 SDP?
>> >> +      */
>> >> +     idx = get_gpmc0_type();
>> >> +     if (idx >= MAX_SUPPORTED_GPMC_CONFIG) {
>> >> +             printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, 
>> >> cs);
>> >> +             return;
>> >> +     }
>> >> +     config_sel = (unsigned char *)(chip_sel_sdp[idx]);
>> >> +
>> >> +     /* Configure start address and size of NOR device */
>> >> +     if (omap_rev() >= OMAP3430_REV_ES1_0) {
>> >> +             sdp_nor_resource.start  = FLASH_BASE_SDPV2;
>> >> +             sdp_nor_resource.end    = FLASH_BASE_SDPV2
>> >> +                                             + FLASH_SIZE_SDPV2 - 1;
>> >> +     } else {
>> >> +             sdp_nor_resource.start  = FLASH_BASE_SDPV1;
>> >> +             sdp_nor_resource.end    = FLASH_BASE_SDPV1
>> >> +                                             + FLASH_SIZE_SDPV1 - 1;
>> >> +     }
>> >
>> > This should be done with gpmc_cs_request using the chip select and size.
>> > Please see gpmc_smc91x_init() for an example.
>>
>> I do not think this should be done with 'gpmc_cs_request'. NOR flashes
>> have been treated somehow differently.
>
> Can you please specify what the issue using gpmc_cs_request is?
>
> To me it seems that if you're not doing gpmc_cs_request, the gpmc can
> be in uninitialized state. I don't think we want to build our kernel
> assuming some hardcoded GPMC settings from the bootloader.

Sorry I was a bit confused. I will fix this too in my next version.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-18 Thread Vimal Singh
On Fri, Nov 13, 2009 at 2:10 AM, Tony Lindgren  wrote:
> * Vimal Singh  [091110 02:08]:
>> From 42f080e0915bbce1509fc8ab3773569fec0a44f1 Mon Sep 17 00:00:00 2001
>> From: Vimal Singh 
>> Date: Tue, 10 Nov 2009 11:39:39 +0530
>> Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards
>>

[...]

>> +     if (!(__raw_readw(fpga_map_addr + REG_FPGA_REV)))
>> +             /* we dont have an DEBUG FPGA??? */
>> +             /* Depend on #defines!! default to strata boot return param */
>> +             return 0x0;
>
> Should iounmap before returning, or goto unmap.

will correct it in next version.

>
>
>> +     /* S8-DIP-OFF = 1, S8-DIP-ON = 0 */
>> +     cs = __raw_readw(fpga_map_addr + REG_FPGA_DIP_SWITCH_INPUT2) & 0xf;
>> +
>> +     /* ES2.0 SDP's onwards 4 dip switches are provided for CS */
>> +     if (omap_rev() >= OMAP3430_REV_ES1_0)
>> +             /* change (S8-1:4=DS-2:0) to (S8-4:1=DS-2:0) */
>> +             cs = ((cs & 8) >> 3) | ((cs & 4) >> 1) |
>> +                     ((cs & 2) << 1) | ((cs & 1) << 3);
>> +     else
>> +             /* change (S8-1:3=DS-2:0) to (S8-3:1=DS-2:0) */
>> +             cs = ((cs & 4) >> 2) | (cs & 2) | ((cs & 1) << 2);
>> +
>> +     iounmap(fpga_map_addr);
>> +     return cs;
>> +}
>> +
>> +/**
>> + * sdp3430_flash_init - Identify devices connected to GPMC and register.
>> + *
>> + * @return - void.
>> + */
>> +void __init sdp_flash_init(void)
>> +{
>> +     u8              cs = 0;
>> +     u8              nandcs = GPMC_CS_NUM + 1;
>> +     u8              onenandcs = GPMC_CS_NUM + 1;
>> +     u8              idx;
>> +     unsigned char   *config_sel = NULL;
>> +
>> +     /* REVISIT: Is this return correct idx for 2430 SDP?
>> +      * for which cs configuration matches for 2430 SDP?
>> +      */
>> +     idx = get_gpmc0_type();
>> +     if (idx >= MAX_SUPPORTED_GPMC_CONFIG) {
>> +             printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs);
>> +             return;
>> +     }
>> +     config_sel = (unsigned char *)(chip_sel_sdp[idx]);
>> +
>> +     /* Configure start address and size of NOR device */
>> +     if (omap_rev() >= OMAP3430_REV_ES1_0) {
>> +             sdp_nor_resource.start  = FLASH_BASE_SDPV2;
>> +             sdp_nor_resource.end    = FLASH_BASE_SDPV2
>> +                                             + FLASH_SIZE_SDPV2 - 1;
>> +     } else {
>> +             sdp_nor_resource.start  = FLASH_BASE_SDPV1;
>> +             sdp_nor_resource.end    = FLASH_BASE_SDPV1
>> +                                             + FLASH_SIZE_SDPV1 - 1;
>> +     }
>
> This should be done with gpmc_cs_request using the chip select and size.
> Please see gpmc_smc91x_init() for an example.

I do not think this should be done with 'gpmc_cs_request'. NOR flashes
have been treated somehow differently.

>
>
>> +     if (platform_device_register(&sdp_nor_device) < 0)
>> +             printk(KERN_ERR "Unable to register NOR device\n");
>> +
>> +     while (cs < GPMC_CS_NUM) {
>> +             switch (config_sel[cs]) {
>> +             case PDC_NAND:
>> +                     if (nandcs > GPMC_CS_NUM)
>> +                             nandcs = cs;
>> +                     break;
>> +             case PDC_ONENAND:
>> +                     if (onenandcs > GPMC_CS_NUM)
>> +                             onenandcs = cs;
>> +                     break;
>> +             };
>> +             cs++;
>> +     }
>> +
>> +     if (onenandcs > GPMC_CS_NUM)
>> +             printk(KERN_INFO "OneNAND: Unable to find configuration "
>> +                             " in GPMC\n ");
>> +     else
>> +             board_onenand_init(onenandcs);
>> +
>> +     if (nandcs > GPMC_CS_NUM)
>> +             printk(KERN_INFO "NAND: Unable to find configuration "
>> +                             " in GPMC\n ");
>> +     else
>> +             board_nand_init(nandcs);
>> +}
>> diff --git a/arch/arm/plat-omap/include/plat/board-sdp.h
>> b/arch/arm/plat-omap/include/plat/board-sdp.h
>> new file mode 100644
>> index 000..632f21a
>> --- /dev/null
>> +++ b/arch/arm/plat-omap/include/plat/board-sdp.h
>> @@ -0,0 +1,15 @@
>> +/*
>> + *  arch/arm/plat-omap/include/plat/board-sdp.h
>> + *
>> + *  Information structures 

Re: [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-11-18 Thread Vimal Singh
Tony,

On Fri, Nov 13, 2009 at 2:14 AM, Tony Lindgren  wrote:
> * Vimal Singh  [091110 02:08]:
>> From 6f535d7128ca392458dd0cb31d138cda84747c06 Mon Sep 17 00:00:00 2001
>> From: Vimal Singh 
>> Date: Tue, 10 Nov 2009 11:42:45 +0530
>> Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards

[...]

>> +static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t 
>> len)
>> +{
>> +     int ret = 0;
>> +     int chipnr;
>> +     int status;
>> +     unsigned long page;
>> +     struct nand_chip *this = mtd->priv;
>> +     printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
>> +                     (int)ofs, (int)len);
>> +
>> +     /* select the NAND device */
>> +     chipnr = (int)(ofs >> this->chip_shift);
>> +     this->select_chip(mtd, chipnr);
>> +     /* check the WP bit */
>> +     this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
>> +     if ((this->read_byte(mtd) & 0x80) == 0) {
>> +             printk(KERN_ERR "nand_unlock: Device is write protected!\n");
>> +             ret = -EINVAL;
>> +             goto out;
>> +     }
>> +
>> +     if ((ofs & (mtd->writesize - 1)) != 0) {
>> +             printk(KERN_ERR "nand_unlock: Start address must be"
>> +                             "beginning of nand page!\n");
>> +             ret = -EINVAL;
>> +             goto out;
>> +     }
>> +
>> +     if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
>> +             printk(KERN_ERR "nand_unlock: Length must be a multiple of "
>> +                             "nand page size!\n");
>> +             ret = -EINVAL;
>> +             goto out;
>> +     }
>> +
>> +     /* submit address of first page to unlock */
>> +     page = (unsigned long)(ofs >> this->page_shift);
>> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK1, -1, page & this->pagemask);
>> +
>> +     /* submit ADDRESS of LAST page to unlock */
>> +     page += (unsigned long)((ofs + len) >> this->page_shift) ;
>> +     this->cmdfunc(mtd, NAND_CMD_UNLOCK2, -1, page & this->pagemask);
>> +
>> +     /* call wait ready function */
>> +     status = this->waitfunc(mtd, this);
>> +     udelay(1000);
>> +     /* see if device thinks it succeeded */
>> +     if (status & 0x01) {
>> +             /* there was an error */
>> +             printk(KERN_ERR "nand_unlock: error status =0x%08x ", status);
>> +             ret = -EIO;
>> +             goto out;
>> +     }
>> +
>> + out:
>> +     /* de-select the NAND device */
>> +     this->select_chip(mtd, -1);
>> +     return ret;
>> +}
>
> Isn't the unlocking generic to the NAND device driver? Or is it somehow board
> specific?

Yes, zoom2 boards come up with whole NAND locked, whereas it is not
case for SDP boards.

>
>
>> +static struct mtd_partition ldp_nand_partitions[] = {
>> +     /* All the partition sizes are listed in terms of NAND block size */
>> +     {
>> +             .name           = "X-Loader-NAND",
>> +             .offset         = 0,
>> +             .size           = 4 * (64 * 2048),      /* 512KB, 0x8 */
>> +             .mask_flags     = MTD_WRITEABLE,        /* force read-only */
>> +     },
>> +     {
>> +             .name           = "U-Boot-NAND",
>> +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
>> +             .size           = 10 * (64 * 2048),     /* 1.25MB, 0x14 */
>> +             .mask_flags     = MTD_WRITEABLE,        /* force read-only */
>> +     },
>> +     {
>> +             .name           = "Boot Env-NAND",
>> +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1c */
>> +             .size           = 2 * (64 * 2048),      /* 256KB, 0x4 */
>> +     },
>> +     {
>> +             .name           = "Kernel-NAND",
>> +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x020*/
>> +             .size           = 240 * (64 * 2048),    /* 30M, 0x1E0 */
>> +     },
>> +#ifdef CONFIG_MACH_OMAP_ZOOM2
>> +     {
>> +             .name           = "system",
>> +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x200 
>> */
>> +             .size           = 1280 * (64 * 2048),   /* 160M, 0xA00 */
>> +     },
>> +     {
>> +             .name           = &qu

Re: [PATCH 3/8] OMAP3 hwmod: Add automatic OCP_SYSCONFIG AUTOIDLE handling

2009-11-18 Thread Vimal Singh
On Wed, Nov 18, 2009 at 6:35 AM, Kevin Hilman
 wrote:
> From: Paul Walmsley 
>
> This patch fills in the OCP_SYSCONFIG.AUTOIDLE handling in the OMAP
> hwmod code.
>
> After this patch, the hwmod code will set the module AUTOIDLE bit (generally
> .OCP_SYSCONFIG.AUTOIDLE) to 1 by default upon enable, and 1 upon
> disable.

You wanted to say:  "0 upon disable", isn't it?

-vimal

> If the hwmod flag HWMOD_NO_AUTOIDLE is set, AUTOIDLE will be
> set to 0 upon enable.
>
> Enabling module autoidle should save some power.  The only reason to
> not set the OCP_SYSCONFIG.AUTOIDLE bit is if there is a bug in the
> module RTL, e.g., the MPUINTC block on OMAP3.
>
> Comments from Kevin Hilman  inspired this patch.
>
> Signed-off-by: Paul Walmsley 
> Tested-by: Kevin Hilman 
> ---
>  arch/arm/mach-omap2/omap_hwmod.c             |   50 
> +++---
>  arch/arm/plat-omap/include/plat/omap_hwmod.h |    8 -
>  2 files changed, 52 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
> b/arch/arm/mach-omap2/omap_hwmod.c
> index 7d7b3b8..25d9484 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.c
> +++ b/arch/arm/mach-omap2/omap_hwmod.c
> @@ -210,6 +210,29 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v)
>  }
>
>  /**
> + * _set_module_autoidle: set the OCP_SYSCONFIG AUTOIDLE field in @v
> + * @oh: struct omap_hwmod *
> + * @autoidle: desired AUTOIDLE bitfield value (0 or 1)
> + * @v: pointer to register contents to modify
> + *
> + * Update the module autoidle mode bit in @v to be @autoidle for the
> + * @oh hwmod.  Does not write to the hardware.  Returns -EINVAL upon
> + * error or 0 upon success.
> + */
> +static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
> +                               u32 *v)
> +{
> +       if (!oh->sysconfig ||
> +           !(oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE))
> +               return -EINVAL;
> +
> +       *v &= ~SYSC_AUTOIDLE_MASK;
> +       *v |= autoidle << SYSC_AUTOIDLE_SHIFT;
> +
> +       return 0;
> +}
> +
> +/**
>  * _enable_wakeup: set OCP_SYSCONFIG.ENAWAKEUP bit in the hardware
>  * @oh: struct omap_hwmod *
>  *
> @@ -560,7 +583,13 @@ static void _sysc_enable(struct omap_hwmod *oh)
>                _set_master_standbymode(oh, idlemode, &v);
>        }
>
> -       /* XXX OCP AUTOIDLE bit? */
> +       if (oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE) {
> +               idlemode = (oh->flags & HWMOD_NO_AUTOIDLE) ?
> +                       0 : 1;
> +               _set_module_autoidle(oh, idlemode, &v);
> +       }
> +
> +       /* XXX OCP ENAWAKEUP bit? */
>
>        if (oh->flags & HWMOD_SET_DEFAULT_CLOCKACT &&
>            oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY)
> @@ -625,7 +654,8 @@ static void _sysc_shutdown(struct omap_hwmod *oh)
>        if (oh->sysconfig->sysc_flags & SYSC_HAS_MIDLEMODE)
>                _set_master_standbymode(oh, HWMOD_IDLEMODE_FORCE, &v);
>
> -       /* XXX clear OCP AUTOIDLE bit? */
> +       if (oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE)
> +               _set_module_autoidle(oh, 1, &v);
>
>        _write_sysconfig(v, oh);
>  }
> @@ -951,11 +981,21 @@ static int _setup(struct omap_hwmod *oh)
>
>        _enable(oh);
>
> -       if (!(oh->flags & HWMOD_INIT_NO_RESET))
> +       if (!(oh->flags & HWMOD_INIT_NO_RESET)) {
>                _reset(oh);
>
> -       /* XXX OCP AUTOIDLE bit? */
> -       /* XXX OCP ENAWAKEUP bit? */
> +               /*
> +                * XXX Do the OCP_SYSCONFIG bits need to be
> +                * reprogrammed after a reset?  If not, then this can
> +                * be removed.  If it does, then probably the
> +                * _enable() function should be split to avoid the
> +                * rewrite of the OCP_SYSCONFIG register.
> +                */
> +               if (oh->sysconfig) {
> +                       _update_sysc_cache(oh);
> +                       _sysc_enable(oh);
> +               }
> +       }
>
>        if (!(oh->flags & HWMOD_INIT_NO_IDLE))
>                _idle(oh);
> diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
> b/arch/arm/plat-omap/include/plat/omap_hwmod.h
> index dbdd123..ec140b0 100644
> --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
> +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
> @@ -50,6 +50,8 @@ struct omap_device;
>  #define SYSC_ENAWAKEUP_MASK            (1 << SYSC_ENAWAKEUP_SHIFT)
>  #define SYSC_SOFTRESET_SHIFT           1
>  #define SYSC_SOFTRESET_MASK            (1 << SYSC_SOFTRESET_SHIFT)
> +#define SYSC_AUTOIDLE_SHIFT            0
> +#define SYSC_AUTOIDLE_MASK             (1 << SYSC_AUTOIDLE_SHIFT)
>
>  /* OCP SYSSTATUS bit shifts/masks */
>  #define SYSS_RESETDONE_SHIFT           0
> @@ -294,13 +296,17 @@ struct omap_hwmod_omap4_prcm {
>  *     SDRAM controller, etc.
>  * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
>  *     controller, etc.
> + * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
> + *     when mod

Re: [PATCH 2/4] Add omap3_devkit8000_defconfig

2009-11-12 Thread Vimal Singh
_DEBUG_LOCK_ALLOC is not set
> +# CONFIG_PROVE_LOCKING is not set
> +# CONFIG_LOCK_STAT is not set
> +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
> +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
> +# CONFIG_DEB

Re: [PATCH 3/4] Add support for DEVKIT8000 LCD

2009-11-12 Thread Vimal Singh
spend        = omap3devkit8000_panel_suspend,
> +       .resume         = omap3devkit8000_panel_resume,
> +       .driver         = {
> +               .name   = "omap3devkit8000_lcd",
> +               .owner  = THIS_MODULE,
> +       },
> +};
> +
> +static int __init omap3devkit8000_panel_drv_init(void)
> +{
> +       return platform_driver_register(&omap3devkit8000_panel_driver);
> +}
> +
> +static void __exit omap3devkit8000_panel_drv_exit(void)
> +{
> +       platform_driver_unregister(&omap3devkit8000_panel_driver);
> +}
> +
> +module_init(omap3devkit8000_panel_drv_init);
> +module_exit(omap3devkit8000_panel_drv_exit);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] Add ASoC support for DEVKIT8000

2009-11-12 Thread Vimal Singh
On Thu, Nov 12, 2009 at 3:54 PM, Kim Botherway  wrote:
> This patch add support for DEVKIT8000, it is a copy of Beagleboard sound
> driver
>
> diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
> index 653a362..8cdcfe9 100644
> --- a/sound/soc/omap/Kconfig
> +++ b/sound/soc/omap/Kconfig
> @@ -91,6 +91,14 @@ config SND_OMAP_SOC_OMAP3_BEAGLE
>        help
>          Say Y if you want to add support for SoC audio on the Beagleboard.
>
> +config SND_OMAP_SOC_OMAP3_DEVKIT8000
> +        tristate "SoC Audio support for OMAP3 DEVKIT8000"
> +        depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_DEVKIT8000
> +        select SND_OMAP_SOC_MCBSP
> +        select SND_SOC_TWL4030
> +        help
> +          Say Y if you want to add support for SoC audio on the
> DEVKIT8000.

Patch is corrupted due to line-wrapping.

> +
>  config SND_OMAP_SOC_ZOOM2
>        tristate "SoC Audio support for Zoom2"
>        depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2
>
> diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
> index 02d6947..7239737 100644
> --- a/sound/soc/omap/Makefile
> +++ b/sound/soc/omap/Makefile
> @@ -15,6 +15,7 @@ snd-soc-omap3evm-objs := omap3evm.o
>  snd-soc-sdp3430-objs := sdp3430.o
>  snd-soc-omap3pandora-objs := omap3pandora.o
>  snd-soc-omap3beagle-objs := omap3beagle.o
> +snd-soc-omap3devkit8000-objs := omap3devkit8000.o
>  snd-soc-zoom2-objs := zoom2.o
>
>  obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
> @@ -26,4 +27,5 @@ obj-$(CONFIG_MACH_OMAP3EVM) += snd-soc-omap3evm.o
>  obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
>  obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
>  obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
> +obj-$(CONFIG_SND_OMAP_SOC_OMAP3_DEVKIT8000) += snd-soc-omap3devkit8000.o
>  obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
>
> diff --git a/sound/soc/omap/omap3devkit8000.c
> b/sound/soc/omap/omap3devkit8000.c
> new file mode 100644
> index 000..6a975d4
> --- /dev/null
> +++ b/sound/soc/omap/omap3devkit8000.c
> @@ -0,0 +1,154 @@
> +/*
> + * omap3devkit8000.c  --  SoC audio for OMAP3 Beagle
> + *
> + * Author: Steve Sakoman 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "omap-mcbsp.h"
> +#include "omap-pcm.h"
> +#include "../codecs/twl4030.h"
> +
> +static int omap3devkit8000_hw_params(struct snd_pcm_substream *substream,
> +       struct snd_pcm_hw_params *params)
> +{
> +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
> +       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
> +       unsigned int fmt;
> +       int ret;
> +
> +       switch (params_channels(params)) {
> +       case 2: /* Stereo I2S mode */
> +               fmt =   SND_SOC_DAIFMT_I2S |
> +                       SND_SOC_DAIFMT_NB_NF |
> +                       SND_SOC_DAIFMT_CBM_CFM;
> +               break;
> +       case 4: /* Four channel TDM mode */
> +               fmt =   SND_SOC_DAIFMT_DSP_A |
> +                       SND_SOC_DAIFMT_IB_NF |
> +                       SND_SOC_DAIFMT_CBM_CFM;
> +               break;
> +       default:
> +               return -EINVAL;
> +       }
> +
> +       /* Set codec DAI configuration */
> +       ret = snd_soc_dai_set_fmt(codec_dai, fmt);
> +       if (ret < 0) {
> +               printk(KERN_ERR "can't set codec DAI configuration\n");
> +               return ret;
> +       }
> +
> +       /* Set cpu DAI configuration */
> +       ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
> +       if (ret < 0) {
> +               printk(KERN_ERR "can't set cpu DAI configuration\n");
> +               return ret;
> +       }
> +
> +       /* Set the codec system clock for DAC and ADC */
> +       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 2600,
> +                                    SND_SOC_CLOCK_IN);
> +       if (ret < 0) {
> +               printk(KERN_ERR "can't set codec system clock\n");
> +               return ret;
> +       }
> +
> +       return 0;
> +}
> +
> +static struct snd_soc_ops omap3devkit8000_ops = {
> +       .hw_params = omap3devkit8000_hw_params,
> +};
> +
> +/* Digital audio interfac

[PATCH] Fixing keymap for zoom2 according to matrix keypad framwork

2009-11-12 Thread Vimal Singh
>From fa0ed0d00ee835d70cd4b1d32f89d4e845e0fff8 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Thu, 12 Nov 2009 14:46:00 +0530
Subject: [PATCH] Fixing keymap for zoom2 according to matrix keypad framwork

Interpretation of 'row' and 'col' got reversed in matrix keymap
framework. Also last element '0', present in keymap array, is no
more needed.
Correcting zoom2 keyboard keymap accordingly.

Signed-off-by: Vimal Singh 
---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   87 +-
 1 files changed, 43 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 54619d5..efb7794 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -29,57 +29,56 @@
 /* Zoom2 has Qwerty keyboard*/
 static int board_keymap[] = {
KEY(0, 0, KEY_E),
-   KEY(1, 0, KEY_R),
-   KEY(2, 0, KEY_T),
-   KEY(3, 0, KEY_HOME),
-   KEY(6, 0, KEY_I),
-   KEY(7, 0, KEY_LEFTSHIFT),
-   KEY(0, 1, KEY_D),
+   KEY(0, 1, KEY_R),
+   KEY(0, 2, KEY_T),
+   KEY(0, 3, KEY_HOME),
+   KEY(0, 6, KEY_I),
+   KEY(0, 7, KEY_LEFTSHIFT),
+   KEY(1, 0, KEY_D),
KEY(1, 1, KEY_F),
-   KEY(2, 1, KEY_G),
-   KEY(3, 1, KEY_SEND),
-   KEY(6, 1, KEY_K),
-   KEY(7, 1, KEY_ENTER),
-   KEY(0, 2, KEY_X),
-   KEY(1, 2, KEY_C),
+   KEY(1, 2, KEY_G),
+   KEY(1, 3, KEY_SEND),
+   KEY(1, 6, KEY_K),
+   KEY(1, 7, KEY_ENTER),
+   KEY(2, 0, KEY_X),
+   KEY(2, 1, KEY_C),
KEY(2, 2, KEY_V),
-   KEY(3, 2, KEY_END),
-   KEY(6, 2, KEY_DOT),
-   KEY(7, 2, KEY_CAPSLOCK),
-   KEY(0, 3, KEY_Z),
-   KEY(1, 3, KEY_KPPLUS),
-   KEY(2, 3, KEY_B),
+   KEY(2, 3, KEY_END),
+   KEY(2, 6, KEY_DOT),
+   KEY(2, 7, KEY_CAPSLOCK),
+   KEY(3, 0, KEY_Z),
+   KEY(3, 1, KEY_KPPLUS),
+   KEY(3, 2, KEY_B),
KEY(3, 3, KEY_F1),
-   KEY(6, 3, KEY_O),
-   KEY(7, 3, KEY_SPACE),
-   KEY(0, 4, KEY_W),
-   KEY(1, 4, KEY_Y),
-   KEY(2, 4, KEY_U),
-   KEY(3, 4, KEY_F2),
+   KEY(3, 6, KEY_O),
+   KEY(3, 7, KEY_SPACE),
+   KEY(4, 0, KEY_W),
+   KEY(4, 1, KEY_Y),
+   KEY(4, 2, KEY_U),
+   KEY(4, 3, KEY_F2),
KEY(4, 4, KEY_VOLUMEUP),
-   KEY(6, 4, KEY_L),
-   KEY(7, 4, KEY_LEFT),
-   KEY(0, 5, KEY_S),
-   KEY(1, 5, KEY_H),
-   KEY(2, 5, KEY_J),
-   KEY(3, 5, KEY_F3),
+   KEY(4, 6, KEY_L),
+   KEY(4, 7, KEY_LEFT),
+   KEY(5, 0, KEY_S),
+   KEY(5, 1, KEY_H),
+   KEY(5, 2, KEY_J),
+   KEY(5, 3, KEY_F3),
KEY(5, 5, KEY_VOLUMEDOWN),
-   KEY(6, 5, KEY_M),
-   KEY(4, 5, KEY_ENTER),
-   KEY(7, 5, KEY_RIGHT),
-   KEY(0, 6, KEY_Q),
-   KEY(1, 6, KEY_A),
-   KEY(2, 6, KEY_N),
-   KEY(3, 6, KEY_BACKSPACE),
+   KEY(5, 6, KEY_M),
+   KEY(5, 7, KEY_ENTER),
+   KEY(6, 0, KEY_Q),
+   KEY(6, 1, KEY_A),
+   KEY(6, 2, KEY_N),
+   KEY(6, 3, KEY_BACKSPACE),
KEY(6, 6, KEY_P),
-   KEY(7, 6, KEY_UP),
KEY(6, 7, KEY_SELECT),
-   KEY(7, 7, KEY_DOWN),
-   KEY(0, 7, KEY_PROG1),   /*MACRO 1  */
-   KEY(1, 7, KEY_PROG2),   /*MACRO 2  */
-   KEY(2, 7, KEY_PROG3),   /*MACRO 3  */
-   KEY(3, 7, KEY_PROG4),   /*MACRO 4  */
-   0
+   KEY(7, 0, KEY_PROG1),   /*MACRO 1  */
+   KEY(7, 1, KEY_PROG2),   /*MACRO 2  */
+   KEY(7, 2, KEY_PROG3),   /*MACRO 3  */
+   KEY(7, 3, KEY_PROG4),   /*MACRO 4  */
+   KEY(7, 5, KEY_RIGHT),
+   KEY(7, 6, KEY_UP),
+   KEY(7, 7, KEY_DOWN)
 };

 static struct matrix_keymap_data board_map_data = {
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module

2009-11-10 Thread Vimal Singh
On Wed, Nov 11, 2009 at 12:26 AM, Tony Lindgren  wrote:
> * Artem Bityutskiy  [091110 06:22]:
>> On Fri, 2009-10-30 at 14:57 +0530, Vimal Singh wrote:
>> > Last time I forgot to 'git add' for 'arch/arm/mach-omap2/gpmc.c'... My bad.
>> > Correct patch is below.
>> >
>> > -vimal
>> >
>> >
>> > From: Vimal Singh 
>> > Date: Fri, 30 Oct 2009 14:54:29 +0530
>> > Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module
>> >
>> > Removing OMAP NAND driver, when loaded as a module, gives error and
>> > does not get success. This fixes this and makes driver loadable and
>> > removable run time.
>> >
>> > Signed-off-by: Vimal Singh 
>> > ---
>> >  arch/arm/mach-omap2/gpmc.c |    2 ++
>> >  drivers/mtd/nand/omap2.c   |    5 -
>> >  2 files changed, 6 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
>> > index 1587682..1d10b7b 100644
>> > --- a/arch/arm/mach-omap2/gpmc.c
>> > +++ b/arch/arm/mach-omap2/gpmc.c
>> > @@ -88,6 +88,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
>> >     reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>> >     __raw_writel(val, reg_addr);
>> >  }
>> > +EXPORT_SYMBOL(gpmc_cs_write_reg);
>> >
>> >  u32 gpmc_cs_read_reg(int cs, int idx)
>> >  {
>> > @@ -96,6 +97,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
>> >     reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>> >     return __raw_readl(reg_addr);
>> >  }
>> > +EXPORT_SYMBOL(gpmc_cs_read_reg);
>>
>> You should get Tony's ack for this. I do not know the code, but on
>> surface it looks strange. Exporting so low-level functions is bad in
>> general, IMO. These function should either be inlined, or you should
>> invent better abstraction, so that you would not need to ever call these
>> functions from omap2.c.
>
> NAK. We don't want the drivers to tinker with these registers
> directly. And really, the drivers should be platform independent.
>
> This seems like a quick hack to add back the missing functionality
> we threw out of the linux-omap tree. It was thrown out because there
> were the same cut and paste hacks duplicated all over the place
> tinkering with the GPMC registers directly.
>
> We've fixed a lot of this by creating gpmc-onenand.c and gpmc-smc91x.c,
> and that's clearly the way to go.
>
> So instead of trying to add back the same old hacks, how about rather
> spend that time to create something that we can use for all boards
> using GPMC?
>
> To me it looks like platform init like this should be done in a
> generic way in arch/arm/mach-omap2/gpmc-nand.c the same way we have
> gpmc-onenand.c and gpmc-smc91x.c.
>
> Also, you should calculate the GPMC timings dynamically as they
> can change based on the L3 frequency. Just take a look at the
> gpmc-onenand.c and gpmc-smc91x.c.

Ok, I'll look into these and will try to do something generic.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Fixing compilation warning for 'nand/omap2.c'

2009-11-10 Thread Vimal Singh
On Tue, Nov 10, 2009 at 7:54 PM, Artem Bityutskiy  wrote:
> On Tue, 2009-11-03 at 14:31 +0530, Vimal Singh wrote:
>> >> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
>> >> index 090ab87..92573d5 100644
>> >> --- a/drivers/mtd/nand/omap2.c
>> >> +++ b/drivers/mtd/nand/omap2.c
>> >> @@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
>> >> mtd_info *mtd, u_char
>> >
>> > :-) It is the same again.
>> >
>> > Try to send the e-mail to yourself, then save it and apply with git-am.
>> > If it works, send to the mailing list.
>>
>> Below patch applies. Sorry for noise... :(
>>
>> Thanks,
>> vimal
>>
>>
>> From eebbd81141b196af2dc3f7a2650ce16b6b0d76ae Mon Sep 17 00:00:00 2001
>> From: Vimal Singh 
>> Date: Fri, 30 Oct 2009 11:31:34 +0530
>> Subject: [PATCH] Fixing compilation warning for 'nand/omap2.c'
>>
>> Fixing below warning in compilation:
>> drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
>> drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
>> 'omap_nand_dma_transfer' discards qualifiers from pointer target type
>>
>> Signed-off-by: Vimal Singh 
>> ---
>>  drivers/mtd/nand/omap2.c |    6 --
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
>> index 090ab87..92573d5 100644
>> --- a/drivers/mtd/nand/omap2.c
>> +++ b/drivers/mtd/nand/omap2.c
>> @@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
>>  static void omap_write_buf_dma_pref(struct mtd_info *mtd,
>>                                       const u_char *buf, int len)
>>  {
>> +     u_char *p = (u_char *)buf;
>> +
>>       if (len <= mtd->oobsize)
>> -             omap_write_buf_pref(mtd, buf, len);
>> +             omap_write_buf_pref(mtd, p, len);
>>       else
>>               /* start transfer in DMA mode */
>> -             omap_nand_dma_transfer(mtd, buf, len, 0x1);
>> +             omap_nand_dma_transfer(mtd, p, len, 0x1);
>>  }
>>
>>  /**
>
> BTW, this patch is still corrupted for me. And it is strange that I do
> not see it in the archives, so I cannot check is this my setup which is
> guilty, or it is you sending the patches incorrectly:
>
> http://lists.infradead.org/pipermail/linux-mtd/2009-November/027918.html

Here is the patch once again:

Fixing below warning in compilation:
drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
'omap_nand_dma_transfer' discards qualifiers from pointer target type

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 090ab87..92573d5 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
 static void omap_write_buf_dma_pref(struct mtd_info *mtd,
const u_char *buf, int len)
 {
+   u_char *p = (u_char *)buf;
+
if (len <= mtd->oobsize)
-   omap_write_buf_pref(mtd, buf, len);
+   omap_write_buf_pref(mtd, p, len);
else
/* start transfer in DMA mode */
-   omap_nand_dma_transfer(mtd, buf, len, 0x1);
+   omap_nand_dma_transfer(mtd, p, len, 0x1);
 }

 /**
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Fixing compilation warning for 'nand/omap2.c'

2009-11-10 Thread Vimal Singh
On Tue, Nov 10, 2009 at 7:56 PM, Artem Bityutskiy  wrote:
> On Tue, 2009-11-10 at 16:20 +0200, Artem Bityutskiy wrote:
>> On Tue, 2009-11-03 at 14:31 +0530, Vimal Singh wrote:
>> > >> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
>> > >> index 090ab87..92573d5 100644
>> > >> --- a/drivers/mtd/nand/omap2.c
>> > >> +++ b/drivers/mtd/nand/omap2.c
>> > >> @@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
>> > >> mtd_info *mtd, u_char
>> > >
>> > > :-) It is the same again.
>> > >
>> > > Try to send the e-mail to yourself, then save it and apply with git-am.
>> > > If it works, send to the mailing list.
>> >
>> > Below patch applies. Sorry for noise... :(
>> >
>> > Thanks,
>> > vimal
>> >
>> >
>> > From eebbd81141b196af2dc3f7a2650ce16b6b0d76ae Mon Sep 17 00:00:00 2001
>> > From: Vimal Singh 
>> > Date: Fri, 30 Oct 2009 11:31:34 +0530
>> > Subject: [PATCH] Fixing compilation warning for 'nand/omap2.c'
>> >
>> > Fixing below warning in compilation:
>> > drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
>> > drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
>> > 'omap_nand_dma_transfer' discards qualifiers from pointer target type
>> >
>> > Signed-off-by: Vimal Singh 
>> > ---
>> >  drivers/mtd/nand/omap2.c |    6 --
>> >  1 files changed, 4 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
>> > index 090ab87..92573d5 100644
>> > --- a/drivers/mtd/nand/omap2.c
>> > +++ b/drivers/mtd/nand/omap2.c
>> > @@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
>> >  static void omap_write_buf_dma_pref(struct mtd_info *mtd,
>> >                                     const u_char *buf, int len)
>> >  {
>> > +   u_char *p = (u_char *)buf;
>> > +
>> >     if (len <= mtd->oobsize)
>> > -           omap_write_buf_pref(mtd, buf, len);
>> > +           omap_write_buf_pref(mtd, p, len);
>> >     else
>> >             /* start transfer in DMA mode */
>> > -           omap_nand_dma_transfer(mtd, buf, len, 0x1);
>> > +           omap_nand_dma_transfer(mtd, p, len, 0x1);
>> >  }
>>
>> I think that you should instead remove the 'const' modifier from the
>> 'omap_write_buf_dma_pref()' function. Indeed, if it has the 'const'
>> modifier, it should never change the bugger.
>
> Sorry, s/bugger/buffer/
> :-)

Write calls are intended to copy data bytes from supplied buffer to
NAND. So yes, these calls are not supposed to change this buffer.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v5 4/4] OMAP: 3430SDP: Enable NAND in defconfig

2009-11-10 Thread Vimal Singh
>From 225e5c1e38ba1d4a14757150b0b7caf1d8cab893 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Tue, 10 Nov 2009 15:24:07 +0530
Subject: [PATCH] OMAP: 3430SDP: Enable NAND in defconfig

Enable NAND by default in 3430sdp_defconfig file.
This patch also enables MTD_CMDLINE_PARTS option.
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_3430sdp_defconfig |  591 ++-
 1 files changed, 271 insertions(+), 320 deletions(-)

diff --git a/arch/arm/configs/omap_3430sdp_defconfig
b/arch/arm/configs/omap_3430sdp_defconfig
index 5a305f0..b48d73a 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -1,15 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Tue Jun 23 10:36:45 2009
+# Linux kernel version: 2.6.32-rc6
+# Tue Nov 10 15:20:01 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +16,14 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_OPROFILE_ARMV7=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -47,11 +45,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -67,6 +66,9 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_ANON_INODES=y
@@ -88,6 +90,10 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLUB_DEBUG=y
 # CONFIG_COMPAT_BRK is not set
@@ -96,13 +102,18 @@ CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 CONFIG_PROFILING=y
 CONFIG_TRACEPOINTS=y
-# CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+# CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -114,8 +125,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-CONFIG_LBD=y
-# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -136,18 +146,22 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,24 +170,27 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
-# CONFIG_ARCH_MSM is no

[PATCH-v5 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

2009-11-10 Thread Vimal Singh
>From ddd6a39e4725c1e3947fab9a54399e9e7de508cd Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Tue, 10 Nov 2009 11:48:24 +0530
Subject: [PATCH] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

Enable NAND and JFFS2 options by default in zoom2_defconfig file
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_zoom2_defconfig |  333 -
 1 files changed, 243 insertions(+), 90 deletions(-)

diff --git a/arch/arm/configs/omap_zoom2_defconfig
b/arch/arm/configs/omap_zoom2_defconfig
index f1739fa..23116c4 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -1,15 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Fri Jun 12 17:25:46 2009
+# Linux kernel version: 2.6.32-rc6
+# Tue Nov 10 11:46:50 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -46,11 +44,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_GROUP_SCHED=y
@@ -77,7 +76,6 @@ CONFIG_UID16=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
@@ -90,18 +88,25 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
 # CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
@@ -114,7 +119,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-# CONFIG_LBD is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -135,19 +140,22 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,25 +164,27 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
-# CONFIG_ARCH_MSM is not set
-# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_BCMRING is not set

 #
 # TI OMAP Implementations
@@ -203,20 +213,23 @@ CONFIG_OMAP_DM_TIMER=y
 # CONFIG_OMAP_LL_DEBUG_UART1 is not set
 # CONFIG_OMAP_LL_DEBU

[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-10 Thread Vimal Singh
>From 42f080e0915bbce1509fc8ab3773569fec0a44f1 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Tue, 10 Nov 2009 11:39:39 +0530
Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards

Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.

Signed-off-by: Vimal Singh 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile|2 +
 arch/arm/mach-omap2/board-2430sdp.c |2 +
 arch/arm/mach-omap2/board-3430sdp.c |2 +
 arch/arm/mach-omap2/board-sdp-flash.c   |  326 +++
 arch/arm/plat-omap/include/plat/board-sdp.h |   15 ++
 arch/arm/plat-omap/include/plat/gpmc.h  |2 +
 6 files changed, 349 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 03cb4fc..627f500 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -66,6 +67,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-omap3evm.o \
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
diff --git a/arch/arm/mach-omap2/board-2430sdp.c
b/arch/arm/mach-omap2/board-2430sdp.c
index db9374b..5676ab9 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include 
 #include 

+#include 
 #include "mmc-twl4030.h"

 #define SDP2430_CS0_BASE   0x0400
@@ -205,6 +206,7 @@ static void __init omap_2430sdp_init(void)
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
diff --git a/arch/arm/mach-omap2/board-3430sdp.c
b/arch/arm/mach-omap2/board-3430sdp.c
index a3c1271..4497ded 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#include 
 #include "sdram-qimonda-hyb18m512160af-6.h"
 #include "mmc-twl4030.h"

@@ -511,6 +512,7 @@ static void __init omap_3430sdp_init(void)
omap_serial_init();
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
 }
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c
b/arch/arm/mach-omap2/board-sdp-flash.c
new file mode 100644
index 000..c881772
--- /dev/null
+++ b/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,326 @@
+/*
+ * arch/arm/mach-omap2/board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2007 Texas Instruments
+ *
+ * Modified from mach-omap2/board-3430sdp-flash.c
+ * Author: Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define REG_FPGA_REV   0x10
+#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
+#define MAX_SUPPORTED_GPMC_CONFIG  3
+
+/* various memory sizes */
+#define FLASH_SIZE_SDPV1   SZ_64M
+#define FLASH_SIZE_SDPV2   SZ_128M
+
+#define FLASH_BASE_SDPV1   0x0400 /* NOR flash (64 Meg aligned) */
+#define FLASH_BASE_SDPV2   0x1000 /* NOR flash (256 Meg aligned) */
+
+#define DEBUG_BASE 

[PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-11-10 Thread Vimal Singh
>From 6f535d7128ca392458dd0cb31d138cda84747c06 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Tue, 10 Nov 2009 11:42:45 +0530
Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards

Adding NAND support for ZOOM2 and LDP board. I have tested it for ZOOM2 boards,
someone can verify it for LDP, hopefully it should not have any problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
  Future boards will be called Zoom2/3/4 etc.
  LDP is a Zoom1. Somhow the LDP name got stuck to that.

Signed-off-by: Vimal Singh 
Signed-off-by: Vikram Pandita 
---
 arch/arm/mach-omap2/Makefile |2 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 ++
 arch/arm/mach-omap2/board-zoom2.c|2 +
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 +
 arch/arm/plat-omap/include/plat/nand.h   |2 +
 6 files changed, 240 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 627f500..b3a9d1c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += 
board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_CM_T35)  += board-cm-t35.o \
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c062238..8aebdf9 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "mmc-twl4030.h"

@@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
b/arch/arm/mach-omap2/board-zoom-flash.c
new file mode 100644
index 000..1406a57
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,196 @@
+/*
+ * arch/arm/mach-omap2/board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Rohit Choraria 
+ *    Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define NAND_CMD_UNLOCK1   0x23
+#define NAND_CMD_UNLOCK2   0x24
+/**
+ * @brief platform specific unlock function
+ *
+ * @param mtd - mtd info
+ * @param ofs - offset to start unlock from
+ * @param len - length to unlock
+ *
+ * @return - unlock status
+ */
+static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
+{
+   int ret = 0;
+   int chipnr;
+   int status;
+   unsigned long page;
+   struct nand_chip *this = mtd->priv;
+   printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
+   (int)ofs, (int)len);
+
+   /* select the NAND device */
+   chipnr = (int)(ofs >> this->chip_shift);
+   this->select_chip(mtd, chipnr);
+   /* check the WP bit */
+   this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
+   if ((this->read_byte(mtd) & 0x80) == 0) {
+   printk(KERN_ERR "nand_unlock: Device is write protected!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if ((ofs & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Start address must be"
+   "beginning of nand page!\n");
+   ret = -EINVAL;
+   goto out;
+   }

[PATCH-v5 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-10 Thread Vimal Singh
>From 225e5c1e38ba1d4a14757150b0b7caf1d8cab893 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Tue, 10 Nov 2009 15:24:29 +0530
Subject: [PATCH] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

This is v5 of this patch series.

This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
OneNAND and NOR (in sdp)

Tested on Zoom2 by Vikram, On SDP by Vimal

Vimal Singh (4):
[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards
[PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
[PATCH-v5 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
[PATCH-v5 4/4] OMAP: 3430SDP: Enable NAND in defconfig

v4-v5:
[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
Implemented Tony's comments.


 arch/arm/configs/omap_3430sdp_defconfig  |  591 --
 arch/arm/configs/omap_zoom2_defconfig|  333 +++
 arch/arm/mach-omap2/Makefile |4 +
 arch/arm/mach-omap2/board-2430sdp.c  |2 +
 arch/arm/mach-omap2/board-3430sdp.c  |2 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-sdp-flash.c|  326 ++
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 +
 arch/arm/mach-omap2/board-zoom2.c|2 +
 arch/arm/plat-omap/include/plat/board-sdp.h  |   15 +
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 ++
 arch/arm/plat-omap/include/plat/gpmc.h   |2 +
 arch/arm/plat-omap/include/plat/nand.h   |2 +
 13 files changed, 1103 insertions(+), 410 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h


-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v4 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-09 Thread Vimal Singh
On Tue, Nov 10, 2009 at 2:21 AM, Tony Lindgren  wrote:
> Hi,
>
> Few comments below.
>
> * Vimal Singh  [091026 05:10]:
>> From 92c416f513df62cc0ad75b61639df27f2857b641 Mon Sep 17 00:00:00 2001
>> From: Vimal Singh 
>> Date: Mon, 26 Oct 2009 14:24:18 +0530
>> Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards
>>
>> Add support for flash on SDP boards. NAND, NOR and OneNAND
>> are supported.
>>
>> Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
>> 2430SDP and check the chips select for 2430SDP.
>>
>> Also note that:
>> For OneNAND: in the earlier 2430SDP code the kernel partition
>> was set to only 1MB instead of 2MB on 3430SDP. If people want
>> the old partition sizes back on 2430SDP, please provide a patch.
>>
>> For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
>> by few blocks to provide few spare blocks for NAND bab block management
>> in u-boot. If people want old partition sizes, please provide a patch.
>>
>> Signed-off-by: Vimal Singh 
>> Cc: Tony Lindgren 
>> ---
>>  arch/arm/mach-omap2/Makefile                |    2 +
>>  arch/arm/mach-omap2/board-2430sdp.c         |    2 +
>>  arch/arm/mach-omap2/board-3430sdp.c         |    2 +
>>  arch/arm/mach-omap2/board-sdp-flash.c       |  327 
>> +++
>>  arch/arm/plat-omap/include/plat/board-sdp.h |   15 ++
>>  arch/arm/plat-omap/include/plat/gpmc.h      |    2 +
>>  6 files changed, 350 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
>>  create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
>>
>> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
>> index 03cb4fc..627f500 100644
>> --- a/arch/arm/mach-omap2/Makefile
>> +++ b/arch/arm/mach-omap2/Makefile
>> @@ -53,6 +53,7 @@ obj-$(CONFIG_OMAP_IOMMU)            += $(iommu-y)
>>  obj-$(CONFIG_MACH_OMAP_GENERIC)              += board-generic.o
>>  obj-$(CONFIG_MACH_OMAP_H4)           += board-h4.o
>>  obj-$(CONFIG_MACH_OMAP_2430SDP)              += board-2430sdp.o \
>> +                                        board-sdp-flash.o \
>>                                          mmc-twl4030.o
>>  obj-$(CONFIG_MACH_OMAP_APOLLON)              += board-apollon.o
>>  obj-$(CONFIG_MACH_OMAP3_BEAGLE)              += board-omap3beagle.o \
>> @@ -66,6 +67,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)         += board-omap3evm.o \
>>  obj-$(CONFIG_MACH_OMAP3_PANDORA)     += board-omap3pandora.o \
>>                                          mmc-twl4030.o
>>  obj-$(CONFIG_MACH_OMAP_3430SDP)              += board-3430sdp.o \
>> +                                        board-sdp-flash.o \
>>                                          mmc-twl4030.o
>>  obj-$(CONFIG_MACH_NOKIA_N8X0)                += board-n8x0.o
>>  obj-$(CONFIG_MACH_NOKIA_RX51)                += board-rx51.o \
>> diff --git a/arch/arm/mach-omap2/board-2430sdp.c
>> b/arch/arm/mach-omap2/board-2430sdp.c
>> index db9374b..5676ab9 100644
>> --- a/arch/arm/mach-omap2/board-2430sdp.c
>> +++ b/arch/arm/mach-omap2/board-2430sdp.c
>> @@ -38,6 +38,7 @@
>>  #include 
>>  #include 
>>
>> +#include 
>>  #include "mmc-twl4030.h"
>>
>>  #define SDP2430_CS0_BASE     0x0400
>> @@ -205,6 +206,7 @@ static void __init omap_2430sdp_init(void)
>>       twl4030_mmc_init(mmc);
>>       usb_musb_init();
>>       board_smc91x_init();
>> +     sdp_flash_init();
>>
>>       /* Turn off secondary LCD backlight */
>>       ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
>> diff --git a/arch/arm/mach-omap2/board-3430sdp.c
>> b/arch/arm/mach-omap2/board-3430sdp.c
>> index a3c1271..4497ded 100644
>> --- a/arch/arm/mach-omap2/board-3430sdp.c
>> +++ b/arch/arm/mach-omap2/board-3430sdp.c
>> @@ -41,6 +41,7 @@
>>  #include 
>>  #include 
>>
>> +#include 
>>  #include "sdram-qimonda-hyb18m512160af-6.h"
>>  #include "mmc-twl4030.h"
>>
>> @@ -511,6 +512,7 @@ static void __init omap_3430sdp_init(void)
>>       omap_serial_init();
>>       usb_musb_init();
>>       board_smc91x_init();
>> +     sdp_flash_init();
>>       enable_board_wakeup_source();
>>       usb_ehci_init(&ehci_pdata);
>>  }
>> diff --git a/arch/arm/mach-omap2/board-sdp-flash.c
>> b/arch/arm/mach-omap2/board-sdp-flash.c
>> new file mode 100644
>> index 000..a19327d
>> --- /dev/null
>> 

Re: [PATCH 0/3] NAND: OMAP: Fix and clean NAND driver

2009-11-09 Thread Vimal Singh
Artem,
I just saw you have taken 2nd patch from this series to your tree .
Could you please be able to maintain this full series?

Tony,
You may want to look into 1st and 2nd patch in this series.

-vimal

On Fri, Oct 30, 2009 at 2:12 PM, Vimal Singh  wrote:
> Looping Linux-omap mailing list.
>
>
> From: Vimal Singh 
> Date: Fri, 30 Oct 2009 11:34:14 +0530
> Subject: [PATCH 0/3] NAND: OMAP: Fix and clean NAND driver
>
> This patch series addresses some of the issues in omap nand driver.
>
> Vimal Singh (3):
>  Fixing compilation warning for 'nand/omap2.c'
>  NAND: OMAP: Fixing omap nand driver, compiled as module
>  NAND: OMAP: Simplifying HWECC and removing unnecessary macros
>
>  drivers/mtd/nand/omap2.c |  315 
> --
>  1 files changed, 108 insertions(+), 207 deletions(-)
>
> --
> Regards,
> Vimal Singh
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v4 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-04 Thread Vimal Singh
Hi Tony,

I did not see any comment on these patches. Could you please upstream these?
Or, do you have some other plan?

-
vimal

On Mon, Oct 26, 2009 at 5:37 PM, Vimal Singh  wrote:
> I posted a patch series for this sometime back and did not get any respose.. 
> :(
> http://marc.info/?l=linux-omap&m=125258227301958&w=2
>
> This time again I am posting these patches, with one more patch added
> in series, after re-basing the patches on top of LO master head.
>
> This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
> OneNAND and NOR (in sdp)
>
> Tested on Zoom2 by Vikram, On SDP by Vimal
>
> [PATCH-v4 1/4] OMAP2/3: Add support for flash on SDP boards
> [PATCH-v4 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
> [PATCH-v4 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
> [PATCH 4/4] OMAP: 3430SDP: Enable NAND in defconfig
>
>  arch/arm/configs/omap_3430sdp_defconfig      |  574 +++--
>  arch/arm/configs/omap_zoom2_defconfig        |  334 ++
>  arch/arm/mach-omap2/Makefile                 |    2
>  arch/arm/mach-omap2/board-2430sdp.c          |    2
>  arch/arm/mach-omap2/board-3430sdp.c          |    2
>  arch/arm/mach-omap2/board-ldp.c              |    2
>  arch/arm/mach-omap2/board-sdp-flash.c        |  327 ++
>  arch/arm/mach-omap2/board-zoom-flash.c       |  196 
>  arch/arm/mach-omap2/board-zoom2.c            |    2
>  arch/arm/plat-omap/include/plat/board-sdp.h  |   15
>  arch/arm/plat-omap/include/plat/board-zoom.h |   36 +
>  arch/arm/plat-omap/include/plat/gpmc.h       |    2
>  arch/arm/plat-omap/include/plat/nand.h       |    2
>  14 files changed, 1095 insertions(+), 403 deletions(-)
>
> --
> Regards,
> Vimal Singh
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Fixing compilation warning for 'nand/omap2.c'

2009-11-03 Thread Vimal Singh
>> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
>> index 090ab87..92573d5 100644
>> --- a/drivers/mtd/nand/omap2.c
>> +++ b/drivers/mtd/nand/omap2.c
>> @@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
>> mtd_info *mtd, u_char
>
> :-) It is the same again.
>
> Try to send the e-mail to yourself, then save it and apply with git-am.
> If it works, send to the mailing list.

Below patch applies. Sorry for noise... :(

Thanks,
vimal


>From eebbd81141b196af2dc3f7a2650ce16b6b0d76ae Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Fri, 30 Oct 2009 11:31:34 +0530
Subject: [PATCH] Fixing compilation warning for 'nand/omap2.c'

Fixing below warning in compilation:
drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
'omap_nand_dma_transfer' discards qualifiers from pointer target type

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 090ab87..92573d5 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
 static void omap_write_buf_dma_pref(struct mtd_info *mtd,
const u_char *buf, int len)
 {
+   u_char *p = (u_char *)buf;
+
if (len <= mtd->oobsize)
-   omap_write_buf_pref(mtd, buf, len);
+   omap_write_buf_pref(mtd, p, len);
else
/* start transfer in DMA mode */
-   omap_nand_dma_transfer(mtd, buf, len, 0x1);
+   omap_nand_dma_transfer(mtd, p, len, 0x1);
 }

 /**
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module

2009-11-03 Thread Vimal Singh
On Tue, Nov 3, 2009 at 2:09 PM, Artem Bityutskiy  wrote:
> On Tue, 2009-11-03 at 14:05 +0530, Vimal Singh wrote:
>> On Tue, Nov 3, 2009 at 1:58 PM, Artem Bityutskiy  wrote:
>> > On Fri, 2009-10-30 at 14:57 +0530, Vimal Singh wrote:
>> >> Last time I forgot to 'git add' for 'arch/arm/mach-omap2/gpmc.c'... My 
>> >> bad.
>> >> Correct patch is below.
>> >>
>> >> -vimal
>> >>
>> >>
>> >> From: Vimal Singh 
>> >> Date: Fri, 30 Oct 2009 14:54:29 +0530
>> >> Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module
>> >>
>> >> Removing OMAP NAND driver, when loaded as a module, gives error and
>> >> does not get success. This fixes this and makes driver loadable and
>> >> removable run time.
>> >>
>> >> Signed-off-by: Vimal Singh 
>> >> ---
>> >>  arch/arm/mach-omap2/gpmc.c |    2 ++
>> >>  drivers/mtd/nand/omap2.c   |    5 -
>> >>  2 files changed, 6 insertions(+), 1 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
>> >> index 1587682..1d10b7b 100644
>> >> --- a/arch/arm/mach-omap2/gpmc.c
>> >> +++ b/arch/arm/mach-omap2/gpmc.c
>> >> @@ -88,6 +88,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
>> >>       reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>> >>       __raw_writel(val, reg_addr);
>> >>  }
>> >> +EXPORT_SYMBOL(gpmc_cs_write_reg);
>> >>
>> >>  u32 gpmc_cs_read_reg(int cs, int idx)
>> >>  {
>> >> @@ -96,6 +97,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
>> >>       reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>> >>       return __raw_readl(reg_addr);
>> >>  }
>> >> +EXPORT_SYMBOL(gpmc_cs_read_reg);
>> >
>> > Why do you export these?
>>
>> These functions are called during prob. So, if not exported and driver
>> is compiled as a module compilation will break with error saying these
>> are not defined or not found.
>
> Could you show the place where they are called from please. I tried to
> compile the omap NAND driver as module and it compiled fine. Probably
> I'm missing something?

Code snippet from omap2.c, in prob call: line 919
---
/* Enable RD PIN Monitoring Reg */
if (pdata->dev_ready) {
val  = gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG1);
val |= WR_RD_PIN_MONITORING;
gpmc_cs_write_reg(info->gpmc_cs, GPMC_CS_CONFIG1, val);
}

val  = gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG7);
val &= ~(0xf << 8);
val |=  (0xc & 0xf) << 8;
gpmc_cs_write_reg(info->gpmc_cs, GPMC_CS_CONFIG7, val);
---

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Fixing compilation warning for 'nand/omap2.c'

2009-11-03 Thread Vimal Singh
On Tue, Nov 3, 2009 at 1:48 PM, Artem Bityutskiy  wrote:
> On Fri, 2009-10-30 at 14:12 +0530, Vimal Singh wrote:
>> Looping Linux-omap mailing list.
>>
>>
>> From: Vimal Singh 
>> Date: Fri, 30 Oct 2009 11:31:34 +0530
>> Subject: [PATCH] Fixing compilation warning for 'nand/omap2.c'
>>
>> Fixing below warning in compilation:
>> drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
>> drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
>> 'omap_nand_dma_transfer' discards qualifiers from pointer target type
>>
>> Signed-off-by: Vimal Singh 
>> ---
>>  drivers/mtd/nand/omap2.c |    6 --
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> [dedek...@eru l2-mtd-2.6.git]$ scripts/checkpatch.pl vimal
> ERROR: patch seems to be corrupt (line wrapped?)
> #94: FILE: drivers/mtd/nand/omap2.c:500:
> mtd_info *mtd, u_char *buf, int len)
>
> total: 1 errors, 0 warnings, 16 lines checked
>
> vimal has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> [dedek...@eru l2-mtd-2.6.git]$ vim vimal
> [dedek...@eru l2-mtd-2.6.git]$ git am vimal
> Applying: Fixing compilation warning for 'nand/omap2.c'
> fatal: corrupt patch at line 10
> Patch failed at 0001 Fixing compilation warning for 'nand/omap2.c'
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> [dedek...@eru l2-mtd-2.6.git]$
>

Grr... its again mailer's issue. Fixed this in below patch:

-vimal

>From eebbd81141b196af2dc3f7a2650ce16b6b0d76ae Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Fri, 30 Oct 2009 11:31:34 +0530
Subject: [PATCH] Fixing compilation warning for 'nand/omap2.c'

Fixing below warning in compilation:
drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
'omap_nand_dma_transfer' discards qualifiers from pointer target type

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 090ab87..92573d5 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
mtd_info *mtd, u_char
 static void omap_write_buf_dma_pref(struct mtd_info *mtd,
const u_char *buf, int len)
 {
+   u_char *p = (u_char *)buf;
+
if (len <= mtd->oobsize)
-   omap_write_buf_pref(mtd, buf, len);
+   omap_write_buf_pref(mtd, p, len);
else
/* start transfer in DMA mode */
-   omap_nand_dma_transfer(mtd, buf, len, 0x1);
+   omap_nand_dma_transfer(mtd, p, len, 0x1);
 }

 /**
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module

2009-11-03 Thread Vimal Singh
On Tue, Nov 3, 2009 at 1:58 PM, Artem Bityutskiy  wrote:
> On Fri, 2009-10-30 at 14:57 +0530, Vimal Singh wrote:
>> Last time I forgot to 'git add' for 'arch/arm/mach-omap2/gpmc.c'... My bad.
>> Correct patch is below.
>>
>> -vimal
>>
>>
>> From: Vimal Singh 
>> Date: Fri, 30 Oct 2009 14:54:29 +0530
>> Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module
>>
>> Removing OMAP NAND driver, when loaded as a module, gives error and
>> does not get success. This fixes this and makes driver loadable and
>> removable run time.
>>
>> Signed-off-by: Vimal Singh 
>> ---
>>  arch/arm/mach-omap2/gpmc.c |    2 ++
>>  drivers/mtd/nand/omap2.c   |    5 -
>>  2 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
>> index 1587682..1d10b7b 100644
>> --- a/arch/arm/mach-omap2/gpmc.c
>> +++ b/arch/arm/mach-omap2/gpmc.c
>> @@ -88,6 +88,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
>>       reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>>       __raw_writel(val, reg_addr);
>>  }
>> +EXPORT_SYMBOL(gpmc_cs_write_reg);
>>
>>  u32 gpmc_cs_read_reg(int cs, int idx)
>>  {
>> @@ -96,6 +97,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
>>       reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>>       return __raw_readl(reg_addr);
>>  }
>> +EXPORT_SYMBOL(gpmc_cs_read_reg);
>
> Why do you export these?

These functions are called during prob. So, if not exported and driver
is compiled as a module compilation will break with error saying these
are not defined or not found.


-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] [OMAP3_PM] Fix omap zoom2 defconfig build error

2009-11-02 Thread Vimal Singh
On Mon, Nov 2, 2009 at 4:51 PM,   wrote:
> From: Manjunatha GK 
>
> The omap zoom2 defconfig build breaks on linux-omap-pm(with pm branch)
> when CONFIG_DEBUG_FS is not enabled. This patch fixes the build issue.
> Kernel booting tested on omap zoom2 board.
>
> Signed-off-by: Manjunatha GK 
> ---
>  arch/arm/mach-omap2/pm-debug.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
> index 767ebbc..3a42615 100644
> --- a/arch/arm/mach-omap2/pm-debug.c
> +++ b/arch/arm/mach-omap2/pm-debug.c
> @@ -625,4 +625,6 @@ arch_initcall(pm_dbg_init);
>
>  #else
>  void pm_dbg_update_time(struct powerdomain *pwrdm, int prev) {}
> +int pm_dbg_regset_init(int reg_set) {}
> +int pm_dbg_regset_save(int reg_set) {}

'return 0' to avoid compilation warning...

-- 
Regards,
Vimal Singh

>  #endif
> --
> 1.6.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] NAND: OMAP: Simplifying HWECC and removing unnecessary macros

2009-10-30 Thread Vimal Singh
I removed function description comments for 'omap_correct_data' by
mistake last time. Correcting that. Updated patch is below.

Sorry for noise.

-vimal

From: Vimal Singh 
Date: Fri, 30 Oct 2009 17:41:55 +0530
Subject: [PATCH] NAND: OMAP: Simplifying HWECC and removing unnecessary macros

Removing number of macros from the top, which were being used
for generating ture ECC earlier. And simplifying the hwecc
correction methode. The idea is taken from:
<http://git.denx.de/?p=u-boot/u-boot-arm.git;a=blob;f=drivers/mtd/nand/omap_gpmc.c;h=99b9cef17c29ecf73ef3b844474a5b196f29eeff;hb=4bc3d2afb380e78fdbb9c501d9a8da6d59eb178e>

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |  293 --
 1 files changed, 100 insertions(+), 193 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index ecc4d32..a586dcf 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -40,73 +40,6 @@
 #defineGPMC_BUF_FULL   0x0001
 #defineGPMC_BUF_EMPTY  0x

-#define NAND_Ecc_P1e   (1 << 0)
-#define NAND_Ecc_P2e   (1 << 1)
-#define NAND_Ecc_P4e   (1 << 2)
-#define NAND_Ecc_P8e   (1 << 3)
-#define NAND_Ecc_P16e  (1 << 4)
-#define NAND_Ecc_P32e  (1 << 5)
-#define NAND_Ecc_P64e  (1 << 6)
-#define NAND_Ecc_P128e (1 << 7)
-#define NAND_Ecc_P256e (1 << 8)
-#define NAND_Ecc_P512e (1 << 9)
-#define NAND_Ecc_P1024e(1 << 10)
-#define NAND_Ecc_P2048e(1 << 11)
-
-#define NAND_Ecc_P1o   (1 << 16)
-#define NAND_Ecc_P2o   (1 << 17)
-#define NAND_Ecc_P4o   (1 << 18)
-#define NAND_Ecc_P8o   (1 << 19)
-#define NAND_Ecc_P16o  (1 << 20)
-#define NAND_Ecc_P32o  (1 << 21)
-#define NAND_Ecc_P64o  (1 << 22)
-#define NAND_Ecc_P128o (1 << 23)
-#define NAND_Ecc_P256o (1 << 24)
-#define NAND_Ecc_P512o (1 << 25)
-#define NAND_Ecc_P1024o(1 << 26)
-#define NAND_Ecc_P2048o(1 << 27)
-
-#define TF(value)  (value ? 1 : 0)
-
-#define P2048e(a)  (TF(a & NAND_Ecc_P2048e)<< 0)
-#define P2048o(a)  (TF(a & NAND_Ecc_P2048o)<< 1)
-#define P1e(a) (TF(a & NAND_Ecc_P1e)   << 2)
-#define P1o(a) (TF(a & NAND_Ecc_P1o)   << 3)
-#define P2e(a) (TF(a & NAND_Ecc_P2e)   << 4)
-#define P2o(a) (TF(a & NAND_Ecc_P2o)   << 5)
-#define P4e(a) (TF(a & NAND_Ecc_P4e)   << 6)
-#define P4o(a) (TF(a & NAND_Ecc_P4o)   << 7)
-
-#define P8e(a) (TF(a & NAND_Ecc_P8e)   << 0)
-#define P8o(a) (TF(a & NAND_Ecc_P8o)   << 1)
-#define P16e(a)(TF(a & NAND_Ecc_P16e)  << 2)
-#define P16o(a)(TF(a & NAND_Ecc_P16o)  << 3)
-#define P32e(a)(TF(a & NAND_Ecc_P32e)  << 4)
-#define P32o(a)(TF(a & NAND_Ecc_P32o)  << 5)
-#define P64e(a)(TF(a & NAND_Ecc_P64e)  << 6)
-#define P64o(a)(TF(a & NAND_Ecc_P64o)  << 7)
-
-#define P128e(a)   (TF(a & NAND_Ecc_P128e) << 0)
-#define P128o(a)   (TF(a & NAND_Ecc_P128o) << 1)
-#define P256e(a)   (TF(a & NAND_Ecc_P256e) << 2)
-#define P256o(a)   (TF(a & NAND_Ecc_P256o) << 3)
-#define P512e(a)   (TF(a & NAND_Ecc_P512e) << 4)
-#define P512o(a)   (TF(a & NAND_Ecc_P512o) << 5)
-#define P1024e(a)  (TF(a & NAND_Ecc_P1024e)<< 6)
-#define P1024o(a)  (TF(a & NAND_Ecc_P1024o)<< 7)
-
-#define P8e_s(a)   (TF(a & NAND_Ecc_P8e)   << 0)
-#define P8o_s(a)   (TF(a & NAND_Ecc_P8o)   << 1)
-#define P16e_s(a)  (TF(a & NAND_Ecc_P16e)  << 2)
-#define P16o_s(a)  (TF(a & NAND_Ecc_P16o)  << 3)
-#define P1e_s(a)   (TF(a & NAND_Ecc_P1e)   << 4)
-#define P1o_s(a)   (TF(a & NAND_Ecc_P1o)   << 5)
-#define P2e_s(a)   (TF(a & NAND_Ecc_P2e)   << 6)
-#define P2o_s(a)   (TF(a & NAND_Ecc_P2o)   << 7)
-
-#define P4e_s(a)   (TF(a & NAND_Ecc_P4e)   << 0)
-#define P4o_s(a)   (TF(a & NAND_Ecc_P4o)   << 1)
-
 #ifdef CONFIG_MTD_PARTITIONS
 static const char *part_probes[] = { "cmdlinepart", NULL };
 #endif
@@ -558,148 +491,122 @@ static void omap_hwecc_init(struct mtd_info *mtd)

 /**
  * gen_t

Re: [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module

2009-10-30 Thread Vimal Singh
Last time I forgot to 'git add' for 'arch/arm/mach-omap2/gpmc.c'... My bad.
Correct patch is below.

-vimal


From: Vimal Singh 
Date: Fri, 30 Oct 2009 14:54:29 +0530
Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module

Removing OMAP NAND driver, when loaded as a module, gives error and
does not get success. This fixes this and makes driver loadable and
removable run time.

Signed-off-by: Vimal Singh 
---
 arch/arm/mach-omap2/gpmc.c |2 ++
 drivers/mtd/nand/omap2.c   |5 -
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 1587682..1d10b7b 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -88,6 +88,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);

 u32 gpmc_cs_read_reg(int cs, int idx)
 {
@@ -96,6 +97,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
return __raw_readl(reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_read_reg);

 /* TODO: Add support for gpmc_fck to clock framework and use it */
 unsigned long gpmc_get_fclk_period(void)
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 92573d5..ecc4d32 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1056,7 +1056,8 @@ out_free_info:
 static int omap_nand_remove(struct platform_device *pdev)
 {
struct mtd_info *mtd = platform_get_drvdata(pdev);
-   struct omap_nand_info *info = mtd->priv;
+   struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
+   mtd);

platform_set_drvdata(pdev, NULL);
if (use_dma)
@@ -1064,7 +1065,9 @@ static int omap_nand_remove(struct platform_device *pdev)

/* Release NAND device, its internal structures and partitions */
nand_release(&info->mtd);
+   release_mem_region(info->phys_base, NAND_IO_SIZE);
iounmap(info->nand_pref_fifo_add);
+   gpmc_cs_free(info->gpmc_cs);
kfree(&info->mtd);
return 0;
 }
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] NAND: OMAP: Simplifying HWECC and removing unnecessary macros

2009-10-30 Thread Vimal Singh
Looping Linunx-omap mailing list.


From: Vimal Singh 
Date: Fri, 30 Oct 2009 11:33:34 +0530
Subject: [PATCH] NAND: OMAP: Simplifying HWECC and removing unnecessary macros

Removing number of macros from the top, which were being used
for generating ture ECC earlier. And simplifying the hwecc
correction methode. The idea is taken from:
<http://git.denx.de/?p=u-boot/u-boot-arm.git;a=blob;f=drivers/mtd/nand/omap_gpmc.c;h=99b9cef17c29ecf73ef3b844474a5b196f29eeff;hb=4bc3d2afb380e78fdbb9c501d9a8da6d59eb178e>

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |  304 +++---
 1 files changed, 100 insertions(+), 204 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index ecc4d32..595926b 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -40,73 +40,6 @@
 #defineGPMC_BUF_FULL   0x0001
 #defineGPMC_BUF_EMPTY  0x

-#define NAND_Ecc_P1e   (1 << 0)
-#define NAND_Ecc_P2e   (1 << 1)
-#define NAND_Ecc_P4e   (1 << 2)
-#define NAND_Ecc_P8e   (1 << 3)
-#define NAND_Ecc_P16e  (1 << 4)
-#define NAND_Ecc_P32e  (1 << 5)
-#define NAND_Ecc_P64e  (1 << 6)
-#define NAND_Ecc_P128e (1 << 7)
-#define NAND_Ecc_P256e (1 << 8)
-#define NAND_Ecc_P512e (1 << 9)
-#define NAND_Ecc_P1024e(1 << 10)
-#define NAND_Ecc_P2048e(1 << 11)
-
-#define NAND_Ecc_P1o   (1 << 16)
-#define NAND_Ecc_P2o   (1 << 17)
-#define NAND_Ecc_P4o   (1 << 18)
-#define NAND_Ecc_P8o   (1 << 19)
-#define NAND_Ecc_P16o  (1 << 20)
-#define NAND_Ecc_P32o  (1 << 21)
-#define NAND_Ecc_P64o  (1 << 22)
-#define NAND_Ecc_P128o (1 << 23)
-#define NAND_Ecc_P256o (1 << 24)
-#define NAND_Ecc_P512o (1 << 25)
-#define NAND_Ecc_P1024o(1 << 26)
-#define NAND_Ecc_P2048o(1 << 27)
-
-#define TF(value)  (value ? 1 : 0)
-
-#define P2048e(a)  (TF(a & NAND_Ecc_P2048e)<< 0)
-#define P2048o(a)  (TF(a & NAND_Ecc_P2048o)<< 1)
-#define P1e(a) (TF(a & NAND_Ecc_P1e)   << 2)
-#define P1o(a) (TF(a & NAND_Ecc_P1o)   << 3)
-#define P2e(a) (TF(a & NAND_Ecc_P2e)   << 4)
-#define P2o(a) (TF(a & NAND_Ecc_P2o)   << 5)
-#define P4e(a) (TF(a & NAND_Ecc_P4e)   << 6)
-#define P4o(a) (TF(a & NAND_Ecc_P4o)   << 7)
-
-#define P8e(a) (TF(a & NAND_Ecc_P8e)   << 0)
-#define P8o(a) (TF(a & NAND_Ecc_P8o)   << 1)
-#define P16e(a)(TF(a & NAND_Ecc_P16e)  << 2)
-#define P16o(a)(TF(a & NAND_Ecc_P16o)  << 3)
-#define P32e(a)(TF(a & NAND_Ecc_P32e)  << 4)
-#define P32o(a)(TF(a & NAND_Ecc_P32o)  << 5)
-#define P64e(a)(TF(a & NAND_Ecc_P64e)  << 6)
-#define P64o(a)(TF(a & NAND_Ecc_P64o)  << 7)
-
-#define P128e(a)   (TF(a & NAND_Ecc_P128e) << 0)
-#define P128o(a)   (TF(a & NAND_Ecc_P128o) << 1)
-#define P256e(a)   (TF(a & NAND_Ecc_P256e) << 2)
-#define P256o(a)   (TF(a & NAND_Ecc_P256o) << 3)
-#define P512e(a)   (TF(a & NAND_Ecc_P512e) << 4)
-#define P512o(a)   (TF(a & NAND_Ecc_P512o) << 5)
-#define P1024e(a)  (TF(a & NAND_Ecc_P1024e)<< 6)
-#define P1024o(a)  (TF(a & NAND_Ecc_P1024o)<< 7)
-
-#define P8e_s(a)   (TF(a & NAND_Ecc_P8e)   << 0)
-#define P8o_s(a)   (TF(a & NAND_Ecc_P8o)   << 1)
-#define P16e_s(a)  (TF(a & NAND_Ecc_P16e)  << 2)
-#define P16o_s(a)  (TF(a & NAND_Ecc_P16o)  << 3)
-#define P1e_s(a)   (TF(a & NAND_Ecc_P1e)   << 4)
-#define P1o_s(a)   (TF(a & NAND_Ecc_P1o)   << 5)
-#define P2e_s(a)   (TF(a & NAND_Ecc_P2e)   << 6)
-#define P2o_s(a)   (TF(a & NAND_Ecc_P2o)   << 7)
-
-#define P4e_s(a)   (TF(a & NAND_Ecc_P4e)   << 0)
-#define P4o_s(a)   (TF(a & NAND_Ecc_P4o)   << 1)
-
 #ifdef CONFIG_MTD_PARTITIONS
 static const char *part_probes[] = { "cmdlinepart", NULL };
 #endif
@@ -558,161 +491,124 @@ static void omap_hwecc_init(struct mtd_info *mtd)

 /**
  * gen_true_ecc - This function will generate true ECC value
- * @ecc_buf: buffer to store ecc code
+ * @ecc_buf:   buffer to stor

Re: [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module

2009-10-30 Thread Vimal Singh
Looping Linux-omap mailing list.


From: Vimal Singh 
Date: Fri, 30 Oct 2009 11:32:17 +0530
Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module

Removing OMAP NAND driver, when loaded as a module, gives error and
does not get success. This fixes this and makes driver loadable and
removable run time.

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 92573d5..ecc4d32 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1056,7 +1056,8 @@ out_free_info:
 static int omap_nand_remove(struct platform_device *pdev)
 {
struct mtd_info *mtd = platform_get_drvdata(pdev);
-   struct omap_nand_info *info = mtd->priv;
+   struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
+   mtd);

platform_set_drvdata(pdev, NULL);
if (use_dma)
@@ -1064,7 +1065,9 @@ static int omap_nand_remove(struct platform_device *pdev)

/* Release NAND device, its internal structures and partitions */
nand_release(&info->mtd);
+   release_mem_region(info->phys_base, NAND_IO_SIZE);
iounmap(info->nand_pref_fifo_add);
+   gpmc_cs_free(info->gpmc_cs);
kfree(&info->mtd);
return 0;
 }
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Fixing compilation warning for 'nand/omap2.c'

2009-10-30 Thread Vimal Singh
Looping Linux-omap mailing list.


From: Vimal Singh 
Date: Fri, 30 Oct 2009 11:31:34 +0530
Subject: [PATCH] Fixing compilation warning for 'nand/omap2.c'

Fixing below warning in compilation:
drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
'omap_nand_dma_transfer' discards qualifiers from pointer target type

Signed-off-by: Vimal Singh 
---
 drivers/mtd/nand/omap2.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 090ab87..92573d5 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -501,11 +501,13 @@ static void omap_read_buf_dma_pref(struct
mtd_info *mtd, u_char *buf, int len)
 static void omap_write_buf_dma_pref(struct mtd_info *mtd,
const u_char *buf, int len)
 {
+   u_char *p = (u_char *)buf;
+
if (len <= mtd->oobsize)
-   omap_write_buf_pref(mtd, buf, len);
+   omap_write_buf_pref(mtd, p, len);
else
/* start transfer in DMA mode */
-   omap_nand_dma_transfer(mtd, buf, len, 0x1);
+   omap_nand_dma_transfer(mtd, p, len, 0x1);
 }

 /**
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] NAND: OMAP: Fix and clean NAND driver

2009-10-30 Thread Vimal Singh
Looping Linux-omap mailing list.


From: Vimal Singh 
Date: Fri, 30 Oct 2009 11:34:14 +0530
Subject: [PATCH 0/3] NAND: OMAP: Fix and clean NAND driver

This patch series addresses some of the issues in omap nand driver.

Vimal Singh (3):
 Fixing compilation warning for 'nand/omap2.c'
 NAND: OMAP: Fixing omap nand driver, compiled as module
 NAND: OMAP: Simplifying HWECC and removing unnecessary macros

 drivers/mtd/nand/omap2.c |  315 --
 1 files changed, 108 insertions(+), 207 deletions(-)

--
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] OMAP: 3430SDP: Enable NAND in defconfig

2009-10-26 Thread Vimal Singh
>From 7f9c36fb821c2a836508be712e8247d6b283acfe Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Mon, 26 Oct 2009 17:23:57 +0530
Subject: [PATCH] OMAP: 3430SDP: Enable NAND in defconfig

Enable NAND options by default in 3430sdp_defconfig file
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_3430sdp_defconfig |  574 ++-
 1 files changed, 261 insertions(+), 313 deletions(-)

diff --git a/arch/arm/configs/omap_3430sdp_defconfig
b/arch/arm/configs/omap_3430sdp_defconfig
index 8a4a7e2..26abfe4 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -1,15 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Tue Jun 23 10:36:45 2009
+# Linux kernel version: 2.6.32-rc5
+# Mon Oct 26 17:10:53 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +16,14 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_OPROFILE_ARMV7=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -47,11 +45,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -67,6 +66,9 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_ANON_INODES=y
@@ -88,6 +90,10 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLUB_DEBUG=y
 # CONFIG_COMPAT_BRK is not set
@@ -96,13 +102,18 @@ CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 CONFIG_PROFILING=y
 CONFIG_TRACEPOINTS=y
-# CONFIG_MARKERS is not set
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+# CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -114,8 +125,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-CONFIG_LBD=y
-# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -136,18 +146,22 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,24 +170,27 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
-# CONFIG_ARCH_MSM is not set
-# CONFIG_ARCH_W90X900 is not set
+# CO

[PATCH-v4 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

2009-10-26 Thread Vimal Singh
>From d99d0bb2f2bf1d6a1b8197daf93634dc5a9fa16f Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Mon, 26 Oct 2009 16:56:16 +0530
Subject: [PATCH] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

Enable NAND and JFFS2 options by default in zoom2_defconfig file
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_zoom2_defconfig |  334 -
 1 files changed, 244 insertions(+), 90 deletions(-)

diff --git a/arch/arm/configs/omap_zoom2_defconfig
b/arch/arm/configs/omap_zoom2_defconfig
index f1739fa..c441a58 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -1,15 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Fri Jun 12 17:25:46 2009
+# Linux kernel version: 2.6.32-rc5
+# Mon Oct 26 15:12:53 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -46,11 +44,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_GROUP_SCHED=y
@@ -77,7 +76,6 @@ CONFIG_UID16=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
@@ -90,18 +88,25 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
 # CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
@@ -114,7 +119,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-# CONFIG_LBD is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -135,19 +140,22 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,25 +164,27 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
-# CONFIG_ARCH_MSM is not set
-# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_BCMRING is not set

 #
 # TI OMAP Implementations
@@ -203,20 +213,23 @@ CONFIG_OMAP_DM_TIMER=y
 # CONFIG_OMAP_LL_DEBUG_UART1 is not set
 # CONFIG_OMAP_LL_DEBU

[PATCH-v4 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-10-26 Thread Vimal Singh
>From 76e86c500e247e231c975f0a5bf01e832bf460d6 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Mon, 26 Oct 2009 14:25:26 +0530
Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards

Adding NAND support for ZOOM2 and LDP board. I have tested it for ZOOM2 boards,
someone can verify it for LDP, hopefully it should not have any problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
   Future boards will be called Zoom2/3/4 etc.
   LDP is a Zoom1. Somhow the LDP name got stuck to that.

Signed-off-by: Vimal Singh 
Signed-off-by: Vikram Pandita 
---
 arch/arm/mach-omap2/Makefile |2 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 ++
 arch/arm/mach-omap2/board-zoom2.c|2 +
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 +
 arch/arm/plat-omap/include/plat/nand.h   |2 +
 6 files changed, 240 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 627f500..b3a9d1c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += 
board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_CM_T35)  += board-cm-t35.o \
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c062238..8aebdf9 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "mmc-twl4030.h"

@@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
b/arch/arm/mach-omap2/board-zoom-flash.c
new file mode 100644
index 000..1406a57
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,196 @@
+/*
+ * arch/arm/mach-omap2/board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Rohit Choraria 
+ *    Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define NAND_CMD_UNLOCK1   0x23
+#define NAND_CMD_UNLOCK2   0x24
+/**
+ * @brief platform specific unlock function
+ *
+ * @param mtd - mtd info
+ * @param ofs - offset to start unlock from
+ * @param len - length to unlock
+ *
+ * @return - unlock status
+ */
+static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
+{
+   int ret = 0;
+   int chipnr;
+   int status;
+   unsigned long page;
+   struct nand_chip *this = mtd->priv;
+   printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
+   (int)ofs, (int)len);
+
+   /* select the NAND device */
+   chipnr = (int)(ofs >> this->chip_shift);
+   this->select_chip(mtd, chipnr);
+   /* check the WP bit */
+   this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
+   if ((this->read_byte(mtd) & 0x80) == 0) {
+   printk(KERN_ERR "nand_unlock: Device is write protected!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if ((ofs & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Start address must be"
+   "beginning of nand page!\n");
+   ret = -EINVAL;
+   goto out;
+   }

[PATCH-v4 1/4] OMAP2/3: Add support for flash on SDP boards

2009-10-26 Thread Vimal Singh
>From 92c416f513df62cc0ad75b61639df27f2857b641 Mon Sep 17 00:00:00 2001
From: Vimal Singh 
Date: Mon, 26 Oct 2009 14:24:18 +0530
Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards

Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.

Signed-off-by: Vimal Singh 
Cc: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile|2 +
 arch/arm/mach-omap2/board-2430sdp.c |2 +
 arch/arm/mach-omap2/board-3430sdp.c |2 +
 arch/arm/mach-omap2/board-sdp-flash.c   |  327 +++
 arch/arm/plat-omap/include/plat/board-sdp.h |   15 ++
 arch/arm/plat-omap/include/plat/gpmc.h  |2 +
 6 files changed, 350 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 03cb4fc..627f500 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -66,6 +67,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-omap3evm.o \
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
diff --git a/arch/arm/mach-omap2/board-2430sdp.c
b/arch/arm/mach-omap2/board-2430sdp.c
index db9374b..5676ab9 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include 
 #include 

+#include 
 #include "mmc-twl4030.h"

 #define SDP2430_CS0_BASE   0x0400
@@ -205,6 +206,7 @@ static void __init omap_2430sdp_init(void)
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
diff --git a/arch/arm/mach-omap2/board-3430sdp.c
b/arch/arm/mach-omap2/board-3430sdp.c
index a3c1271..4497ded 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#include 
 #include "sdram-qimonda-hyb18m512160af-6.h"
 #include "mmc-twl4030.h"

@@ -511,6 +512,7 @@ static void __init omap_3430sdp_init(void)
omap_serial_init();
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
 }
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c
b/arch/arm/mach-omap2/board-sdp-flash.c
new file mode 100644
index 000..a19327d
--- /dev/null
+++ b/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,327 @@
+/*
+ * arch/arm/mach-omap2/board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2007 Texas Instruments
+ *
+ * Modified from mach-omap2/board-3430sdp-flash.c
+ * Author: Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define REG_FPGA_REV   0x10
+#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
+#define MAX_SUPPORTED_GPMC_CONFIG  3
+
+/* various memory sizes */
+#define FLASH_SIZE_SDPV1   SZ_64M
+#define FLASH_SIZE_SDPV2   SZ_128M
+
+#define FLASH_BASE_SDPV1   0x0400 /* NOR flash (64 Meg aligned) */
+#define FLASH_BASE_SDPV2   0x1000 /* NOR flash (256 Meg aligned) */
+
+#define DEBUG_BASE 

[PATCH-v4 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-10-26 Thread Vimal Singh
I posted a patch series for this sometime back and did not get any respose.. :(
http://marc.info/?l=linux-omap&m=125258227301958&w=2

This time again I am posting these patches, with one more patch added
in series, after re-basing the patches on top of LO master head.

This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
OneNAND and NOR (in sdp)

Tested on Zoom2 by Vikram, On SDP by Vimal

[PATCH-v4 1/4] OMAP2/3: Add support for flash on SDP boards
[PATCH-v4 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
[PATCH-v4 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
[PATCH 4/4] OMAP: 3430SDP: Enable NAND in defconfig

 arch/arm/configs/omap_3430sdp_defconfig  |  574 +++--
 arch/arm/configs/omap_zoom2_defconfig|  334 ++
 arch/arm/mach-omap2/Makefile |2
 arch/arm/mach-omap2/board-2430sdp.c  |2
 arch/arm/mach-omap2/board-3430sdp.c  |2
 arch/arm/mach-omap2/board-ldp.c  |2
 arch/arm/mach-omap2/board-sdp-flash.c|  327 ++
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 
 arch/arm/mach-omap2/board-zoom2.c|2
 arch/arm/plat-omap/include/plat/board-sdp.h  |   15
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 +
 arch/arm/plat-omap/include/plat/gpmc.h   |2
 arch/arm/plat-omap/include/plat/nand.h   |2
 14 files changed, 1095 insertions(+), 403 deletions(-)

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3: Fix McBSP poll read and write for 32bit reg access

2009-10-14 Thread vimal singh
 clear the error */
> -       if (readw(base + OMAP_MCBSP_REG_SPCR1) & RSYNC_ERR) {
> +       if (OMAP_MCBSP_READ(base, SPCR1) & RSYNC_ERR) {
>                /* clear error */
> -               writew(readw(base + OMAP_MCBSP_REG_SPCR1) & (~RSYNC_ERR),
> -                      base + OMAP_MCBSP_REG_SPCR1);
> +               OMAP_MCBSP_WRITE(base, SPCR1, OMAP_MCBSP_READ(base, SPCR1)
> +                                       & (~RSYNC_ERR));
>                /* resend */
>                return -1;
>        } else {
>                /* wait for recieve confirmation */
>                int attemps = 0;
> -               while (!(readw(base + OMAP_MCBSP_REG_SPCR1) & RRDY)) {
> -                       if (attemps++ > 1000) {
> -                               writew(readw(base + OMAP_MCBSP_REG_SPCR1) &
> -                                      (~RRST),
> -                                      base + OMAP_MCBSP_REG_SPCR1);
> +               while (!(OMAP_MCBSP_READ(base, SPCR1) & RRDY)) {
> +                       if (attemps++ > 1) {
> +                               OMAP_MCBSP_WRITE(base, SPCR1,
> +                                       OMAP_MCBSP_READ(base, SPCR1) & 
> (~RRST));
>                                udelay(10);
> -                               writew(readw(base + OMAP_MCBSP_REG_SPCR1) |
> -                                      (RRST),
> -                                      base + OMAP_MCBSP_REG_SPCR1);
> +                               OMAP_MCBSP_WRITE(base, SPCR1,
> +                                       OMAP_MCBSP_READ(base, SPCR1) | 
> (RRST));
>                                udelay(10);
>                                dev_err(mcbsp->dev, "Could not read from"
>                                        " McBSP%d Register\n", mcbsp->id);
> @@ -696,7 +692,7 @@ int omap_mcbsp_pollread(unsigned int id, u16 *buf)
>                        }
>                }
>        }
> -       *buf = readw(base + OMAP_MCBSP_REG_DRR1);
> +       *buf = OMAP_MCBSP_READ(base, DRR);
>
>        return 0;
>  }
> --
> 1.6.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v3 0/3] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-09-25 Thread vimal singh
Tony,

Can you please upstream these patches, or there is still something to fix?

--vimal

On Thu, Sep 10, 2009 at 4:31 AM, vimal singh  wrote:
> This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
> OneNAND and NOR (in sdp)
>
> Tested on Zoom2 by Vikram, On SDP by Vimal
>
>  OMAP: Zoom2: Enable NAND and JFFS2 in defconfig
>  OMAP2/3: Add support for flash on SDP boards
>  OMAP3: Add support for NAND on ZOOM2/LDP boards
>
>  arch/arm/omap_zoom2_defconfig |  241 
> +--
>  arch/arm/mach-omap2/Makefile            |    4
>  arm/mach-omap2/board-2430sdp.c          |    2
>  arch/arm/mach-omap2/board-3430sdp.c     |    2
>  arch/arm/mach-omap2/board-sdp-flash.c   |  327 
> ++
>  arch/arm/mach-omap2/board-sdp.h         |   15 +
>  arch/arm/plat-omap/include/mach/gpmc.h  |    2
>  arch/arm/mach-omap2/board-ldp.c              |    2
>  arch/arm/mach-omap2/board-zoom-flash.c       |  196 
> 
>  arch/arm/mach-omap2/board-zoom2.c            |    2
>  arch/arm/plat-omap/include/mach/board-zoom.h |   36 ++
>  arch/arm/plat-omap/include/mach/nand.h       |    2
>  12 files changed, 767 insertions(+), 64 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
>  create mode 100644 arch/arm/mach-omap2/board-sdp.h
>  create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
>  create mode 100644 arch/arm/plat-omap/include/mach/board-zoom.h
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] mfd: restoring twl4030 power-off and power-button capabilities

2009-09-25 Thread vimal singh
Hi Tony,

Since there are no comments on these patches, can these go upstream?
Or, is there something to fix?

--vimal

On Thu, Sep 3, 2009 at 8:11 AM, vimal singh  wrote:
> This patch series restores the TWL Power-button and Power-off capabilities.
> Which were removed in "REMOVE OMAP LEGACY CODE" patches.
>
> Patches are compile tested only.
>
> [PATCH 1/2]: twl4030: register twl4030-pwrbuttonas a child of twl4030-core.c
> [PATCH 2/2]: twl4030: initialization of pm_power_off in twl4030-core.c
>
> Both patches are based on Felipe Balbi's patches posted earlier.
> http://lkml.org/lkml/2009/2/28/88
> http://markmail.org/message/ts4if3553qnauket
>
> --
> Vimal
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v3 3/3] OMAP: Zoom2: Enable NAND in defconfig

2009-09-10 Thread vimal singh
From: Vimal Singh 

Enable NAND options by default in zoom2_defconfig file
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vikram Pandita 
Signed-off-by: Vimal Singh 
---
 arch/arm/configs/omap_zoom2_defconfig |  241 --
 1 files changed, 177 insertions(+), 64 deletions(-)

Index: linux-omap-2.6/arch/arm/configs/omap_zoom2_defconfig
===
--- linux-omap-2.6.orig/arch/arm/configs/omap_zoom2_defconfig
+++ linux-omap-2.6/arch/arm/configs/omap_zoom2_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Fri Jun 12 17:25:46 2009
+# Linux kernel version: 2.6.31-rc9-omap1
+# Thu Sep 10 15:27:16 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -9,7 +9,6 @@ CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +17,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -77,7 +75,6 @@ CONFIG_UID16=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
@@ -90,7 +87,12 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Performance Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
@@ -102,6 +104,10 @@ CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
 # CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
@@ -114,7 +120,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-# CONFIG_LBD is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -141,13 +147,14 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,25 +163,25 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
-# CONFIG_ARCH_MSM is not set
-# CONFIG_ARCH_W90X900 is not set

 #
 # TI OMAP Implementations
@@ -203,19 +210,21 @@ CONFIG_OMAP_DM_TIMER=y
 # CONFIG_OMAP_LL_DEBUG_UART1 is not set
 # CONFIG_OMAP_LL_DEBUG_UART2 is not set
 CONFIG_OMAP_LL_DEBUG_UART3=y
+# CONFIG_OMAP_PM_NONE is not set
+CONFIG_OMAP_PM_NOOP=y
 CONFIG_ARCH_OMAP34XX=y
 CONFIG_ARCH_OMAP3430=y

 #
 # OMAP Board Type
 #
-# CONFIG_MACH_NOKIA_RX51 is not set
-# CONFIG_MACH_OMAP_LDP is not set
-# CONFIG_MACH_OMAP_3430SDP is not set
-# CONFIG_MACH_OMAP3EVM is not set
 # CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OMAP_LDP is not set
 # CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3EVM is not set
 # CONFIG_MACH_OMAP3_PANDORA is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_NOKIA_RX51 is not set
 CONFIG_MACH_OMAP_ZOOM2=y

 #
@@ -244,7 +253,6 @@ CONFIG_ARM_THUMB=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_BPREDICT_DISABLE is not set
 CONFIG_HAS_TLS_REG=y
-# CONFIG_OUTER_CACHE is not set
 # CONFIG_ARM_ERRATA_430973 is not set
 # CONFIG_ARM_ERRATA_458693 is not set
 # CONFIG_ARM_ERRATA_460075 is not set
@

[PATCH-v3 2/3] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-09-10 Thread vimal singh
Sorry I clicked on -send- button without $SUBJECT. Correcting this time.

-vimal

From: Vimal Singh 

Adding NAND support for ZOOM2 and LDP board. I have tested it for ZOOM2 boards,
someone can verify it for LDP, hopefully it should not have any problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
Future boards will be called Zoom2/3/4 etc.
LDP is a Zoom1. Somhow the LDP name got stuck to that.

In v-3: Corrected prototype of 'unlock' function pointer in structure
'omap_nand_platform_data'.

Signed-off-by: Vimal Singh 
Signed-off-by: Vikram Pandita 
---
 arch/arm/mach-omap2/Makefile |2
 arch/arm/mach-omap2/board-ldp.c  |2
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 +++
 arch/arm/mach-omap2/board-zoom2.c|2
 arch/arm/plat-omap/include/mach/board-zoom.h |   36 
 arch/arm/plat-omap/include/mach/nand.h   |2
 6 files changed, 240 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += boar
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o

Index: linux-omap-2.6/arch/arm/mach-omap2/board-ldp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-ldp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "mmc-twl4030.h"

@@ -381,6 +382,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
Index: linux-omap-2.6/arch/arm/mach-omap2/board-zoom-flash.c
===
--- /dev/null
+++ linux-omap-2.6/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,196 @@
+/*
+ * arch/arm/mach-omap2/board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Rohit Choraria 
+ *Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define NAND_CMD_UNLOCK1   0x23
+#define NAND_CMD_UNLOCK2   0x24
+/**
+ * @brief platform specific unlock function
+ *
+ * @param mtd - mtd info
+ * @param ofs - offset to start unlock from
+ * @param len - length to unlock
+ *
+ * @return - unlock status
+ */
+static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
+{
+   int ret = 0;
+   int chipnr;
+   int status;
+   unsigned long page;
+   struct nand_chip *this = mtd->priv;
+   printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
+   (int)ofs, (int)len);
+
+   /* select the NAND device */
+   chipnr = (int)(ofs >> this->chip_shift);
+   this->select_chip(mtd, chipnr);
+   /* check the WP bit */
+   this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
+   if ((this->read_byte(mtd) & 0x80) == 0) {
+   printk(KERN_ERR "nand_unlock: Device is write protected!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if ((ofs & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Start address must be"
+   "beginning of nand page!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
+   pr

[no subject]

2009-09-10 Thread vimal singh
From: Vimal Singh 

Adding NAND support for ZOOM2 and LDP board. I have tested it for ZOOM2
boards, someone can verify it for LDP, hopefully it should not have any
problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
Future boards will be called Zoom2/3/4 etc.
LDP is a Zoom1. Somhow the LDP name got stuck to that.

In v-3: Corrected prototype of 'unlock' function pointer in structure
'omap_nand_platform_data'.

Signed-off-by: Vimal Singh 
Signed-off-by: Vikram Pandita 
---
 arch/arm/mach-omap2/Makefile |2
 arch/arm/mach-omap2/board-ldp.c  |2
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 +++
 arch/arm/mach-omap2/board-zoom2.c|2
 arch/arm/plat-omap/include/mach/board-zoom.h |   36 
 arch/arm/plat-omap/include/mach/nand.h   |2
 6 files changed, 240 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += boar
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o

Index: linux-omap-2.6/arch/arm/mach-omap2/board-ldp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-ldp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "mmc-twl4030.h"

@@ -381,6 +382,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
Index: linux-omap-2.6/arch/arm/mach-omap2/board-zoom-flash.c
===
--- /dev/null
+++ linux-omap-2.6/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,196 @@
+/*
+ * arch/arm/mach-omap2/board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Rohit Choraria 
+ *Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define NAND_CMD_UNLOCK1   0x23
+#define NAND_CMD_UNLOCK2   0x24
+/**
+ * @brief platform specific unlock function
+ *
+ * @param mtd - mtd info
+ * @param ofs - offset to start unlock from
+ * @param len - length to unlock
+ *
+ * @return - unlock status
+ */
+static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
+{
+   int ret = 0;
+   int chipnr;
+   int status;
+   unsigned long page;
+   struct nand_chip *this = mtd->priv;
+   printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
+   (int)ofs, (int)len);
+
+   /* select the NAND device */
+   chipnr = (int)(ofs >> this->chip_shift);
+   this->select_chip(mtd, chipnr);
+   /* check the WP bit */
+   this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
+   if ((this->read_byte(mtd) & 0x80) == 0) {
+   printk(KERN_ERR "nand_unlock: Device is write protected!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if ((ofs & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Start address must be"
+   "beginning of nand page!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Length must be a multiple of "
+

[PATCH-v3 1/3 ] OMAP2/3: Add support for flash on SDP boards

2009-09-10 Thread vimal singh
From: Vimal Singh 

Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.

Signed-off-by: Vimal Singh 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile   |2
 arch/arm/mach-omap2/board-2430sdp.c|2
 arch/arm/mach-omap2/board-3430sdp.c|2
 arch/arm/mach-omap2/board-sdp-flash.c  |  327 +
 arch/arm/mach-omap2/board-sdp.h|   15 +
 arch/arm/plat-omap/include/mach/gpmc.h |2
 6 files changed, 350 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -66,6 +67,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-om
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
Index: linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-2430sdp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include 
 #include 

+#include "board-sdp.h"
 #include "mmc-twl4030.h"

 #define SDP2430_CS0_BASE   0x0400
@@ -205,6 +206,7 @@ static void __init omap_2430sdp_init(voi
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#include "board-sdp.h"
 #include "sdram-qimonda-hyb18m512160af-6.h"
 #include "mmc-twl4030.h"

@@ -495,6 +496,7 @@ static void __init omap_3430sdp_init(voi
omap_serial_init();
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
enable_board_wakeup_source();
 }
Index: linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
===
--- /dev/null
+++ linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,327 @@
+/*
+ * arch/arm/mach-omap2/board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2007 Texas Instruments
+ *
+ * Modified from mach-omap2/board-3430sdp-flash.c
+ * Author: Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define REG_FPGA_REV   0x10
+#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
+#define MAX_SUPPORTED_GPMC_CONFIG  3
+
+/* various memory sizes */
+#define FLASH_SIZE_SDPV1   SZ_64M
+#define FLASH_SIZE_SDPV2   SZ_128M
+
+#define FLASH_BASE_SDPV1   0x0400 /* NOR flash (64 Meg aligned) */
+#define FLASH_BASE_SDPV2   0x1000 /* NOR flash (256 Meg aligned) */
+
+#define DEBUG_BASE 0x0800 /* debug board */
+
+#define PDC_NOR1
+#define PDC_NAND   2
+#define PDC_ONENAND3
+#define DBG_MPDB 

[PATCH-v3 0/3] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-09-10 Thread vimal singh
This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
OneNAND and NOR (in sdp)

Tested on Zoom2 by Vikram, On SDP by Vimal

  OMAP: Zoom2: Enable NAND and JFFS2 in defconfig
  OMAP2/3: Add support for flash on SDP boards
  OMAP3: Add support for NAND on ZOOM2/LDP boards

 arch/arm/omap_zoom2_defconfig |  241 
+--
 arch/arm/mach-omap2/Makefile|4
 arm/mach-omap2/board-2430sdp.c  |2
 arch/arm/mach-omap2/board-3430sdp.c |2
 arch/arm/mach-omap2/board-sdp-flash.c   |  327 
++
 arch/arm/mach-omap2/board-sdp.h |   15 +
 arch/arm/plat-omap/include/mach/gpmc.h  |2
 arch/arm/mach-omap2/board-ldp.c  |2
 arch/arm/mach-omap2/board-zoom-flash.c   |  196 

 arch/arm/mach-omap2/board-zoom2.c|2
 arch/arm/plat-omap/include/mach/board-zoom.h |   36 ++
 arch/arm/plat-omap/include/mach/nand.h   |2
 12 files changed, 767 insertions(+), 64 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/board-sdp.h
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/mach/board-zoom.h


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v2 0/3] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-09-10 Thread vimal singh
Hi Vikram,

I am going to post version-3 for these patches due to below updates/fixes:

PATCH 2/3: Add support for NAND on ZOOM2/LDP boards
1. prototype mismatch for 'unlock' funtion pointer in 'mach/nand.h and
in 'mtd_struct'
2. typo error (Singned -> Signed) indicated by Kishore.

PATCH 3/3: Zoom2: Enable NAND in defconfig
1. Disabling 'CONFIG_MTD_NAND_VERIFY_WRITE' and
'CONFIG_MTD_NAND_ECC_SMC' in from previous patch
2. Enabling CONFIG_JFFS2_FS in addition, to support NAND devices.

Patch 1/3:  Add support for flash on SDP boards
will remain unchanged.

-- 
Regards,
Vimal Singh


On Fri, Sep 4, 2009 at 12:55 AM, Vikram Pandita  wrote:
> This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
> OneNAND and NOR (in sdp)
>
> Tested on Zoom2 by Vikram, On SDP by Vimal
>
> Vikram Pandita (1):
>  OMAP: Zoom2: Enable NAND in defconfig
>
> Vimal Singh (2):
>  OMAP2/3: Add support for flash on SDP boards
>  OMAP3: Add support for NAND on ZOOM2/LDP boards
>
>  arch/arm/configs/omap_zoom2_defconfig        |  224 +-
>  arch/arm/mach-omap2/Makefile                 |    4 +
>  arch/arm/mach-omap2/board-2430sdp.c          |    2 +
>  arch/arm/mach-omap2/board-3430sdp.c          |    2 +
>  arch/arm/mach-omap2/board-ldp.c              |    2 +
>  arch/arm/mach-omap2/board-sdp-flash.c        |  326 
> ++
>  arch/arm/mach-omap2/board-sdp.h              |   15 ++
>  arch/arm/mach-omap2/board-zoom-flash.c       |  196 
>  arch/arm/mach-omap2/board-zoom2.c            |    2 +
>  arch/arm/plat-omap/include/mach/board-zoom.h |   36 +++
>  arch/arm/plat-omap/include/mach/gpmc.h       |    2 +
>  arch/arm/plat-omap/include/mach/nand.h       |    1 +
>  12 files changed, 748 insertions(+), 64 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
>  create mode 100644 arch/arm/mach-omap2/board-sdp.h
>  create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
>  create mode 100644 arch/arm/plat-omap/include/mach/board-zoom.h
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v3 1:2] [MTD][NAND]omap: Adding support for nand prefetch-read and post-write, in MPU mode.

2009-09-05 Thread vimal singh
Hi David,


On Tue, Aug 11, 2009 at 11:59 AM, vimal singh wrote:
> On Tue, Aug 11, 2009 at 11:51 AM, Artem Bityutskiy wrote:
>> On 08/11/2009 08:45 AM, vimal singh wrote:
>>>
>>> On Mon, Aug 10, 2009 at 9:57 PM, Tony Lindgren  wrote:
>>>>
>>>> * vimal singh  [090713 13:56]:
>>>>>
>>>>> Patch updated for ' ioreadX / iowriteX and ioreadX_rep / iowriteX_rep'
>>>>> as per
>>>>> David Brownell's comment. I updated 'omap_(read/write)_buf16' fucntions
>>>>> also
>>>>> for this.
>>>>>
>>>>> -vimal
>>>>>
>>>>> This patch adds prefetch support to access nand flash in mpu mode.
>>>>> This patch also adds 8-bit nand support (omap_read/write_buf8).
>>>>> Prefetch can be used for both 8- and 16-bit devices.
>>>>>
>>>>> Signed-off-by: Vimal Singh
>>>>
>>>> Sorry for the delay. I've looked at the GPMC part, and that now looks OK
>>>> to me. So I'm OK for this to get integrated via the MTD list.
>>>>
>>>> Acked-by: Tony Lindgren
>>>>
>>>
>>> Can you give your ack to below patch too?
>>>
>>> http://lists.infradead.org/pipermail/linux-mtd/2009-July/026373.html
>>
>> I've picked up both of your patches, please, check:
>> http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/33f48f597315842f39427ee4261cbf82a9afeaf3
>> http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/b67d52c91b26e97f981f2c292619d31667d5b272
>>
>
Is there any chance for these patches to get merged in this merge
window? These have been waiting for long time.

-Vimal

> Thanks Artem.
>
>> --
>> Best Regards,
>> Artem Bityutskiy (Артём Битюцкий)
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2]: twl4030: initialize pm_power_off in twl4030-core.c

2009-09-03 Thread vimal singh
'twl4030-poweroff' module was removed sometime back. This patch adds back
this capability.
We don't really need a whole new driver just for initializing one pointer.
Initialize pm_power_off in twl4030-core.c

Signed-off-by: Vimal Singh 
CC: Felipe Balbi 
---
This patch is compile tested only.
This patch is based on Felipe Balbi's patch posted earlier:
http://markmail.org/message/ts4if3553qnauket

 drivers/mfd/twl4030-core.c |   31 +++
 1 files changed, 31 insertions(+)

Index: linux-omap-2.6/drivers/mfd/twl4030-core.c
===
--- linux-omap-2.6.orig/drivers/mfd/twl4030-core.c
+++ linux-omap-2.6/drivers/mfd/twl4030-core.c
@@ -178,6 +178,10 @@
 #define TWL4030_VAUX2  BIT(0)  /* pre-5030 voltage ranges */
 #define TPS_SUBSET BIT(1)  /* tps659[23]0 have fewer LDOs */

+/* for pm_power_off */
+#define PWR_P1_SW_EVENTS   0x10
+#define PWR_DEVOFF (1 << 0)
+
 /*--*/

 /* is driver active, bound to a chip? */
@@ -754,6 +758,30 @@ static int twl4030_remove(struct i2c_cli
return 0;
 }

+static void twl4030_poweroff(void)
+{
+   int err;
+   u8 val;
+
+   err = twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &val,
+ PWR_P1_SW_EVENTS);
+   if (err) {
+   pr_err("%s: i2c error %d while reading TWL4030"
+   "PM_MASTER P1_SW_EVENTS\n",
+   DRIVER_NAME, err);
+   return;
+   }
+
+   val |= PWR_DEVOFF;
+
+   err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, val,
+  PWR_P1_SW_EVENTS);
+   if (err)
+   pr_err("%s: i2c error %d while writing TWL4030"
+   "PM_MASTER P1_SW_EVENTS\n",
+   DRIVER_NAME, err);
+}
+
 /* NOTE:  this driver only handles a single twl4030/tps659x0 chip */
 static int
 twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
@@ -811,6 +839,9 @@ twl4030_probe(struct i2c_client *client,
goto fail;
}

+   /* initialize pm_power_off routine */
+   pm_power_off = twl4030_poweroff;
+
status = add_children(pdata, id->driver_data);
 fail:
if (status < 0)


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2]: twl4030: register twl4030-pwrbuttonas a child of twl4030-core.c

2009-09-03 Thread vimal singh
'twl4030-pwrbutton' was already made as a platform_driver so it can
be registered as a child of twl4030-core.c.

But adding twl4030-pwrbutton as our child in twl4030-core is missing
currently. This patch adds it.

Signed-off-by: Vimal Singh 
CC: Felipe Balbi 
Cc: Samuel Ortiz 
Cc: David Brownell 
---
This patch is compile tested only.
This patch is based on Felipe Balbi's patch posted earlier:
http://lkml.org/lkml/2009/2/28/88

 drivers/mfd/twl4030-core.c |   14 ++
 1 files changed, 14 insertions(+)

Index: linux-omap-2.6/drivers/mfd/twl4030-core.c
===
--- linux-omap-2.6.orig/drivers/mfd/twl4030-core.c
+++ linux-omap-2.6/drivers/mfd/twl4030-core.c
@@ -108,6 +108,13 @@
 #define twl_has_watchdog()false
 #endif

+#if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \
+   || defined(CONFIG_INPUT_TWL4030_PWRBUTTON_MODULE)
+#define twl_has_pwrbutton()true
+#else
+#define twl_has_pwrbutton()false
+#endif
+
 /* Triton Core internal information (BEGIN) */

 /* Last - for index max*/
@@ -538,6 +545,13 @@ add_children(struct twl4030_platform_dat
return PTR_ERR(child);
}

+   if (twl_has_pwrbutton()) {
+   child = add_child(1, "twl4030_pwrbutton",
+   NULL, 0, true, pdata->irq_base + 8 + 0, 0);
+   if (IS_ERR(child))
+   return PTR_ERR(child);
+   }
+
if (twl_has_regulator()) {
/*
child = add_regulator(TWL4030_REG_VPLL1, pdata->vpll1);


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] mfd: restoring twl4030 power-off and power-button capabilities

2009-09-03 Thread vimal singh
This patch series restores the TWL Power-button and Power-off capabilities.
Which were removed in "REMOVE OMAP LEGACY CODE" patches.

Patches are compile tested only.

[PATCH 1/2]: twl4030: register twl4030-pwrbuttonas a child of twl4030-core.c
[PATCH 2/2]: twl4030: initialization of pm_power_off in twl4030-core.c

Both patches are based on Felipe Balbi's patches posted earlier.
http://lkml.org/lkml/2009/2/28/88
http://markmail.org/message/ts4if3553qnauket

--
Vimal




--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-09-01 Thread vimal singh
Adding NAND support for ZOOM2 and LDP board. I have tested it for ZOOM2
boards, someone can verify it for LDP, hopefully it should not have any
problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Singned-off-by: Vimal Singh 
---
 arch/arm/mach-omap2/Makefile|2
 arch/arm/mach-omap2/board-ldp-flash.c   |  196 
 arch/arm/mach-omap2/board-ldp.c |2
 arch/arm/mach-omap2/board-zoom2.c   |2
 arch/arm/plat-omap/include/mach/board-ldp.h |   36 +
 arch/arm/plat-omap/include/mach/nand.h  |1
 6 files changed, 239 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
@@ -54,6 +54,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += boar
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-ldp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -69,6 +70,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-ldp-flash.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o

Index: linux-omap-2.6/arch/arm/mach-omap2/board-ldp-flash.c
===
--- /dev/null
+++ linux-omap-2.6/arch/arm/mach-omap2/board-ldp-flash.c
@@ -0,0 +1,196 @@
+/*
+ * arch/arm/mach-omap2/board-ldp-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Rohit Choraria 
+ *Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define NAND_CMD_UNLOCK1   0x23
+#define NAND_CMD_UNLOCK2   0x24
+/**
+ * @brief platform specific unlock function
+ *
+ * @param mtd - mtd info
+ * @param ofs - offset to start unlock from
+ * @param len - length to unlock
+ *
+ * @return - unlock status
+ */
+static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
+{
+   int ret = 0;
+   int chipnr;
+   int status;
+   unsigned long page;
+   struct nand_chip *this = mtd->priv;
+   printk(KERN_INFO "nand_unlock: start: %08x, length: %d!\n",
+   (int)ofs, (int)len);
+
+   /* select the NAND device */
+   chipnr = (int)(ofs >> this->chip_shift);
+   this->select_chip(mtd, chipnr);
+   /* check the WP bit */
+   this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
+   if ((this->read_byte(mtd) & 0x80) == 0) {
+   printk(KERN_ERR "nand_unlock: Device is write protected!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if ((ofs & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Start address must be"
+   "beginning of nand page!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if (len == 0 || (len & (mtd->writesize - 1)) != 0) {
+   printk(KERN_ERR "nand_unlock: Length must be a multiple of "
+   "nand page size!\n");
+   ret = -EINVAL;
+   goto out;
+   }
+
+   /* submit address of first page to unlock */
+   page = (unsigned long)(ofs >> this->page_shift);
+   this->cmdfunc(mtd, NAND_CMD_UNLOCK1, -1, page & this->pagemask);
+
+   /* submit ADDRESS of LAST page to unlock */
+   page += (unsigned long)((ofs + len) >> this->page_shift) ;
+   this->cmdfunc(mtd, NAND_CMD_UNLOCK2, -1, page & this->pagemask);
+
+   /* call wait ready function */
+   status = this->waitfunc(mtd, this);
+   udelay(1000);
+   /* see if device thinks it succeeded */
+   if (status & 0x01) {
+   /* there was an error */
+   printk(KERN_ERR "nand_unlock: error status =0x%08x ", status);
+   ret = -EIO;
+   goto

[PATCH 1/2] OMAP2/3: Add support for flash on SDP boards

2009-09-01 Thread vimal singh
Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.


Signed-off-by: Vimal Singh 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile   |2
 arch/arm/mach-omap2/board-2430sdp.c|2
 arch/arm/mach-omap2/board-3430sdp.c|2
 arch/arm/mach-omap2/board-sdp-flash.c  |  326 +
 arch/arm/mach-omap2/board-sdp.h|   15 +
 arch/arm/plat-omap/include/mach/gpmc.h |2
 6 files changed, 349 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -61,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-om
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
Index: linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-2430sdp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include 
 #include 

+#include "board-sdp.h"
 #include "mmc-twl4030.h"

 #define SDP2430_CS0_BASE   0x0400
@@ -210,6 +211,7 @@ static void __init omap_2430sdp_init(voi
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#include "board-sdp.h"
 #include "sdram-qimonda-hyb18m512160af-6.h"
 #include "mmc-twl4030.h"

@@ -494,6 +495,7 @@ static void __init omap_3430sdp_init(voi
omap_serial_init(&sdp3430_uart_config);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
 }

Index: linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
===
--- /dev/null
+++ linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,326 @@
+/*
+ * arch/arm/mach-omap2/board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * Modified from mach-omap2/board-3430sdp-flash.c
+ * Author: Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define REG_FPGA_REV   0x10
+#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
+#define MAX_SUPPORTED_GPMC_CONFIG  3
+
+/* various memory sizes */
+#define FLASH_SIZE_SDPV1   SZ_64M
+#define FLASH_SIZE_SDPV2   SZ_128M
+
+#define FLASH_BASE_SDPV1   0x0400 /* NOR flash (64 Meg aligned) */
+#define FLASH_BASE_SDPV2   0x1000 /* NOR flash (256 Meg aligned) */
+
+#define DEBUG_BASE 0x0800 /* debug board */
+
+#define PDC_NOR1
+#define PDC_NAND   2
+#define PDC_ONENAND3
+#define DBG_MPDB   4
+
+/* REVISIT: Do

[PATCH 0/2] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-09-01 Thread vimal singh
This patch series adds flash support for NAND (in sdp, zoom2 and ldp),
OneNAND and NOR (in sdp).

[PATCH 1/2] OMAP2/3: Add support for flash on SDP boards
[PATCH 2/2] OMAP3: Add support for NAND on ZOOM2/LDP boards

These patches were submitted earlier too.. But putting them in a single
list now.

---
Thanks and Regards,
Vimal Singh

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3: Zoom2: provide default MTD partitions

2009-09-01 Thread vimal singh
On Tue, Sep 1, 2009 at 12:42 PM, Maxime Petazzoni wrote:
> * vimal singh  [2009-09-01 12:34:26]:
>
>> > Yes, I am aware of the mtdparts command line arguments, which works
>> > great. I think a "default", sensible partition layout for the Zoom2
>> > would be nice though.
>>
>> I agree. Keeping it in the mind that mtdparts command line arguments
>> will be given higher precedence anyway...
>
> Exactly. I would recommend that your patch gets merged in. Although I'm
> a bit curious of the rationale behind a 30M kernel partition?
>
> Also, given a 512MB NAND, we could easily affect 256MB or more to the
> system partition (as well as a bit more space for the userdata
> partition).
>
> But that's just nitpicking. As we said, mtdparts can be used to take
> precedence over the default settings if they don't match the
> user/system's needs.

I'll re-submit this patch along with one that I mentioned earlier:
http://marc.info/?l=linux-omap&m=125065707704826&w=2

in a series of patches.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3: Zoom2: provide default MTD partitions

2009-09-01 Thread vimal singh
On Thu, Aug 27, 2009 at 7:36 PM, Maxime Petazzoni wrote:
> Hi,
>
> * Pandita, Vikram  [2009-08-27 19:16:27]:
>
>> Why?
>>
>> I know of an implementation by Vimal Singh that introduces a common
>> flash file for Zoom1 and Zoom2.
>> There is reuse of code there.
>
> Thanks for your comments.
>
> There are indeed other implentations around using a common flash file
> for Zoom1 and Zoom2 boards. I didn't know of this specific
> implementation by Vimal Singh, but we use something very similar
> internally.
>
> Since linux-omap didn't had any MTD partitions definitions for either
> boards, I decided to go for the smallest change: only partitions for
> Zoom2.
>
>> Please discuss and get a converged approach on handling NAND
>> partitions on Zoom1 and Zoom2.
>
> Agreed. We should use a common file for Zoom1 and Zoom2 flash, with
> Zoom2 specific partition sizes. But I'm not sure I deserve the right to
> propose Vimal Singh's patch (by the way, why hasn't it been merged in
> the linux-omap tree?). How should we proceed then?
>
>> Also the Systerm/User/Cache partition definitions are more from Android 
>> perspective.
>>
>> Given that each system may have a different NAND partition requirement,
>> have you looked at bootargs passing the MTD partition info: Eg:
>>
>> mtdparts=omap2-nand.0:5...@0(xloader),\
>> 15...@512k(bootloader),\
>> 2...@2m(kernel),\
>> 1...@32m(system),\
>> 3...@192m(userdata),\
>> 3...@224m(cache)
>
> Yes, I am aware of the mtdparts command line arguments, which works
> great. I think a "default", sensible partition layout for the Zoom2
> would be nice though.

I agree. Keeping it in the mind that mtdparts command line arguments
will be given higher precedence anyway...

-vimal

>
> - Maxime
>
> --
> Maxime Petazzoni
> Linux kernel & software dev
> MontaVista Software, Inc
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkqWktkACgkQ7KsOe4Pmrg28zwCdHvKdX9NDgWVoUOx6Mc8kA6+7
> rx8An1NMQg5aEUHrEgGBZM/1YoFTvQtz
> =4L+0
> -END PGP SIGNATURE-
>
>



-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC][PATCH]: Adding support for omap-serail driver

2009-08-28 Thread vimal singh
From: Govindraj R 

This patch adds support for OMAP3430-HIGH SPEED UART Controller.

It currently adds support for the following features.

1. Supports Interrupt Mode for all three UARTs on SDP/ZOOM2.
2. Supports DMA Mode for all three UARTs on SDP/ZOOM2.
3. Supports Hardware flow control (CTS/RTS) on SDP/ZOOM2.
4. Supports 3.6Mbps baudrate on SDP/ZOOM2.
5. Debug Console support on all UARTs on SDP/ZOOM2.
6. Support for quad uart on ZOOM2 board.

The reason for adding this new driver alternative to 8250 is to avoid
polluting 8250 driver with too many omap specific data as 8250 already
supports more than 16 different uart controllers and may need too
many omap-platform checks to implement feature like DMA support.

Signed-off-by: Govindraj R 
---
 arch/arm/plat-omap/include/mach/omap-serial.h |   84 +
 drivers/serial/Kconfig|   92 +
 drivers/serial/Makefile   |1
 drivers/serial/omap-serial.c  | 1431 ++
 4 files changed, 1608 insertions(+)

diff --git a/arch/arm/plat-omap/include/mach/omap-serial.h
b/arch/arm/plat-omap/include/mach/omap-serial.h
new file mode 100644
index 000..d1b0bf2
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/omap-serial.h
@@ -0,0 +1,84 @@
+/*
+ * arch/arm/plat-omap/include/mach/omap-serial.h
+ *
+ * Driver for OMAP3430 UART controller.
+ *
+ * Copyright (C) 2009 Texas Instruments.
+ *
+ * Authors:
+ * Thara Gopinath  
+ * Govindraj R 
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef __OMAP_SERIAL_H__
+#define __OMAP_SERIAL_H__
+
+#include 
+#include 
+
+/* TI OMAP CONSOLE */
+#define PORT_OMAP   86
+
+#define DRIVER_NAME"omap-hsuart"
+
+/*
+ * We default to IRQ0 for the "no irq" hack.   Some
+ * machine types want  others as well - they're free
+ * to redefine this in their header file.
+ */
+#define is_real_interrupt(irq)  ((irq) != 0)
+
+#if defined(CONFIG_SERIAL_OMAP_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
+#ifdef CONFIG_ARCH_OMAP34XX
+#define OMAP_MDR1_DISABLE  0x07
+#define OMAP_MDR1_MODE13X  0x03
+#define OMAP_MDR1_MODE16X  0x00
+#define OMAP_MODE13X_SPEED 230400
+#endif
+
+#define CONSOLE_NAME   "console="
+
+#define UART_CLK   (4800)
+#define QUART_CLK  (1843200)
+
+/* UART NUMBERS */
+#define UART1  (0x0)
+#define UART2  (0x1)
+#define UART3  (0x2)
+#define QUART  (0x3)
+
+#ifdef CONFIG_MACH_OMAP_ZOOM2
+#define MAX_UARTS  QUART
+#else
+#define MAX_UARTS  UART3
+#endif
+
+#define UART_BASE(uart_no) (uart_no == UART1) ? OMAP_UART1_BASE :\
+   (uart_no == UART2) ? OMAP_UART2_BASE :\
+OMAP_UART3_BASE
+
+#define UART_MODULE_BASE(uart_no)  (UART1 == uart_no ? \
+   IO_ADDRESS(OMAP_UART1_BASE) :\
+   (UART2 == uart_no ? \
+   IO_ADDRESS(OMAP_UART2_BASE) :\
+   IO_ADDRESS(OMAP_UART3_BASE)))
+extern unsigned int fcr[MAX_UARTS];
+extern char *saved_command_line;
+
+struct plat_serialomap_port {
+   void __iomem*membase;   /* ioremap cookie or NULL */
+resource_size_t mapbase;   /* resource base */
+   unsigned intirq;/* interrupt number */
+   unsigned char   regshift;   /* register shift */
+   upf_t   flags;  /* UPF_* flags */
+   void*private_data;
+};
+
+#endif /* __OMAP_SERIAL_H__ */
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 037c1e0..906fb61 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1359,6 +1359,98 @@ config SERIAL_OF_PLATFORM
  Currently, only 8250 compatible ports are supported, but
  others can easily be added.

+config SERIAL_OMAP
+   bool "OMAP serial port support"
+   depends on ARM && ARCH_OMAP
+   select SERIAL_CORE
+   help
+   If you have a machine based on an Texas Instruments OMAP CPU you
+   can enable its onboard serial ports by enabling this option.
+
+config SERIAL_OMAP_CONSOLE
+   bool "Console on OMAP serial port"
+   depends on SERIAL_OMAP
+   select SERIAL_CORE_CONSOLE
+   help
+   If you have enabled the serial port on the Texas Instruments OMAP
+   CPU you can make it the console by answering Y to this option.
+
+   Even if you say Y here, the currently visible virtual console
+   (/dev/tty0) will still be used as the system console by default, but
+   you can alter that using a kernel command line option such as
+   "console=ttyS0". (Try "man bootparam" or see the docu

Re: [PATCH] OMAP3: Zoom2: provide default MTD partitions

2009-08-27 Thread vimal singh
Hi,

On Thu, Aug 27, 2009 at 7:16 PM, Pandita, Vikram wrote:
> Petazzoni/Vimal
>
>>-Original Message-
>>From: linux-omap-ow...@vger.kernel.org 
>>[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Maxime
>>Petazzoni
>>Sent: Thursday, August 27, 2009 7:00 AM
>>To: linux-omap@vger.kernel.org
>>Subject: [PATCH] OMAP3: Zoom2: provide default MTD partitions
>>
>>This change introduces default MTD partitions for the Zoom-II board
>>NAND, inspired by the OMAP3 Beagle partitions and the OMAP3 Zoom2
>>partitions defined in OmapZoom.org's OMAP kernel.
>
> Thanks for putting this together for zoom2, however I NAK for now.
>
> Why?
>
> I know of an implementation by Vimal Singh that introduces a common flash 
> file for Zoom1 and Zoom2.
> There is reuse of code there.
>
> I have attached the patch by Vimal here (in-lining would be difficult)

I am attaching an updated patch, which is prepared on top of the patch
which I submitted for flash supports for OMAP2/3 SDP board:
http://marc.info/?l=linux-omap&m=125065707704826&w=2

-vimal

>
> Please discuss and get a converged approach on handling NAND partitions on 
> Zoom1 and Zoom2.
>
> Also the Systerm/User/Cache partition definitions are more from Android 
> perspective.
>
> Given that each system may have a different NAND partition requirement,
> have you looked at bootargs passing the MTD partition info: Eg:
>
> mtdparts=omap2-nand.0:5...@0(xloader),\
> 15...@512k(bootloader),\
> 2...@2m(kernel),\
> 1...@32m(system),\
> 3...@192m(userdata),\
> 3...@224m(cache)
>
>
> Lets discuss the final approach on this list and try to close this soon.
>
> Thnx
>
>>
>>The size of the U-Boot environment partition was increased to 1MB, as
>>the previously smaller partition couldn't contain the U-Boot environment
>>correctly (erasing the next partition would erase the U-Boot env as
>>well).
>>
>>Finally, the "system" partition gets an increased size of 256MB to take
>>advantage of the size of the flash on the Zoom-II board.
>>
>>Signed-off-by: Maxime Petazzoni 
>>---
>> arch/arm/mach-omap2/board-zoom2.c |   86 
>> +
>> 1 files changed, 86 insertions(+), 0 deletions(-)
>>
>>diff --git a/arch/arm/mach-omap2/board-zoom2.c 
>>b/arch/arm/mach-omap2/board-zoom2.c
>>index 4d295d5..ce5a4d8 100644
>>--- a/arch/arm/mach-omap2/board-zoom2.c
>>+++ b/arch/arm/mach-omap2/board-zoom2.c
>>@@ -16,16 +16,101 @@
>> #include 
>> #include 
>> #include 
>>+#include 
>>+#include 
>>+#include 
>>
>> #include 
>> #include 
>>
>> #include 
>>+#include 
>> #include 
>> #include 
>>
>> #include "mmc-twl4030.h"
>>
>>+#define LDP3430_NAND_CS       0
>>+#define GPMC_CS0_BASE 0x60
>>+#define GPMC_CS_SIZE  0x30
>>+
>>+static struct mtd_partition zoom2_nand_partitions[] = {
>>+      {
>>+              .name           = "X-Loader-NAND",
>>+              .offset         = 0,
>>+              .size           = 4 * (64 * 2048),      /* 512kB */
>>+              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
>>+      },
>>+      {
>>+              .name           = "U-Boot-NAND",
>>+              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
>>+              .size           = 4 * (64 * 2048),      /* 512kB */
>>+              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
>>+      },
>>+      {
>>+              .name           = "Boot Env-NAND",
>>+              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x10 */
>>+              .size           = 8 * (64 * 2048),      /* 1MB */
>>+      },
>>+      {
>>+              .name           = "Kernel-NAND",
>>+              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x20 */
>>+              .size           = 32 * (64 * 2048),     /* 4MB */
>>+      },
>>+      {
>>+              .name           = "system",
>>+              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x60 */
>>+              .size           = 2048 * (64 * 2048),   /* 256MB */
>>+      },
>>+      {
>>+              .name           = "userdata",
>>+              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1060 
>>*/
>>+              .size           = 512 * (64 * 2048),    /* 64MB */
>>+      },
>>+      {
>>+              .name           = "cac

Re: [PATCH] OMAP2/3: Add support for flash on SDP boards

2009-08-21 Thread vimal singh
Hi Tony,

Are you OK with below patch? I have not received any comment yet.

In case this patch is OK, can you please push it?

-vimal

On Wed, Aug 19, 2009 at 10:14 AM, vimal singh wrote:
> Add support for flash on SDP boards. NAND, NOR and OneNAND
> are supported.
>
> Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
> 2430SDP and check the chips select for 2430SDP.
>
> Also note that:
> For OneNAND: in the earlier 2430SDP code the kernel partition
> was set to only 1MB instead of 2MB on 3430SDP. If people want
> the old partition sizes back on 2430SDP, please provide a patch.
>
> For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
> by few blocks to provide few spare blocks for NAND bab block management
> in u-boot. If people want old partition sizes, please provide a patch.
>
>
> Signed-off-by: Vimal Singh 
> Signed-off-by: Tony Lindgren 
> ---
>  arch/arm/mach-omap2/Makefile           |    2
>  arch/arm/mach-omap2/board-2430sdp.c    |    2
>  arch/arm/mach-omap2/board-3430sdp.c    |    2
>  arch/arm/mach-omap2/board-sdp-flash.c  |  326 
> +
>  arch/arm/mach-omap2/board-sdp.h        |   15 +
>  arch/arm/plat-omap/include/mach/gpmc.h |    2
>  6 files changed, 349 insertions(+)
>
> Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
> ===
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
> +++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
> @@ -48,6 +48,7 @@ obj-$(CONFIG_OMAP_IOMMU)              += $(iommu-y)
>  obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
>  obj-$(CONFIG_MACH_OMAP_H4)             += board-h4.o
>  obj-$(CONFIG_MACH_OMAP_2430SDP)                += board-2430sdp.o \
> +                                          board-sdp-flash.o \
>                                           mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_APOLLON)                += board-apollon.o
>  obj-$(CONFIG_MACH_OMAP3_BEAGLE)                += board-omap3beagle.o \
> @@ -61,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)           += board-om
>  obj-$(CONFIG_MACH_OMAP3_PANDORA)       += board-omap3pandora.o \
>                                           mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_3430SDP)                += board-3430sdp.o \
> +                                          board-sdp-flash.o \
>                                           mmc-twl4030.o
>  obj-$(CONFIG_MACH_NOKIA_N8X0)          += board-n8x0.o
>  obj-$(CONFIG_MACH_NOKIA_RX51)          += board-rx51.o \
> Index: linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
> ===
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-2430sdp.c
> +++ linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
> @@ -38,6 +38,7 @@
>  #include 
>  #include 
>
> +#include "board-sdp.h"
>  #include "mmc-twl4030.h"
>
>  #define SDP2430_CS0_BASE       0x0400
> @@ -210,6 +211,7 @@ static void __init omap_2430sdp_init(voi
>        twl4030_mmc_init(mmc);
>        usb_musb_init();
>        board_smc91x_init();
> +       sdp_flash_init();
>
>        /* Turn off secondary LCD backlight */
>        ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
> ===
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c
> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
> @@ -41,6 +41,7 @@
>  #include 
>  #include 
>
> +#include "board-sdp.h"
>  #include "sdram-qimonda-hyb18m512160af-6.h"
>  #include "mmc-twl4030.h"
>
> @@ -494,6 +495,7 @@ static void __init omap_3430sdp_init(voi
>        omap_serial_init(&sdp3430_uart_config);
>        usb_musb_init();
>        board_smc91x_init();
> +       sdp_flash_init();
>        usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
>  }
>
> Index: linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
> =======
> --- /dev/null
> +++ linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
> @@ -0,0 +1,326 @@
> +/*
> + * arch/arm/mach-omap2/board-sdp-flash.c
> + *
> + * Copyright (C) 2009 Nokia Corporation
> + * Copyright (C) 2009 Texas Instruments
> + *
> + * Modified from mach-omap2/board-3430sdp-flash.c
> + * Author: Vimal Singh 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
>

[PATCH] OMAP2/3: Add support for flash on SDP boards

2009-08-18 Thread vimal singh
Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.


Signed-off-by: Vimal Singh 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/Makefile   |2
 arch/arm/mach-omap2/board-2430sdp.c|2
 arch/arm/mach-omap2/board-3430sdp.c|2
 arch/arm/mach-omap2/board-sdp-flash.c  |  326 +
 arch/arm/mach-omap2/board-sdp.h|   15 +
 arch/arm/plat-omap/include/mach/gpmc.h |2
 6 files changed, 349 insertions(+)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -61,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-om
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
Index: linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-2430sdp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include 
 #include 

+#include "board-sdp.h"
 #include "mmc-twl4030.h"

 #define SDP2430_CS0_BASE   0x0400
@@ -210,6 +211,7 @@ static void __init omap_2430sdp_init(voi
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#include "board-sdp.h"
 #include "sdram-qimonda-hyb18m512160af-6.h"
 #include "mmc-twl4030.h"

@@ -494,6 +495,7 @@ static void __init omap_3430sdp_init(voi
omap_serial_init(&sdp3430_uart_config);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
 }

Index: linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
===
--- /dev/null
+++ linux-omap-2.6/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,326 @@
+/*
+ * arch/arm/mach-omap2/board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * Modified from mach-omap2/board-3430sdp-flash.c
+ * Author: Vimal Singh 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define REG_FPGA_REV   0x10
+#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
+#define MAX_SUPPORTED_GPMC_CONFIG  3
+
+/* various memory sizes */
+#define FLASH_SIZE_SDPV1   SZ_64M
+#define FLASH_SIZE_SDPV2   SZ_128M
+
+#define FLASH_BASE_SDPV1   0x0400 /* NOR flash (64 Meg aligned) */
+#define FLASH_BASE_SDPV2   0x1000 /* NOR flash (256 Meg aligned) */
+
+#define DEBUG_BASE 0x0800 /* debug board */
+
+#define PDC_NOR1
+#define PDC_NAND   2
+#define PDC_ONENAND3
+#define DBG_MPDB   4
+
+/* REVISIT: Do

Re: SDP support seems broken in LO

2009-08-18 Thread vimal singh
> Move to 2008q3 or 2009q1 as a workaround.

Thanks Anand... it came up. :)

-vimal
> - Anand
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SDP support seems broken in LO

2009-08-18 Thread vimal singh
On Tue, Aug 18, 2009 at 6:30 PM, Gadiyar, Anand wrote:
>> >> LO seems broken on OMAP3430 SDP platform. I compile latest kernel with
>> >> 'omap_3430sdp_defconfig' config options.
>> >>
>> >> Booting hangs after kernel uncompressed and last message which appears
>> >> is 'booting the kernel'
>> >>
>> >>
>> >> Thanks and regards,
>> >> vimal
>> >>
>> >> See below log:
>> >>
>> >> ## Booting image at 8000 ...
>> >>    Image Name:   Linux-2.6.31-rc5-omap1-05896-ge0
>> >>    Image Type:   ARM Linux Kernel Image (uncompressed)
>> >>    Data Size:    2520992 Bytes =  2.4 MB
>> >>    Load Address: 80008000
>> >>    Entry Point:  80008000
>> >>    Verifying Checksum ... OK
>> >> OK
>> >>
>> >> Starting kernel ...
>> >>
>> >> Uncompressing 
>> >> Linux.
>> >>
>> ..
>> 
>> >> ..
>> >> done, booting the kernel.
>> > Mainly because of frame-buffer and musb. You can try disabling these two 
>> > and see if it boots.
>>
>> I disabled frame-buffer and usb support fully:
>> # CONFIG_FB is not set
>> # CONFIG_USB_SUPPORT is not set
>>
>> I still get same message.
>>
>> -vimal
>>
>
>
> Do you have CONFIG_DEBUG_LL enabled? If so, could you enable that please to
> see if we have a crash somewhere?
>

Here is the log after enabling 'CONFIG_DEBUG_LL':

## Booting image at 8000 ...
   Image Name:   Linux-2.6.31-rc5-omap1-05896-ge0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2303384 Bytes =  2.2 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing 
Linux
done, booting the kernel.
<5>Linux version 2.6.31-rc5-omap1-05896-ge087f6f-dirty
(x0094...@omaplinux2) (gcc version 4.2.1 (CodeSourcery Sourcery G++
Lite 2007q3-51)) #7 Tue Aug 18 18:38:47 IST 2009
CPU: ARMv7 Processor [411fc081] revision 1 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP3430 3430SDP board
Memory policy: ECC disabled, Data cache writeback
<7>On node 0 totalpages: 32768
<7>free_area_init_node: node 0, pgdat c048c700, node_mem_map c04da000
<7>  Normal zone: 256 pages used for memmap
<7>  Normal zone: 0 pages reserved
<7>  Normal zone: 32512 pages, LIFO batch:7
<6>OMAP3430 ES2.0
<6>SRAM: Mapped pa 0x4020 to va 0xe300 size: 0x10
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
<5>Kernel command line: mem=128M console=ttyS0,115200n8 noinitrd
root=/dev/nfs rw
nfsroot=10.24.246.118:/home1/vimal_fs/newfs,nolock,tcp,rsize=1024,wsize=1024
ip=dhcp nohz=off
PID hash table entries: 512 (order: 9, 2048 bytes)
<6>Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
<6>Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
<6>Memory: 128MB = 128MB total
<5>Memory: 124828KB available (4132K code, 529K data, 128K init, 0K highmem)
<6>SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
<6>NR_IRQS:402
<6>Clocking rate (Crystal/DPLL/ARM core): 26.0/332/500 MHz
<6>Reprogramming SDRC clock to 33200 Hz
<6>GPMC revision 5.0
<6>IRQ: Found an INTC at 0xd820 (revision 4.0) with 96 interrupts
<6>Total of 96 interrupts on 1 active controller
<6>OMAP34xx GPIO hardware version 2.5
<6>OMAP clockevent source: GPTIMER1 at 32768 Hz
Console: colour dummy device 80x30
<6>Calibrating delay loop...


-vimal

> - Anand
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SDP support seems broken in LO

2009-08-18 Thread vimal singh
On Tue, Aug 18, 2009 at 5:53 PM, Shilimkar,
Santosh wrote:
>> -Original Message-
>> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
>> ow...@vger.kernel.org] On Behalf Of vimal singh
>> Sent: Tuesday, August 18, 2009 5:49 PM
>> To: linux-omap@vger.kernel.org
>> Subject: SDP support seems broken in LO
>>
>> LO seems broken on OMAP3430 SDP platform. I compile latest kernel with
>> 'omap_3430sdp_defconfig' config options.
>>
>> Booting hangs after kernel uncompressed and last message which appears
>> is 'booting the kernel'
>>
>>
>> Thanks and regards,
>> vimal
>>
>> See below log:
>>
>> ## Booting image at 8000 ...
>>    Image Name:   Linux-2.6.31-rc5-omap1-05896-ge0
>>    Image Type:   ARM Linux Kernel Image (uncompressed)
>>    Data Size:    2520992 Bytes =  2.4 MB
>>    Load Address: 80008000
>>    Entry Point:  80008000
>>    Verifying Checksum ... OK
>> OK
>>
>> Starting kernel ...
>>
>> Uncompressing
>> Linux.
>> ..
>> ..
>> done, booting the kernel.
> Mainly because of frame-buffer and musb. You can try disabling these two and 
> see if it boots.

I disabled frame-buffer and usb support fully:
# CONFIG_FB is not set
# CONFIG_USB_SUPPORT is not set

I still get same message.

-vimal

>
>
> Regards,
> Santosh
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SDP support seems broken in LO

2009-08-18 Thread vimal singh
LO seems broken on OMAP3430 SDP platform. I compile latest kernel with
'omap_3430sdp_defconfig' config options.

Booting hangs after kernel uncompressed and last message which appears
is 'booting the kernel'


Thanks and regards,
vimal

See below log:

## Booting image at 8000 ...
   Image Name:   Linux-2.6.31-rc5-omap1-05896-ge0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2520992 Bytes =  2.4 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing 
Linux.
done, booting the kernel.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/9] OMAP2/3: Add support for flash on SDP boards

2009-08-12 Thread vimal singh
On Wed, Aug 12, 2009 at 5:00 PM, Tony Lindgren wrote:
> * vimal singh  [090811 17:34]:
>> On Tue, Aug 11, 2009 at 3:23 PM, Tony Lindgren wrote:
>> > Add support for flash on SDP boards. Currently only onenand
>> > is supported.
>> >
>> > Only tested on 3430SDP, somebody please test on 2430SDP and
>> > check the chip select for 2430SDP.
>> >
>> > Also note that in the earlier 2430SDP code the kernel partition
>> > was set to only 1MB instead of 2MB on 3430SDP. If people want
>> > the old partition sizes back on 2430SDP, please provide a patch.
>> >
>
> 
>
>> > +static struct omap_onenand_platform_data board_onenand_data = {
>> > +       .cs             = 2,    /* REVISIT: Is this the same for 2430 SDP? 
>> > */
>>
>> SDP3430 V2 Board CS organization is different from SDP3430 V1. Now 4
>> dip switches are used to specify CS configuration for flashes.
>
> Hmm, OK thanks. That could be done with a cmdline option, or
> by adding the GPMC probing in some generic form on top of this patch.
>
> Do you still want this patch to get integrated, or me to drop it
> until somebody patches support for toggling the chip select?

You may drop this patch as of now. I'll submit a patch for this
probably next week.

-vimal

>
> Tony
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/9] OMAP2/3: Add support for flash on SDP boards

2009-08-11 Thread vimal singh
On Tue, Aug 11, 2009 at 3:23 PM, Tony Lindgren wrote:
> Add support for flash on SDP boards. Currently only onenand
> is supported.
>
> Only tested on 3430SDP, somebody please test on 2430SDP and
> check the chip select for 2430SDP.
>
> Also note that in the earlier 2430SDP code the kernel partition
> was set to only 1MB instead of 2MB on 3430SDP. If people want
> the old partition sizes back on 2430SDP, please provide a patch.
>
> Signed-off-by: Tony Lindgren 
> ---
>  arch/arm/mach-omap2/Makefile          |    2 +
>  arch/arm/mach-omap2/board-2430sdp.c   |    2 +
>  arch/arm/mach-omap2/board-3430sdp.c   |    2 +
>  arch/arm/mach-omap2/board-sdp-flash.c |   78 
> +
>  arch/arm/mach-omap2/board-sdp.h       |    9 
>  5 files changed, 93 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
>  create mode 100644 arch/arm/mach-omap2/board-sdp.h
>
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 735bae5..2a2361e 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -48,6 +48,7 @@ obj-$(CONFIG_OMAP_IOMMU)              += $(iommu-y)
>  obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
>  obj-$(CONFIG_MACH_OMAP_H4)             += board-h4.o
>  obj-$(CONFIG_MACH_OMAP_2430SDP)                += board-2430sdp.o \
> +                                          board-sdp-flash.o \
>                                           mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_APOLLON)                += board-apollon.o
>  obj-$(CONFIG_MACH_OMAP3_BEAGLE)                += board-omap3beagle.o \
> @@ -61,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)           += board-omap3evm.o \
>  obj-$(CONFIG_MACH_OMAP3_PANDORA)       += board-omap3pandora.o \
>                                           mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_3430SDP)                += board-3430sdp.o \
> +                                          board-sdp-flash.o \
>                                           mmc-twl4030.o
>
>  obj-$(CONFIG_MACH_NOKIA_RX51)          += board-rx51.o \
> diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
> b/arch/arm/mach-omap2/board-2430sdp.c
> index 03f0887..bea6f06 100644
> --- a/arch/arm/mach-omap2/board-2430sdp.c
> +++ b/arch/arm/mach-omap2/board-2430sdp.c
> @@ -39,6 +39,7 @@
>  #include 
>
>  #include "mmc-twl4030.h"
> +#include "board-sdp.h"
>
>  #define SDP2430_CS0_BASE       0x0400
>  #define SECONDARY_LCD_GPIO             147
> @@ -210,6 +211,7 @@ static void __init omap_2430sdp_init(void)
>        twl4030_mmc_init(mmc);
>        usb_musb_init();
>        board_smc91x_init();
> +       sdp_flash_init();
>
>        /* Turn off secondary LCD backlight */
>        ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
> b/arch/arm/mach-omap2/board-3430sdp.c
> index 3f5c316..f5c8fa7 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -43,6 +43,7 @@
>
>  #include "sdram-qimonda-hyb18m512160af-6.h"
>  #include "mmc-twl4030.h"
> +#include "board-sdp.h"
>
>  #define CONFIG_DISABLE_HFCLK 1
>
> @@ -494,6 +495,7 @@ static void __init omap_3430sdp_init(void)
>        omap_serial_init(&sdp3430_uart_config);
>        usb_musb_init();
>        board_smc91x_init();
> +       sdp_flash_init();
>  }
>
>  static void __init omap_3430sdp_map_io(void)
> diff --git a/arch/arm/mach-omap2/board-sdp-flash.c 
> b/arch/arm/mach-omap2/board-sdp-flash.c
> new file mode 100644
> index 000..1496d89
> --- /dev/null
> +++ b/arch/arm/mach-omap2/board-sdp-flash.c
> @@ -0,0 +1,78 @@
> +/*
> + * linux/arch/arm/mach-omap2/board-sdp-flash.c
> + *
> + *
> + * Copyright (C) 2009 Nokia Corporation
> + * Copyright (C) 2007 Texas Instruments
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +/* REVISIT: Add support for other flash memory types */
> +
> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> +               defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> +
> +static struct mtd_partition board_onenand_partitions[] = {
> +       {
> +               .name           = "X-Loader-OneNAND",
> +               .offset         = 0,
> +               .size           = 4 * (64 * 2048),
> +               .mask_flags     = MTD_WRITEABLE  /* force read-only */
> +       },
> +       {
> +               .name           = "U-Boot-OneNAND",
> +               .offset         = MTDPART_OFS_APPEND,
> +               .size           = 2 * (64 * 2048),
> +               .mask_flags     = MTD_WRITEABLE  /* force read-only */
> +       },
> +       {
> +               .name           = "U-Boot Environment-OneNAND",
> +               .offset         = MTDPART_OFS_APPEND,
> +               .size  

Re: [PATCH-v3 1:2] [MTD][NAND]omap: Adding support for nand prefetch-read and post-write, in MPU mode.

2009-08-11 Thread vimal singh
On Tue, Aug 11, 2009 at 11:51 AM, Artem Bityutskiy wrote:
> On 08/11/2009 08:45 AM, vimal singh wrote:
>>
>> On Mon, Aug 10, 2009 at 9:57 PM, Tony Lindgren  wrote:
>>>
>>> * vimal singh  [090713 13:56]:
>>>>
>>>> Patch updated for ' ioreadX / iowriteX and ioreadX_rep / iowriteX_rep'
>>>> as per
>>>> David Brownell's comment. I updated 'omap_(read/write)_buf16' fucntions
>>>> also
>>>> for this.
>>>>
>>>> -vimal
>>>>
>>>> This patch adds prefetch support to access nand flash in mpu mode.
>>>> This patch also adds 8-bit nand support (omap_read/write_buf8).
>>>> Prefetch can be used for both 8- and 16-bit devices.
>>>>
>>>> Signed-off-by: Vimal Singh
>>>
>>> Sorry for the delay. I've looked at the GPMC part, and that now looks OK
>>> to me. So I'm OK for this to get integrated via the MTD list.
>>>
>>> Acked-by: Tony Lindgren
>>>
>>
>> Can you give your ack to below patch too?
>>
>> http://lists.infradead.org/pipermail/linux-mtd/2009-July/026373.html
>
> I've picked up both of your patches, please, check:
> http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/33f48f597315842f39427ee4261cbf82a9afeaf3
> http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/b67d52c91b26e97f981f2c292619d31667d5b272
>

Thanks Artem.

> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v3 1:2] [MTD][NAND]omap: Adding support for nand prefetch-read and post-write, in MPU mode.

2009-08-11 Thread vimal singh
On Mon, Aug 10, 2009 at 9:57 PM, Tony Lindgren wrote:
> * vimal singh  [090713 13:56]:
>> Patch updated for ' ioreadX / iowriteX and ioreadX_rep / iowriteX_rep' as per
>> David Brownell's comment. I updated 'omap_(read/write)_buf16' fucntions also
>> for this.
>>
>> -vimal
>>
>> This patch adds prefetch support to access nand flash in mpu mode.
>> This patch also adds 8-bit nand support (omap_read/write_buf8).
>> Prefetch can be used for both 8- and 16-bit devices.
>>
>> Signed-off-by: Vimal Singh 
>
> Sorry for the delay. I've looked at the GPMC part, and that now looks OK
> to me. So I'm OK for this to get integrated via the MTD list.
>
> Acked-by: Tony Lindgren 
>

Can you give your ack to below patch too?

http://lists.infradead.org/pipermail/linux-mtd/2009-July/026373.html

>
>> ---
>>
>> ---
>>  arch/arm/mach-omap2/gpmc.c             |   63 
>>  arch/arm/plat-omap/include/mach/gpmc.h |    4
>>  drivers/mtd/nand/Kconfig               |    8 +
>>  drivers/mtd/nand/omap2.c               |  161 
>> +++--
>>  4 files changed, 226 insertions(+), 10 deletions(-)
>>
>> Index: mtd-2.6/arch/arm/mach-omap2/gpmc.c
>> ===
>> --- mtd-2.6.orig/arch/arm/mach-omap2/gpmc.c
>> +++ mtd-2.6/arch/arm/mach-omap2/gpmc.c
>> @@ -57,6 +57,11 @@
>>  #define GPMC_CHUNK_SHIFT     24              /* 16 MB */
>>  #define GPMC_SECTION_SHIFT   28              /* 128 MB */
>>
>> +#define PREFETCH_FIFOTHRESHOLD       (0x40 << 8)
>> +#define CS_NUM_SHIFT         24
>> +#define ENABLE_PREFETCH              (0x1 << 7)
>> +#define DMA_MPU_MODE         2
>> +
>>  static struct resource       gpmc_mem_root;
>>  static struct resource       gpmc_cs_mem[GPMC_CS_NUM];
>>  static DEFINE_SPINLOCK(gpmc_mem_lock);
>> @@ -386,6 +391,63 @@ void gpmc_cs_free(int cs)
>>  }
>>  EXPORT_SYMBOL(gpmc_cs_free);
>>
>> +/**
>> + * gpmc_prefetch_enable - configures and starts prefetch transfer
>> + * @cs: nand cs (chip select) number
>> + * @dma_mode: dma mode enable (1) or disable (0)
>> + * @u32_count: number of bytes to be transferred
>> + * @is_write: prefetch read(0) or write post(1) mode
>> + */
>> +int gpmc_prefetch_enable(int cs, int dma_mode,
>> +                             unsigned int u32_count, int is_write)
>> +{
>> +     uint32_t prefetch_config1;
>> +
>> +     if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
>> +             /* Set the amount of bytes to be prefetched */
>> +             gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
>> +
>> +             /* Set dma/mpu mode, the prefetch read / post write and
>> +              * enable the engine. Set which cs is has requested for.
>> +              */
>> +             prefetch_config1 = ((cs << CS_NUM_SHIFT) |
>> +                                     PREFETCH_FIFOTHRESHOLD |
>> +                                     ENABLE_PREFETCH |
>> +                                     (dma_mode << DMA_MPU_MODE) |
>> +                                     (0x1 & is_write));
>> +             gpmc_write_reg(GPMC_PREFETCH_CONFIG1, prefetch_config1);
>> +     } else {
>> +             return -EBUSY;
>> +     }
>> +     /*  Start the prefetch engine */
>> +     gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1);
>> +
>> +     return 0;
>> +}
>> +EXPORT_SYMBOL(gpmc_prefetch_enable);
>> +
>> +/**
>> + * gpmc_prefetch_reset - disables and stops the prefetch engine
>> + */
>> +void gpmc_prefetch_reset(void)
>> +{
>> +     /* Stop the PFPW engine */
>> +     gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
>> +
>> +     /* Reset/disable the PFPW engine */
>> +     gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0);
>> +}
>> +EXPORT_SYMBOL(gpmc_prefetch_reset);
>> +
>> +/**
>> + * gpmc_prefetch_status - reads prefetch status of engine
>> + */
>> +int  gpmc_prefetch_status(void)
>> +{
>> +     return gpmc_read_reg(GPMC_PREFETCH_STATUS);
>> +}
>> +EXPORT_SYMBOL(gpmc_prefetch_status);
>> +
>>  static void __init gpmc_mem_init(void)
>>  {
>>       int cs;
>> @@ -452,6 +514,5 @@ void __init gpmc_init(void)
>>       l &= 0x03 << 3;
>>       l |= (0x02 << 3) | (1 << 0);
>>       gpmc_write_reg(GPMC_SYSCONFIG, l);
>> -
>>       gpmc_mem_init();
>>  }
>>

Re: [PATCH][OMAP]: Adding flash devices support back for OMAP3430 SDP boards

2009-08-10 Thread vimal singh
Adding Linux-Omap mailing list too...

-vimal

> Adding flash devices support back for OMAP3430 SDP boards.
>
> Signed-off-by: Vimal Singh 
> ---
>
>  mach-omap2/Makefile  |1
>  mach-omap2/board-3430sdp-flash.c |  267 
> +++
>  mach-omap2/board-3430sdp.c   |3
>  plat-omap/include/mach/gpmc.h|2
>  4 files changed, 273 insertions(+)
> 
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -61,6 +61,7 @@ obj-$(CONFIG_MACH_OMAP3EVM) += board-om
>  obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \
>  mmc-twl4030.o
>  obj-$(CONFIG_MACH_OMAP_3430SDP)  += board-3430sdp.o \
> +board-3430sdp-flash.o \
>  mmc-twl4030.o
>  obj-$(CONFIG_MACH_NOKIA_N800)+= board-n800.o \
>  board-n800-mmc.o \
> 
> --- a/arch/arm/plat-omap/include/mach/gpmc.h
> +++ b/arch/arm/plat-omap/include/mach/gpmc.h
> @@ -27,6 +27,8 @@
>
>  #define GPMC_CONFIG  0x50
>  #define GPMC_STATUS  0x54
> +#define GPMC_CS0_BASE0x60
> +#define GPMC_CS_SIZE 0x30
>
>  #define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31)
>  #define GPMC_CONFIG1_READMULTIPLE_SUPP  (1 << 30)
> 
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -54,6 +54,8 @@
>
>  #define TWL4030_MSECURE_GPIO 22
>
> +extern void sdp3430_flash_init(void);
> +
>  static int sdp3430_keymap[] = {
>   KEY(0, 0, KEY_LEFT),
>   KEY(0, 1, KEY_RIGHT),
> @@ -492,6 +494,7 @@ static void __init omap_3430sdp_init(voi
>   spi_register_board_info(sdp3430_spi_board_info,
>   ARRAY_SIZE(sdp3430_spi_board_info));
>   ads7846_dev_init();
> + sdp3430_flash_init();
>   omap_serial_init();
>   usb_musb_init();
>   board_smc91x_init();
> 
> --- /dev/null
> +++ b/arch/arm/mach-omap2/board-3430sdp-flash.c
> @@ -0,0 +1,267 @@
> +/*
> + * linux/arch/arm/mach-omap2/board-3430sdp-flash.c
> + *
> + * Copyright (c) 2007 Texas Instruments
> + *
> + * Modified from mach-omap2/board-2430sdp-flash.c
> + * Author: Rohit Choraria 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define NAND_BLOCK_SIZESZ_128K
> +
> +/* NAND */
> +/* IMPORTANT NOTE ON MAPPING
> + * 3430SDP - 34XX
> + * --
> + * NOR always on 0x0400 for SDPV1
> + * NOR always on 0x1000 for SDPV2
> + * MPDB always on 0x0800
> + * NAND always on 0x0C00
> + * OneNand Mapped to 0x2000
> + * Boot Mode(NAND/NOR). The other on CS1
> + */
> +#define FLASH_BASE_SDPV1   0x0400 /* NOR flash (64 Meg aligned) */
> +#define FLASH_BASE_SDPV2   0x1000 /* NOR flash (256 Meg aligned) */
> +#define DEBUG_BASE 0x0800 /* debug board */
> +#define NAND_BASE  0x0C00 /* NAND flash */
> +#define ONENAND_MAP0x2000 /* OneNand flash */
> +
> +/* various memory sizes */
> +#define FLASH_SIZE_SDPV1   SZ_64M
> +#define FLASH_SIZE_SDPV2   SZ_128M
> +
> +static struct mtd_partition sdp_nor_partitions[] = {
> +   /* bootloader (U-Boot, etc) in first sector */
> +   {
> +   .name   = "Bootloader-NOR",
> +   .offset = 0,
> +   .size   = SZ_256K,
> +   .mask_flags = MTD_WRITEABLE, /* force read-only */
> +   },
> +   /* bootloader params in the next sector */
> +   {
> +   .name   = "Params-NOR",
> +   .offset = MTDPART_OFS_APPEND,
> +   .size   = SZ_256K,
> +   .mask_flags = 0,
> +   },
> +   /* kernel */
> +   {
> +   .name   = "Kernel-NOR",
> +   .offset = M

Re: [PATCH] musb: fix CONFIGDATA register read issue

2009-07-27 Thread vimal singh
On Mon, Jul 6, 2009 at 11:03 AM, Ajay Kumar Gupta wrote:
> INDEX register has to be set to '0' before reading
> CONFIGDATA register which is only present in TI musb
> platforms.
>
> Currently the default register access mode is set to
> FLAT_MODE thus INDEX register is not getting set
> properly with musb_ep_select() which is just a nop
> operation in FLAT_MODE.This invalid register read is
> causing module reinset failure.
>
> Fixing the issue by moving INDEX register write part to
> musb_read_configdata() function itself.
>
> Signed-off-by: Vikram Pandita 

Please correct the e-mail address above.

> Signed-off-by: Anand Gadiyar 
> Signed-off-by: Ajay Kumar Gupta 
> ---
> Based on a previous patch from Anand at,
> http://marc.info/?l=linux-omap&m=122051303604377&w=2
>
> Another version of this fix by Vikram is at,
> http://linux.omap.com/pipermail/linux-omap-open-source/2007-November/012084.html
>
>  drivers/usb/musb/musb_core.c |    1 -
>  drivers/usb/musb/musb_regs.h |    1 +
>  2 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 554a414..3ec68a1 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1326,7 +1326,6 @@ static int __init musb_core_init(u16 musb_type, struct 
> musb *musb)
>        int             i;
>
>        /* log core options (read using indexed model) */
> -       musb_ep_select(mbase, 0);
>        reg = musb_read_configdata(mbase);
>
>        strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");
> diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
> index de3b2f1..fbfd3fd 100644
> --- a/drivers/usb/musb/musb_regs.h
> +++ b/drivers/usb/musb/musb_regs.h
> @@ -323,6 +323,7 @@ static inline void  musb_write_rxfifoadd(void __iomem 
> *mbase, u16 c_off)
>
>  static inline u8 musb_read_configdata(void __iomem *mbase)
>  {
> +       musb_writeb(mbase, MUSB_INDEX, 0);
>        return musb_readb(mbase, 0x10 + MUSB_CONFIGDATA);
>  }
>
> --
> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
---
Regards,
\/ | |\/| /-\ |_

  __o
--   -\<,
-  ( )/ ( )
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v2 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write

2009-07-13 Thread vimal singh
This patch updated for line offsets due to 1st patch.

-vimal

This patch adds DMA mode support for nand prefetch/post-write engine.

Signed-off-by: Vimal Singh 
---

 drivers/mtd/nand/Kconfig |9 ++
 drivers/mtd/nand/omap2.c |  186 ++-
 2 files changed, 193 insertions(+), 2 deletions(-)

Index: mtd-2.6/drivers/mtd/nand/Kconfig
===
--- mtd-2.6.orig/drivers/mtd/nand/Kconfig
+++ mtd-2.6/drivers/mtd/nand/Kconfig
@@ -88,6 +88,15 @@ config MTD_NAND_OMAP_PREFETCH
 The NAND device can be accessed for Read/Write using GPMC PREFETCH 
engine
 to improve the performance.

+config MTD_NAND_OMAP_PREFETCH_DMA
+   depends on MTD_NAND_OMAP_PREFETCH
+   bool "DMA mode"
+   default n
+   help
+The GPMC PREFETCH engine can be configured eigther in MPU interrupt 
mode
+or in DMA interrupt mode.
+Say y for DMA mode or MPU mode will be used
+
 config MTD_NAND_TS7250
tristate "NAND Flash device on TS-7250 board"
depends on MACH_TS72XX
Index: mtd-2.6/drivers/mtd/nand/omap2.c
===
--- mtd-2.6.orig/drivers/mtd/nand/omap2.c
+++ mtd-2.6/drivers/mtd/nand/omap2.c
@@ -18,8 +18,7 @@
 #include 
 #include 

-#include 
-
+#include 
 #include 
 #include 

@@ -118,8 +117,19 @@ static int use_prefetch = 1;
 /* "modprobe ... use_prefetch=0" etc */
 module_param(use_prefetch, bool, 0);
 MODULE_PARM_DESC(use_prefetch, "enable/disable use of PREFETCH");
+
+#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
+static int use_dma = 1;
+
+/* "modprobe ... use_dma=0" etc */
+module_param(use_dma, bool, 0);
+MODULE_PARM_DESC(use_dma, "enable/disable use of DMA");
+#else
+const int use_dma;
+#endif
 #else
 const int use_prefetch;
+const int use_dma;
 #endif

 struct omap_nand_info {
@@ -135,6 +145,8 @@ struct omap_nand_info {
void __iomem*gpmc_cs_baseaddr;
void __iomem*gpmc_baseaddr;
void __iomem*nand_pref_fifo_add;
+   struct completion   comp;
+   int dma_ch;
 };

 /**
@@ -355,6 +367,147 @@ static void omap_write_buf_pref(struct m
}
 }

+#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
+/*
+ * omap_nand_dma_cb: callback on the completion of dma transfer
+ * @lch: logical channel
+ * @ch_satuts: channel status
+ * @data: pointer to completion data structure
+ */
+static void omap_nand_dma_cb(int lch, u16 ch_status, void *data)
+{
+   complete((struct completion *) data);
+}
+
+/*
+ * omap_nand_dma_transfer: configer and start dma transfer
+ * @mtd: MTD device structure
+ * @addr: virtual address in RAM of source/destination
+ * @len: number of data bytes to be transferred
+ * @is_write: flag for read/write operation
+ */
+static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
+   unsigned int len, int is_write)
+{
+   struct omap_nand_info *info = container_of(mtd,
+   struct omap_nand_info, mtd);
+   uint32_t prefetch_status = 0;
+   enum dma_data_direction dir = is_write ? DMA_TO_DEVICE :
+   DMA_FROM_DEVICE;
+   dma_addr_t dma_addr;
+   int ret;
+
+   /* The fifo depth is 64 bytes. We have a sync at each frame and frame
+* length is 64 bytes.
+*/
+   int buf_len = len >> 6;
+
+   if (addr >= high_memory) {
+   struct page *p1;
+
+   if (((size_t)addr & PAGE_MASK) !=
+   ((size_t)(addr + len - 1) & PAGE_MASK))
+   goto out_copy;
+   p1 = vmalloc_to_page(addr);
+   if (!p1)
+   goto out_copy;
+   addr = page_address(p1) + ((size_t)addr & ~PAGE_MASK);
+   }
+
+   dma_addr = dma_map_single(&info->pdev->dev, addr, len, dir);
+   if (dma_mapping_error(&info->pdev->dev, dma_addr)) {
+   dev_err(&info->pdev->dev,
+   "Couldn't DMA map a %d byte buffer\n", len);
+   goto out_copy;
+   }
+
+   if (is_write) {
+   omap_set_dma_dest_params(info->dma_ch, 0, OMAP_DMA_AMODE_CONSTANT,
+   info->phys_base, 0, 0);
+   omap_set_dma_src_params(info->dma_ch, 0, OMAP_DMA_AMODE_POST_INC,
+   dma_addr, 0, 0);
+   omap_set_dma_transfer_params(info->dma_ch, OMAP_DMA_DATA_TYPE_S32,
+   0x10, buf_len, OMAP_DMA_SYNC_FRAME,
+   OMAP24XX_DMA_GPMC, OMAP_DMA_DST_SYNC);
+   } else {
+

[PATCH-v3 1:2] [MTD][NAND]omap: Adding support for nand prefetch-read and post-write, in MPU mode.

2009-07-13 Thread vimal singh
Patch updated for ' ioreadX / iowriteX and ioreadX_rep / iowriteX_rep' as per
David Brownell's comment. I updated 'omap_(read/write)_buf16' fucntions also
for this.

-vimal

This patch adds prefetch support to access nand flash in mpu mode.
This patch also adds 8-bit nand support (omap_read/write_buf8).
Prefetch can be used for both 8- and 16-bit devices.

Signed-off-by: Vimal Singh 
---

---
 arch/arm/mach-omap2/gpmc.c |   63 
 arch/arm/plat-omap/include/mach/gpmc.h |4
 drivers/mtd/nand/Kconfig   |8 +
 drivers/mtd/nand/omap2.c   |  161 +++--
 4 files changed, 226 insertions(+), 10 deletions(-)

Index: mtd-2.6/arch/arm/mach-omap2/gpmc.c
===
--- mtd-2.6.orig/arch/arm/mach-omap2/gpmc.c
+++ mtd-2.6/arch/arm/mach-omap2/gpmc.c
@@ -57,6 +57,11 @@
 #define GPMC_CHUNK_SHIFT   24  /* 16 MB */
 #define GPMC_SECTION_SHIFT 28  /* 128 MB */

+#define PREFETCH_FIFOTHRESHOLD (0x40 << 8)
+#define CS_NUM_SHIFT   24
+#define ENABLE_PREFETCH(0x1 << 7)
+#define DMA_MPU_MODE   2
+
 static struct resource gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
@@ -386,6 +391,63 @@ void gpmc_cs_free(int cs)
 }
 EXPORT_SYMBOL(gpmc_cs_free);

+/**
+ * gpmc_prefetch_enable - configures and starts prefetch transfer
+ * @cs: nand cs (chip select) number
+ * @dma_mode: dma mode enable (1) or disable (0)
+ * @u32_count: number of bytes to be transferred
+ * @is_write: prefetch read(0) or write post(1) mode
+ */
+int gpmc_prefetch_enable(int cs, int dma_mode,
+   unsigned int u32_count, int is_write)
+{
+   uint32_t prefetch_config1;
+
+   if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
+   /* Set the amount of bytes to be prefetched */
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
+
+   /* Set dma/mpu mode, the prefetch read / post write and
+* enable the engine. Set which cs is has requested for.
+*/
+   prefetch_config1 = ((cs << CS_NUM_SHIFT) |
+   PREFETCH_FIFOTHRESHOLD |
+   ENABLE_PREFETCH |
+   (dma_mode << DMA_MPU_MODE) |
+   (0x1 & is_write));
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, prefetch_config1);
+   } else {
+   return -EBUSY;
+   }
+   /*  Start the prefetch engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1);
+
+   return 0;
+}
+EXPORT_SYMBOL(gpmc_prefetch_enable);
+
+/**
+ * gpmc_prefetch_reset - disables and stops the prefetch engine
+ */
+void gpmc_prefetch_reset(void)
+{
+   /* Stop the PFPW engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
+
+   /* Reset/disable the PFPW engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0);
+}
+EXPORT_SYMBOL(gpmc_prefetch_reset);
+
+/**
+ * gpmc_prefetch_status - reads prefetch status of engine
+ */
+int  gpmc_prefetch_status(void)
+{
+   return gpmc_read_reg(GPMC_PREFETCH_STATUS);
+}
+EXPORT_SYMBOL(gpmc_prefetch_status);
+
 static void __init gpmc_mem_init(void)
 {
int cs;
@@ -452,6 +514,5 @@ void __init gpmc_init(void)
l &= 0x03 << 3;
l |= (0x02 << 3) | (1 << 0);
gpmc_write_reg(GPMC_SYSCONFIG, l);
-
gpmc_mem_init();
 }
Index: mtd-2.6/arch/arm/plat-omap/include/mach/gpmc.h
===
--- mtd-2.6.orig/arch/arm/plat-omap/include/mach/gpmc.h
+++ mtd-2.6/arch/arm/plat-omap/include/mach/gpmc.h
@@ -103,6 +103,10 @@ extern int gpmc_cs_request(int cs, unsig
 extern void gpmc_cs_free(int cs);
 extern int gpmc_cs_set_reserved(int cs, int reserved);
 extern int gpmc_cs_reserved(int cs);
+extern int gpmc_prefetch_enable(int cs, int dma_mode,
+   unsigned int u32_count, int is_write);
+extern void gpmc_prefetch_reset(void);
+extern int gpmc_prefetch_status(void);
 extern void __init gpmc_init(void);

 #endif
Index: mtd-2.6/drivers/mtd/nand/Kconfig
===
--- mtd-2.6.orig/drivers/mtd/nand/Kconfig
+++ mtd-2.6/drivers/mtd/nand/Kconfig
@@ -80,6 +80,14 @@ config MTD_NAND_OMAP2
help
   Support for NAND flash on Texas Instruments OMAP2 and OMAP3 
platforms.

+config MTD_NAND_OMAP_PREFETCH
+   bool "GPMC prefetch support for NAND Flash device"
+   depends on MTD_NAND && MTD_NAND_OMAP2
+   default y
+   help
+The NAND device can be accessed for Read/Write using GPMC PREFETCH 
engine
+to improve the performance.
+
 config MTD_NAND_TS7250
tristate "NAND Fla

[PATCH-v2 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write

2009-07-10 Thread vimal singh
This patch also got updated due to changes in 1st patch.
Also made 'len/64' to 'len >> 6', as per Artem's comment.

-vimal

This patch adds DMA mode support for nand prefetch/post-write engine.

Signed-off-by: Vimal Singh 
---

 drivers/mtd/nand/Kconfig |9 ++
 drivers/mtd/nand/omap2.c |  186 ++-
 2 files changed, 193 insertions(+), 2 deletions(-)

Index: mtd-2.6/drivers/mtd/nand/Kconfig
===
--- mtd-2.6.orig/drivers/mtd/nand/Kconfig
+++ mtd-2.6/drivers/mtd/nand/Kconfig
@@ -88,6 +88,15 @@ config MTD_NAND_OMAP_PREFETCH
 The NAND device can be accessed for Read/Write using GPMC PREFETCH 
engine
 to improve the performance.

+config MTD_NAND_OMAP_PREFETCH_DMA
+   depends on MTD_NAND_OMAP_PREFETCH
+   bool "DMA mode"
+   default n
+   help
+The GPMC PREFETCH engine can be configured eigther in MPU interrupt 
mode
+or in DMA interrupt mode.
+Say y for DMA mode or MPU mode will be used
+
 config MTD_NAND_TS7250
tristate "NAND Flash device on TS-7250 board"
depends on MACH_TS72XX
Index: mtd-2.6/drivers/mtd/nand/omap2.c
===
--- mtd-2.6.orig/drivers/mtd/nand/omap2.c
+++ mtd-2.6/drivers/mtd/nand/omap2.c
@@ -18,8 +18,7 @@
 #include 
 #include 

-#include 
-
+#include 
 #include 
 #include 

@@ -118,8 +117,19 @@ static int use_prefetch = 1;
 /* "modprobe ... use_prefetch=0" etc */
 module_param(use_prefetch, bool, 0);
 MODULE_PARM_DESC(use_prefetch, "enable/disable use of PREFETCH");
+
+#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
+static int use_dma = 1;
+
+/* "modprobe ... use_dma=0" etc */
+module_param(use_dma, bool, 0);
+MODULE_PARM_DESC(use_dma, "enable/disable use of DMA");
+#else
+const int use_dma;
+#endif
 #else
 const int use_prefetch;
+const int use_dma;
 #endif

 struct omap_nand_info {
@@ -135,6 +145,8 @@ struct omap_nand_info {
void __iomem*gpmc_cs_baseaddr;
void __iomem*gpmc_baseaddr;
void __iomem*nand_pref_fifo_add;
+   struct completion   comp;
+   int dma_ch;
 };

 /**
@@ -357,6 +369,147 @@ static void omap_write_buf_pref(struct m
}
 }

+#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
+/*
+ * omap_nand_dma_cb: callback on the completion of dma transfer
+ * @lch: logical channel
+ * @ch_satuts: channel status
+ * @data: pointer to completion data structure
+ */
+static void omap_nand_dma_cb(int lch, u16 ch_status, void *data)
+{
+   complete((struct completion *) data);
+}
+
+/*
+ * omap_nand_dma_transfer: configure and start dma transfer
+ * @mtd: MTD device structure
+ * @addr: virtual address in RAM of source/destination
+ * @len: number of data bytes to be transferred
+ * @is_write: flag for read/write operation
+ */
+static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
+   unsigned int len, int is_write)
+{
+   struct omap_nand_info *info = container_of(mtd,
+   struct omap_nand_info, mtd);
+   uint32_t prefetch_status = 0;
+   enum dma_data_direction dir = is_write ? DMA_TO_DEVICE :
+   DMA_FROM_DEVICE;
+   dma_addr_t dma_addr;
+   int ret;
+
+   /* The fifo depth is 64 bytes. We have a sync at each frame and frame
+* length is 64 bytes.
+*/
+   int buf_len = len >> 6;
+
+   if (addr >= high_memory) {
+   struct page *p1;
+
+   if (((size_t)addr & PAGE_MASK) !=
+   ((size_t)(addr + len - 1) & PAGE_MASK))
+   goto out_copy;
+   p1 = vmalloc_to_page(addr);
+   if (!p1)
+   goto out_copy;
+   addr = page_address(p1) + ((size_t)addr & ~PAGE_MASK);
+   }
+
+   dma_addr = dma_map_single(&info->pdev->dev, addr, len, dir);
+   if (dma_mapping_error(&info->pdev->dev, dma_addr)) {
+   dev_err(&info->pdev->dev,
+   "Couldn't DMA map a %d byte buffer\n", len);
+   goto out_copy;
+   }
+
+   if (is_write) {
+   omap_set_dma_dest_params(info->dma_ch, 0, OMAP_DMA_AMODE_CONSTANT,
+   info->phys_base, 0, 0);
+   omap_set_dma_src_params(info->dma_ch, 0, OMAP_DMA_AMODE_POST_INC,
+   dma_addr, 0, 0);
+   omap_set_dma_transfer_params(info->dma_ch, OMAP_DMA_DATA_TYPE_S32,
+   0x10, buf_len, OMAP_DMA_SYNC_FRAME,
+  

[PATCH-v2 1:2] [MTD][NAND]omap: Adding support for nand prefetch-read and post-write, in MPU mode.

2009-07-10 Thread vimal singh
Please ignore previous patch, it had some problem.
Fixing and re-submitting the patch this time.

-vimal

This patch adds prefetch support to access nand flash in mpu mode.
This patch also adds 8-bit nand support (omap_read/write_buf8).
Prefetch can be used for both 8- and 16-bit devices.

Signed-off-by: Vimal Singh 
---

 arch/arm/mach-omap2/gpmc.c |   63 -
 arch/arm/plat-omap/include/mach/gpmc.h |4
 drivers/mtd/nand/Kconfig   |8 +
 drivers/mtd/nand/omap2.c   |  159 +++--
 4 files changed, 226 insertions(+), 8 deletions(-)

Index: mtd-2.6/arch/arm/mach-omap2/gpmc.c
===
--- mtd-2.6.orig/arch/arm/mach-omap2/gpmc.c
+++ mtd-2.6/arch/arm/mach-omap2/gpmc.c
@@ -57,6 +57,11 @@
 #define GPMC_CHUNK_SHIFT   24  /* 16 MB */
 #define GPMC_SECTION_SHIFT 28  /* 128 MB */

+#define PREFETCH_FIFOTHRESHOLD (0x40 << 8)
+#define CS_NUM_SHIFT   24
+#define ENABLE_PREFETCH(0x1 << 7)
+#define DMA_MPU_MODE   2
+
 static struct resource gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
@@ -386,6 +391,63 @@ void gpmc_cs_free(int cs)
 }
 EXPORT_SYMBOL(gpmc_cs_free);

+/**
+ * gpmc_prefetch_enable - configures and starts prefetch transfer
+ * @cs: nand cs (chip select) number
+ * @dma_mode: dma mode enable (1) or disable (0)
+ * @u32_count: number of bytes to be transferred
+ * @is_write: prefetch read(0) or write post(1) mode
+ */
+int gpmc_prefetch_enable(int cs, int dma_mode,
+   unsigned int u32_count, int is_write)
+{
+   uint32_t prefetch_config1;
+
+   if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
+   /* Set the amount of bytes to be prefetched */
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
+
+   /* Set dma/mpu mode, the prefetch read / post write and
+* enable the engine. Set which cs is has requested for.
+*/
+   prefetch_config1 = ((cs << CS_NUM_SHIFT) |
+   PREFETCH_FIFOTHRESHOLD |
+   ENABLE_PREFETCH |
+   (dma_mode << DMA_MPU_MODE) |
+   (0x1 & is_write));
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, prefetch_config1);
+   } else {
+   return -EBUSY;
+   }
+   /*  Start the prefetch engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1);
+
+   return 0;
+}
+EXPORT_SYMBOL(gpmc_prefetch_enable);
+
+/**
+ * gpmc_prefetch_reset - disables and stops the prefetch engine
+ */
+void gpmc_prefetch_reset(void)
+{
+   /* Stop the PFPW engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
+
+   /* Reset/disable the PFPW engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0);
+}
+EXPORT_SYMBOL(gpmc_prefetch_reset);
+
+/**
+ * gpmc_prefetch_status - reads prefetch status of engine
+ */
+int  gpmc_prefetch_status(void)
+{
+   return gpmc_read_reg(GPMC_PREFETCH_STATUS);
+}
+EXPORT_SYMBOL(gpmc_prefetch_status);
+
 static void __init gpmc_mem_init(void)
 {
int cs;
@@ -452,6 +514,5 @@ void __init gpmc_init(void)
l &= 0x03 << 3;
l |= (0x02 << 3) | (1 << 0);
gpmc_write_reg(GPMC_SYSCONFIG, l);
-
gpmc_mem_init();
 }
Index: mtd-2.6/arch/arm/plat-omap/include/mach/gpmc.h
===
--- mtd-2.6.orig/arch/arm/plat-omap/include/mach/gpmc.h
+++ mtd-2.6/arch/arm/plat-omap/include/mach/gpmc.h
@@ -103,6 +103,10 @@ extern int gpmc_cs_request(int cs, unsig
 extern void gpmc_cs_free(int cs);
 extern int gpmc_cs_set_reserved(int cs, int reserved);
 extern int gpmc_cs_reserved(int cs);
+extern int gpmc_prefetch_enable(int cs, int dma_mode,
+   unsigned int u32_count, int is_write);
+extern void gpmc_prefetch_reset(void);
+extern int gpmc_prefetch_status(void);
 extern void __init gpmc_init(void);

 #endif
Index: mtd-2.6/drivers/mtd/nand/Kconfig
===
--- mtd-2.6.orig/drivers/mtd/nand/Kconfig
+++ mtd-2.6/drivers/mtd/nand/Kconfig
@@ -80,6 +80,14 @@ config MTD_NAND_OMAP2
help
   Support for NAND flash on Texas Instruments OMAP2 and OMAP3 
platforms.

+config MTD_NAND_OMAP_PREFETCH
+   bool "GPMC prefetch support for NAND Flash device"
+   depends on MTD_NAND && MTD_NAND_OMAP2
+   default y
+   help
+The NAND device can be accessed for Read/Write using GPMC PREFETCH 
engine
+to improve the performance.
+
 config MTD_NAND_TS7250
tristate "NAND Flash device on TS-7250 board"
depends on MACH_TS72XX
Index: mtd-2.6/drivers/mtd/nand/omap2

[PATCH 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write

2009-07-10 Thread vimal singh
This patch adds DMA mode support for nand prefetch/post-write engine.

Signed-off-by: Vimal Singh 
---

 drivers/mtd/nand/Kconfig |9 ++
 drivers/mtd/nand/omap2.c |  186 ++-
 2 files changed, 193 insertions(+), 2 deletions(-)

Index: mtd-2.6/drivers/mtd/nand/Kconfig
===
--- mtd-2.6.orig/drivers/mtd/nand/Kconfig
+++ mtd-2.6/drivers/mtd/nand/Kconfig
@@ -88,6 +88,15 @@ config MTD_NAND_OMAP_PREFETCH
 The NAND device can be accessed for Read/Write using GPMC PREFETCH 
engine
 to improve the performance.

+config MTD_NAND_OMAP_PREFETCH_DMA
+   depends on MTD_NAND_OMAP_PREFETCH
+   bool "DMA mode"
+   default n
+   help
+The GPMC PREFETCH engine can be configured eigther in MPU interrupt 
mode
+or in DMA interrupt mode.
+Say y for DMA mode or MPU mode will be used
+
 config MTD_NAND_TS7250
tristate "NAND Flash device on TS-7250 board"
depends on MACH_TS72XX
Index: mtd-2.6/drivers/mtd/nand/omap2.c
===
--- mtd-2.6.orig/drivers/mtd/nand/omap2.c
+++ mtd-2.6/drivers/mtd/nand/omap2.c
@@ -18,8 +18,7 @@
 #include 
 #include 

-#include 
-
+#include 
 #include 
 #include 

@@ -118,8 +117,19 @@ static int use_prefetch = 1;
 /* "modprobe ... use_prefetch=0" etc */
 module_param(use_prefetch, bool, 0);
 MODULE_PARM_DESC(use_prefetch, "enable/disable use of PREFETCH");
+
+#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
+static int use_dma = 1;
+
+/* "modprobe ... use_dma=0" etc */
+module_param(use_dma, bool, 0);
+MODULE_PARM_DESC(use_dma, "enable/disable use of DMA");
+#else
+const int use_dma;
+#endif
 #else
 const int use_prefetch;
+const int use_dma;
 #endif

 struct omap_nand_info {
@@ -135,6 +145,8 @@ struct omap_nand_info {
void __iomem*gpmc_cs_baseaddr;
void __iomem*gpmc_baseaddr;
void __iomem*nand_pref_fifo_add;
+   struct completion   comp;
+   int dma_ch;
 };

 /**
@@ -356,6 +368,147 @@ static void omap_write_buf_pref(struct m
gpmc_prefetch_reset();
 }

+#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
+/*
+ * omap_nand_dma_cb: callback on the completion of dma transfer
+ * @lch: logical channel
+ * @ch_satuts: channel status
+ * @data: pointer to completion data structure
+ */
+static void omap_nand_dma_cb(int lch, u16 ch_status, void *data)
+{
+   complete((struct completion *) data);
+}
+
+/*
+ * omap_nand_dma_transfer: configer and start dma transfer
+ * @mtd: MTD device structure
+ * @addr: virtual address in RAM of source/destination
+ * @len: number of data bytes to be transferred
+ * @is_write: flag for read/write operation
+ */
+static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
+   unsigned int len, int is_write)
+{
+   struct omap_nand_info *info = container_of(mtd,
+   struct omap_nand_info, mtd);
+   uint32_t prefetch_status = 0;
+   enum dma_data_direction dir = is_write ? DMA_TO_DEVICE :
+   DMA_FROM_DEVICE;
+   dma_addr_t dma_addr;
+   int ret;
+
+   /* The fifo depth is 64 bytes. We have a sync at each frame and frame
+* length is 64 bytes.
+*/
+   int buf_len = len/64;
+
+   if (addr >= high_memory) {
+   struct page *p1;
+
+   if (((size_t)addr & PAGE_MASK) !=
+   ((size_t)(addr + len - 1) & PAGE_MASK))
+   goto out_copy;
+   p1 = vmalloc_to_page(addr);
+   if (!p1)
+   goto out_copy;
+   addr = page_address(p1) + ((size_t)addr & ~PAGE_MASK);
+   }
+
+   dma_addr = dma_map_single(&info->pdev->dev, addr, len, dir);
+   if (dma_mapping_error(&info->pdev->dev, dma_addr)) {
+   dev_err(&info->pdev->dev,
+   "Couldn't DMA map a %d byte buffer\n", len);
+   goto out_copy;
+   }
+
+   if (is_write) {
+   omap_set_dma_dest_params(info->dma_ch, 0, OMAP_DMA_AMODE_CONSTANT,
+   info->phys_base, 0, 0);
+   omap_set_dma_src_params(info->dma_ch, 0, OMAP_DMA_AMODE_POST_INC,
+   dma_addr, 0, 0);
+   omap_set_dma_transfer_params(info->dma_ch, OMAP_DMA_DATA_TYPE_S32,
+   0x10, buf_len, OMAP_DMA_SYNC_FRAME,
+   OMAP24XX_DMA_GPMC, OMAP_DMA_DST_SYNC);
+   } else {
+   omap_set_dma_src_params(info->dma_ch, 0, OMAP_DMA_AMODE

[PATCH 1:2] [MTD][NAND]omap: Adding support for nand prefetch-read and post-write, in MPU mode.

2009-07-10 Thread vimal singh
This patch adds prefetch support to access nand flash in mpu mode.
This patch also adds 8-bit nand support (omap_read/write_buf8).
Prefetch can be used for both 8- and 16-bit devices.

Signed-off-by: Vimal Singh 
---

 arch/arm/mach-omap2/gpmc.c |   63 -
 arch/arm/plat-omap/include/mach/gpmc.h |4
 drivers/mtd/nand/Kconfig   |8 +
 drivers/mtd/nand/omap2.c   |  158 +++--
 4 files changed, 225 insertions(+), 8 deletions(-)

Index: mtd-2.6/arch/arm/mach-omap2/gpmc.c
===
--- mtd-2.6.orig/arch/arm/mach-omap2/gpmc.c
+++ mtd-2.6/arch/arm/mach-omap2/gpmc.c
@@ -57,6 +57,11 @@
 #define GPMC_CHUNK_SHIFT   24  /* 16 MB */
 #define GPMC_SECTION_SHIFT 28  /* 128 MB */

+#define PREFETCH_FIFOTHRESHOLD (0x40 << 8)
+#define CS_NUM_SHIFT   24
+#define ENABLE_PREFETCH(0x1 << 7)
+#define DMA_MPU_MODE   2
+
 static struct resource gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
@@ -386,6 +391,63 @@ void gpmc_cs_free(int cs)
 }
 EXPORT_SYMBOL(gpmc_cs_free);

+/**
+ * gpmc_prefetch_enable - configures and starts prefetch transfer
+ * @cs: nand cs (chip select) number
+ * @dma_mode: dma mode enable (1) or disable (0)
+ * @u32_count: number of bytes to be transferred
+ * @is_write: prefetch read(0) or write post(1) mode
+ */
+int gpmc_prefetch_enable(int cs, int dma_mode,
+   unsigned int u32_count, int is_write)
+{
+   uint32_t prefetch_config1;
+
+   if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
+   /* Set the amount of bytes to be prefetched */
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
+
+   /* Set dma/mpu mode, the prefetch read / post write and
+* enable the engine. Set which cs is has requested for.
+*/
+   prefetch_config1 = ((cs << CS_NUM_SHIFT) |
+   PREFETCH_FIFOTHRESHOLD |
+   ENABLE_PREFETCH |
+   (dma_mode << DMA_MPU_MODE) |
+   (0x1 & is_write));
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, prefetch_config1);
+   } else {
+   return -EBUSY;
+   }
+   /*  Start the prefetch engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1);
+
+   return 0;
+}
+EXPORT_SYMBOL(gpmc_prefetch_enable);
+
+/**
+ * gpmc_prefetch_reset - disables and stops the prefetch engine
+ */
+void gpmc_prefetch_reset(void)
+{
+   /* Stop the PFPW engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
+
+   /* Reset/disable the PFPW engine */
+   gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0);
+}
+EXPORT_SYMBOL(gpmc_prefetch_reset);
+
+/**
+ * gpmc_prefetch_status - reads prefetch status of engine
+ */
+int  gpmc_prefetch_status(void)
+{
+   return gpmc_read_reg(GPMC_PREFETCH_STATUS);
+}
+EXPORT_SYMBOL(gpmc_prefetch_status);
+
 static void __init gpmc_mem_init(void)
 {
int cs;
@@ -452,6 +514,5 @@ void __init gpmc_init(void)
l &= 0x03 << 3;
l |= (0x02 << 3) | (1 << 0);
gpmc_write_reg(GPMC_SYSCONFIG, l);
-
gpmc_mem_init();
 }
Index: mtd-2.6/arch/arm/plat-omap/include/mach/gpmc.h
===
--- mtd-2.6.orig/arch/arm/plat-omap/include/mach/gpmc.h
+++ mtd-2.6/arch/arm/plat-omap/include/mach/gpmc.h
@@ -103,6 +103,10 @@ extern int gpmc_cs_request(int cs, unsig
 extern void gpmc_cs_free(int cs);
 extern int gpmc_cs_set_reserved(int cs, int reserved);
 extern int gpmc_cs_reserved(int cs);
+extern int gpmc_prefetch_enable(int cs, int dma_mode,
+   unsigned int u32_count, int is_write);
+extern void gpmc_prefetch_reset(void);
+extern int gpmc_prefetch_status(void);
 extern void __init gpmc_init(void);

 #endif
Index: mtd-2.6/drivers/mtd/nand/Kconfig
===
--- mtd-2.6.orig/drivers/mtd/nand/Kconfig
+++ mtd-2.6/drivers/mtd/nand/Kconfig
@@ -80,6 +80,14 @@ config MTD_NAND_OMAP2
help
   Support for NAND flash on Texas Instruments OMAP2 and OMAP3 
platforms.

+config MTD_NAND_OMAP_PREFETCH
+   bool "GPMC prefetch support for NAND Flash device"
+   depends on MTD_NAND && MTD_NAND_OMAP2
+   default y
+   help
+The NAND device can be accessed for Read/Write using GPMC PREFETCH 
engine
+to improve the performance.
+
 config MTD_NAND_TS7250
tristate "NAND Flash device on TS-7250 board"
depends on MACH_TS72XX
Index: mtd-2.6/drivers/mtd/nand/omap2.c
===
--- mtd-2.6.orig/drivers/mtd/nand/o

[PATCH 0/2] [MTD] [NAND] Add prefetch and dma support for omap2/3 NAND driver

2009-07-10 Thread vimal singh
Hi,

I have splited gpmc prefetch support for NAND into two patches:
[PATCH 1:2] : Adding support for nand prefetch-read and post-write, in MPU mode.
[PATCH 2:2] : Adding DMA mode support in nand prefetch/post-write

These patches implements Tony's comments. (For comments and discussion see:
http://lists.infradead.org/pipermail/linux-mtd/2009-June/025993.html)

Other than that, gpmc_prefetch_(inti/request) call has been removed, as nothing
great was done in that and we really do not need that.

Function 'gpmc_prefetch_enable' does check for 'if prefetch is already being
used by some other driver?'. And if it is busy, normal cpu copy method for
read/write request will be used.

Thanks and regards,
vimal




--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [MTD] [NAND] Add prefetch and dma support for omap2/3 NAND driver

2009-06-04 Thread vimal singh
On Wed, Jun 3, 2009 at 10:03 PM, Tony Lindgren  wrote:
> * Singh, Vimal
 [090602
23:46]:
>>
>> On Wed, Jun 3, 2009 at 2:06 AM, Tony Lindgren  wrote:
>> > * vimal singh  [090602 05:40]:
>> >> This patch adds prefetch support to access nand flash in both mpu and dma
mode.
>> >> This patch also adds 8-bit nand support (omap_read/write_buf8).
>> >> Prefetch can be used for both 8- and 16-bit devices.
>> >
>> > This should be reviewed on the linux-omap@vger.kernel.org list for sure.
>> > One other comment below.
>> >
>> >> Signed-off-by: Vimal Singh 
>> >> ---
>> >> I prepared this patch on top of "OMAP2 / OMAP3 NAND driver" patch:
>> >> http://lists.infradead.org/pipermail/linux-mtd/2009-May/025562.html
>> >>
>> >> ---
>> >>  arch/arm/mach-omap2/gpmc.c |  102 ++
>> >>  arch/arm/plat-omap/include/mach/gpmc.h |4
>> >>  drivers/mtd/nand/Kconfig   |   17 +
>> >>  drivers/mtd/nand/omap2.c   |  308
-
>> >>  4 files changed, 422 insertions(+), 9 deletions(-)
>> >>
>> >> Index: mtd-2.6/arch/arm/mach-omap2/gpmc.c
>> >> ===
>> >> --- mtd-2.6.orig/arch/arm/mach-omap2/gpmc.c
>> >> +++ mtd-2.6/arch/arm/mach-omap2/gpmc.c
>> >> @@ -54,6 +54,12 @@
>> >>  #define GPMC_CHUNK_SHIFT 24  /* 16 MB */
>> >>  #define GPMC_SECTION_SHIFT   28  /* 128 MB */
>> >>
>> >> +#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH
>> >> +#define CS_NUM_SHIFT 24
>> >> +#define ENABLE_PREFETCH  7
>> >> +#define DMA_MPU_MODE 2
>> >> +#endif
>> >> +
>> >>  static struct resource   gpmc_mem_root;
>> >>  static struct resource   gpmc_cs_mem[GPMC_CS_NUM];
>> >>  static DEFINE_SPINLOCK(gpmc_mem_lock);
>> >> @@ -383,6 +389,99 @@ void gpmc_cs_free(int cs)
>> >>  }
>> >>  EXPORT_SYMBOL(gpmc_cs_free);
>> >>
>> >> +#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH
>> >> +/**
>> >> + * gpmc_prefetch_init - configures default configuration for prefetch
engine
>> >> + */
>> >> +static void gpmc_prefetch_init(void)
>> >> +{
>> >> + /* Setting the default threshold to 64 */
>> >> + gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
>> >> + gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x40  << 8);
>> >> + gpmc_write_reg(GPMC_PREFETCH_CONFIG2, 0x0);
>> >> +}
>> >
>> > Why would you want to have NAND specific init code int gpmc.c?
>> >
>> > The purpose if gpmc.c is to provide access to configuring the
>> > General Purpose Memory Controller (GPMC). You should just provide
>> > functions in gpmc.c for the platform init code to use, and then
>> > the drivers can stay platform independent.
>>
>> In my understanding, this 'prefetch' engine is part of GPMC itself, it is a
>> kind of feature provided by GPMC which can be utilized by NAND driver.
>> So, to me, it makes sens to get initialized prefetch by GPMC itself so that
>> NAND driver can use it.
>
> But it should not have a dependency to NAND.

This engine, in GPMC, is dedicated for NAND devices only.

>
>> Another reason was that all read / write to GPMC register are done by
>> functions 'gpmc_read_reg' / 'gpmc_write_reg', which have been made
>> 'static' in nature.
>
> That's why you need to provide a generic function in gpmc.c to enable
> prefetch that the platform code for any driver can use.

Exactly, and whenever a platform code uses gpmc init call, gpmc initializes
this engine too. Since prefetch engine is the part of GPMC, IMHOP, it should
get initialized as part of GPMC initialization.

And then there are prefetch start, stop and status functions calls have been
provided to be used by NAND driver.

-vimal
>
> Tony


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2][RFC] OMAP4: McBSP support for OMAP_4430SDP.

2009-05-11 Thread vimal singh

On Tue, May 12, 2009 at 11:49 AM, Syed Rafiuddin  wrote:
> This patch creates McBSP support on OMAP4430 development platform.
> This patch includes corresponding base address changes for OMAP4.
>
> Signed-off-by: Syed Rafiuddin 
> ---
>  arch/arm/mach-omap2/mcbsp.c |   46 
> 
>  arch/arm/plat-omap/include/mach/mcbsp.h |8 -
>  2 files changed, 53 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/arch/arm/mach-omap2/mcbsp.c
> ===
> --- linux-2.6.orig/arch/arm/mach-omap2/mcbsp.c  2009-05-12 10:57:12.0
+0530
> +++ linux-2.6/arch/arm/mach-omap2/mcbsp.c   2009-05-12 10:57:32.0
+0530
> @@ -169,6 +169,47 @@
>  #define OMAP34XX_MCBSP_PDATA_SZ0
>  #endif
>
> +#ifdef CONFIG_ARCH_OMAP4
> +static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = {
> +   {
> +   .phys_base  = OMAP44XX_MCBSP1_BASE,
> +   .dma_rx_sync= OMAP44XX_DMA_MCBSP1_RX,
> +   .dma_tx_sync= OMAP44XX_DMA_MCBSP1_TX,
> +   .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
> +   .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
> +   .ops= &omap2_mcbsp_ops,
> +   },
> +   {
> +   .phys_base  = OMAP44XX_MCBSP2_BASE,
> +   .dma_rx_sync= OMAP44XX_DMA_MCBSP2_RX,
> +   .dma_tx_sync= OMAP44XX_DMA_MCBSP2_TX,
> +   .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
> +   .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
> +   .ops= &omap2_mcbsp_ops,
> +   },
> +   {
> +   .phys_base  = OMAP44XX_MCBSP3_BASE,
> +   .dma_rx_sync= OMAP44XX_DMA_MCBSP3_RX,
> +   .dma_tx_sync= OMAP44XX_DMA_MCBSP3_TX,
> +   .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
> +   .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
> +   .ops= &omap2_mcbsp_ops,
> +   },
> +   {
> +   .phys_base  = OMAP44XX_MCBSP4_BASE,
> +   .dma_rx_sync= OMAP44XX_DMA_MCBSP4_RX,
> +   .dma_tx_sync= OMAP44XX_DMA_MCBSP4_TX,
> +   .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
> +   .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
> +   .ops= &omap2_mcbsp_ops,
> +   },
> +}
> +#define OMAP44XX_MCBSP_PDATA_SZ
> ARRAY_SIZE(omap44xx_mcbsp_pdata)
> +#else
> +#define omap44xx_mcbsp_pdata   NULL
> +#define OMAP44XX_MCBSP_PDATA_SZ0
> +#endif
> +
>  static int __init omap2_mcbsp_init(void)
>  {
>if (cpu_is_omap2420())
> @@ -177,6 +218,8 @@
>omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
>if (cpu_is_omap34xx())
>omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
> +   if (cpu_is_omap44xx())
> +   omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ;
>
>mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
>GFP_KERNEL);
> @@ -192,6 +235,9 @@
>if (cpu_is_omap34xx())
>omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
>OMAP34XX_MCBSP_PDATA_SZ);
> +   if (cpu_is_omap44xx())
> +   omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata,
> +   OMAP44XX_MCBSP_PDATA_SZ);
>
>return omap_mcbsp_init();
>  }
> Index: linux-2.6/arch/arm/plat-omap/include/mach/mcbsp.h
> ===
> --- linux-2.6.orig/arch/arm/plat-omap/include/mach/mcbsp.h  2009-05-12
> 10:57:12.0 +0530
> +++ linux-2.6/arch/arm/plat-omap/include/mach/mcbsp.h   2009-05-12
> 10:58:24.0 +0530
> @@ -53,6 +53,11 @@
>  #define OMAP34XX_MCBSP4_BASE   0x49026000
>  #define OMAP34XX_MCBSP5_BASE   0x48096000
>
> +#define OMAP44XX_MCBSP1_BASE   0x49022000
> +#define OMAP44XX_MCBSP2_BASE   0x49024000
> +#define OMAP44XX_MCBSP3_BASE   0x49026000
> +#define OMAP44XX_MCBSP4_BASE   0x48074000
> +
>  #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) ||
> defined(CONFIG_ARCH_OMAP730)

Can provide '\' in above line too...

>
>  #define OMAP_MCBSP_REG_DRR20x00
> @@ -98,7 +103,8 @@
>  #define AUDIO_DMA_TX   OMAP_DMA_MCBSP1_TX
>  #define AUDIO_DMA_RX   OMAP_DMA_MCBSP1_RX
>
> -#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
> +#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
> +   defined(CONFIG_ARCH_OMAP4)
>
>  #define OMAP_MCBSP_REG_DRR20x00
>  #define OMAP_MCBSP_REG_DRR10x04
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



---
Regards,
\/ | |\/| /-\ |_

Re: [PATCH 2/2][RFC] OMAP4: UART4 Support for OMAP_4430SDP.

2009-05-11 Thread vimal singh


On Tue, May 12, 2009 at 11:50 AM, Syed Rafiuddin  wrote:
> This patch enables support for UART4 on OMAP4430 development platform.
>
> Signed-off-by: Syed Rafiuddin 
> ---
> arch/arm/mach-omap2/board-4430sdp.c |2 +-
>  arch/arm/mach-omap2/serial.c|   12 
>  2 files changed, 13 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/arch/arm/mach-omap2/board-4430sdp.c
> ===
> --- linux-2.6.orig/arch/arm/mach-omap2/board-4430sdp.c  2009-05-12
> 10:43:41.0 +0530
> +++ linux-2.6/arch/arm/mach-omap2/board-4430sdp.c   2009-05-12
11:40:54.0
> +0530
This patch has lines wrapped here. Please correct this and re-send the patch.

> @@ -38,7 +38,7 @@
>  };
>
>  static struct omap_uart_config sdp4430_uart_config __initdata = {
> -   .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
> +   .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)),
>  };
>
>  static struct omap_lcd_config sdp4430_lcd_config __initdata = {
> Index: linux-2.6/arch/arm/mach-omap2/serial.c
> ===
> --- linux-2.6.orig/arch/arm/mach-omap2/serial.c 2009-05-12 11:35:55.0
> +0530
> +++ linux-2.6/arch/arm/mach-omap2/serial.c  2009-05-12 11:46:13.0
+0530

Ditto...

> @@ -53,8 +53,20 @@
>.iotype = UPIO_MEM,
>.regshift   = 2,
>.uartclk= OMAP24XX_BASE_BAUD * 16,
> +
> +   }, {
> +#ifdef CONFIG_ARCH_OMAP4
> +   .membase= IO_ADDRESS(OMAP_UART3_BASE),
> +   .mapbase= OMAP_UART4_BASE,
> +   .irq= 70,
> +   .flags  = UPF_BOOT_AUTOCONF,
> +   .iotype = UPIO_MEM,
> +   .regshift   = 2,
> +   .uartclk= OMAP24XX_BASE_BAUD * 16,
>}, {
> +#else
>.flags  = 0
> +#endif
>}
>  };
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>




---
Regards,
\/ | |\/| /-\ |_


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] onenand_init: Allow disabling sync read and write based on flags, v2 (Re: [PATCH 1/4] onenand init: Rename board-n800-flash.c to gpmc-onenand.c)

2009-05-04 Thread vimal singh


On Mon, May 4, 2009 at 9:29 PM, Tony Lindgren  wrote:
> * vimal singh  [090503 22:36]:
>>
>>
>> On Fri, May 1, 2009 at 11:08 PM, Tony Lindgren  wrote:
>> > * Tony Lindgren  [090430 11:56]:
>> >> * Tony Lindgren  [090430 07:06]:
>> >> > * vimal singh  [090429 23:33]:
>> >> > > 'gpmc-onenand.c' is still confusing name. This is not going to used in
>> >> > > all boards anyway.
>> >> >
>> >> > Why do you think this cannot be used for all boards?
>> >> >
>> >> > The GPMC timings are totally based on the onenand chip features.
>> >>
>> >> And these two patches make omap3430sdp to work with the gpmc-onenand
>> >> code. Sync mode does not work, but it seems like it was never enabled
>> >> for sdp anyways.
>> >>
>> >> Similar patch should work for other boards too.
>> >
>> > Setting the sync_write depends on flags and processor, not just flags.
>> > Here's a fixed version of this patch.
>> OK, these both patches seems good to me...
>
> OK, thanks for looking.
>
>> Earlier I was in impression that this patch series is basically to remove
>> board-*-flash.c files. Since in 3430sdp boards we find out 'CS' number for
>> flash devices dynamically in different versions of boards. So, I was 
>> confused.
>
> Well looks like those functions are used for at least few boards, so we could
> have functions like gpmc_probe_onenand() and gpmc_probe_nor() functions that
> could be called from board-*.c files.
>
> That way we could have generic gpmc-onenand.c and gpmc-nor.c, and still do
> the necessary probe logic in the board-*.c files.
But then how we'll be taking care of timing parameter configuration, for
different chips (part numbers), as some of these parts may vary in timing
specifications, and also for different working frequencies.
And if we are going to put those information in board-*.c, then rather I will
prefer separate board-*-flash.c file to handle all this.

---
Regards,
\/ | |\/| /-\ |_


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] onenand_init: Allow disabling sync read and write based on flags, v2 (Re: [PATCH 1/4] onenand init: Rename board-n800-flash.c to gpmc-onenand.c)

2009-05-03 Thread vimal singh


On Fri, May 1, 2009 at 11:08 PM, Tony Lindgren  wrote:
> * Tony Lindgren  [090430 11:56]:
>> * Tony Lindgren  [090430 07:06]:
>> > * vimal singh  [090429 23:33]:
>> > > 'gpmc-onenand.c' is still confusing name. This is not going to used in
>> > > all boards anyway.
>> >
>> > Why do you think this cannot be used for all boards?
>> >
>> > The GPMC timings are totally based on the onenand chip features.
>>
>> And these two patches make omap3430sdp to work with the gpmc-onenand
>> code. Sync mode does not work, but it seems like it was never enabled
>> for sdp anyways.
>>
>> Similar patch should work for other boards too.
>
> Setting the sync_write depends on flags and processor, not just flags.
> Here's a fixed version of this patch.
OK, these both patches seems good to me...
Earlier I was in impression that this patch series is basically to remove
board-*-flash.c files. Since in 3430sdp boards we find out 'CS' number for
flash devices dynamically in different versions of boards. So, I was confused.

> Tony
>


---
Regards,
\/ | |\/| /-\ |_



--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] onenand init: Rename board-n800-flash.c to gpmc-onenand.c

2009-04-29 Thread vimal singh
'gpmc-onenand.c' is still confusing name. This is not going to used in
all boards anyway.


On Thu, Apr 30, 2009 at 3:20 AM, Tony Lindgren  wrote:
> Rename board-n800-flash.c to gpmc-onenand.c.
>
> Signed-off-by: Tony Lindgren 
> ---
>  arch/arm/mach-omap2/Makefile   |4 ++--
>  arch/arm/mach-omap2/gpmc-onenand.c |0
>  2 files changed, 2 insertions(+), 2 deletions(-)
>  rename arch/arm/mach-omap2/{board-n800-flash.c => gpmc-onenand.c} (100%)
>
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 76acefa..9127a94 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -55,14 +55,14 @@ obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \
>  obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o \
>   board-apollon-mmc.o  \
>   board-apollon-keys.o
> -obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.o board-n800-flash.o \
> +obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.o gpmc-onenand.o \
>   board-n800-mmc.o board-n800-bt.o \
>   board-n800-usb.o \
>   board-n800-dsp.o \
>   board-n800-camera.o
>  obj-$(CONFIG_MACH_NOKIA_N810)  += board-n810.o
>  obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
> -  board-n800-flash.o \
> +  gpmc-onenand.o \
>   board-rx51-flash.o \
>   board-rx51-sdram.o \
>   board-rx51-video.o \
> diff --git a/arch/arm/mach-omap2/board-n800-flash.c
b/arch/arm/mach-omap2/gpmc-onenand.c
> similarity index 100%
> rename from arch/arm/mach-omap2/board-n800-flash.c
> rename to arch/arm/mach-omap2/gpmc-onenand.c
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
---
Regards,
\/ | |\/| /-\ |_


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH - Omapzoom] [NAND] [OMAP2]: Change __raw_readsl() to __raw_readsw()

2008-12-12 Thread vimal singh
OMAP2 NAND: Change __raw_readsl() to __raw_readsw()

This patch is taken from linux-omap tree submitted by Juha Kuikka (commit id:
352eeeabb67c2cb2cc613a02a62623790f360224).

Singed-off-by: Vimal Singh 
Signed-off-by: Juha Kuikka 
Signed-off-by: Tony Lindgren 
---
Patch is reworked to make it apply on omapzoom tree.

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index a542272..cf26958 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -338,7 +338,7 @@ static void omap_read_buf16(struct mtd_info *mtd, u_char
*buf, int len)
 {
struct nand_chip *nand = mtd->priv;

-   __raw_readsl(nand->IO_ADDR_R, buf, len / 2);
+   __raw_readsw(nand->IO_ADDR_R, buf, len / 2);
 }

 /*


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH - Omapzoom][NAND] 32-bit read in prefetch for NAND

2008-12-10 Thread vimal singh
Changing 16-bit read access to 32-bit to improve the performance in prefetch
support.

Signed-off-by: Vimal Singh <[EMAIL PROTECTED]>
---
 drivers/mtd/nand/omap2.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

Index: omapkernel/drivers/mtd/nand/omap2.c
===
--- omapkernel.orig/drivers/mtd/nand/omap2.c2008-11-06 18:33:49.0 
+0530
+++ omapkernel/drivers/mtd/nand/omap2.c 2008-11-06 18:36:32.0 +0530
@@ -375,27 +375,27 @@
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
uint32_t prefetch_status = 0, read_count = 0;
-   u16 *p = (u16 *)buf;
+   u32 *p = (u32 *)buf;

if ((use_dma && len <= mtd->oobsize) || (!use_dma)) {

/* take care of subpage reads */
-   if (len % 2 != 0) {
+   for (; len % 4 != 0; ) {
*buf++ = __raw_readb(info->nand.IO_ADDR_R);
-   p = (u16 *) buf;
len--;
}
+   p = (u32 *) buf;

/* configure and start prefetch transfer */
gpmc_prefetch_start(info->gpmc_cs, 0x0, len, 0x0);

do {
prefetch_status = gpmc_prefetch_status();
-   read_count = ((prefetch_status >> 24) & 0x7F) >> 1;
-   __raw_readsw(info->nand_pref_fifo_add, p,
+   read_count = ((prefetch_status >> 24) & 0x7F) >> 2;
+   __raw_readsl(info->nand_pref_fifo_add, p,
read_count);
p += read_count;
-   len -= read_count << 1;
+   len -= read_count << 2;
} while (len);

/* disable and stop the PFPW engine */


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


<    1   2   3   >