Re: [PATCH v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-10-03 Thread Cousson, Benoit

+ Arnd

Hi Tony,

After rebasing by DT series on top of your dt-base, I noticed two minor 
issues from this timer series.


First some new warnings:

[0.260009]  omap_timer.1: alias fck already exists
[0.260345]  omap_timer.2: alias fck already exists
[0.260650]  omap_timer.3: alias fck already exists
[0.260955]  omap_timer.4: alias fck already exists
[0.261260]  omap_timer.5: alias fck already exists
[0.261566]  omap_timer.6: alias fck already exists
[0.261871]  omap_timer.7: alias fck already exists
[0.262207]  omap_timer.8: alias fck already exists
[0.262512]  omap_timer.9: alias fck already exists
[0.262847]  omap_timer.10: alias fck already exists
[0.263153]  omap_timer.11: alias fck already exists

These warnings are due to the commit 
318c3e15cd55c73a26ae22a65a8183655b3003f9  ARM: OMAP2+: dmtimer: add 
device names to flck nodes


Since 3.1, the fck clock nodes are added automatically based on hwmod 
main_clk attribute.


+   CLK(omap_timer.1, fck, timer1_fck,CK_443X),
+   CLK(omap_timer.2, fck, timer2_fck,CK_443X),
+   CLK(omap_timer.3, fck, timer3_fck,CK_443X),
+   CLK(omap_timer.4, fck, timer4_fck,CK_443X),
+   CLK(omap_timer.5, fck, timer5_fck,CK_443X),
+   CLK(omap_timer.6, fck, timer6_fck,CK_443X),
+   CLK(omap_timer.7, fck, timer7_fck,CK_443X),
+   CLK(omap_timer.8, fck, timer8_fck,CK_443X),
+   CLK(omap_timer.9, fck, timer9_fck,CK_443X),
+   CLK(omap_timer.10,fck, timer10_fck,   CK_443X),
+   CLK(omap_timer.11,fck, timer11_fck,   CK_443X),

So they should not exist in this patch.

Moreover, all the legacy clockdev should be removed at the same time.

CLK(NULL,   gpt1_fck,   timer1_fck,CK_443X),
CLK(NULL,   gpt10_fck,  timer10_fck,   CK_443X),
CLK(NULL,   gpt11_fck,  timer11_fck,   CK_443X),
CLK(NULL,   gpt2_fck,   timer2_fck,CK_443X),
CLK(NULL,   gpt3_fck,   timer3_fck,CK_443X),
CLK(NULL,   gpt4_fck,   timer4_fck,CK_443X),
CLK(NULL,   gpt5_fck,   timer5_fck,CK_443X),
CLK(NULL,   gpt6_fck,   timer6_fck,CK_443X),
CLK(NULL,   gpt7_fck,   timer7_fck,CK_443X),
CLK(NULL,   gpt8_fck,   timer8_fck,CK_443X),
CLK(NULL,   gpt9_fck,   timer9_fck,CK_443X),
CLK(NULL,   gpt1_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt2_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt3_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt4_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt5_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt6_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt7_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt8_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt9_ick,   dummy_ck,  CK_443X),
CLK(NULL,   gpt10_ick,  dummy_ck,  CK_443X),
CLK(NULL,   gpt11_ick,  dummy_ck,  CK_443X),

That will reduce a little bit the size of these static data files.



Secondly, in commit c345c8b09d7a131f3571af55341038054a79efbd ARM: 
OMAP2+: dmtimer: convert to platform devices


+struct omap_device_pm_latency omap2_dmtimer_latency[] = {
+   {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+

That structure should be removed, since I added a default one in the 
omap_device cleanup series for 3.2. Assuming that the cleanup is pulled 
before the new feature, the timer series could avoid adding that.


How do you want to handle that, using some cleanup patch on top of your 
current branch or by resubmitting the series?
The point is that this branch was already pulled by Arnd in 
arm-soc/next/dmtimer feature branch.


Regards,
Benoit
--
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 v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-10-03 Thread Tony Lindgren
* Cousson, Benoit b-cous...@ti.com [111003 07:00]:
 + Arnd
 
 Hi Tony,
 
 After rebasing by DT series on top of your dt-base, I noticed two
 minor issues from this timer series.
 
 First some new warnings:
 
 [0.260009]  omap_timer.1: alias fck already exists
 [0.260345]  omap_timer.2: alias fck already exists
 [0.260650]  omap_timer.3: alias fck already exists
 [0.260955]  omap_timer.4: alias fck already exists
 [0.261260]  omap_timer.5: alias fck already exists
 [0.261566]  omap_timer.6: alias fck already exists
 [0.261871]  omap_timer.7: alias fck already exists
 [0.262207]  omap_timer.8: alias fck already exists
 [0.262512]  omap_timer.9: alias fck already exists
 [0.262847]  omap_timer.10: alias fck already exists
 [0.263153]  omap_timer.11: alias fck already exists
 
 These warnings are due to the commit
 318c3e15cd55c73a26ae22a65a8183655b3003f9  ARM: OMAP2+: dmtimer: add
 device names to flck nodes

Yes I noticed those too, but too late :(
 
 Since 3.1, the fck clock nodes are added automatically based on
 hwmod main_clk attribute.
 
 +   CLK(omap_timer.1, fck, timer1_fck,CK_443X),
 +   CLK(omap_timer.2, fck, timer2_fck,CK_443X),
 +   CLK(omap_timer.3, fck, timer3_fck,CK_443X),
 +   CLK(omap_timer.4, fck, timer4_fck,CK_443X),
 +   CLK(omap_timer.5, fck, timer5_fck,CK_443X),
 +   CLK(omap_timer.6, fck, timer6_fck,CK_443X),
 +   CLK(omap_timer.7, fck, timer7_fck,CK_443X),
 +   CLK(omap_timer.8, fck, timer8_fck,CK_443X),
 +   CLK(omap_timer.9, fck, timer9_fck,CK_443X),
 +   CLK(omap_timer.10,fck, timer10_fck,   CK_443X),
 +   CLK(omap_timer.11,fck, timer11_fck,   CK_443X),
 
 So they should not exist in this patch.
 
 Moreover, all the legacy clockdev should be removed at the same time.
 
 CLK(NULL, gpt1_fck, timer1_fck,CK_443X),
 CLK(NULL, gpt10_fck,timer10_fck,   CK_443X),
 CLK(NULL, gpt11_fck,timer11_fck,   CK_443X),
 CLK(NULL, gpt2_fck, timer2_fck,CK_443X),
 CLK(NULL, gpt3_fck, timer3_fck,CK_443X),
 CLK(NULL, gpt4_fck, timer4_fck,CK_443X),
 CLK(NULL, gpt5_fck, timer5_fck,CK_443X),
 CLK(NULL, gpt6_fck, timer6_fck,CK_443X),
 CLK(NULL, gpt7_fck, timer7_fck,CK_443X),
 CLK(NULL, gpt8_fck, timer8_fck,CK_443X),
 CLK(NULL, gpt9_fck, timer9_fck,CK_443X),
 CLK(NULL, gpt1_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt2_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt3_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt4_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt5_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt6_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt7_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt8_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt9_ick, dummy_ck,  CK_443X),
 CLK(NULL, gpt10_ick,dummy_ck,  CK_443X),
 CLK(NULL, gpt11_ick,dummy_ck,  CK_443X),
 
 That will reduce a little bit the size of these static data files.
 
OK 
 
 Secondly, in commit c345c8b09d7a131f3571af55341038054a79efbd ARM:
 OMAP2+: dmtimer: convert to platform devices
 
 +struct omap_device_pm_latency omap2_dmtimer_latency[] = {
 +   {
 +   .deactivate_func = omap_device_idle_hwmods,
 +   .activate_func   = omap_device_enable_hwmods,
 +   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 +   },
 +};
 +
 
 That structure should be removed, since I added a default one in the
 omap_device cleanup series for 3.2. Assuming that the cleanup is
 pulled before the new feature, the timer series could avoid adding
 that.

OK
 
 How do you want to handle that, using some cleanup patch on top of
 your current branch or by resubmitting the series?
 The point is that this branch was already pulled by Arnd in
 arm-soc/next/dmtimer feature branch.

Can you please just do a fix on either the dmtimer branch or
on cleanup branch?

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 v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-09-26 Thread Tony Lindgren
* DebBarma, Tarun Kanti tarun.ka...@ti.com [110923 01:54]:
 Hi Tony,
 [...]
  I've applied these into dmtimer branch with some changes to simplify
  things further. I've also merged it into linux-omap master branch
  for further testing.
 
  I'll reply to your patches with the changes I've done. Care give the
  dmtimer branch a try and see if I've missed something?
  Sure, I will go through the changes and do testing on it.
 Please find the missing/correction in the patch below.
 You can include them as part of patch 9.

Thanks I've updated your original patch with that. The missing part
I probably accidentally dropped while rebasing, sorry about that.

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 v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-09-26 Thread DebBarma, Tarun Kanti
On Mon, Sep 26, 2011 at 10:55 PM, Tony Lindgren t...@atomide.com wrote:
 * DebBarma, Tarun Kanti tarun.ka...@ti.com [110923 01:54]:
 Hi Tony,
 [...]
  I've applied these into dmtimer branch with some changes to simplify
  things further. I've also merged it into linux-omap master branch
  for further testing.
 
  I'll reply to your patches with the changes I've done. Care give the
  dmtimer branch a try and see if I've missed something?
  Sure, I will go through the changes and do testing on it.
 Please find the missing/correction in the patch below.
 You can include them as part of patch 9.

 Thanks I've updated your original patch with that. The missing part
 I probably accidentally dropped while rebasing, sorry about that.
Ok, no problem.
--
Tarun

 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 v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-09-23 Thread DebBarma, Tarun Kanti
Hi Tony,
[...]
 I've applied these into dmtimer branch with some changes to simplify
 things further. I've also merged it into linux-omap master branch
 for further testing.

 I'll reply to your patches with the changes I've done. Care give the
 dmtimer branch a try and see if I've missed something?
 Sure, I will go through the changes and do testing on it.
Please find the missing/correction in the patch below.
You can include them as part of patch 9.
Thanks.
--
Tarun

From 98cb7949054214684d7361eed2e382fa716ab0da Mon Sep 17 00:00:00 2001
From: Tarun Kanti DebBarma tarun.ka...@ti.com
Date: Fri, 23 Sep 2011 14:48:56 +0530
Subject: [correction] [PATCH 09/12] OMAP: dmtimer: low-power mode support

These are some missing content as well as correction to this patch.

Signed-off-by: Tarun Kanti DebBarma tarun.ka...@ti.com
---
 arch/arm/plat-omap/dmtimer.c |   21 ++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index de7896f..81a2305 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -79,9 +79,9 @@ static void omap_dm_timer_write_reg(struct
omap_dm_timer *timer, u32 reg,

 static void omap_timer_restore_context(struct omap_dm_timer *timer)
 {
-   omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_OFFSET,
-   timer-context.tiocp_cfg);
-   if (timer-revision  1)
+   __raw_writel(timer-context.tiocp_cfg,
+   timer-io_base + OMAP_TIMER_OCP_CFG_OFFSET);
+   if (timer-revision == 1)
__raw_writel(timer-context.tistat, timer-sys_stat);

__raw_writel(timer-context.tisr, timer-irq_stat);
@@ -356,6 +356,21 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer)

__omap_dm_timer_stop(timer, timer-posted, rate);

+   if (timer-loses_context) {
+   if (timer-get_context_loss_count)
+   timer-ctx_loss_count =
+   timer-get_context_loss_count(timer-pdev-dev);
+   }
+
+   /*
+* Since the register values are computed and written within
+* __omap_dm_timer_stop, we need to use read to retrieve the
+* context.
+*/
+   timer-context.tclr =
+   omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+   timer-context.tisr = __raw_readl(timer-irq_stat);
+   omap_dm_timer_disable(timer);
return 0;
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
-- 
1.7.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


Re: [PATCH v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-09-22 Thread DebBarma, Tarun Kanti
On Thu, Sep 22, 2011 at 6:29 AM, Tony Lindgren t...@atomide.com wrote:
 Hi Tarun,

 * Tarun Kanti DebBarma tarun.ka...@ti.com [110920 03:57]:
 Adaptation of dmtimer code to platform driver using omap_device and
 omap_hwmod abstraction. It also include pm-runtime and off-mode support.

 I've applied these into dmtimer branch with some changes to simplify
 things further. I've also merged it into linux-omap master branch
 for further testing.

 I'll reply to your patches with the changes I've done. Care give the
 dmtimer branch a try and see if I've missed something?
Sure, I will go through the changes and do testing on it.
--
Tarun

 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 v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-09-21 Thread Tony Lindgren
Hi Tarun,

* Tarun Kanti DebBarma tarun.ka...@ti.com [110920 03:57]:
 Adaptation of dmtimer code to platform driver using omap_device and
 omap_hwmod abstraction. It also include pm-runtime and off-mode support.

I've applied these into dmtimer branch with some changes to simplify
things further. I've also merged it into linux-omap master branch
for further testing.

I'll reply to your patches with the changes I've done. Care give the
dmtimer branch a try and see if I've missed something?

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


[PATCH v16 00/12] OMAP: dmtimer: adaptation to platform_driver

2011-09-20 Thread Tarun Kanti DebBarma
Adaptation of dmtimer code to platform driver using omap_device and
omap_hwmod abstraction. It also include pm-runtime and off-mode support.

Baseline: git://github.com/tmlind/linux.git
Branch: cleanup

Test Info:
- OMAP4430SDP: Functional tests.
- OMAP3430SDP: Functional. Off-mode does not work.
- OMAP2430SDP: Functional tests.
- OMAP2420SDP: Functional tests.
- OMAP1710SDP: Boot test.

v16:
(1) Baselined on top of Tony Lindgren's following patch:
ARM: OMAP: Add support for dmtimer v2 ip
(2) Removed usage of ip version constants from dmtimer files
as well as hwmod database.
(3) Use __omap_dm_timer_init_regs() to initialize timer base
and offsets for both old and new ip versions in probe().
(4) Added tidr register field in omap_dm_timer{} which is
is initialized with TIDR register value during probe.
This is used in context restore function to differentiate
ip version. This avoids reading the TIDR register whenever
context restore function is called.

v15:
(1) Use pm_runtime_put() instead of pm_runtime_put_sync_suspend().
(2) Call pm_runtime_irq_safe() so that dmtimer is usable in interrupt
context.
(3) Dynamic context save whenever registers are modified. This avoids
overhead of calling context save routine which saves all registers.
(4) Avoid use of omap_readl(), omap_writel() in mach-omap1/timer.c.
Instead use __raw_readl() and __raw_writel().
(5) Handle failure of *_dm_timer_prepare() in *_dm_timer_request()
and *_dm_timer_request_specific().
(6) In mach-omap2/timer.c make sure that any of the timers can be
used as iclocksource/clockevent timer by initializing func_offset
and intr_offset correctly.
(7) Maintain proper register context restoration order. Specifically,
made sure that interrupt enable and control registers are restored
at the end.
(8) Remove wrapper around omap_pm_get_dev_context_loss_count(). Instead
use it directly.
(9) Extend protection of exported APIs using spinlock.
(10) Remove the patch which uses mutex instead of spinlock because dmtimer
can be used in interrupt context.
(11) Removed system_timer_reserved variable declaration in mach-omap1/timer.c
which was added to remove compilation error while building for OMAP1.

v14:
(1) Baselined on top of Tony Lindgren's latest timer patch series.
(2) Context save/restore routines.
(3) Off-mode support
(4)  Following comments from Todd Poynor toddpoy...@google.com implemented
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg52677.html
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg52676.html
(5) Incorrect balancing of *_runtime_get/put_sync for wakeup domain timers
  in the off-mode patch corrected.


v13:
(1) Handling of early timer removed because this is being taken care by
Tony's patch series.
(2) Timers reserved for clockevent/clocksource during early boot are
registered and marked reserved.
(3) Platform specific timer code merged to mach-omap2/timer.c.
(4) Timer capabilities are added in the hwmod database to each of the
omap timers.
(5) plat-omap/dmtimer.c plat-omap/include/plat/dmtimer.h are converted
to a driver by moving them to drivers/misc/timer-omap.c and 
include/linux/timer-omap.h

v12:
(1) Remove registration and initialization of all timers during early boot.
Initialize only the system timer which is set by the board file or default
value assigned to it. This timer is not considered later during rest of the
timers initialization.

(2) Use mutex instead of spinlock since there is no interrupt context.

(3) Remove hacky code to manage GPTIMER12 in mach-omap2/dmtimer.c. This is
now changed to use dev_attr instead to identify if it is a secure timer.
In the hwmod database, any secure timer entry can use this dev_attr so that
driver avoids registering tha particular timer.

(4) Removed reset function from OMAP1 and kept it back to its original place
in plat-omap/dmtimer.c, with modification of course. Instead of (is_omap16xx)
flag a new variable (needs_manual_reset) added. This flag is set for OMAP1.
So, call to reset function is made if this value is set implying that reset
is called only for OMAP1.

(5) Timer enable and disable functions cleanup with checks for early boot
condition removed. Added new interface wrapper function to configure
system timer clock source.

(6) Move OMAP4 specific register offsets from mach-omap2 to driver code
along with other register offset definitions.

(7) omap2_dm_timer_early_init() renamed to omap2_system_timer_init(),
omap2_dm_timer_normal_init() renamed to omap2_dm_timer_init().

(8) Use dev_err() instead of pr_err() in low level read/write functions.

v11:
(1) Removed early timer initialization call from omap2_init_common_devices()
in io.c. It is now called from omap2_gp_timer_init() in timer-gp.c as part
of following call sequence:
start_kernel()-time_init()-timer-init()-omap2_gp_timer_init()
(2) Basedlined on top of Paul's patch series mentioned above.

v10:
(1) Update PM runtime for active early