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

2009-05-04 Thread Adrian Hunter

Tony Lindgren wrote:

* Tony Lindgren t...@atomide.com [090430 07:06]:

* vimal singh vimalsi...@ti.com [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.

Tony



This is not quite right.  OneNAND only allows 3 possibilities:

1. Async: call 'omap2_onenand_set_async_mode()'

2. Sync Read: call 'omap2_onenand_set_sync_mode()' but force 'sync_write' 
variable to be always zero

3. Sync Read and Sync Write: call 'omap2_onenand_set_sync_mode()' as now
--
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] input: Add support for the TSC2003 controller.

2009-05-04 Thread Thierry Reding
* Kwangwoo Lee wrote:
 Hi Thierry and Trilok,
 
 On Wed, Apr 29, 2009 at 10:23 PM, Trilok Soni soni.tri...@gmail.com wrote:
  Hi Thierry,
 
  I have added linux-omap community. How different is this chip from
  tsc2007. It looks to me that this chip is not much different from
  tsc2007 (this is just quick look at the driver). If they
  are similar please consider using i2c_device_id feature in tsc2007 to
  accommodate this chip.
 
 I agree with the Trilok's opinion.
[snip]

I only noticed the tsc2007 driver some time ago, when the tsc2003 was already
finished (it's actually pretty old, I just never got around to submitting
it). However I never got the tsc2007 to work on my platform because it uses
sleeping functions inside the timer handler, which results in an oops right
after the first touchscreen interrupt.

I guess I could try and fix the tsc2007 properly instead of having a second,
pretty similar driver in the tree.

Cheers,
Thierry

--
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] input: Add support for the TSC2003 controller.

2009-05-04 Thread Trilok Soni
Hi Thierry,

On Mon, May 4, 2009 at 5:07 PM, Thierry Reding
thierry.red...@avionic-design.de wrote:
 * Kwangwoo Lee wrote:
 Hi Thierry and Trilok,

 On Wed, Apr 29, 2009 at 10:23 PM, Trilok Soni soni.tri...@gmail.com wrote:
  Hi Thierry,
 
  I have added linux-omap community. How different is this chip from
  tsc2007. It looks to me that this chip is not much different from
  tsc2007 (this is just quick look at the driver). If they
  are similar please consider using i2c_device_id feature in tsc2007 to
  accommodate this chip.

 I agree with the Trilok's opinion.
 [snip]

 I only noticed the tsc2007 driver some time ago, when the tsc2003 was already
 finished (it's actually pretty old, I just never got around to submitting
 it). However I never got the tsc2007 to work on my platform because it uses
 sleeping functions inside the timer handler, which results in an oops right
 after the first touchscreen interrupt.

 I guess I could try and fix the tsc2007 properly instead of having a second,
 pretty similar driver in the tree.


This could be because of improper locking? If you share a crash we can
have look at it.

-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
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] I2C: OMAP: Add missing wakeup events

2009-05-04 Thread Jagadeesh Bhaskar Pakaravoor
Ben,

On Sat, Feb 21, 2009 at 12:12 AM, Tony Lindgren t...@atomide.com wrote:

 * Pakaravoor, Jagadeesh j-pakarav...@ti.com [090202 07:28]:
  Hi,
   Is it a necesary bugfix, or should it wait for the next merge window?
 
  You can line it up for the next merge window.

 Just for references, I'm assuming that Ben has picked up this for his
 queue, so not adding it to any of my ustream queues.

 Acked-by: Tony Lindgren t...@atomide.com

 Regards,

 Tony

Is this patch applied?

--
With Regards,
Jagadeesh Bhaskar Pakaravoor
--
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 Tony Lindgren
* vimal singh vimalsi...@ti.com [090503 22:36]:
 
 
 On Fri, May 1, 2009 at 11:08 PM, Tony Lindgren t...@atomide.com wrote:
  * Tony Lindgren t...@atomide.com [090430 11:56]:
  * Tony Lindgren t...@atomide.com [090430 07:06]:
   * vimal singh vimalsi...@ti.com [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.

Regards,

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] input: Add support for the TSC2003 controller.

2009-05-04 Thread Thierry Reding
* Trilok Soni wrote:
 Hi Thierry,
 
 On Mon, May 4, 2009 at 5:07 PM, Thierry Reding
 thierry.red...@avionic-design.de wrote:
  * Kwangwoo Lee wrote:
  Hi Thierry and Trilok,
 
  On Wed, Apr 29, 2009 at 10:23 PM, Trilok Soni soni.tri...@gmail.com 
  wrote:
   Hi Thierry,
  
   I have added linux-omap community. How different is this chip from
   tsc2007. It looks to me that this chip is not much different from
   tsc2007 (this is just quick look at the driver). If they
   are similar please consider using i2c_device_id feature in tsc2007 to
   accommodate this chip.
 
  I agree with the Trilok's opinion.
  [snip]
 
  I only noticed the tsc2007 driver some time ago, when the tsc2003 was 
  already
  finished (it's actually pretty old, I just never got around to submitting
  it). However I never got the tsc2007 to work on my platform because it uses
  sleeping functions inside the timer handler, which results in an oops right
  after the first touchscreen interrupt.
 
  I guess I could try and fix the tsc2007 properly instead of having a second,
  pretty similar driver in the tree.
 
 
 This could be because of improper locking? If you share a crash we can
 have look at it.

Attached is a patch that fixes things for me. The problem was that the I2C
transfers were done in interrupt context which fails for the controller I use
(PXA270). The attached patch uses a struct work_struct to schedule the I2C
transfers so they are executed in non-interrupt context.

I've tested the patch on a minimal system with tslib and it work fine with
ts_calibrate and friends.

Thierry

From: Thierry Reding thierry.red...@avionic-design.de
Subject: [PATCH] tsc2007: Fix for I2C controllers that sleep during transfers.

This patch fixes the tsc2007 driver with I2C controllers that sleep during
transfers. By moving the critical code to a workqueue, I2C transfers can be
scheduled to run in non-interrupt context.

Signed-off-by: Thierry Reding thierry.red...@avionic-design.de

---
 drivers/input/touchscreen/tsc2007.c |   25 ++---
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 4ab0702..6efb54d 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -70,6 +70,7 @@ struct ts_event {
 struct tsc2007 {
 	struct input_dev	*input;
 	char			phys[32];
+	struct work_struct	work;
 	struct hrtimer		timer;
 	struct ts_event		tc;
 
@@ -173,6 +174,9 @@ static void tsc2007_send_event(void *tsc)
 
 		dev_dbg(ts-client-dev, point(%4d,%4d), pressure (%4u)\n,
 			x, y, rt);
+	} else {
+		if (!ts-pendown)
+			ts-pendown = 1;
 	}
 
 	hrtimer_start(ts-timer, ktime_set(0, TS_POLL_PERIOD),
@@ -197,11 +201,19 @@ static int tsc2007_read_values(struct tsc2007 *tsc)
 	return 0;
 }
 
+static void tsc2007_work(struct work_struct *work)
+{
+	struct tsc2007 *ts = container_of(work, struct tsc2007, work);
+	tsc2007_read_values(ts);
+	tsc2007_send_event(ts);
+}
+
 static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
 {
 	struct tsc2007 *ts = container_of(handle, struct tsc2007, timer);
+	unsigned long flags = 0;
 
-	spin_lock_irq(ts-lock);
+	spin_lock_irqsave(ts-lock, flags);
 
 	if (unlikely(!ts-get_pendown_state()  ts-pendown)) {
 		struct input_dev *input = ts-input;
@@ -217,12 +229,10 @@ static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
 	} else {
 		/* pen is still down, continue with the measurement */
 		dev_dbg(ts-client-dev, pen is still down\n);
-
-		tsc2007_read_values(ts);
-		tsc2007_send_event(ts);
+		schedule_work(ts-work);
 	}
 
-	spin_unlock_irq(ts-lock);
+	spin_unlock_irqrestore(ts-lock, flags);
 
 	return HRTIMER_NORESTART;
 }
@@ -235,7 +245,7 @@ static irqreturn_t tsc2007_irq(int irq, void *handle)
 	spin_lock_irqsave(ts-lock, flags);
 
 	if (likely(ts-get_pendown_state())) {
-		disable_irq(ts-irq);
+		disable_irq_nosync(ts-irq);
 		hrtimer_start(ts-timer, ktime_set(0, TS_POLL_DELAY),
 	HRTIMER_MODE_REL);
 	}
@@ -252,7 +262,7 @@ static int tsc2007_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
 	struct tsc2007 *ts;
-	struct tsc2007_platform_data *pdata = pdata = client-dev.platform_data;
+	struct tsc2007_platform_data *pdata = client-dev.platform_data;
 	struct input_dev *input_dev;
 	int err;
 
@@ -279,6 +289,7 @@ static int tsc2007_probe(struct i2c_client *client,
 
 	hrtimer_init(ts-timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	ts-timer.function = tsc2007_timer;
+	INIT_WORK(ts-work, tsc2007_work);
 
 	spin_lock_init(ts-lock);
 
-- 
tg: (091438d..) adx/input/tsc2007 (depends on: adx/master)


Re: [PATCH] input: Add support for the TSC2003 controller.

2009-05-04 Thread Trilok Soni
Hi Therry,

On Mon, May 4, 2009 at 8:27 PM, Thierry Reding
thierry.red...@avionic-design.de wrote:
 * Trilok Soni wrote:
 Hi Thierry,

 On Mon, May 4, 2009 at 5:07 PM, Thierry Reding
 thierry.red...@avionic-design.de wrote:
  * Kwangwoo Lee wrote:
  Hi Thierry and Trilok,
 
  On Wed, Apr 29, 2009 at 10:23 PM, Trilok Soni soni.tri...@gmail.com 
  wrote:
   Hi Thierry,
  
   I have added linux-omap community. How different is this chip from
   tsc2007. It looks to me that this chip is not much different from
   tsc2007 (this is just quick look at the driver). If they
   are similar please consider using i2c_device_id feature in tsc2007 to
   accommodate this chip.
 
  I agree with the Trilok's opinion.
  [snip]
 
  I only noticed the tsc2007 driver some time ago, when the tsc2003 was 
  already
  finished (it's actually pretty old, I just never got around to submitting
  it). However I never got the tsc2007 to work on my platform because it uses
  sleeping functions inside the timer handler, which results in an oops right
  after the first touchscreen interrupt.
 
  I guess I could try and fix the tsc2007 properly instead of having a 
  second,
  pretty similar driver in the tree.
 

 This could be because of improper locking? If you share a crash we can
 have look at it.

 Attached is a patch that fixes things for me. The problem was that the I2C
 transfers were done in interrupt context which fails for the controller I use
 (PXA270). The attached patch uses a struct work_struct to schedule the I2C
 transfers so they are executed in non-interrupt context.

 I've tested the patch on a minimal system with tslib and it work fine with
 ts_calibrate and friends.

Thanks for the patch. It looks good. Let's wait for Kwangwoo Lee to
verify it on his platform. Also please add tsc2003 entry into
i2c_device_ids so that i2c_board_info can specify the .name as
tsc2003.

-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
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, v3

2009-05-04 Thread Tony Lindgren
* Adrian Hunter adrian.hun...@nokia.com [090504 01:27]:
 Tony Lindgren wrote:
 * Tony Lindgren t...@atomide.com [090430 07:06]:
 * vimal singh vimalsi...@ti.com [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.

 Tony


 This is not quite right.  OneNAND only allows 3 possibilities:

 1. Async: call 'omap2_onenand_set_async_mode()'

 2. Sync Read: call 'omap2_onenand_set_sync_mode()' but force 'sync_write' 
 variable to be always zero

 3. Sync Read and Sync Write: call 'omap2_onenand_set_sync_mode()' as now

Thanks. I take it that you mean that we need to leave out the sync write
option from the possible combinations. Here's the updated version, let
me know if you had something else in mind.

This patch also moves the cpu_is_24xx() test to the init.

Regards,

Tony

From 27f14d9d80b20bbc03b99927ce5f0d2e409ab890 Mon Sep 17 00:00:00 2001
From: Tony Lindgren t...@atomide.com
Date: Thu, 30 Apr 2009 11:43:19 -0700
Subject: [PATCH] onenand_init: Allow disabling sync read and write based on flags, v3

Allow disabling sync read and write based on flags

Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index e882e4b..74e7ea4 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -722,6 +722,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
 	.gpio_irq	= 26,
 	.parts		= onenand_partitions,
 	.nr_parts	= ARRAY_SIZE(onenand_partitions),
+	.flags		= ONENAND_SYNC_READ,
 };
 
 static void __init board_onenand_init(void)
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 7b1ee3d..55e8568 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -515,6 +515,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
 	.gpio_irq	= 65,
 	.parts		= onenand_partitions,
 	.nr_parts	= ARRAY_SIZE(onenand_partitions),
+	.flags		= ONENAND_SYNC_READWRITE,
 };
 
 static void __init board_onenand_init(void)
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index fc79183..d243228 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -86,15 +86,18 @@ static void omap2_onenand_writew(unsigned short value, void __iomem *addr)
 }
 
 static void set_onenand_cfg(void __iomem *onenand_base, int latency,
-			int sync_write, int hf)
+int sync_read, int sync_write, int hf)
 {
 	u32 reg;
 
 	reg = omap2_onenand_readw(onenand_base + ONENAND_REG_SYS_CFG1);
 	reg = ~((0x7  ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7  9));
 	reg |=	(latency  ONENAND_SYS_CFG1_BRL_SHIFT) |
-		ONENAND_SYS_CFG1_SYNC_READ |
 		ONENAND_SYS_CFG1_BL_16;
+	if (sync_read)
+		reg |= ONENAND_SYS_CFG1_SYNC_READ;
+	else
+		reg = ~ONENAND_SYS_CFG1_SYNC_READ;
 	if (sync_write)
 		reg |= ONENAND_SYS_CFG1_SYNC_WRITE;
 	else
@@ -106,8 +109,9 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
 	omap2_onenand_writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
 }
 
-static int omap2_onenand_set_sync_mode(int cs, void __iomem *onenand_base,
-   int freq)
+static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
+	void __iomem *onenand_base,
+	int freq)
 {
 	struct gpmc_timings t;
 	const int t_cer  = 15;
@@ -118,9 +122,17 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem *onenand_base,
 	const int t_wph  = 30;
 	int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
 	int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
-	int err, ticks_cez, sync_write = 0, first_time = 0, hf = 0;
+	int err, ticks_cez, sync_read = 0, sync_write = 0, first_time = 0, hf = 0;
+	int cs = cfg-cs;
 	u32 reg;
 
+	if (cfg-flags  ONENAND_SYNC_READ) {
+		sync_read = 1;
+	} else if (cfg-flags  ONENAND_SYNC_READWRITE) {
+		sync_read = 1;
+		sync_write = 1;
+	}
+
 	if (!freq) {
 		/* Very first call freq is not known */
 		err = omap2_onenand_set_async_mode(cs, onenand_base);
@@ -160,8 +172,6 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem *onenand_base,
 		t_ach   = 6;
 		t_aavdh = 6;
 		t_rdyo  = 9;
-		if (cpu_is_omap34xx())
-			sync_write = 1;
 		break;
 	case 66:
 		min_gpmc_clk_period = 15; /* 66 MHz */
@@ -171,8 +181,6 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem *onenand_base,
 		t_ach   = 6;
 		t_aavdh = 6;
 		t_rdyo  = 11;
-		if (cpu_is_omap34xx())
-			sync_write = 1;
 		break;
 	default:
 		min_gpmc_clk_period = 18; /* 54 MHz */
@@ -182,6 +190,7 @@ static int 

[PATCH 0/7] Generic gpmc-onenand initialization, v3

2009-05-04 Thread Tony Lindgren
Hi all,

Here's the whole series one more time, looks like I missed Juha
from the recipients originally. After all it's mostly Juha's
code! :)

To recap, this series creates a generic gpmc-onenand.c out of the
board-n800-flash.c so we can get this init code to the mainline
kernel. This series is against the linux-omap tree, the patch
against the mainline tree will be posted later.

Regards,

Tony

---

Tony Lindgren (7):
  onenand_init: Clean-up for checkpatch.pl
  onenand init: Convert omap3430sdp to use gpmc-onenand
  onenand_init: Allow disabling sync read and write based on flags, v3
  onenand init: Pass configuration data from board-*.c files
  onenand init: Rename n800_* functions to gpmc_onenand_* functions
  onenand init: Build gpmc-onenand.o based on CONFIG_MTD_ONENAND_OMAP2
  onenand init: Rename board-n800-flash.c to gpmc-onenand.c


 arch/arm/mach-omap2/Makefile |7 +-
 arch/arm/mach-omap2/board-3430sdp-flash.c|   28 ---
 arch/arm/mach-omap2/board-n800.c |   50 
 arch/arm/mach-omap2/board-rx51-flash.c   |   21 -
 arch/arm/mach-omap2/board-rx51-peripherals.c |   47 
 arch/arm/mach-omap2/board-rx51.c |2 
 arch/arm/mach-omap2/gpmc-onenand.c   |  105 --
 arch/arm/plat-omap/include/mach/board.h  |8 --
 arch/arm/plat-omap/include/mach/onenand.h|   29 +++
 9 files changed, 177 insertions(+), 120 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-rx51-flash.c
 rename arch/arm/mach-omap2/{board-n800-flash.c = gpmc-onenand.c} (78%)

-- 
Signature
--
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/7] onenand init: Rename board-n800-flash.c to gpmc-onenand.c

2009-05-04 Thread Tony Lindgren
Rename board-n800-flash.c to gpmc-onenand.c.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 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


[PATCH 2/7] onenand init: Build gpmc-onenand.o based on CONFIG_MTD_ONENAND_OMAP2

2009-05-04 Thread Tony Lindgren
Build gpmc-onenand.o based on CONFIG_MTD_ONENAND_OMAP2

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 9127a94..9cb2662 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -55,14 +55,13 @@ 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 gpmc-onenand.o \
+obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.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 \
-  gpmc-onenand.o \
   board-rx51-flash.o \
   board-rx51-sdram.o \
   board-rx51-video.o \
@@ -79,6 +78,9 @@ obj-$(CONFIG_MACH_OMAP3_PANDORA)  += board-omap3pandora.o 
\
 obj-$(CONFIG_USB_MUSB_SOC) += usb-musb.o
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)  += usb-tusb6010.o
 
+onenand-$(CONFIG_MTD_ONENAND_OMAP2):= gpmc-onenand.o
+obj-y  += $(onenand-m) $(onenand-y)
+
 ifneq ($(CONFIG_USB_EHCI_HCD),)
obj-y   += usb-ehci.o
 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


[PATCH 3/7] onenand init: Rename n800_* functions to gpmc_onenand_* functions

2009-05-04 Thread Tony Lindgren
Rename n800_* functions to gpmc_onenand_* functions

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile  |1 -
 arch/arm/mach-omap2/board-n800.c  |2 +-
 arch/arm/mach-omap2/board-rx51-flash.c|   21 ---
 arch/arm/mach-omap2/board-rx51.c  |4 ++--
 arch/arm/mach-omap2/gpmc-onenand.c|   32 +++--
 arch/arm/plat-omap/include/mach/onenand.h |   12 +++
 6 files changed, 31 insertions(+), 41 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-rx51-flash.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 9cb2662..d35996d 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -62,7 +62,6 @@ obj-$(CONFIG_MACH_NOKIA_N800) += board-n800.o \
   board-n800-camera.o
 obj-$(CONFIG_MACH_NOKIA_N810)  += board-n810.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
-  board-rx51-flash.o \
   board-rx51-sdram.o \
   board-rx51-video.o \
   board-rx51-peripherals.o \
diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index f1552f0..3d0a83b 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -689,7 +689,7 @@ void __init nokia_n800_common_init(void)
 {
platform_add_devices(n800_devices, ARRAY_SIZE(n800_devices));
 
-   n800_flash_init();
+   gpmc_onenand_init();
n800_mmc_init();
n800_bt_init();
n800_dsp_init();
diff --git a/arch/arm/mach-omap2/board-rx51-flash.c 
b/arch/arm/mach-omap2/board-rx51-flash.c
deleted file mode 100644
index f3b7eaf..000
--- a/arch/arm/mach-omap2/board-rx51-flash.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/board-rx51-flash.c
- *
- * Copyright (C) 2008 Nokia
- *
- * 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 linux/kernel.h
-#include linux/init.h
-#include mach/board-rx51.h
-
-extern void __init n800_flash_init(void);
-
-void __init rx51_flash_init(void)
-{
-   n800_flash_init();
-}
-
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index c800b24..20a2470 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -30,6 +30,7 @@
 #include mach/dma.h
 #include mach/gpmc.h
 #include mach/usb.h
+#include mach/onenand.h
 #include mach/board-rx51.h
 
 static struct omap_uart_config rx51_uart_config = {
@@ -67,7 +68,6 @@ static void __init rx51_init_irq(void)
omap_gpio_init();
 }
 
-extern void __init rx51_flash_init(void);
 extern void __init rx51_peripherals_init(void);
 extern void __init rx51_video_init(void);
 
@@ -77,7 +77,7 @@ static void __init rx51_init(void)
omap_board_config_size = ARRAY_SIZE(rx51_config);
omap_serial_init();
usb_musb_init();
-   rx51_flash_init();
+   gpmc_onenand_init();
rx51_peripherals_init();
rx51_video_init();
 }
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c 
b/arch/arm/mach-omap2/gpmc-onenand.c
index 52aaf76..96f9358 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -19,22 +19,22 @@
 #include mach/board.h
 #include mach/gpmc.h
 
-struct mtd_partition n800_partitions[ONENAND_MAX_PARTITIONS];
+struct mtd_partition gpmc_onenand_partitions[ONENAND_MAX_PARTITIONS];
 
-int n800_onenand_setup(void __iomem *, int freq);
+int gpmc_onenand_setup(void __iomem *, int freq);
 
-static struct omap_onenand_platform_data n800_onenand_data = {
+static struct omap_onenand_platform_data gpmc_onenand_data = {
.cs = 0,
-   .parts = n800_partitions,
+   .parts = gpmc_onenand_partitions,
.nr_parts = 0, /* filled later */
-   .onenand_setup = n800_onenand_setup,
+   .onenand_setup = gpmc_onenand_setup,
 };
 
-static struct platform_device n800_onenand_device = {
+static struct platform_device gpmc_onenand_device = {
.name   = omap2-onenand,
.id = -1,
.dev = {
-   .platform_data = n800_onenand_data,
+   .platform_data = gpmc_onenand_data,
},
 };
 
@@ -305,10 +305,10 @@ static int omap2_onenand_set_sync_mode(int cs, void 
__iomem *onenand_base,
return 0;
 }
 
-int n800_onenand_setup(void __iomem *onenand_base, int freq)
+int gpmc_onenand_setup(void __iomem *onenand_base, int freq)
 {
-   struct omap_onenand_platform_data *datap = n800_onenand_data;
-   struct device *dev = n800_onenand_device.dev;
+   struct omap_onenand_platform_data *datap = gpmc_onenand_data;
+   struct device *dev = gpmc_onenand_device.dev;
 
 

[PATCH 4/7] onenand init: Pass configuration data from board-*.c files

2009-05-04 Thread Tony Lindgren
Pass configuration data from board-*.c files.

Also remove support for the OMAP_TAG_PARTITION tag.
If the partition info is passed, it should be passed from
cmdline, and probably should be done in a generic way
in the drivers/mtd.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-n800.c |   49 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |   46 
 arch/arm/mach-omap2/board-rx51.c |2 -
 arch/arm/mach-omap2/gpmc-onenand.c   |   47 +
 arch/arm/plat-omap/include/mach/board.h  |8 
 arch/arm/plat-omap/include/mach/onenand.h|   16 +++-
 6 files changed, 116 insertions(+), 52 deletions(-)

diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index 3d0a83b..e882e4b 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -41,6 +41,7 @@
 #include mach/gpio-switch.h
 #include mach/omapfb.h
 #include mach/blizzard.h
+#include mach/onenand.h
 #include mach/board-nokia.h
 
 #include ../drivers/cbus/tahvo.h
@@ -685,11 +686,55 @@ static struct i2c_board_info __initdata_or_module 
n810_i2c_board_info_2[] = {
},
 };
 
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || 
defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+
+static struct mtd_partition onenand_partitions[] = {
+   {
+   .name   = bootloader,
+   .offset = 0,
+   .size   = 0x2,
+   .mask_flags = MTD_WRITEABLE,/* Force read-only */
+   },
+   {
+   .name   = config,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x6,
+   },
+   {
+   .name   = kernel,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x20,
+   },
+   {
+   .name   = initfs,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x40,
+   },
+   {
+   .name   = rootfs,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   },
+};
+
+static struct omap_onenand_platform_data board_onenand_data = {
+   .cs = 0,
+   .gpio_irq   = 26,
+   .parts  = onenand_partitions,
+   .nr_parts   = ARRAY_SIZE(onenand_partitions),
+};
+
+static void __init board_onenand_init(void)
+{
+   gpmc_onenand_init(board_onenand_data);
+}
+
+#endif
+
 void __init nokia_n800_common_init(void)
 {
platform_add_devices(n800_devices, ARRAY_SIZE(n800_devices));
 
-   gpmc_onenand_init();
n800_mmc_init();
n800_bt_init();
n800_dsp_init();
@@ -717,6 +762,7 @@ void __init nokia_n800_common_init(void)

mipid_dev_init();
blizzard_dev_init();
+   board_onenand_init();
 }
 
 static void __init nokia_n800_init(void)
@@ -728,6 +774,7 @@ static void __init nokia_n800_init(void)
tea5761_dev_init();
omap_register_gpio_switches(n800_gpio_switches,
ARRAY_SIZE(n800_gpio_switches));
+   board_onenand_init();
 }
 
 void __init nokia_n800_map_io(void)
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 22183af..7b1ee3d 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -27,6 +27,7 @@
 #include mach/common.h
 #include mach/dma.h
 #include mach/gpmc.h
+#include mach/onenand.h
 
 #include mmc-twl4030.h
 
@@ -478,6 +479,50 @@ static int __init rx51_i2c_init(void)
return 0;
 }
 
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || 
defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+
+static struct mtd_partition onenand_partitions[] = {
+   {
+   .name   = bootloader,
+   .offset = 0,
+   .size   = 0x2,
+   .mask_flags = MTD_WRITEABLE,/* Force read-only */
+   },
+   {
+   .name   = config,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x6,
+   },
+   {
+   .name   = kernel,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x20,
+   },
+   {
+   .name   = initfs,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x20,
+   },
+   {
+   .name   = rootfs,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   },
+};
+
+static struct omap_onenand_platform_data board_onenand_data = {
+   .cs = 0,
+   .gpio_irq   = 65,
+   .parts  = onenand_partitions,
+   .nr_parts   

[PATCH 5/7] onenand_init: Allow disabling sync read and write based on flags, v3

2009-05-04 Thread Tony Lindgren
Allow disabling sync read and write based on flags

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-n800.c |1 +
 arch/arm/mach-omap2/board-rx51-peripherals.c |1 +
 arch/arm/mach-omap2/gpmc-onenand.c   |   43 ++
 arch/arm/plat-omap/include/mach/onenand.h|4 ++
 4 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index e882e4b..74e7ea4 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -722,6 +722,7 @@ static struct omap_onenand_platform_data board_onenand_data 
= {
.gpio_irq   = 26,
.parts  = onenand_partitions,
.nr_parts   = ARRAY_SIZE(onenand_partitions),
+   .flags  = ONENAND_SYNC_READ,
 };
 
 static void __init board_onenand_init(void)
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 7b1ee3d..55e8568 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -515,6 +515,7 @@ static struct omap_onenand_platform_data board_onenand_data 
= {
.gpio_irq   = 65,
.parts  = onenand_partitions,
.nr_parts   = ARRAY_SIZE(onenand_partitions),
+   .flags  = ONENAND_SYNC_READWRITE,
 };
 
 static void __init board_onenand_init(void)
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c 
b/arch/arm/mach-omap2/gpmc-onenand.c
index fc79183..d243228 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -86,15 +86,18 @@ static void omap2_onenand_writew(unsigned short value, void 
__iomem *addr)
 }
 
 static void set_onenand_cfg(void __iomem *onenand_base, int latency,
-   int sync_write, int hf)
+   int sync_read, int sync_write, int hf)
 {
u32 reg;
 
reg = omap2_onenand_readw(onenand_base + ONENAND_REG_SYS_CFG1);
reg = ~((0x7  ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7  9));
reg |=  (latency  ONENAND_SYS_CFG1_BRL_SHIFT) |
-   ONENAND_SYS_CFG1_SYNC_READ |
ONENAND_SYS_CFG1_BL_16;
+   if (sync_read)
+   reg |= ONENAND_SYS_CFG1_SYNC_READ;
+   else
+   reg = ~ONENAND_SYS_CFG1_SYNC_READ;
if (sync_write)
reg |= ONENAND_SYS_CFG1_SYNC_WRITE;
else
@@ -106,8 +109,9 @@ static void set_onenand_cfg(void __iomem *onenand_base, int 
latency,
omap2_onenand_writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
 }
 
-static int omap2_onenand_set_sync_mode(int cs, void __iomem *onenand_base,
-  int freq)
+static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
+   void __iomem *onenand_base,
+   int freq)
 {
struct gpmc_timings t;
const int t_cer  = 15;
@@ -118,9 +122,17 @@ static int omap2_onenand_set_sync_mode(int cs, void 
__iomem *onenand_base,
const int t_wph  = 30;
int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
-   int err, ticks_cez, sync_write = 0, first_time = 0, hf = 0;
+   int err, ticks_cez, sync_read = 0, sync_write = 0, first_time = 0, hf = 
0;
+   int cs = cfg-cs;
u32 reg;
 
+   if (cfg-flags  ONENAND_SYNC_READ) {
+   sync_read = 1;
+   } else if (cfg-flags  ONENAND_SYNC_READWRITE) {
+   sync_read = 1;
+   sync_write = 1;
+   }
+
if (!freq) {
/* Very first call freq is not known */
err = omap2_onenand_set_async_mode(cs, onenand_base);
@@ -160,8 +172,6 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem 
*onenand_base,
t_ach   = 6;
t_aavdh = 6;
t_rdyo  = 9;
-   if (cpu_is_omap34xx())
-   sync_write = 1;
break;
case 66:
min_gpmc_clk_period = 15; /* 66 MHz */
@@ -171,8 +181,6 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem 
*onenand_base,
t_ach   = 6;
t_aavdh = 6;
t_rdyo  = 11;
-   if (cpu_is_omap34xx())
-   sync_write = 1;
break;
default:
min_gpmc_clk_period = 18; /* 54 MHz */
@@ -182,6 +190,7 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem 
*onenand_base,
t_ach   = 9;
t_aavdh = 7;
t_rdyo  = 15;
+   sync_write = 0;
break;
}
 
@@ -198,7 +207,8 @@ static int omap2_onenand_set_sync_mode(int cs, void __iomem 
*onenand_base,
latency = 4;
 
if (first_time)
-

[PATCH 6/7] onenand init: Convert omap3430sdp to use gpmc-onenand

2009-05-04 Thread Tony Lindgren
Convert omap3430sdp to use gpmc-onenand. Note that sync mode
does not seem to work for some reason, so disable it with flags.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-3430sdp-flash.c |   28 ++--
 1 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp-flash.c 
b/arch/arm/mach-omap2/board-3430sdp-flash.c
index f0e25a4..e0ea564 100644
--- a/arch/arm/mach-omap2/board-3430sdp-flash.c
+++ b/arch/arm/mach-omap2/board-3430sdp-flash.c
@@ -103,8 +103,6 @@ static struct platform_device sdp_nor_device = {
.resource   = sdp_nor_resource,
 };
 
-static int sdp_onenand_setup(void __iomem *, int freq);
-
 static struct mtd_partition sdp_onenand_partitions[] = {
{
.name   = X-Loader-OneNAND,
@@ -138,30 +136,9 @@ static struct mtd_partition sdp_onenand_partitions[] = {
 static struct omap_onenand_platform_data sdp_onenand_data = {
.parts  = sdp_onenand_partitions,
.nr_parts   = ARRAY_SIZE(sdp_onenand_partitions),
-   .onenand_setup  = sdp_onenand_setup,
.dma_channel= -1,   /* disable DMA in OMAP OneNAND driver */
 };
 
-static struct platform_device sdp_onenand_device = {
-   .name   = omap2-onenand,
-   .id = -1,
-   .dev = {
-   .platform_data = sdp_onenand_data,
-   },
-};
-
-/*
- * sdp_onenand_setup - The function configures the onenand flash.
- * @onenand_base: Onenand base address
- *
- * @return int:Currently always returning zero.
- */
-static int sdp_onenand_setup(void __iomem *onenand_base, int freq)
-{
-   /* Onenand setup does nothing at present */
-   return 0;
-}
-
 static struct mtd_partition sdp_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
{
@@ -262,7 +239,7 @@ void __init sdp3430_flash_init(void)
} else {
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
if ((ret  0x3F) == (ONENAND_MAP  24))
-   onenandcs = cs;
+   onenandcs = cs;
}
cs++;
}
@@ -284,7 +261,6 @@ void __init sdp3430_flash_init(void)
 
if (onenandcs  GPMC_CS_NUM) {
sdp_onenand_data.cs = onenandcs;
-   if (platform_device_register(sdp_onenand_device)  0)
-   printk(KERN_ERR Unable to register OneNAND device\n);
+   gpmc_onenand_init(sdp_onenand_data);
}
 }

--
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 7/7] onenand_init: Clean-up for checkpatch.pl

2009-05-04 Thread Tony Lindgren
Clean-up for checkpatch.pl

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/gpmc-onenand.c|   15 +--
 arch/arm/plat-omap/include/mach/onenand.h |5 ++---
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-onenand.c 
b/arch/arm/mach-omap2/gpmc-onenand.c
index d243228..71fc05a 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -1,8 +1,9 @@
 /*
- * linux/arch/arm/mach-omap2/board-n800-flash.c
+ * linux/arch/arm/mach-omap2/gpmc-onenand.c
  *
- * Copyright (C) 2006 Nokia Corporation
- * Author: Juha Yrjola
+ * Copyright (C) 2006 - 2009 Nokia Corporation
+ * Contacts:   Juha Yrjola
+ * Tony Lindgren
  *
  * 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
@@ -14,7 +15,7 @@
 #include asm/mach/flash.h
 #include linux/mtd/onenand_regs.h
 
-#include asm/io.h
+#include linux/io.h
 #include mach/onenand.h
 #include mach/board.h
 #include mach/gpmc.h
@@ -122,7 +123,8 @@ static int omap2_onenand_set_sync_mode(struct 
omap_onenand_platform_data *cfg,
const int t_wph  = 30;
int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
-   int err, ticks_cez, sync_read = 0, sync_write = 0, first_time = 0, hf = 
0;
+   int first_time = 0, hf = 0 sync_read = 0, sync_write = 0;
+   int err, ticks_cez;
int cs = cfg-cs;
u32 reg;
 
@@ -267,7 +269,8 @@ static int omap2_onenand_set_sync_mode(struct 
omap_onenand_platform_data *cfg,
t.wr_access = t.access;
}
} else {
-   t.adv_wr_off = gpmc_round_ns_to_ticks(max_t(int, t_avdp, 
t_cer));
+   t.adv_wr_off = gpmc_round_ns_to_ticks(max_t(int,
+   t_avdp, t_cer));
t.we_on  = t.adv_wr_off + gpmc_round_ns_to_ticks(t_aavdh);
t.we_off = t.we_on + gpmc_round_ns_to_ticks(t_wpl);
t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph);
diff --git a/arch/arm/plat-omap/include/mach/onenand.h 
b/arch/arm/plat-omap/include/mach/onenand.h
index bb66d0b..94cde73 100644
--- a/arch/arm/plat-omap/include/mach/onenand.h
+++ b/arch/arm/plat-omap/include/mach/onenand.h
@@ -27,11 +27,10 @@ struct omap_onenand_platform_data {
u8  flags;
 };
 
-int omap2_onenand_rephase(void);
-
 #define ONENAND_MAX_PARTITIONS 8
 
-#if defined(CONFIG_MTD_ONENAND_OMAP2) || 
defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
+   defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
 
 extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
 

--
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: Anyone have MUSB working on PM branch?

2009-05-04 Thread Rebecca Schultz Zavin
I'm pretty sure we do, though I doubt we have it doing the right thing
across power events, we're still in the process of getting all our
drivers to behave.  Check out the android omap tree:

http://android.git.kernel.org/?p=kernel/omap.git;a=shortlog;h=refs/heads/android-omap-2.6.29

Rebecca

On Sat, May 2, 2009 at 2:33 AM, Eugeny S. Mints eugeny.mi...@gmail.com wrote:
 Peter,

 Peter Barada wrote:

 All,



 [skip]

 1) Has anyone gotten the MUSB in the latest PM branch working?


 I believe MUSB has not yet been validated on the PM branch as of 4/29
 according to Kevin.

 Eugeny

 2) Outside of setting up the pinmux, is there anything else necessary to
 get the MUSB to come up?

 3) Any ideas on how to fix this?




 --
 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


[DSPBRIDGE] Staging TODO List

2009-05-04 Thread Ramirez Luna, Omar
Hi All,

I think I have a more organized list of TODO tasks, which it is being hosted at 
omapzoom tracker:

https://www.omapzoom.org/gf/project/omapbridge/tracker/

Please comment or feel free to contribute with patches, bug reports or feedback.

Thanks to the people who provided comments for this initial version.

- omar

---

DSP Bridge TODO list

Architecture and Design
===

Remove custom implementations from Services layer

Bridge driver is composed of many modules which are tightly related, these
modules could be less dependent by getting rid of the Services (formerly
know as OSAL - OS Abstraction Layer) layer.

* List Module
  ---
  (drivers/dsp/bridge/services/list.c)
  The kernel already contains an implementation for double linked list, bridge
  could use that to deprecate its custom implementation.

Previous approach (HK) showed that bridge can replace its list implementation,
by reworking some of its internal structures.

* Mem Module
  --
  (drivers/dsp/bridge/services/mem.c)
  Some of bridge calls are direct wrappers plus debugging features (memory leak
  detection).

It seems the functionality is implemented by the kernel, a good feature would
be lost by removing wrappers (memory leak detection), but there is a patch under
review which might help to replace the memory leak feature:
[Kernel memory leak detector] http://thread.gmane.org/gmane.linux.kernel/827196

Seems to be existing mempool APIs to switch from using dma_alloc_coherent,
does this fit the driver needs?

There is a patch (HD) that makes a separate module to register platform
information, this also takes care of reserving a mempool at kernel bootup, are
module parameters still needed for this?

(RMK) MEM_FlushCache() exposes DMA specific cache handling for non-DMA
purposes.  This can only be used with kernel direct-mapped addresses, not
userspace nor some remapped virtual addresses.

* Kfile Module
  
  (drivers/dsp/bridge/services/kfile.c)

Some functions are provided by the kernel, these can be removed once the doff
loader is ported to userspace.

* Dbg Module
  --
  (drivers/dsp/bridge/services/dbg.c)
  
Core of the bridge debug tracing, it provides a useful method of runtime
debugging.

Need to explore about the following options:
For code flow debugging, ftrace can be used.
For module level debbuging DYNAMIC_DEBUG(2.6.30), DYNAMIC_PRINTK_DEBUG (2.6.30)
can be used.

* Dpc Module
  --
  (drivers/dsp/bridge/services/dpc.c)
  
Call tasklet functions directly instead.

* Ntfy Module
  ---
  (drivers/dsp/bridge/services/ntfy.c)

Homebrewed wrappers should be removed.

* Sync Module
  ---
  (drivers/dsp/bridge/services/sync.c)

Homebrewed wrappers should be removed.

* Reg Module
  --
  (drivers/dsp/bridge/services/reg.c)

Homebrewed wrappers should be removed.

* Clk module
  --
  (drivers/dsp/bridge/services/clk.c)

Clock module either to be removed or to use other clock interface. This needs
to be further analyzed, bridge wrappers are needed to maintain internal handle
references to the clocks.

Use count of other peripherals should also be taken care of. Maybe more general
framework should take care of this, not specific to clk usecount. This needs 
more
analysis. [HD]


(RMK) Do NOT Allow invalidation/flushing of _any_ region of memory via ioctl

(drivers/dsp/bridge/rmgr/proc.c)
Exposes MEM_FlushCache() via PROC_FlushMemory() and PROC_InvalidateMemory().

(drivers/dsp/bridge/pmgr/wcd.c)
Exposes PROC_FlushMemory() and PROC_InvalidateMemory via
PROCWRAP_FlushMemory() PROCWRAP_InvalidateMemory() respectively, which then
allows them to be called without any argument checking from userspace. 
This allows direct unchecked access to functions which can discard any kernel
data from userspace.  Not only is this a security issue, but has no isolation
from buggy usage.

Why would userspace want to know about kernel addresses?


(RMK) IOCTL numbers not correctly defined
-
(arch/arm/plat-omap/include/dspbridge/wmdioctl.h)
should be defined using _IO(), _IOR() for those that read arguments,
_IOW() for those which write arguments, and _IORW() for those which read
and write their arguments.


Move doff binary loader to userspace

Binary doff files should be handled outside the kernel, for this to happen
Kfile module must be decoupled from bridge driver.


Remove bridge custom tracing implementation
---
Even if it has been proved that it provides a very useful debug mechanism, its
wrappers are not open source aligned, besides there has been an effort to
improve existing debug kernel tools which could provide similar functionality
to replace GT_TRACE.

This can be addressed removing Dbg 

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 t...@atomide.com wrote:
 * vimal singh vimalsi...@ti.com [090503 22:36]:


 On Fri, May 1, 2009 at 11:08 PM, Tony Lindgren t...@atomide.com wrote:
  * Tony Lindgren t...@atomide.com [090430 11:56]:
  * Tony Lindgren t...@atomide.com [090430 07:06]:
   * vimal singh vimalsi...@ti.com [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