Skip to contentSkip to conversation

ARM: architected timers: allow dt based discovery using clocksource_of_init

PATCH New Thomas Abraham 4 participants 9 messages Jan 21, 2013 – Jan 30, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

---
 arch/arm/kernel/arch_timer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/kernel/arch_timer.c +3 -0
index c8ef207..d21aada 100644
@@ -504,6 +504,9 @@ int __init arch_timer_of_register(void)
 
 	return arch_timer_register();
 }
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif
 
 int __init arch_timer_sched_clock_init(void)
 {
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Hi Thomas,

This looks really useful, and it's going to conflict with my arch_timer / arm_generic driver unification series [1].

I'm happy to take this as part of my series if that's ok with you?

Quoted 30 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

---
 arch/arm/kernel/arch_timer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/kernel/arch_timer.c +3 -0
index c8ef207..d21aada 100644
@@ -504,6 +504,9 @@ int __init arch_timer_of_register(void)
 
 	return arch_timer_register();
 }
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif
 
 int __init arch_timer_sched_clock_init(void)
 {
Signature · 6 lines
1.7.5.4

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

Thanks,
Mark.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/142070.html

#2 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Hi Mark,

Quoted 6 lines · Mark Rutland

Hi Thomas,

This looks really useful, and it's going to conflict with my arch_timer / arm_generic driver unification series [1].

I'm happy to take this as part of my series if that's ok with you?

Sure, that's fine. This patch would probably be needed in 3.9 on Exynos platforms. So you could squash this change into your series.

Thanks,
Thomas.

Quoted 38 lines · Thomas Abraham
Quoted 25 lines

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

---
 arch/arm/kernel/arch_timer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/kernel/arch_timer.c +3 -1
index c8ef207..d21aada 100644
@@ -504,6 +504,9 @@ int __init arch_timer_of_register(void)
 
      return arch_timer_register();
 }
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif
 
 int __init arch_timer_sched_clock_init(void)
 {
--

1.7.5.4

Quoted 5 lines

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

Thanks,
Mark.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/142070.html

#3 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

In reply to Thomas Abraham

arch/arm/kernel/arch_timer.c int __init arch_timer_of_register(void) · line 509

Quoted 8 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

arch/arm/kernel/arch_timer.c +3 -0
 
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif

I wonder if we shouldn't enhance include/linux/clocksource.h to define CLOCKSOURCE_OF_DECLARE even when !CONFIG_CLKSRC_OF; that way, drivers wouldn't need that ifdef.

#4 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Quoted 5 lines · Stephen Warren

Review

Quoted 4 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

(quoted diff) +0 -0

b/arch/arm/kernel/arch_timer.c

Quoted 9 lines
Quoted 5 lines
(quoted diff) +2 -0
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer",

arch_timer_of_register)
+#endif

I wonder if we shouldn't enhance include/linux/clocksource.h to define CLOCKSOURCE_OF_DECLARE even when !CONFIG_CLKSRC_OF; that way, drivers wouldn't need that ifdef.

Indeed. That would be a lot nicer.

        M.
Signature · 1 line
Fast, cheap, reliable. Pick two.
#5 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

In reply to Stephen Warren

Hi Stephen,

Quoted 6 lines · Stephen Warren
Quoted 4 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

arch/arm/kernel/arch_timer.c +0 -0
Quoted 7 lines

arch/arm/kernel/arch_timer.c int __init arch_timer_of_register(void) · line 509

Quoted 3 lines
arch/arm/kernel/arch_timer.c +3 -0
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif

I wonder if we shouldn't enhance include/linux/clocksource.h to define CLOCKSOURCE_OF_DECLARE even when !CONFIG_CLKSRC_OF; that way, drivers wouldn't need that ifdef.

Yes, it will be helpful to have a !CONFIG_CLKSRC_OF version of CLOCKSOURCE_OF_DECLARE. And can CONFIG_CLKSRC_OF be enabled by default for all ARM platforms?

Thanks,
Thomas.

#6 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Quoted 17 lines · Thomas Abraham

Hi Stephen,

Quoted 6 lines · Stephen Warren
Quoted 4 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

arch/arm/kernel/arch_timer.c +0 -0
Quoted 7 lines

arch/arm/kernel/arch_timer.c int __init arch_timer_of_register(void) · line 509

Quoted 3 lines
arch/arm/kernel/arch_timer.c +3 -0
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif

I wonder if we shouldn't enhance include/linux/clocksource.h to define CLOCKSOURCE_OF_DECLARE even when !CONFIG_CLKSRC_OF; that way, drivers wouldn't need that ifdef.

Quoted 6 lines

Yes, it will be helpful to have a !CONFIG_CLKSRC_OF version of CLOCKSOURCE_OF_DECLARE. And can CONFIG_CLKSRC_OF be enabled by default for all ARM platforms?

Thanks,
Thomas.

Thomas,

Once the above is worked out, could you send me the updated patch with a pointer to whichever {branch,patch}(es) I need for CLKSRC_OF?

Thanks,
Mark.

#7 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Thomas,

Quoted 22 lines · Mark Rutland
Quoted 21 lines · Thomas Abraham

Hi Stephen,

Quoted 6 lines · Stephen Warren
Quoted 4 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

arch/arm/kernel/arch_timer.c +0 -0
Quoted 7 lines

arch/arm/kernel/arch_timer.c int __init arch_timer_of_register(void) · line 509

Quoted 3 lines
arch/arm/kernel/arch_timer.c +3 -0
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif

I wonder if we shouldn't enhance include/linux/clocksource.h to define CLOCKSOURCE_OF_DECLARE even when !CONFIG_CLKSRC_OF; that way, drivers wouldn't need that ifdef.

Yes, it will be helpful to have a !CONFIG_CLKSRC_OF version of CLOCKSOURCE_OF_DECLARE. And can CONFIG_CLKSRC_OF be enabled by default for all ARM platforms?

Quoted 7 lines
Quoted 2 lines

Thanks,
Thomas.

Thomas,

Once the above is worked out, could you send me the updated patch with a pointer to whichever {branch,patch}(es) I need for CLKSRC_OF?

Is there any news on this? I'd like to be able to push out a branch ready for merging soon.

I've also realised that platforms using of_clocksource_init won't get the architected timer registered as a sched_clock, which would seem like a loss. I'm not sure what the relative requirements are for sched_clock and clocksource, so there may be some platforms that want it and some that don't.

I see for exynos5440 the architected timer is regsitered as a clock{source,_event_device}, but not as a sched_clock, and omap5 is similar, but may register dmtimer_read_sched_clock first.

We can probably leave it out for now, but it's something we'll need to consider in future.

Thanks,
Mark.

#8 lore raw

PATCH 1/1 ARM: architected timers: allow dt based discovery using clocksource_of_init

Quoted 28 lines · Mark Rutland

Thomas,

Quoted 25 lines · Mark Rutland
Quoted 23 lines · Thomas Abraham

Hi Stephen,

Quoted 6 lines · Stephen Warren
Quoted 4 lines · Thomas Abraham

Add an entry in __clksrc_of_table so that ARMv7 architected timer is discoverable using call to clocksource_of_init.

arch/arm/kernel/arch_timer.c +0 -0
Quoted 7 lines

arch/arm/kernel/arch_timer.c int __init arch_timer_of_register(void) · line 509

Quoted 3 lines
arch/arm/kernel/arch_timer.c +3 -0
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif

I wonder if we shouldn't enhance include/linux/clocksource.h to define CLOCKSOURCE_OF_DECLARE even when !CONFIG_CLKSRC_OF; that way, drivers wouldn't need that ifdef.

Yes, it will be helpful to have a !CONFIG_CLKSRC_OF version of CLOCKSOURCE_OF_DECLARE. And can CONFIG_CLKSRC_OF be enabled by default for all ARM platforms?

Thanks,
Thomas.

Quoted 7 lines
Quoted 4 lines

Thomas,

Once the above is worked out, could you send me the updated patch with a pointer to whichever {branch,patch}(es) I need for CLKSRC_OF?

Is there any news on this? I'd like to be able to push out a branch ready for merging soon.

I just sent a patch for this.