RE: [PATCH v11 6/8] dmtimer: switch-over to platform device driver

2011-03-07 Thread DebBarma, Tarun Kanti
Tony, Santosh,
[...]
 +void __init omap2_dm_timer_early_init(void)
 +{
 + int ret = omap_hwmod_for_each_by_class(timer,
 + omap_timer_init, NULL);
   
Here we really only want to initialize the system timer. The
  rest we
want to do later, so let's not init all of them early.
   So, that is how it was at the beginning.
   Later we realized different platforms can use different timers for
  this.
   For example, beagle uses GPT12. Therefore, as part of one of the
  comments,
   We decided to provide flexibility so that any of the timers could
  be used.
 
  You can still do it, just register the one that's being used and
  mark it reserved so it won't get initialized again later on.
 
 
 I agree with Tony. We can still registers only the system
 timer because the timer ID is known well before we do
 initialization.
I must say, there was a gap in my understanding of the comment.
So, here is the implementation change:

- Call omap2_dm_timer_early_init(u8 gptimer_id) from omap2_gp_timer_init()
- Initialize only gptimer_id inside this function
- In the regular init skip initialization of gptimer_id

As a result of this, we can rid of double registration and related code.
--
Tarun
--
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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-07 Thread Tony Lindgren
* DebBarma, Tarun Kanti tarun.ka...@ti.com [110307 04:52]:
  
  I agree with Tony. We can still registers only the system
  timer because the timer ID is known well before we do
  initialization.
 I must say, there was a gap in my understanding of the comment.
 So, here is the implementation change:
 
 - Call omap2_dm_timer_early_init(u8 gptimer_id) from omap2_gp_timer_init()
 - Initialize only gptimer_id inside this function
 - In the regular init skip initialization of gptimer_id
 
 As a result of this, we can rid of double registration and related code.

I suggest we keep the system timer completely separate from the
rest of the timers. This way we avoid adding hwmod dependencies
early on when the system timer is initialized, and can still
use hwmod for handling the the rest of the timers nicely.

The rest of the timers can then become just a regular device
driver that ignores the physical system timer.

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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-07 Thread DebBarma, Tarun Kanti
 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Tuesday, March 08, 2011 5:37 AM
 To: DebBarma, Tarun Kanti
 Cc: Shilimkar, Santosh; linux-omap@vger.kernel.org
 Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
 driver
 
 * DebBarma, Tarun Kanti tarun.ka...@ti.com [110307 04:52]:
  
   I agree with Tony. We can still registers only the system
   timer because the timer ID is known well before we do
   initialization.
  I must say, there was a gap in my understanding of the comment.
  So, here is the implementation change:
 
  - Call omap2_dm_timer_early_init(u8 gptimer_id) from
 omap2_gp_timer_init()
  - Initialize only gptimer_id inside this function
  - In the regular init skip initialization of gptimer_id
 
  As a result of this, we can rid of double registration and related code.
 
 I suggest we keep the system timer completely separate from the
 rest of the timers. This way we avoid adding hwmod dependencies
 early on when the system timer is initialized, and can still
 use hwmod for handling the the rest of the timers nicely.
Yes, just the system timer is initialized now.
We just call omap_hwmod_setup_one() to initialize system timer.

 
 The rest of the timers can then become just a regular device
 driver that ignores the physical system timer.
Right, system timer is NOT touched at all later.

 
 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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-04 Thread Tony Lindgren
* Tarun Kanti DebBarma tarun.ka...@ti.com [110224 03:23]:
 --- a/arch/arm/mach-omap2/dmtimer.c
 +++ b/arch/arm/mach-omap2/dmtimer.c
 @@ -197,3 +197,64 @@ static int __init omap_timer_init(struct omap_hwmod *oh, 
 void *unused)
  
   return ret;
  }
 +
 +/**
 + * omap2_dm_timer_early_init - top level early timer initialization
 + * called in the last part of omap2_init_common_hw
 + *
 + * Uses dedicated hwmod api to parse through hwmod database for
 + * given class name and then build and register the timer device.
 + * At the end driver is registered and early probe initiated.
 + */
 +void __init omap2_dm_timer_early_init(void)
 +{
 + int ret = omap_hwmod_for_each_by_class(timer,
 + omap_timer_init, NULL);

Here we really only want to initialize the system timer. The rest we
want to do later, so let's not init all of them early.

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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-04 Thread DebBarma, Tarun Kanti
 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Friday, March 04, 2011 10:53 PM
 To: DebBarma, Tarun Kanti
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
 driver
 
 * Tarun Kanti DebBarma tarun.ka...@ti.com [110224 03:23]:
  --- a/arch/arm/mach-omap2/dmtimer.c
  +++ b/arch/arm/mach-omap2/dmtimer.c
  @@ -197,3 +197,64 @@ static int __init omap_timer_init(struct omap_hwmod
 *oh, void *unused)
 
  return ret;
   }
  +
  +/**
  + * omap2_dm_timer_early_init - top level early timer initialization
  + * called in the last part of omap2_init_common_hw
  + *
  + * Uses dedicated hwmod api to parse through hwmod database for
  + * given class name and then build and register the timer device.
  + * At the end driver is registered and early probe initiated.
  + */
  +void __init omap2_dm_timer_early_init(void)
  +{
  +   int ret = omap_hwmod_for_each_by_class(timer,
  +   omap_timer_init, NULL);
 
 Here we really only want to initialize the system timer. The rest we
 want to do later, so let's not init all of them early.
So, that is how it was at the beginning.
Later we realized different platforms can use different timers for this.
For example, beagle uses GPT12. Therefore, as part of one of the comments,
We decided to provide flexibility so that any of the timers could be used.
--
Tarun
--
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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-04 Thread Tony Lindgren
* DebBarma, Tarun Kanti tarun.ka...@ti.com [110304 10:50]:
  -Original Message-
  From: Tony Lindgren [mailto:t...@atomide.com]
  Sent: Friday, March 04, 2011 10:53 PM
  To: DebBarma, Tarun Kanti
  Cc: linux-omap@vger.kernel.org
  Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
  driver
  
  * Tarun Kanti DebBarma tarun.ka...@ti.com [110224 03:23]:
   --- a/arch/arm/mach-omap2/dmtimer.c
   +++ b/arch/arm/mach-omap2/dmtimer.c
   @@ -197,3 +197,64 @@ static int __init omap_timer_init(struct omap_hwmod
  *oh, void *unused)
  
 return ret;
}
   +
   +/**
   + * omap2_dm_timer_early_init - top level early timer initialization
   + * called in the last part of omap2_init_common_hw
   + *
   + * Uses dedicated hwmod api to parse through hwmod database for
   + * given class name and then build and register the timer device.
   + * At the end driver is registered and early probe initiated.
   + */
   +void __init omap2_dm_timer_early_init(void)
   +{
   + int ret = omap_hwmod_for_each_by_class(timer,
   + omap_timer_init, NULL);
  
  Here we really only want to initialize the system timer. The rest we
  want to do later, so let's not init all of them early.
 So, that is how it was at the beginning.
 Later we realized different platforms can use different timers for this.
 For example, beagle uses GPT12. Therefore, as part of one of the comments,
 We decided to provide flexibility so that any of the timers could be used.

You can still do it, just register the one that's being used and mark
it reserved so it won't get initialized again later on.

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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-04 Thread DebBarma, Tarun Kanti
 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Saturday, March 05, 2011 1:07 AM
 To: DebBarma, Tarun Kanti
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
 driver
 
 * DebBarma, Tarun Kanti tarun.ka...@ti.com [110304 10:50]:
   -Original Message-
   From: Tony Lindgren [mailto:t...@atomide.com]
   Sent: Friday, March 04, 2011 10:53 PM
   To: DebBarma, Tarun Kanti
   Cc: linux-omap@vger.kernel.org
   Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
   driver
  
   * Tarun Kanti DebBarma tarun.ka...@ti.com [110224 03:23]:
--- a/arch/arm/mach-omap2/dmtimer.c
+++ b/arch/arm/mach-omap2/dmtimer.c
@@ -197,3 +197,64 @@ static int __init omap_timer_init(struct
 omap_hwmod
   *oh, void *unused)
   
return ret;
 }
+
+/**
+ * omap2_dm_timer_early_init - top level early timer initialization
+ * called in the last part of omap2_init_common_hw
+ *
+ * Uses dedicated hwmod api to parse through hwmod database for
+ * given class name and then build and register the timer device.
+ * At the end driver is registered and early probe initiated.
+ */
+void __init omap2_dm_timer_early_init(void)
+{
+   int ret = omap_hwmod_for_each_by_class(timer,
+   omap_timer_init, NULL);
  
   Here we really only want to initialize the system timer. The rest we
   want to do later, so let's not init all of them early.
  So, that is how it was at the beginning.
  Later we realized different platforms can use different timers for this.
  For example, beagle uses GPT12. Therefore, as part of one of the
 comments,
  We decided to provide flexibility so that any of the timers could be
 used.
 
 You can still do it, just register the one that's being used and mark
 it reserved so it won't get initialized again later on.
May be I was not clear in my explanation.
Yes, you are right, the system timer gets reserved early and initialized.
Later it is NOT initialized again.
 
 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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-04 Thread Santosh Shilimkar
 -Original Message-
 From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Tony Lindgren
 Sent: Saturday, March 05, 2011 1:07 AM
 To: DebBarma, Tarun Kanti
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
 driver

 * DebBarma, Tarun Kanti tarun.ka...@ti.com [110304 10:50]:
   -Original Message-
   From: Tony Lindgren [mailto:t...@atomide.com]
   Sent: Friday, March 04, 2011 10:53 PM
   To: DebBarma, Tarun Kanti
   Cc: linux-omap@vger.kernel.org
   Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform
 device
   driver
  
   * Tarun Kanti DebBarma tarun.ka...@ti.com [110224 03:23]:
--- a/arch/arm/mach-omap2/dmtimer.c
+++ b/arch/arm/mach-omap2/dmtimer.c
@@ -197,3 +197,64 @@ static int __init omap_timer_init(struct
 omap_hwmod
   *oh, void *unused)
   
return ret;
 }
+
+/**
+ * omap2_dm_timer_early_init - top level early timer
 initialization
+ * called in the last part of omap2_init_common_hw
+ *
+ * Uses dedicated hwmod api to parse through hwmod database
 for
+ * given class name and then build and register the timer
 device.
+ * At the end driver is registered and early probe initiated.
+ */
+void __init omap2_dm_timer_early_init(void)
+{
+   int ret = omap_hwmod_for_each_by_class(timer,
+   omap_timer_init, NULL);
  
   Here we really only want to initialize the system timer. The
 rest we
   want to do later, so let's not init all of them early.
  So, that is how it was at the beginning.
  Later we realized different platforms can use different timers for
 this.
  For example, beagle uses GPT12. Therefore, as part of one of the
 comments,
  We decided to provide flexibility so that any of the timers could
 be used.

 You can still do it, just register the one that's being used and
 mark it reserved so it won't get initialized again later on.


I agree with Tony. We can still registers only the system
timer because the timer ID is known well before we do
initialization.
--
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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-03 Thread Kevin Hilman
Tarun Kanti DebBarma tarun.ka...@ti.com writes:

 switch-over to platform device driver through following changes:
 (a) initiate dmtimer early initialization from omap2_gp_timer_init()
 in timer-gp.c. This is equivalent of timer_init()-timer-init().
 (b) modify plat-omap/dmtimer routines to use new register map and
 platform data.

 Signed-off-by: Tarun Kanti DebBarma tarun.ka...@ti.com
 Acked-by: Cousson, Benoit b-cous...@ti.com

[...]

 @@ -507,20 +394,22 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_start);
  void omap_dm_timer_stop(struct omap_dm_timer *timer)
  {
   u32 l;
 + struct dmtimer_platform_data *pdata = timer-pdev-dev.platform_data;
  
   l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
   if (l  OMAP_TIMER_CTRL_ST) {
   l = ~0x1;
   omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
 -#ifdef CONFIG_ARCH_OMAP2PLUS
 - /* Readback to make sure write has completed */
 - omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
 -  /*
 -   * Wait for functional clock period x 3.5 to make sure that
 -   * timer is stopped
 -   */
 - udelay(350 / clk_get_rate(timer-fclk) + 1);
 -#endif
 +
 + if (!pdata-is_omap16xx) {
 + /* Readback to make sure write has completed */
 + omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
 + /*
 +  * Wait for functional clock period x 3.5 to make
 +  * sure that timer is stopped
 +  */
 + udelay(350 / clk_get_rate(timer-fclk) + 1);
 + }

Can't this 'is_omap16xx' check just be using the IP revision?


   }

Kevin
--
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 v11 6/8] dmtimer: switch-over to platform device driver

2011-03-03 Thread DebBarma, Tarun Kanti
 -Original Message-
 From: Hilman, Kevin
 Sent: Friday, March 04, 2011 6:56 AM
 To: DebBarma, Tarun Kanti
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [PATCH v11 6/8] dmtimer: switch-over to platform device
 driver
 
 Tarun Kanti DebBarma tarun.ka...@ti.com writes:
 
  switch-over to platform device driver through following changes:
  (a) initiate dmtimer early initialization from omap2_gp_timer_init()
  in timer-gp.c. This is equivalent of timer_init()-timer-init().
  (b) modify plat-omap/dmtimer routines to use new register map and
  platform data.
 
  Signed-off-by: Tarun Kanti DebBarma tarun.ka...@ti.com
  Acked-by: Cousson, Benoit b-cous...@ti.com
 
 [...]
 
  @@ -507,20 +394,22 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_start);
   void omap_dm_timer_stop(struct omap_dm_timer *timer)
   {
  u32 l;
  +   struct dmtimer_platform_data *pdata = timer-pdev-dev.platform_data;
 
  l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
  if (l  OMAP_TIMER_CTRL_ST) {
  l = ~0x1;
  omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
  -#ifdef CONFIG_ARCH_OMAP2PLUS
  -   /* Readback to make sure write has completed */
  -   omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
  -/*
  - * Wait for functional clock period x 3.5 to make sure that
  - * timer is stopped
  - */
  -   udelay(350 / clk_get_rate(timer-fclk) + 1);
  -#endif
  +
  +   if (!pdata-is_omap16xx) {
  +   /* Readback to make sure write has completed */
  +   omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
  +   /*
  +* Wait for functional clock period x 3.5 to make
  +* sure that timer is stopped
  +*/
  +   udelay(350 / clk_get_rate(timer-fclk) + 1);
  +   }
 
 Can't this 'is_omap16xx' check just be using the IP revision?
OK, I will introduce a new version to cover this.

 
 
  }
 
 Kevin
--
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 v11 6/8] dmtimer: switch-over to platform device driver

2011-02-24 Thread Tarun Kanti DebBarma
switch-over to platform device driver through following changes:
(a) initiate dmtimer early initialization from omap2_gp_timer_init()
in timer-gp.c. This is equivalent of timer_init()-timer-init().
(b) modify plat-omap/dmtimer routines to use new register map and
platform data.

Signed-off-by: Tarun Kanti DebBarma tarun.ka...@ti.com
Acked-by: Cousson, Benoit b-cous...@ti.com
---
 arch/arm/mach-omap2/clock2420_data.c  |2 +-
 arch/arm/mach-omap2/clock2430_data.c  |2 +-
 arch/arm/mach-omap2/clock3xxx_data.c  |2 +-
 arch/arm/mach-omap2/clock44xx_data.c  |2 +-
 arch/arm/mach-omap2/dmtimer.c |   61 +
 arch/arm/mach-omap2/dmtimer.h |   30 +++
 arch/arm/mach-omap2/timer-gp.c|4 +-
 arch/arm/plat-omap/dmtimer.c  |  350 -
 arch/arm/plat-omap/include/plat/dmtimer.h |5 +-
 9 files changed, 190 insertions(+), 268 deletions(-)
 create mode 100644 arch/arm/mach-omap2/dmtimer.h

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index ee93d3c..390d6aa 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1801,7 +1801,7 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   virt_prcm_set, virt_prcm_set, CK_242X),
/* general l4 interface ck, multi-parent functional clk */
CLK(NULL,   gpt1_ick, gpt1_ick,  CK_242X),
-   CLK(NULL,   gpt1_fck, gpt1_fck,  CK_242X),
+   CLK(omap_timer.1, fck,  gpt1_fck,  CK_242X),
CLK(NULL,   gpt2_ick, gpt2_ick,  CK_242X),
CLK(omap_timer.2, fck,  gpt2_fck,  CK_242X),
CLK(NULL,   gpt3_ick, gpt3_ick,  CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 24553ce..7a3e5a4 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1905,7 +1905,7 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   virt_prcm_set, virt_prcm_set, CK_243X),
/* general l4 interface ck, multi-parent functional clk */
CLK(NULL,   gpt1_ick, gpt1_ick,  CK_243X),
-   CLK(NULL,   gpt1_fck, gpt1_fck,  CK_243X),
+   CLK(omap_timer.1, fck,  gpt1_fck,  CK_243X),
CLK(NULL,   gpt2_ick, gpt2_ick,  CK_243X),
CLK(omap_timer.2, fck,  gpt2_fck,  CK_243X),
CLK(NULL,   gpt3_ick, gpt3_ick,  CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 6a17982..506f59d 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3374,7 +3374,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   usbhost_ick,  usbhost_ick,   CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(ehci-omap.0,  usbhost_ick,  usbhost_ick,   CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
CLK(NULL,   usim_fck, usim_fck,  CK_3430ES2PLUS | 
CK_36XX),
-   CLK(NULL,   gpt1_fck, gpt1_fck,  CK_3XXX),
+   CLK(omap_timer.1, fck,  gpt1_fck,  CK_3XXX),
CLK(NULL,   wkup_32k_fck, wkup_32k_fck,  CK_3XXX),
CLK(NULL,   gpio1_dbck,   gpio1_dbck,CK_3XXX),
CLK(omap_wdt, fck,  wdt2_fck,  CK_3XXX),
diff --git a/arch/arm/mach-omap2/clock44xx_data.c 
b/arch/arm/mach-omap2/clock44xx_data.c
index 11997a3..8f8b010 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3181,7 +3181,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL,   smartreflex_core_fck, smartreflex_core_fck,  
CK_443X),
CLK(NULL,   smartreflex_iva_fck,  smartreflex_iva_fck,   
CK_443X),
CLK(NULL,   smartreflex_mpu_fck,  smartreflex_mpu_fck,   
CK_443X),
-   CLK(NULL,   gpt1_fck, timer1_fck,
CK_443X),
+   CLK(omap_timer.1, fck,  timer1_fck,
CK_443X),
CLK(omap_timer.10,fck,  timer10_fck,   
CK_443X),
CLK(omap_timer.11,fck,  timer11_fck,   
CK_443X),
CLK(omap_timer.2, fck,  timer2_fck,
CK_443X),
diff --git a/arch/arm/mach-omap2/dmtimer.c b/arch/arm/mach-omap2/dmtimer.c
index 00cebe9..63d5ae7 100644
--- a/arch/arm/mach-omap2/dmtimer.c
+++ b/arch/arm/mach-omap2/dmtimer.c
@@ -197,3 +197,64 @@ static int __init omap_timer_init(struct omap_hwmod *oh, 
void *unused)
 
return ret;
 }
+
+/**
+ * omap2_dm_timer_early_init - top level early timer initialization
+ * called in the last part of omap2_init_common_hw
+ *
+ * Uses dedicated hwmod api to parse through hwmod database for
+ * given class name and then build and register the timer device.
+ * At the end driver is registered and early probe initiated.
+ */
+void __init