ARM: sa100: use pxa_timer clocksource driver
Subsystems (3)
v2 cover ARM: sa100: use pxa_timer clocksource driver
This is a second iteration of this patch series. Changes since V1:
- Added OSTIMER0 clock as requested by pxa_timer code.
Thomas has previously blessed that this patchset can go through arm-soc.
The following changes since commit 0df1f2487d2f0d04703f142813d53615d62a1da4:
Linux 3.18-rc3 (2014-11-02 15:01:51 -0800)
are available in the git repository at:
git://git.infradead.org/users/dbaryshkov/zaurus.git sa1100-clksrc
for you to fetch changes up to 261fcd132d124b3700ff0b61112fb1b853028901:
ARM: sa1100: use pxa_timer clocksource driver (2014-12-02 02:42:28 +0300)
----------------------------------------------------------------
Dmitry Eremin-Solenikov (4):
clocksource: enable pxa_timer for SA-1100 platform
ARM: sa1100: implement clk_get_rate
ARM: sa1100: provide OSTIMER0 clock for pxa_timer
ARM: sa1100: use pxa_timer clocksource driver
arch/arm/mach-sa1100/Makefile | 2 +- arch/arm/mach-sa1100/clock.c | 17 ++++- arch/arm/mach-sa1100/generic.c | 6 ++ arch/arm/mach-sa1100/time.c | 139 ----------------------------------------- drivers/clocksource/Kconfig | 6 ++ drivers/clocksource/Makefile | 2 +- 6 files changed, 30 insertions(+), 142 deletions(-) delete mode 100644 arch/arm/mach-sa1100/time.c
PATCH v2 1/4 clocksource: enable pxa_timer for SA-1100 platform
SA-11x0 platform used the same IP block as was used on PXA. Consequently it makes sense to have only one driver. Enable pxa_timer clocksource for StrongARM platform.
--- drivers/clocksource/Kconfig | 6 ++++++ drivers/clocksource/Makefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +6 -0
@@ -223,4 +223,10 @@ config CLKSRC_VERSATILE ARM Versatile, RealView and Versatile Express reference platforms. +config CLKSRC_PXA + def_bool y if ARCH_PXA || ARCH_SA1100 + help + This enables OST0 support available on PXA and SA-11x0 + platforms. + endmenu
drivers/clocksource/Makefile +1 -1
@@ -21,7 +21,7 @@ obj-$(CONFIG_ARCH_CLPS711X) += clps711x-timer.o obj-$(CONFIG_ARCH_MARCO) += timer-marco.o obj-$(CONFIG_ARCH_MOXART) += moxart_timer.o obj-$(CONFIG_ARCH_MXS) += mxs_timer.o -obj-$(CONFIG_ARCH_PXA) += pxa_timer.o +obj-$(CONFIG_CLKSRC_PXA) += pxa_timer.o obj-$(CONFIG_ARCH_PRIMA2) += timer-prima2.o obj-$(CONFIG_ARCH_U300) += timer-u300.o obj-$(CONFIG_SUN4I_TIMER) += sun4i_timer.o
Signature · 1 line
2.1.3
PATCH v2 2/4 ARM: sa1100: implement clk_get_rate
In reply to Dmitry Eremin-SolenikovProvide actual implementation of clk_get_rate function for StrongARM sa-11x0 SoC family.
--- arch/arm/mach-sa1100/clock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-sa1100/clock.c +4 -1
@@ -19,6 +19,7 @@struct clkops {void (*enable)(struct clk *);void (*disable)(struct clk *); +unsigned long (*get_rate)(struct clk *); };struct clk {
@@ -33,9 +34,11 @@ struct clk clk_##_name = { \static DEFINE_SPINLOCK (clocks_lock); -/* Dummy clk routine to build generic kernel parts that may be using them */ unsigned long clk_get_rate (struct clk *clk) { +if (clk && clk->ops && clk->ops->get_rate) +return clk->ops->get_rate (clk); +return 0 ; }EXPORT_SYMBOL (clk_get_rate);
Signature · 1 line
2.1.3
PATCH v2 3/4 ARM: sa1100: provide OSTIMER0 clock for pxa_timer
In reply to Dmitry Eremin-SolenikovPxa_timer clocksource requires OSTIMER0 clock to be provided. Add dummy clock returning proper rate.
--- arch/arm/mach-sa1100/clock.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/mach-sa1100/clock.c +12 -0
@@ -97,9 +97,21 @@ const struct clkops clk_gpio27_ops = { static DEFINE_CLK(gpio27, &clk_gpio27_ops); +static unsigned long clk_36864_get_rate (struct clk *clk) +{ +return 36864000 ; +} + +static struct clkops clk_36864_ops = { + .get_rate = clk_36864_get_rate, +}; + +static DEFINE_CLK(36864, &clk_36864_ops); +static struct clk_lookup sa11xx_clkregs[] = {CLKDEV_INIT ("sa1111.0" ,NULL , &clk_gpio27),CLKDEV_INIT ("sa1100-rtc" ,NULL ,NULL ), +CLKDEV_INIT (NULL ,"OSTIMER0" , &clk_36864), };static int __init sa11xx_clk_init (void )
Signature · 1 line
2.1.3
PATCH v2 4/4 ARM: sa1100: use pxa_timer clocksource driver
In reply to Dmitry Eremin-SolenikovUse pxa_timer clocksource driver.
--- arch/arm/mach-sa1100/Makefile | 2 +- arch/arm/mach-sa1100/generic.c | 6 ++ arch/arm/mach-sa1100/time.c | 139 ----------------------------------------- 3 files changed, 7 insertions(+), 140 deletions(-) delete mode 100644 arch/arm/mach-sa1100/time.c
arch/arm/mach-sa1100/Makefile +1 -1
@@ -3,7 +3,7 @@ # # Common support -obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o +obj-y := clock.o generic.o irq.o #nmi-oopser.o # Specific board support obj-$(CONFIG_SA1100_ASSABET) += assabet.o
arch/arm/mach-sa1100/generic.c +6 -0
@@ -33,6 +33,7 @@#include <mach/irqs.h> #include "generic.h" +#include <clocksource/pxa.h> unsigned int reset_status;EXPORT_SYMBOL (reset_status);
@@ -369,6 +370,11 @@ void __init sa1100_map_io(void)iotable_init (standard_io_desc,ARRAY_SIZE (standard_io_desc)); } +void __init sa1100_timer_init (void ) +{ +pxa_timer_nodt_init (IRQ_OST0 ,io_p2v (0x90000000 ),3686400 ); +} +/* * Disable the memory bus request/grant signals on the SA1110 to * ensure that we don't receive spurious memory requests. We set
arch/arm/mach-sa1100/time.c deleted +0 -139
139 lines not on this page · raw message
Signature · 1 line
2.1.3