From 8fc78998b23182f812cce876a41e57db5e0df235 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 24 Apr 2012 10:04:46 +0100 Subject: [PATCH] --- yaml --- r: 303230 b: refs/heads/master c: c51423fc067b00d8c8bd0e4e7bc861bf9050511d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-ux500/timer.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e6a5f6894a82..581c551092b4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f58546a17c5dc2255c40e4bc4287e06a93b5c9a0 +refs/heads/master: c51423fc067b00d8c8bd0e4e7bc861bf9050511d diff --git a/trunk/arch/arm/mach-ux500/timer.c b/trunk/arch/arm/mach-ux500/timer.c index d37df98b5c32..885c74231b8d 100644 --- a/trunk/arch/arm/mach-ux500/timer.c +++ b/trunk/arch/arm/mach-ux500/timer.c @@ -8,6 +8,7 @@ #include #include #include +#include #include @@ -43,10 +44,17 @@ static void __init ux500_twd_init(void) #define ux500_twd_init() do { } while(0) #endif +const static struct of_device_id prcmu_timer_of_match[] __initconst = { + { .compatible = "stericsson,db8500-prcmu-timer-4", }, + { }, +}; + static void __init ux500_timer_init(void) { void __iomem *mtu_timer_base; void __iomem *prcmu_timer_base; + void __iomem *tmp_base; + struct device_node *np; if (cpu_is_u5500()) { mtu_timer_base = __io_address(U5500_MTU0_BASE); @@ -58,6 +66,22 @@ static void __init ux500_timer_init(void) ux500_unknown_soc(); } + /* TODO: Once MTU has been DT:ed place code above into else. */ + if (of_have_populated_dt()) { + np = of_find_matching_node(NULL, prcmu_timer_of_match); + if (!np) + goto dt_fail; + + tmp_base = of_iomap(np, 0); + if (!tmp_base) + goto dt_fail; + + prcmu_timer_base = tmp_base; + } + +dt_fail: + /* Doing it the old fashioned way. */ + /* * Here we register the timerblocks active in the system. * Localtimers (twd) is started when both cpu is up and running.