From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH v6 3/9] ARM: versatile: Map local timers using Device Tree when possible Date: Thu, 15 Dec 2011 08:53:28 -0600 Message-ID: <4EEA09E8.3010807@gmail.com> References: <1323957761-13553-1-git-send-email-pawel.moll@arm.com> <1323957761-13553-4-git-send-email-pawel.moll@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1323957761-13553-4-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Pawel Moll Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On 12/15/2011 08:02 AM, Pawel Moll wrote: > Try to map TWD registers basing on a "arm,smp-twd" Device Tree > node (compatible value as used in Highbank's DT). This overrides > existing twd_base value. > > Signed-off-by: Pawel Moll > --- > arch/arm/plat-versatile/localtimer.c | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/plat-versatile/localtimer.c b/arch/arm/plat-versatile/localtimer.c > index 0fb3961..8f0dc10 100644 > --- a/arch/arm/plat-versatile/localtimer.c > +++ b/arch/arm/plat-versatile/localtimer.c > @@ -11,6 +11,8 @@ > #include > #include > #include > +#include > +#include > > #include > #include > @@ -21,6 +23,16 @@ > */ > int __cpuinit local_timer_setup(struct clock_event_device *evt) > { > +#if defined(CONFIG_OF) > + struct device_node *node = of_find_compatible_node(NULL, > + NULL, "arm,smp-twd"); > + > + if (node) > + twd_base = of_iomap(node, 0); > +#endif I think your previous version was more correct. This is going to find the node and do ioremap N times where N is the number of cores. It does work though because that is what I did initially too. Rob