From patchwork Mon Jul 9 13:11:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 1172971 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E4B4A40B18 for ; Mon, 9 Jul 2012 13:14:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753730Ab2GINLf (ORCPT ); Mon, 9 Jul 2012 09:11:35 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:42577 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753457Ab2GINLf (ORCPT ); Mon, 9 Jul 2012 09:11:35 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q69DBH7Q000519; Mon, 9 Jul 2012 08:11:18 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q69DBHpR017598; Mon, 9 Jul 2012 18:41:17 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 9 Jul 2012 18:41:16 +0530 Received: from ula0393909.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q69DBCxx013773; Mon, 9 Jul 2012 18:41:16 +0530 From: Santosh Shilimkar To: CC: , Santosh Shilimkar , Benoit Cousson Subject: [PATCH 2/2] ARM: OMAP4: Add local timer support for Device Tree Date: Mon, 9 Jul 2012 18:41:10 +0530 Message-ID: <1341839470-5586-3-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1341839470-5586-1-git-send-email-santosh.shilimkar@ti.com> References: <1341839470-5586-1-git-send-email-santosh.shilimkar@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Add cortex-a9 local timer support for all OMAP4 based SOCs using DT. Cc: Benoit Cousson Signed-off-by: Santosh Shilimkar --- arch/arm/boot/dts/omap4.dtsi | 6 ++++++ arch/arm/mach-omap2/timer.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 57f7cd4..8504397 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -43,6 +43,12 @@ cache-level = <2>; }; + local-timer { + compatible = "arm,cortex-a9-twd-timer"; + reg = <0x48240600 0x20>; + interrupts = <1 13 0x304>; + }; + /* * The soc node represents the soc top level view. It is uses for IPs * that are not memory mapped in the MPU view or for the MPU itself. diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 840929b..dbdd9a6 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -384,9 +385,13 @@ static void __init omap4_timer_init(void) if (omap_rev() != OMAP4430_REV_ES1_0) { int err; - err = twd_local_timer_register(&twd_local_timer); - if (err) - pr_err("twd_local_timer_register failed %d\n", err); + if (of_have_populated_dt()) { + twd_local_timer_of_register(); + } else { + err = twd_local_timer_register(&twd_local_timer); + if (err) + pr_err("twd_local_timer_register failed %d\n", err); + } } #endif }