Skip to contentSkip to conversation

ARM: OMAP: Timer and Counter DT Updates for v3.8

GIT PULL Jon Hunter 2 participants 8 messages Nov 2, 2012 – Nov 9, 2012

Subsystems (2)
lore
Share & tools
lore

Jon Hunter

author
#0 lore raw

Hi Tony,

Please pull the remaining patches to migrate OMAP timers and counters over to use device-tree. I recommend applying this after Benoit's DT series for v3.8 [1].

This branch contains ...
- Handling OMAP3 secure timers with device-tree
- Requesting timer by capability/feature
- Adds new DT machine descriptor for OMAP3 GP devices
- Look-up of clocksource/events timers from DT
- Migrate dmtimer driver to use DT

Cheers
Jon

[1] http://marc.info/?l=linux-omap&m=135179007210696&w=2

The following changes since commit 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64:

Linux 3.7-rc3 (2012-10-28 12:24:48 -0700)

are available in the git repository at:

git at github.com:jonhunter/linux.git dev-dt-timer

for you to fetch changes up to 9883f7c8dd21acb90697582ca331f3f8a66ac054:

ARM: OMAP2+: Add device-tree support for 32kHz counter (2012-11-02 13:16:31 -0500)

----------------------------------------------------------------
Jon Hunter (5):
ARM: OMAP3: Dynamically disable secure timer nodes for secure devices
ARM: OMAP: Add function to request a timer by capability
ARM: OMAP3: Add generic machine descriptor for boards with OMAP3 GP devices
ARM: OMAP: Add DT support for timer driver
ARM: OMAP2+: Add device-tree support for 32kHz counter

 arch/arm/mach-omap2/board-generic.c       |   17 +++
 arch/arm/mach-omap2/timer.c               |  203 ++++++++++++++++++++++++-----
 arch/arm/plat-omap/dmtimer.c              |   93 ++++++++++++-
 arch/arm/plat-omap/include/plat/dmtimer.h |    1 +
 4 files changed, 275 insertions(+), 39 deletions(-)
#1 lore raw
Quoted 19 lines · Jon Hunter

Hi Tony,

Please pull the remaining patches to migrate OMAP timers and counters over to use device-tree. I recommend applying this after Benoit's DT series for v3.8 [1].

This branch contains ...
- Handling OMAP3 secure timers with device-tree
- Requesting timer by capability/feature
- Adds new DT machine descriptor for OMAP3 GP devices
- Look-up of clocksource/events timers from DT
- Migrate dmtimer driver to use DT

Cheers
Jon

[1] http://marc.info/?l=linux-omap&m=135179007210696&w=2

Quoted 7 lines

The following changes since commit 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64:

Linux 3.7-rc3 (2012-10-28 12:24:48 -0700)

are available in the git repository at:

git at github.com:jonhunter/linux.git dev-dt-timer

Thanks pulling into omap-for-v3.8/dt branch.

Regards,

Tony

Quoted 17 lines

for you to fetch changes up to 9883f7c8dd21acb90697582ca331f3f8a66ac054:

ARM: OMAP2+: Add device-tree support for 32kHz counter (2012-11-02 13:16:31 -0500)

----------------------------------------------------------------
Jon Hunter (5):
ARM: OMAP3: Dynamically disable secure timer nodes for secure devices
ARM: OMAP: Add function to request a timer by capability
ARM: OMAP3: Add generic machine descriptor for boards with OMAP3 GP devices
ARM: OMAP: Add DT support for timer driver
ARM: OMAP2+: Add device-tree support for 32kHz counter

 arch/arm/mach-omap2/board-generic.c       |   17 +++
 arch/arm/mach-omap2/timer.c               |  203 ++++++++++++++++++++++++-----
 arch/arm/plat-omap/dmtimer.c              |   93 ++++++++++++-
 arch/arm/plat-omap/include/plat/dmtimer.h |    1 +
 4 files changed, 275 insertions(+), 39 deletions(-)
#2 lore raw

Hi Jon,

Quoted 5 lines · Tony Lindgren
Quoted 2 lines · Jon Hunter

git at github.com:jonhunter/linux.git dev-dt-timer

Thanks pulling into omap-for-v3.8/dt branch.

Looks like omap-for-v3.8/dt boots OK on blaze when booted with device tree, but then current omap-for-v3.8/tmp-merge oopses.

I guess we should apply the following fix somewhere or do we need to check other places too?

Regards,

Tony

[<c04e3d30>] (omap_dm_timer_probe+0x110/0x310) from [<c0334a18>] (platform_drv_probe+0x1c/0x24) [<c0334a18>] (platform_drv_probe+0x1c/0x24) from [<c03335d4>] (really_probe+0x60/0x1f4) [<c03335d4>] (really_probe+0x60/0x1f4) from [<c033379c>] (driver_probe_device+0x34/0x50) [<c033379c>] (driver_probe_device+0x34/0x50) from [<c033384c>] (__driver_attach+0x94/0x98) [<c033384c>] (__driver_attach+0x94/0x98) from [<c0331df8>] (bus_for_each_dev+0x60/0x8c) [<c0331df8>] (bus_for_each_dev+0x60/0x8c) from [<c03326c4>] (bus_add_driver+0x18c/0x254) [<c03326c4>] (bus_add_driver+0x18c/0x254) from [<c0333e44>] (driver_register+0x5c/0x150) [<c0333e44>] (driver_register+0x5c/0x150) from [<c0008868>] (do_one_initcall+0x2c/0x178) [<c0008868>] (do_one_initcall+0x2c/0x178) from [<c06df2a0>] (do_basic_setup+0x94/0xd0) [<c06df2a0>] (do_basic_setup+0x94/0xd0) from [<c06df358>] (kernel_init_freeable+0x7c/0x124) [<c06df358>] (kernel_init_freeable+0x7c/0x124) from [<c04e1810>] (kernel_init+0x8/0x1a8) [<c04e1810>] (kernel_init+0x8/0x1a8) from [<c0014410>] (ret_from_fork+0x14/0x24)

arch/arm/plat-omap/dmtimer.c +5 -2
@@ -803,8 +803,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
 
 	timer->irq = irq->start;
 	timer->pdev = pdev;
-	timer->capability = pdata->timer_capability;
-	timer->get_context_loss_count = pdata->get_context_loss_count;
+
+	if (pdata) {
+		timer->capability = pdata->timer_capability;
+		timer->get_context_loss_count = pdata->get_context_loss_count;
+	}
 
 	/* Skip pm_runtime_enable for OMAP1 */
 	if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
author
#3 lore raw
Quoted 5 lines · Tony Lindgren

Hi Jon,

Quoted 2 lines · Tony Lindgren
Quoted 1 line · Jon Hunter
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

git at github.com:jonhunter/linux.git dev-dt-timer

Thanks pulling into omap-for-v3.8/dt branch.

Looks like omap-for-v3.8/dt boots OK on blaze when booted with device tree, but then current omap-for-v3.8/tmp-merge oopses.

That's a bugger. I completely missed your patch last week sorry (I will blame the Danish beer) and had clearly not folded in to my testing!

Quoted 2 lines

I guess we should apply the following fix somewhere or do we need to check other places too?

I will re-test your master branch today and put it through my dmtimer tests to double check. However, in general I did ensure that we checked pdata was not NULL before accessing when I introduced the dt stuff. In my changelog [1] I had ...

"5. When device-tree is present the platform_data structure will be NULL and so check for this."

I just need to make sure that get_context_loss_count() is not called before checking it is populated.

Quoted 20 lines

Regards,

Tony

[<c04e3d30>] (omap_dm_timer_probe+0x110/0x310) from [<c0334a18>] (platform_drv_probe+0x1c/0x24) [<c0334a18>] (platform_drv_probe+0x1c/0x24) from [<c03335d4>] (really_probe+0x60/0x1f4) [<c03335d4>] (really_probe+0x60/0x1f4) from [<c033379c>] (driver_probe_device+0x34/0x50) [<c033379c>] (driver_probe_device+0x34/0x50) from [<c033384c>] (__driver_attach+0x94/0x98) [<c033384c>] (__driver_attach+0x94/0x98) from [<c0331df8>] (bus_for_each_dev+0x60/0x8c) [<c0331df8>] (bus_for_each_dev+0x60/0x8c) from [<c03326c4>] (bus_add_driver+0x18c/0x254) [<c03326c4>] (bus_add_driver+0x18c/0x254) from [<c0333e44>] (driver_register+0x5c/0x150) [<c0333e44>] (driver_register+0x5c/0x150) from [<c0008868>] (do_one_initcall+0x2c/0x178) [<c0008868>] (do_one_initcall+0x2c/0x178) from [<c06df2a0>] (do_basic_setup+0x94/0xd0) [<c06df2a0>] (do_basic_setup+0x94/0xd0) from [<c06df358>] (kernel_init_freeable+0x7c/0x124) [<c06df358>] (kernel_init_freeable+0x7c/0x124) from [<c04e1810>] (kernel_init+0x8/0x1a8) [<c04e1810>] (kernel_init+0x8/0x1a8) from [<c0014410>] (ret_from_fork+0x14/0x24)

arch/arm/plat-omap/dmtimer.c static int __devinit omap_dm_timer_probe(struct platform_device *pdev) · line 808

Quoted 8 lines
arch/arm/plat-omap/dmtimer.c +3 -2
@@ -803,8 +803,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
 
 	timer->irq = irq->start;
 	timer->pdev = pdev;
-	timer->capability = pdata->timer_capability;
-	timer->get_context_loss_count = pdata->get_context_loss_count;
+
+	if (pdata) {
+		timer->capability = pdata->timer_capability;

You don't need this it is already handled a few lines before.

arch/arm/plat-omap/dmtimer.c static int __devinit omap_dm_timer_probe(struct platform_device *pdev) · line 809

Quoted 1 line
arch/arm/plat-omap/dmtimer.c +1 -0
+		timer->get_context_loss_count = pdata->get_context_loss_count;

We could probably move this too. For example ...

arch/arm/plat-omap/dmtimer.c +1 -2
index 38c12ef..9dca23e 100644
@@ -799,12 +799,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
                timer->id = pdev->id;
                timer->capability = pdata->timer_capability;
                timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
+               timer->get_context_loss_count = pdata->get_context_loss_count;
        }
 
        timer->irq = irq->start;
        timer->pdev = pdev;
-       timer->capability = pdata->timer_capability;
-       timer->get_context_loss_count = pdata->get_context_loss_count;
 
        /* Skip pm_runtime_enable for OMAP1 */
        if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {

Cheers
Jon

[1] http://marc.info/?l=linux-omap&m=135065877008624&w=2

#4 lore raw
Quoted 5 lines · Jon Hunter

On 11/07/2012 05:44 PM, Tony Lindgren wrote:

That's a bugger. I completely missed your patch last week sorry (I will blame the Danish beer) and had clearly not folded in to my testing!

:)

Quoted 7 lines
Quoted 2 lines

I guess we should apply the following fix somewhere or do we need to check other places too?

I will re-test your master branch today and put it through my dmtimer tests to double check. However, in general I did ensure that we checked pdata was not NULL before accessing when I introduced the dt stuff. In my changelog [1] I had ...

Quoted 5 lines

"5. When device-tree is present the platform_data structure will be NULL and so check for this."

I just need to make sure that get_context_loss_count() is not called before checking it is populated.

OK

Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+	if (pdata) {
+		timer->capability = pdata->timer_capability;

You don't need this it is already handled a few lines before.

arch/arm/plat-omap/dmtimer.c static int __devinit omap_dm_timer_probe(struct platform_device *pdev) · line 802

Quoted 1 line
arch/arm/plat-omap/dmtimer.c +1 -0
+		timer->get_context_loss_count = pdata->get_context_loss_count;

We could probably move this too. For example ...

OK yeah makes sense to me.

Regards,

Tony

Quoted 23 lines
arch/arm/plat-omap/dmtimer.c +1 -2
index 38c12ef..9dca23e 100644
@@ -799,12 +799,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
                timer->id = pdev->id;
                timer->capability = pdata->timer_capability;
                timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
+               timer->get_context_loss_count = pdata->get_context_loss_count;
        }
 
        timer->irq = irq->start;
        timer->pdev = pdev;
-       timer->capability = pdata->timer_capability;
-       timer->get_context_loss_count = pdata->get_context_loss_count;
 
        /* Skip pm_runtime_enable for OMAP1 */
        if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {

Cheers
Jon

[1] http://marc.info/?l=linux-omap&m=135065877008624&w=2

author
#5 lore raw
Quoted 52 lines · Tony Lindgren
Quoted 5 lines · Jon Hunter

On 11/07/2012 05:44 PM, Tony Lindgren wrote:

That's a bugger. I completely missed your patch last week sorry (I will blame the Danish beer) and had clearly not folded in to my testing!

:)

Quoted 7 lines
Quoted 2 lines

I guess we should apply the following fix somewhere or do we need to check other places too?

I will re-test your master branch today and put it through my dmtimer tests to double check. However, in general I did ensure that we checked pdata was not NULL before accessing when I introduced the dt stuff. In my changelog [1] I had ...

Quoted 5 lines

"5. When device-tree is present the platform_data structure will be NULL and so check for this."

I just need to make sure that get_context_loss_count() is not called before checking it is populated.

OK

Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+	if (pdata) {
+		timer->capability = pdata->timer_capability;

You don't need this it is already handled a few lines before.

arch/arm/plat-omap/dmtimer.c static int __devinit omap_dm_timer_probe(struct platform_device *pdev) · line 802

Quoted 1 line
arch/arm/plat-omap/dmtimer.c +1 -0
+		timer->get_context_loss_count = pdata->get_context_loss_count;

We could probably move this too. For example ...

OK yeah makes sense to me.

Regards,

Tony

Quoted 11 lines
arch/arm/plat-omap/dmtimer.c +1 -0
index 38c12ef..9dca23e 100644
@@ -799,12 +799,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
                timer->id = pdev->id;
                timer->capability = pdata->timer_capability;
                timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
+               timer->get_context_loss_count = pdata->get_context_loss_count;
        }
 
Quoted 7 lines

arch/arm/plat-omap/dmtimer.c static int __devinit omap_dm_timer_probe(struct platform_device *pdev) · line 809

Quoted 7 lines
arch/arm/plat-omap/dmtimer.c +0 -2
        timer->irq = irq->start;
        timer->pdev = pdev;
-       timer->capability = pdata->timer_capability;
-       timer->get_context_loss_count = pdata->get_context_loss_count;
 
        /* Skip pm_runtime_enable for OMAP1 */
        if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {

I have tested the dmtimers with this on the 3430-beagle and 4430-panda with and without device tree and is working fine.

Do you want to generate the patch or me?

Cheers
Jon

Quoted 1 line
Quoted 1 line

[1] http://marc.info/?l=linux-omap&m=135065877008624&w=2