@@ -183,6 +183,8 @@
interrupts = <2>;
clocks = <&v2m_sysctl 0>, <&v2m_sysctl 1>, <&smbclk>;
clock-names = "timclken1", "timclken2", "apb_pclk";
+ arm,sp804-clocksource = <0x20>;
+ arm,sp804-clockevent = <0>;
};
v2m_timer23: timer@120000 {
@@ -182,6 +182,8 @@
interrupts = <2>;
clocks = <&v2m_sysctl 0>, <&v2m_sysctl 1>, <&smbclk>;
clock-names = "timclken1", "timclken2", "apb_pclk";
+ arm,sp804-clocksource = <0x20>;
+ arm,sp804-clockevent = <0>;
};
v2m_timer23: timer@12000 {
@@ -98,6 +98,8 @@
<0 49 4>;
clocks = <&oscclk2>, <&oscclk2>;
clock-names = "timclk", "apb_pclk";
+ arm,sp804-clocksource = <0x20>;
+ arm,sp804-clockevent = <0>;
};
watchdog@100e5000 {
@@ -5,6 +5,7 @@ config ARCH_VEXPRESS
select ARM_GIC
select ARM_TIMER_SP804
select CLKDEV_LOOKUP
+ select CLKSRC_OF
select COMMON_CLK
select COMMON_CLK_VERSATILE
select CPU_V7
@@ -21,6 +21,7 @@
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/vexpress.h>
+#include <linux/clocksource.h>
#include <clocksource/arm_timer.h>
#include <clocksource/timer-sp.h>
@@ -431,19 +432,9 @@ void __init v2m_dt_init_early(void)
static void __init v2m_dt_timer_init(void)
{
- struct device_node *node = NULL;
-
vexpress_clk_of_init();
- do {
- node = of_find_compatible_node(node, NULL, "arm,sp804");
- } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB);
- if (node) {
- pr_info("Using SP804 '%s' as a clock & events source\n",
- node->full_name);
- v2m_sp804_init(of_iomap(node, 0),
- irq_of_parse_and_map(node, 0));
- }
+ clocksource_of_init();
if (arch_timer_of_register() != 0)
twd_local_timer_of_register();
Remove all code to parse sp804. Use clocksource_of_init() instead since all these code are implemented in sp804 driver already. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> --- arch/arm/boot/dts/vexpress-v2m-rs1.dtsi | 2 ++ arch/arm/boot/dts/vexpress-v2m.dtsi | 2 ++ arch/arm/boot/dts/vexpress-v2p-ca9.dts | 2 ++ arch/arm/mach-vexpress/Kconfig | 1 + arch/arm/mach-vexpress/v2m.c | 13 ++----------- 5 files changed, 9 insertions(+), 11 deletions(-)