Introduce clocksource driver for Keystone platform
Subsystems (3)
v6 cover Introduce clocksource driver for Keystone platform
Add a broadcast timer64 based clockevent driver for keystone arch. This driver uses timer in 64-bit general purpose mode as clock event device.
Documentation:
http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
Based ongit://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
keystone/master
v5..v6:
added function to encapsulate __iowmb().
v4..v5:
used __iowmb() insted of wmb()
v3..v4:
rebased on latest of linux-keystone.git keystone/master
v2..v3:
- clocksource: timer-keystone: introduce clocksource driver for changed "u64" type to "unsigned long" for hz_period as more appropriate hz_period rounded up by DIV_ROUND_UP(rate, HZ)
corrected comments
v1..v2:
- clocksource: timer-keystone: introduce clocksource driver for renamed timer on "timer-keystone"
in keystone_timer_interrupt() evet pointer is passed via "dev_id" used __relaxed variants of writel/readl and added explicit barriers added "keystone_timer_disable()" for using in keystone_set_mode() keystone_timer_config() is not used for disabling the timer any more in case of an unsupported mode the keystone_timer_config() returns -1. used request_irq() instead of setup_irq()
assigned irq for event_device in event_dev->irq calculated timer.hz_period for CLOCK_EVT_MODE_PERIODIC at init deleted spare call of keystone_timer_config() in keystone_timer_init()
Ivan Khoronzhuk (3):
clocksource: timer-keystone: introduce clocksource driver for Keystone
clocksource: keystone: add bindings for keystone timer
arm: dts: keystone: add keystone timer entry
.../bindings/timer/ti,keystone-timer.txt | 29 +++ arch/arm/boot/dts/keystone-clocks.dtsi | 10 + arch/arm/boot/dts/keystone.dtsi | 7 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keystone.c | 244 +++++++++++++++++++++ 5 files changed, 291 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/ti,keystone-timer.txt create mode 100644 drivers/clocksource/timer-keystone.c
Signature · 1 line
1.8.3.2
PATCH v6 1/3 clocksource: timer-keystone: introduce clocksource driver for Keystone
Add broadcast clock-event device for the Keystone arch.
The timer can be configured as a general-purpose 64-bit timer, dual general-purpose 32-bit timers. When configured as dual 32-bit timers, each half can operate in conjunction (chain mode) or independently (unchained mode) of each other.
--- drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keystone.c | 244 +++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 drivers/clocksource/timer-keystone.c
drivers/clocksource/Makefile +1 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o obj-$(CONFIG_CLKSRC_METAG_GENERIC) += metag_generic.o obj-$(CONFIG_ARCH_HAS_TICK_BROADCAST) += dummy_timer.o +obj-$(CONFIG_ARCH_KEYSTONE) += timer-keystone.o
drivers/clocksource/timer-keystone.c new file +244 -0
244 lines not on this page · raw message
Signature · 1 line
1.8.3.2
Daniel Lezcano
AppliedRe: [PATCH v6 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone
Quoted 11 lines · Ivan Khoronzhuk
Add broadcast clock-event device for the Keystone arch.
The timer can be configured as a general-purpose 64-bit timer, dual general-purpose 32-bit timers. When configured as dual 32-bit timers, each half can operate in conjunction (chain mode) or independently (unchained mode) of each other.
Reviewed-by Stephen Boyd <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>---
Applied to my tree for 3.15
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH v6 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone
2014-02-11 13:58 GMT+01:00 Daniel Lezcano <[email protected]>:
Quoted 9 lines · Ivan Khoronzhuk
Quoted 8 lines
Add broadcast clock-event device for the Keystone arch.
The timer can be configured as a general-purpose 64-bit timer, dual general-purpose 32-bit timers. When configured as dual 32-bit timers, each half can operate in conjunction (chain mode) or independently (unchained mode) of each other.
Quoted 7 lines
Quoted 4 lines
Reviewed-by Stephen Boyd <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>---
Applied to my tree for 3.15
I wanted to send a trivial follow-up patch, but I can't find the tree to which you have applied this patch.
Would you mind to indicate me where I can find it.
Cheers,
Matthias
Quoted 14 lines
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCsFollow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 1 line
motzblog.wordpress.com
Re: [PATCH v6 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone
Quoted 16 lines · Matthias Brugger
2014-02-11 13:58 GMT+01:00 Daniel Lezcano <[email protected]>:
Quoted 15 lines · Ivan Khoronzhuk
Quoted 12 lines
Add broadcast clock-event device for the Keystone arch.
The timer can be configured as a general-purpose 64-bit timer, dual general-purpose 32-bit timers. When configured as dual 32-bit timers, each half can operate in conjunction (chain mode) or independently (unchained mode) of each other.
Reviewed-by Stephen Boyd <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>---
Quoted 5 lines
Quoted 1 line
Applied to my tree for 3.15
I wanted to send a trivial follow-up patch, but I can't find the tree to which you have applied this patch.
Would you mind to indicate me where I can find it.
Sure.
git://git.linaro.org/people/daniel.lezcano/linux.git #clockevents/3.15
Regards
-- Daniel
Quoted 21 lines
Cheers,
MatthiasQuoted 14 lines
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCsFollow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
PATCH 1/1 clocksource: timer-keystone: Delete unnecessary variable
In reply to Daniel LezcanoCommit 438e0bff5257 added the timer-keystone device driver but make use of an unnecessary variable in the init function.
This patch delets this variable.
--- drivers/clocksource/timer-keystone.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/clocksource/timer-keystone.c +1 -4
@@ -164,7 +164,6 @@ static void __init keystone_timer_init(struct device_node *np)unsigned long rate;struct clk *clk;int irq, error; -u32 tgcr; irq =irq_of_parse_and_map (np,0 );if (irq ==NO_IRQ ) {
@@ -199,12 +198,10 @@ static void __init keystone_timer_init(struct device_node *np)keystone_timer_barrier ();/* reset timer as 64-bit, no pre-scaler, plus features are disabled */ - tgcr =0 ;keystone_timer_writel (0 ,TGCR );/* unreset timer */ - tgcr |=TGCR_TIM_UNRESET_MASK ; -keystone_timer_writel (tgcr,TGCR ); +keystone_timer_writel (TGCR_TIM_UNRESET_MASK ,TGCR );/* init counter to zero */ keystone_timer_writel (0 ,TIM12 );
Signature · 1 line
1.8.1.2
Daniel Lezcano
AppliedRe: [PATCH] clocksource: timer-keystone: Delete unnecessary variable
Quoted 5 lines · Matthias Brugger
Commit
438e0bff5257added the timer-keystone device driver but make use of an unnecessary variable in the init function.
This patch delets this variable.Signed-off-by Matthias Brugger <[email protected]>
Applied to my tree for 3.15.
Thanks
-- Daniel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
PATCH v6 2/3 clocksource: keystone: add bindings for keystone timer
In reply to Ivan KhoronzhukThis patch provides bindings for the 64-bit timer in the KeyStone architecture devices. The timer can be configured as a general-purpose 64-bit timer, dual general-purpose 32-bit timers. When configured as dual 32-bit timers, each half can operate in conjunction (chain mode) or independently (unchained mode) of each other.
It is global timer is a free running up-counter and can generate interrupt when the counter reaches preset counter values.
Documentation:
http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
--- .../bindings/timer/ti,keystone-timer.txt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/ti,keystone-timer.txt
Documentation/devicetree/bindings/timer/ti,keystone-timer.txt new file +29 -0
@@ -0,0 +1,29 @@ +* Device tree bindings for Texas instruments Keystone timer + +This document provides bindings for the 64-bit timer in the KeyStone +architecture devices. The timer can be configured as a general-purpose 64-bit +timer, dual general-purpose 32-bit timers. When configured as dual 32-bit +timers, each half can operate in conjunction (chain mode) or independently +(unchained mode) of each other. + +It is global timer is a free running up-counter and can generate interrupt +when the counter reaches preset counter values. + +Documentation: +http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf + +Required properties: + +- compatible : should be "ti,keystone-timer". +- reg : specifies base physical address and count of the registers. +- interrupts : interrupt generated by the timer. +- clocks : the clock feeding the timer clock. + +Example: + +timer at 22f0000 { + compatible = "ti,keystone-timer"; + reg = <0x022f0000 0x80>; + interrupts = <GIC_SPI 110 IRQ_TYPE_EDGE_RISING>; + clocks = <&clktimer15>; +};
Signature · 1 line
1.8.3.2
Daniel Lezcano
AppliedRe: [PATCH v6 2/3] clocksource: keystone: add bindings for keystone timer
Quoted 9 lines · Ivan Khoronzhuk
This patch provides bindings for the 64-bit timer in the KeyStone architecture devices. The timer can be configured as a general-purpose 64-bit timer, dual general-purpose 32-bit timers. When configured as dual 32-bit timers, each half can operate in conjunction (chain mode) or independently (unchained mode) of each other.
It is global timer is a free running up-counter and can generate interrupt when the counter reaches preset counter values.
Quoted 7 lines
Documentation:
http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdfAcked-by Rob Herring <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>---
Applied to my tree for 3.15
Thanks !
-- Daniel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
PATCH v6 3/3 arm: dts: keystone: add keystone timer entry
In reply to Ivan KhoronzhukAdd keystone timer entry to keystone device tree. This 64-bit timer is used as backup clock event device.
--- arch/arm/boot/dts/keystone-clocks.dtsi | 10 ++++++++++ arch/arm/boot/dts/keystone.dtsi | 7 +++++++ 2 files changed, 17 insertions(+)
arch/arm/boot/dts/keystone-clocks.dtsi +10 -0
@@ -737,6 +737,16 @@ clocks { domain-id = <0>; }; + clktimer15: clktimer15 { + #clock-cells = <0>; + compatible = "ti,keystone,psc-clock"; + clocks = <&clkmodrst0>; + clock-output-names = "timer15"; + reg = <0x02350000 0xb00>, <0x02350000 0x400>; + reg-names = "control", "domain"; + domain-id = <0>; + }; + clkuart0: clkuart0 { #clock-cells = <0>; compatible = "ti,keystone,psc-clock";
arch/arm/boot/dts/keystone.dtsi +7 -0
@@ -208,5 +208,12 @@ usb-phy = <&usb_phy>, <&usb_phy>; }; }; + + clock_event: timer at 22f0000 { + compatible = "ti,keystone-timer"; + reg = <0x022f0000 0x80>; + interrupts = <GIC_SPI 110 IRQ_TYPE_EDGE_RISING>; + clocks = <&clktimer15>; + }; }; };
Signature · 1 line
1.8.3.2
Daniel,
Quoted 39 lines · Ivan Khoronzhuk
Add a broadcast timer64 based clockevent driver for keystone arch. This driver uses timer in 64-bit general purpose mode as clock event device.
Documentation:
http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdfBased on
git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
keystone/masterv5..v6:
added function to encapsulate__iowmb().v4..v5:
used__iowmb()insted ofwmb()v3..v4:
rebased on latest of linux-keystone.git keystone/masterv2..v3:
- clocksource: timer-keystone: introduce clocksource driver for changed "u64" type to "unsigned long" forhz_periodas more appropriatehz_periodrounded up byDIV_ROUND_UP(rate, HZ)
corrected commentsv1..v2:
- clocksource: timer-keystone: introduce clocksource driver for renamed timer on "timer-keystone"
inkeystone_timer_interrupt()evet pointer is passed via "dev_id" used__relaxedvariants of writel/readl and added explicit barriers added "keystone_timer_disable()" for using inkeystone_set_mode()keystone_timer_config()is not used for disabling the timer any more in case of an unsupported mode thekeystone_timer_config()returns -1. usedrequest_irq()instead ofsetup_irq()
assigned irq forevent_deviceinevent_dev->irqcalculated timer.hz_period forCLOCK_EVT_MODE_PERIODICat init deleted spare call ofkeystone_timer_config()inkeystone_timer_init()
Quoted 5 lines
Ivan Khoronzhuk (3):
clocksource: timer-keystone: introduce clocksource driver for Keystone
clocksource: keystone: add bindings for keystone timer
arm: dts: keystone: add keystone timer entry
Can you queue the first two patches from the series ? I will queue the dts patch via my tree.
Regards,
Santosh
Quoted 42 lines · Santosh Shilimkar
Daniel,
Quoted 39 lines · Ivan Khoronzhuk
Add a broadcast timer64 based clockevent driver for keystone arch. This driver uses timer in 64-bit general purpose mode as clock event device.
Documentation:
http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdfBased on
git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
keystone/masterv5..v6:
added function to encapsulate__iowmb().v4..v5:
used__iowmb()insted ofwmb()v3..v4:
rebased on latest of linux-keystone.git keystone/masterv2..v3:
- clocksource: timer-keystone: introduce clocksource driver for changed "u64" type to "unsigned long" forhz_periodas more appropriatehz_periodrounded up byDIV_ROUND_UP(rate, HZ)
corrected commentsv1..v2:
- clocksource: timer-keystone: introduce clocksource driver for renamed timer on "timer-keystone"
inkeystone_timer_interrupt()evet pointer is passed via "dev_id" used__relaxedvariants of writel/readl and added explicit barriers added "keystone_timer_disable()" for using inkeystone_set_mode()keystone_timer_config()is not used for disabling the timer any more in case of an unsupported mode thekeystone_timer_config()returns -1. usedrequest_irq()instead ofsetup_irq()
assigned irq forevent_deviceinevent_dev->irqcalculated timer.hz_period forCLOCK_EVT_MODE_PERIODICat init deleted spare call ofkeystone_timer_config()inkeystone_timer_init()
Quoted 7 lines
Quoted 5 lines
Ivan Khoronzhuk (3):
clocksource: timer-keystone: introduce clocksource driver for Keystone
clocksource: keystone: add bindings for keystone timer
arm: dts: keystone: add keystone timer entryCan you queue the first two patches from the series ? I will queue the dts patch via my tree.
Sure.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog